public

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: 3 Imported by: 0

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.

Jump to

Keyboard shortcuts

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