iyuu

package
v0.1.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 24, 2025 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const IYUU_VERSION = "8.2.0"
View Source
const MAX_INTOHASH_NUMBER = 300 // 单次提交种子info_hash最多300个

Variables

View Source
var Command = &cobra.Command{
	Use:   "iyuu",
	Short: "Cross seed automation tool using IYUU (https://github.com/ledccn/IYUUAutoReseed) API.",
	Long:  `Cross seed automation tool using IYUU (https://github.com/ledccn/IYUUAutoReseed) API.`,
}

Functions

func Db

func Db() *gorm.DB

func GenerateIyuu2LocalSiteMap

func GenerateIyuu2LocalSiteMap(iyuuSites []Site,
	localSites []*config.SiteConfigStruct) map[int64]string

return iyuuSid => localSiteName map

func IyuuApiBind

func IyuuApiBind(token string, site string, sid int64, uid int64, passkey string) (any, error)

https://doc.iyuu.cn/reference/users_bind

func IyuuApiHash

func IyuuApiHash(token string, infoHashes []string, sid_sha1 string) (map[string][]IyuuTorrentInfoHash, error)

https://doc.iyuu.cn/reference/reseed_index

func IyuuApiReportExisting added in v0.1.10

func IyuuApiReportExisting(token string, sites []*IyuuApiSite) (string, error)

https://doc.iyuu.cn/reference/site_report_existing

func IyuuApiUsersProfile added in v0.1.10

func IyuuApiUsersProfile(token string) (data map[string]any, err error)

Get iyuu user profile. New profile api is undocumented (yet) in https://doc.iyuu.cn/. See: https://github.com/ledccn/iyuuplus-dev/commit/2bf34e2ab3824caf0939eb8081c8a9d3e97736b0 .

Types

type IyuuApiHashResponse

type IyuuApiHashResponse struct {
	Code int64  `json:"code"`
	Msg  string `json:"msg"`
	Data map[string]*struct {
		Torrent []IyuuTorrentInfoHash `json:"torrent"`
	} `json:"data"`
}

type IyuuApiRecommendSite

type IyuuApiRecommendSite struct {
	Id         int64  `json:"id"`
	Site       string `json:"site"`
	Nickname   string `json:"nickname"`
	Bind_check string `json:"bind_check"`
}

func IyuuApiGetRecommendSites

func IyuuApiGetRecommendSites() ([]IyuuApiRecommendSite, error)

type IyuuApiReportExistingRequest added in v0.1.10

type IyuuApiReportExistingRequest struct {
	SidList []int64 `json:"sid_list"`
}

type IyuuApiReportExistingResponse added in v0.1.10

type IyuuApiReportExistingResponse struct {
	Code int64  `json:"code"`
	Msg  string `json:"msg"`
	Data struct {
		SidSha1 string `json:"sid_sha1"`
	} `json:"data"`
}

type IyuuApiResponse

type IyuuApiResponse struct {
	Code int64  `json:"code"`
	Msg  string `json:"msg"`
	Data any    `json:"data"`
}

type IyuuApiSite

type IyuuApiSite struct {
	Id            int64  `json:"id"`
	Site          string `json:"site"`
	Base_url      string `json:"base_url"`
	Nickname      string `json:"nickname"`      // "朋友" / "馒头"
	Download_page string `json:"download_page"` // torrent download url. params: {passkey}, {authkey}, {} (id)
	Is_https      int64  `json:"is_https"`      // 2 / 1 / 0
}

func (*IyuuApiSite) GetUrl

func (site *IyuuApiSite) GetUrl() string

func (IyuuApiSite) ToSite

func (iyuuApiSite IyuuApiSite) ToSite() Site

type IyuuApiSitesResponse

type IyuuApiSitesResponse struct {
	Code int64  `json:"code"`
	Msg  string `json:"msg"`
	Data struct {
		Sites []*IyuuApiSite `json:"sites"`
	} `json:"data"`
}

type IyuuGetRecommendSitesResponse

type IyuuGetRecommendSitesResponse struct {
	Code int64  `json:"code"`
	Msg  string `json:"msg"`
	Data struct {
		List []IyuuApiRecommendSite `json:"list"`
	} `json:"data"`
}

type IyuuTorrentInfoHash

type IyuuTorrentInfoHash struct {
	Sid        int64  `json:"sid"`
	Torrent_id int64  `json:"torrent_id"`
	Info_hash  string `json:"info_hash"`
}

type Meta

type Meta struct {
	Key   string `gorm:"primaryKey"` // keys: lastUpdateTime
	Value string
}

gorm "meta" (not metas!) table

type Site

type Site struct {
	Sid          int64  `gorm:"primaryKey"`
	Name         string `gorm:"index"`
	Nickname     string
	Url          string // site homepage url. e.g. https://hdvideo.one/
	DownloadPage string // (relative) torrent download url. e.g. "download.php?id={}&passkey={passkey}"
}

gorm "sites" table

func (*Site) MatchFilter added in v0.1.5

func (iyuuSite *Site) MatchFilter(filter string) bool

type Torrent

type Torrent struct {
	InfoHash       string `gorm:"primaryKey"`
	Sid            int64  // iyuu site id
	Tid            int64  // torrent id of site
	TargetInfoHash string `gorm:"index"` // original (target) torrent info hash

}

gorm "torrents" table

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL