Documentation
¶
Overview ¶
Package tracker implements BitTorrent tracker scraping.
Both the HTTP scrape convention (BEP 48) and the UDP tracker protocol (BEP 15) are supported. Scrape returns seeder counts without announcing a download.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Scrape ¶
Scrape returns the seeder count for the given info hash by querying each announce URL in turn, stopping at the first successful response. Returns (0, nil) on success with zero seeds. Returns (0, err) when every tracker fails — callers should treat this as "unknown" and not reject.
func ScrapeBatch ¶ added in v1.22.1
func ScrapeBatch(ctx context.Context, infoHashesHex []string, announceURL string) (map[string]int, error)
ScrapeBatch returns seeder counts for the given info hashes from a single tracker, chunking into requests of at most maxHashesPerScrape hashes. The result maps lowercase hex hash → seeder count and contains an entry for every hash the tracker answered; missing hashes are unknown, not zero. An error is returned only when every chunk failed.
Types ¶
This section is empty.