🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

torrent-tracker-scraper

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

torrent-tracker-scraper

A UDP torrent tracker scraper written in Python 3

4.1.0
PyPI
Maintainers
1

Torrent Tracker Scraper

A UDP torrent tracker scraper written in Python 3

PyPI pyversions PyPI version License: LGPL v3

Installation

pipenv install torrent-tracker-scraper
pipenv shell

Usage

Pass in a list of infohashes

from torrent_tracker_scraper import scraper

scraper = scraper.Scraper(
    infohashes=[
        "82026E5C56F0AEACEDCE2D7BC2074A644BC50990",
        "04D9A2D3FAEA111356519A0E0775E5EAEE9C944A",
    ]
)
results = scraper.scrape()
print(results)

[
    ...,
    {
        'tracker': 'udp://explodie.org:6969',
        'results': [
            {
                'infohash': '82026E5C56F0AEACEDCE2D7BC2074A644BC50990',
                'seeders': 246,
                'completed': 0,
                'leechers': 36
            },
            {
                'infohash': '04D9A2D3FAEA111356519A0E0775E5EAEE9C944A',
                'seeders': 7,
                'completed': 0,
                'leechers': 27
            }
        ]
    },
    {
        'tracker': 'udp//:bt-trace.adgk.net:6969',
        'results': [
            {
                 'infohash': '82026E5C56F0AEACEDCE2D7BC2074A644BC50990', 'error': 'Could not get stats for infohash [bt-trace.adgk.net:6969]'
            },
            {
                 'infohash': '04D9A2D3FAEA111356519A0E0775E5EAEE9C944A', 'error': 'Could not get stats for infohash [bt-trace.adgk.net:6969]'
            }
        ],
        'error': None
    }
    ...

Get your scrapped information

Pass in a list of trackers

from torrent_tracker_scraper import scraper

scraper = scraper.Scraper(
    trackers=["udp://explodie.org:6969/annouce"],
    infohashes=[
        "82026E5C56F0AEACEDCE2D7BC2074A644BC50990",
        "04D9A2D3FAEA111356519A0E0775E5EAEE9C944A",
    ],
)
results = scraper.scrape()
print(results)

[
    ...,
    {
        'tracker': 'udp://explodie.org:6969',
        'results': [
            {
                'infohash': '82026E5C56F0AEACEDCE2D7BC2074A644BC50990',
                'seeders': 246,
                'completed': 0,
                'leechers': 36
            },
            {
                'infohash': '04D9A2D3FAEA111356519A0E0775E5EAEE9C944A',
                'seeders': 7,
                'completed': 0,
                'leechers': 27
            }
        ]
    },
    ...

Testing

pipenv install --dev
pipenv run pytest

Help/Contributing

Contributors (in alphabetical order)

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts