Skip to main content

Simple collection of scrapers of popular torrent sites.

Project description

Torrent Scraper Collection

Collection of web scrapers of popular torrent sites.

Currently package provides scrapers for:


🚀 Features

  • Scrape torrent listings (name, seeders, leechers, size, uploader, etc.)
  • Fetch magnet links
  • Handle pagination and search filters (category, sorting)
  • Easily extendable to other torrent sites
  • Logs warnings for missing data, connection errors and timeouts

Installation

You can install the package from pypi or clone the repository.

Package

pip install torrent-scrapers

Manual installation

🧱 Requirements

  • Python 3.10+
  • requests
  • beautifulsoup4

Clone repository

git clone https://github.com/flisakl/torrent-scrapers
cd torrent-scrapers

Install dependencies

pip install requests beautifulsoup4

🛠 Usage

Using built in scraper

from scrapers import Scrapper1337, SearchParams

scraper = Scrapper1337()

params = SearchParams(
    name="ubuntu",
    order_column="seeders",
    order_ascending=False
)

results = scraper.find_torrents(params, pages=(1, 2))
scraper.get_magnet_links(results)

for torrent in results:
    print(torrent.name, torrent.magnet)

🧩 Making your own scraper

To add support for a new torrent site:

  1. Subclass Scrapper
  2. Implement the following methods:
    • get_request_data
    • parse_response
    • fetch_magnet_link - implement when magnet link can not be obtained on site's search page

🔧 Structures

TorrentInfo

Dataclass containing torrent informations

Field Type Description
name str Search term
url str URL for torrent detail page
seeders int Number of seeders
leechers int Number of leechers
size str Size of torrent's data
uploader str Optional name of torrent uploader
magnet str Magnet link

SearchParams

Immutable dataclass for filters

Field Type Description
name str Search term
category str Optional category
order_column str Sorting column
order_ascending bool Sort order

If order_column is set to None, ordering will not be applied.

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

torrent_scrapers-0.0.1.tar.gz (18.7 kB view details)

Uploaded Source

Built Distribution

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

torrent_scrapers-0.0.1-py3-none-any.whl (17.7 kB view details)

Uploaded Python 3

File details

Details for the file torrent_scrapers-0.0.1.tar.gz.

File metadata

  • Download URL: torrent_scrapers-0.0.1.tar.gz
  • Upload date:
  • Size: 18.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.3

File hashes

Hashes for torrent_scrapers-0.0.1.tar.gz
Algorithm Hash digest
SHA256 6de7bce384ba5ed79b2a2025e3376eb8adec2435ebc981acabf869a5326731aa
MD5 13d74ce2747361beae38b104270dcab4
BLAKE2b-256 bb5fc9b170010fadbcbea6614e1afe2a078fd01dcd6055705a81f2576884b5c2

See more details on using hashes here.

File details

Details for the file torrent_scrapers-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for torrent_scrapers-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e4ad66e7822341eb56f65e60204c41d0ef2b59700afe7187887a752d5716657b
MD5 6e062d73c0ca2db9f02805d1c98ee230
BLAKE2b-256 88a8994b3cad99310049926cfe4cdff93b6050590e155e974474d583e9845ca5

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