A UDP torrent tracker scraper written in Python 3
Project description
Torrent Tracker Scraper
A UDP torrent tracker scraper written in Python 3
Installation
pip install torrent-tracker-scraper
Usage
The package can be used either as a module within a script or straight up from the commandline.
As a python module
pass in a single infohash
from torrent_tracker_scraper import scraper
scraper = scraper.Scraper("tracker.coppersuffer.tk", 6969, json=True)
results = scraper.scrape("95105D919C10E64AE4FA31067A8D37CCD33FE92D")
print(results)
{'tracker': 'tracker.coppersuffer.tk', 'results': [{'infohash': '95105D919C10E64AE4FA31067A8D37CCD33FE92D', 'seeders': 112, 'completed': 496, 'leechers': 2}]}
pass in multiple infohashes separated by commas
results = scraper.scrape("95105D919C10E64AE4FA31067A8D37CCD33FE92D,913EF55D5DD1A9376B738922E5104B3A1BE3754A")
print(results)
{'tracker': 'tracker.coppersuffer.tk', 'results': [{'infohash': '95105D919C10E64AE4FA31067A8D37CCD33FE92D', 'seeders': 112, 'completed': 496, 'leechers': 2}, {'infohash': '913EF55D5DD1A9376B738922E5104B3A1BE3754A', 'seeders': 334, 'completed': 989, 'leechers': 250}]}
pass in a list of infohashes
results = scraper.scrape(["913EF55D5DD1A9376B738922E5104B3A1BE3754A", "95105D919C10E64AE4FA31067A8D37CCD33FE92D"])
print(results)
{'tracker': 'tracker.coppersuffer.tk', 'results': [{'infohash': '913EF55D5DD1A9376B738922E5104B3A1BE3754A', 'seeders': 334, 'completed': 989, 'leechers': 250}, {'infohash': '95105D919C10E64AE4FA31067A8D37CCD33FE92D', 'seeders': 112, 'completed': 496, 'leechers': 2}]}
Get your scrap information
Testing
python -m unittest discover tests
Help/Contributing
Use the normal GitHub bug reporting flow i.e Create an issue here https://github.com/49e94b8f256530dc0d41f740dfe8a4c1/torrent-tracker-scraper/issues.
Fork the code, make your changes and create a pull request.
Behind the scenes
For a detailed quick rundown of whats going on behind the scenes
https://blog.takeshispalace.com/programming/python3/udp/2018/12/23/udp-torrent-scraper-python.html
Contributors
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Hashes for torrent-tracker-scraper-1.1.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9455cdefab1d504f77a0a76deacf9c58b1d5305e2c6c2c06aed21626efcb04c2 |
|
MD5 | dec1e7ed9fc0249bc0037ac427316e61 |
|
BLAKE2b-256 | 14a2e9bb7fd7876c38c903ad7072d4733f6de8771de80fc8b29c39e8e6a632e3 |