Documentation ¶
Index ¶
- func CreateSiteHttpClient(siteConfig *config.SiteConfigStruct, globalConfig *config.ConfigStruct) (*azuretls.Session, [][]string, error)
- func DownloadTorrentByUrl(siteInstance Site, httpClient *azuretls.Session, torrentUrl string, ...) ([]byte, string, error)
- func Exit()
- func GetConfigSiteNameByDomain(domain string) (string, error)
- func GetConfigSiteNameByTypes(types ...string) (string, error)
- func GetUa(siteInstance Site) string
- func PrintTorrents(torrents []Torrent, filter string, now int64, noHeader bool, dense bool, ...)
- func Purge(siteName string)
- func Register(regInfo *RegInfo)
- func SiteExists(name string) bool
- type RegInfo
- type Site
- type SiteCreator
- type Status
- type Torrent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateSiteHttpClient ¶ added in v0.1.1
func CreateSiteHttpClient(siteConfig *config.SiteConfigStruct, globalConfig *config.ConfigStruct) ( *azuretls.Session, [][]string, error)
func DownloadTorrentByUrl ¶ added in v0.1.1
func DownloadTorrentByUrl(siteInstance Site, httpClient *azuretls.Session, torrentUrl string, torrentId string) ( []byte, string, error)
General download torrent func. Return torrentContent, filename, err
func GetConfigSiteNameByDomain ¶ added in v0.1.1
func GetConfigSiteNameByTypes ¶ added in v0.1.1
func PrintTorrents ¶
func SiteExists ¶ added in v0.1.6
Types ¶
type RegInfo ¶
type RegInfo struct { Name string Aliases []string Creator func(string, *config.SiteConfigStruct, *config.ConfigStruct) (Site, error) }
func GetConfigSiteReginfo ¶
type Site ¶
type Site interface { GetName() string // default sent http request headers GetDefaultHttpHeaders() [][]string GetSiteConfig() *config.SiteConfigStruct // download torrent by id (e.g.: 12345), sitename.id (e.g.: mteam.12345), // or absolute download url (e.g.: https://kp.m-team.cc/download.php?id=12345). DownloadTorrent(url string) (content []byte, filename string, id string, err error) // download torrent by torrent id (e.g.: "12345") DownloadTorrentById(id string) (content []byte, filename string, err error) GetLatestTorrents(full bool) ([]Torrent, error) // sort: size|name|none(or "") GetAllTorrents(sort string, desc bool, pageMarker string, baseUrl string) ( torrents []Torrent, nextPageMarker string, err error) // can use "%s" as keyword placeholder in baseUrl SearchTorrents(keyword string, baseUrl string) ([]Torrent, error) GetStatus() (*Status, error) PurgeCache() }
func CreateSite ¶
func CreateSiteInternal ¶
func CreateSiteInternal(name string, siteConfig *config.SiteConfigStruct, config *config.ConfigStruct) (Site, error)
type SiteCreator ¶
type Status ¶
type Torrent ¶
type Torrent struct { Name string Description string Id string // optional torrent id in the site InfoHash string DownloadUrl string DownloadMultiplier float64 UploadMultiplier float64 DiscountEndTime int64 Time int64 // torrent timestamp Size int64 IsSizeAccurate bool Seeders int64 Leechers int64 Snatched int64 HasHnR bool // true if has any type of HR IsActive bool // true if torrent is as already downloading / seeding Paid bool // "付费"种子: (第一次)下载或汇报种子时扣除魔力/积分 Bought bool // 适用于付费种子:已购买 Neutral bool // 中性种子:不计算上传、下载、做种魔力 }
func (*Torrent) MatchFilter ¶ added in v0.1.4
func (*Torrent) MatchFiltersAndOr ¶ added in v0.1.9
Matches if every list of filtersArray is successed with MatchFiltersOr(). If filtersArray is empty, return true.
func (*Torrent) MatchFiltersOr ¶ added in v0.1.7
matches if any filter in list matches
Click to show internal directories.
Click to hide internal directories.