iyuu

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const IYUU_VERSION = "2.0.0"

Variables

View Source
var Command = &cobra.Command{
	Use:   "iyuu",
	Short: "Cross seed automation tool using iyuu API.",
	Long:  `Cross seed automation tool using iyuu 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, uid int64, passkey string) (map[string]any, error)

func IyuuApiGetUser

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

Types

type IyuuApiGetUserResponse

type IyuuApiGetUserResponse struct {
	Ret  int64  `json:"ret"`
	Msg  string `json:"msg"`
	Data struct {
		User map[string]any `json:"user"`
	} `json:"data"`
}

type IyuuApiHashResponse

type IyuuApiHashResponse struct {
	Ret  int64  `json:"ret"`
	Msg  string `json:"msg"`
	Data []struct {
		Hash    string                `json:"hash"`
		Torrent []IyuuTorrentInfoHash `json:"torrent"`
	} `json:"data"`
}

type IyuuApiRecommendSite

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

func IyuuApiGetRecommendSites

func IyuuApiGetRecommendSites() ([]IyuuApiRecommendSite, error)

type IyuuApiResponse

type IyuuApiResponse struct {
	Ret  int64          `json:"ret"`
	Msg  string         `json:"msg"`
	Data map[string]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"`      // 1 / 0
	Reseed_check  string `json:"reseed_check"`  // "passkey"
}

func IyuuApiSites

func IyuuApiSites(token string) ([]IyuuApiSite, error)

func (*IyuuApiSite) GetUrl

func (site *IyuuApiSite) GetUrl() string

func (IyuuApiSite) ToSite

func (iyuuApiSite IyuuApiSite) ToSite() Site

type IyuuApiSitesResponse

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

type IyuuGetRecommendSitesResponse

type IyuuGetRecommendSitesResponse struct {
	Ret  int64  `json:"ret"`
	Msg  string `json:"msg"`
	Data struct {
		Recommend []IyuuApiRecommendSite `json:"recommend"`
	} `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