Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

A UDP torrent tracker scraper written in Python 3

Project description

Torrent Tracker Scraper

A UDP torrent tracker scraper written in Python 3

Coverage SVG PyPI version License: LGPL v3

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

https://github.com/dessalines

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for torrent-tracker-scraper, version 1.1.3
Filename, size File type Python version Upload date Hashes
Filename, size torrent-tracker-scraper-1.1.3.tar.gz (5.1 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page