Skip to content

Basic

The smallest complete program: install the package, call scrape() once against a UDP tracker, and print the result.

Terminal window
pip install tracker-scraper
scrape_basic.py
from tracker_scraper import scrape
results = scrape(
tracker="udp://exodus.desync.com:6969",
hashes=["2d88e693eda7edf3c1fd0c48e8b99b8fd5a820b2"],
)
print(results)
Terminal window
python scrape_basic.py

You get back a dictionary keyed by the info_hash, with the live counts:

{'2d88e693eda7edf3c1fd0c48e8b99b8fd5a820b2': {'seeds': 34, 'peers': 189, 'complete': 10}}
from tracker_scraper import scrape
info_hash = "2d88e693eda7edf3c1fd0c48e8b99b8fd5a820b2"
stats = scrape("udp://exodus.desync.com:6969", [info_hash])[info_hash]
print(f"Seeders: {stats['seeds']}")
print(f"Leechers: {stats['peers']}")
print(f"Completed: {stats['complete']}")
  • HTTP Tracker — scrape an http:// / https:// tracker and batch multiple torrents.
  • Command Line — do the same thing straight from your shell.