Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Sites = []*PublicBittorrentSite{ { Name: "nyaa", Domains: []string{"sukebei.nyaa.si", "nyaa.si"}, TrackerDomains: []string{"sukebei.tracker.wf", "nyaa.tracker.wf"}, TorrentUrlIdRegexp: regexp.MustCompile(`\bview/(?P<id>\d+)\b`), TorrentDownloadUrl: `{{origin}}/download/{{id}}.torrent`, TorrentDownloadInterval: 5000, }, } // site name & domain (main or tracker) => site SitesMap = map[string]*PublicBittorrentSite{} )
Functions ¶
This section is empty.
Types ¶
type PublicBittorrentSite ¶
type PublicBittorrentSite struct { Name string Domains []string // first one of Domains is considered as primary domain TrackerDomains []string TorrentDownloadUrl string // placeholders: {{origin}}, {{domain}}, {{id}} TorrentUrlIdRegexp *regexp.Regexp // extract torrent id (in "id" subgroup) from url TorrentDownloadInterval int64 // min interval between downloading 2 torrents (miliseconds) }
func GetSiteByDomain ¶
func GetSiteByDomain(defaultSite string, extraDomainOrUrls ...string) *PublicBittorrentSite
Get a public site by a website or tracker url or domain. defaultSite is a site name or domain. If none of extraDomainOrUrls matches with a existing site, use defaultSite as fallback.
Click to show internal directories.
Click to hide internal directories.