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`, }, } // 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 }
func GetSiteByDomain ¶
func GetSiteByDomain(defaultSite string, domainOrUrls ...string) *PublicBittorrentSite
Get a site by a website or tracker url or domain.
Click to show internal directories.
Click to hide internal directories.