Basic
The smallest complete program: install the package, call scrape() once against a UDP tracker, and print the result.
1. Install
Section titled “1. Install”pip install tracker-scraper2. Scrape a UDP tracker
Section titled “2. Scrape a UDP tracker”from tracker_scraper import scrape
results = scrape( tracker="udp://exodus.desync.com:6969", hashes=["2d88e693eda7edf3c1fd0c48e8b99b8fd5a820b2"],)
print(results)3. Run it
Section titled “3. Run it”python scrape_basic.pyYou get back a dictionary keyed by the info_hash, with the live counts:
{'2d88e693eda7edf3c1fd0c48e8b99b8fd5a820b2': {'seeds': 34, 'peers': 189, 'complete': 10}}Reading individual stats
Section titled “Reading individual stats”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']}")Next steps
Section titled “Next steps”- HTTP Tracker — scrape an
http:///https://tracker and batch multiple torrents. - Command Line — do the same thing straight from your shell.