Skip to main content

A Python package to fetch torrent metadata from multiple sources

Project description

torrfetch

torrfetch is a Python package that lets you search torrents across multiple public torrent indexers with deduplication and relevance sorting. Designed for developers building CLI tools or automation scripts around torrent discovery.

Features

  • Search multiple torrent providers in parallel or fallback mode
  • Automatic deduplication of results
  • Smart scoring by title relevance and seeders
  • Fast and extensible provider interface

Providers

Currently supports:

  • The Pirate Bay
  • yts

Installation

pip install torrfetch

Usage

Parallel mode (default)

All providers are queried simultaneously, and the output is ranked by relevance and seeders

torrfetch.search("oppenheimer 2023 1080p", mode="parallel")

Fallback mode

Queries providers one by one, proceeding to the next if the current one is down or returns no results

torrfetch.search("oppenheimer", mode="fallback")

Restrict to specific providers

Use only to limit the search to a subset of sources (e.g., just YTS or YTS and Piratebay):

torrfetch.search("oppenheimer", only=["yts"])

Sample data returned

The first 30 results are returned, sorted by a combination of relevance and seeders:

[
  {
    "title": "Interstellar (2014)",
    "magnet": "magnet:?xt=urn:btih:...",
    "size": "2.2 GB",
    "uploaded": "2020-10-01",
    "uploader": "YTS",
    "category": "Movies",
    "seeders": 2145,
    "leechers": 198,
    "source": "yts"
  },
  {
    "title": "Interstellar.2014.1080p.BluRay.x264",
    "magnet": "magnet:?xt=urn:btih:...",
    "size": "3.1 GB",
    "uploaded": "2019-07-12",
    "uploader": "1337xUploader",
    "category": "Movies",
    "seeders": 1200,
    "leechers": 230,
    "source": "1337x"
  },
  ...
]

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

torrfetch-0.1.3.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

torrfetch-0.1.3-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file torrfetch-0.1.3.tar.gz.

File metadata

  • Download URL: torrfetch-0.1.3.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for torrfetch-0.1.3.tar.gz
Algorithm Hash digest
SHA256 03b4584264e577e91f3ee896c8129ede3e28b6d5c0655a3338cd84526cb893bc
MD5 4afcd10038b981fd27233e89a0d235a2
BLAKE2b-256 742e12685ccbb663c293f690bac8c82ab28c11fc452ae10ce2f5d1192252f4d0

See more details on using hashes here.

File details

Details for the file torrfetch-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: torrfetch-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for torrfetch-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5a51b61c2dd0833111c1c11fc69ca900174a39609d2a5b48c46655b4d34ed854
MD5 bcf4f830df0db562f70573cba2805569
BLAKE2b-256 bb487efaa0ff91c9e7900f4eb4850370d5772b297a4f35550c2bf35254e61664

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page