tracker

package
v1.65.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 16, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

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

func Scrape(ctx context.Context, infoHashHex string, announceURLs []string) (int, error)

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.

Jump to

Keyboard shortcuts

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