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+
requestsbeautifulsoup4pydantic
Clone repository
git clone https://github.com/flisakl/torrent-scrapers
cd torrent-scrapers
Install dependencies
pip install requests beautifulsoup4 pydantic
🛠 Usage
Using built in scraper
from scrapers.x1337 import Scraper1337, Params1337, Category1337, Order1337
scraper = Scraper1337()
params = Params1337(
name="ozark",
category=Category1337.TV,
order_column=Order1337.SIZE,
order_ascending=False
)
results = scraper.find_torrents(params, (1,))
for torrent in results:
scraper.get_torrent_info(torrent)
print(torrent)
🧩 Making your own scraper
To add support for a new torrent site:
- Subclass Scrapper
- Implement the following methods:
- get_request_data
- parse_search_page
- parse_detail_page
🔧 Structures
TorrentInfo
Pydantic's model 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 |
| magnet | str | Magnet link |
| uploader | str | Optional name of torrent uploader |
| category | str | Optional category of the torrent |
SearchParams
Pydantic's model containing search parameters, it is best to create subclass for each scraper.
| Field | Type | Description |
|---|---|---|
| name | str | Search term |
| category | str | Optional category |
| order_column | str | Optional sorting column |
| order_ascending | bool | Sort order |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file torrent_scrapers-0.0.2.tar.gz.
File metadata
- Download URL: torrent_scrapers-0.0.2.tar.gz
- Upload date:
- Size: 21.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.32.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5214589ea743c070c98da073cf1c5676cd07199c34868d84f7437373e37db378
|
|
| MD5 |
d1c6ddb1f3732466a58a6f8f437f16d0
|
|
| BLAKE2b-256 |
88413512e526694f6cf2034c3eaaaf28df0d418d334222de29b2dea14256a1f4
|
File details
Details for the file torrent_scrapers-0.0.2-py3-none-any.whl.
File metadata
- Download URL: torrent_scrapers-0.0.2-py3-none-any.whl
- Upload date:
- Size: 21.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.32.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d49e1bb8c3bc18b2cb30ff91c96f96251ef9e43f641c54b23764e828ed752197
|
|
| MD5 |
c9fd96b1b8985e843281dc4e117b64a0
|
|
| BLAKE2b-256 |
077a07b0ed779837b2d538734a4ab40b39bff989063d3cea6df49a4b7a325ccd
|