A python library for searching thepiratebay.org
Project description
the-python-bay
Python library for searching thepiratebay.org
Install
pip install the-python-bay
Basic Usage
from the_python_bay import tpb
results = tpb.search("ubuntu")
This will return the a list of instances of the Torrent
class.
So you can then access the data like so:
for torrent in results:
print(f"{torrent.name} - {torrent.magnet}")
Full Docs
search
This can be used to search thepiratebay.org, it will return a list of instances of the Torrent
class.
from the_python_bay import tpb
results = tpb.search("ubuntu")
top_movies
Can be used to return the current top 100 movies on thepiratebay.org
from the_python_bay import tpb
results = tpb.top_movies()
top_tv
Can be used to return the current top 100 tv on thepiratebay.org
from the_python_bay import tpb
results = tpb.top_tv()
Torrent
The Torrent
class is the format the torrents are returned in, it has the following attributes:
name
the torrents namemagent
the torrents magnet linkseeders
number of seeders the torrent hasusername
the username of the torrents uploaderstatus
the users prominence status
Torrent also has the property to_dict
that can he used to return the dict of the the object. It can be used more generally:
from the_python_bay import tpb
results = tpb.search_dict("ubuntu")
Or it can be used on a specific Torrent
object like so:
from the_python_bay import tpb
results = tpb.search("ubuntu")
for torrent in results:
print(torrent.to_dict)
Or even more directly:
torrent = Torrent(data)
torrent.to_dict
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
Hashes for the_python_bay-1.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7e02d4577ddf96e040ad48e4a03f03fcc8c161c6ab1bc774c64a0d284442d77 |
|
MD5 | c1fc96b4e8e81343fdcb157c0b353e51 |
|
BLAKE2b-256 | 727c1f6aed7cf58cc856937633d69d039cfa4d69b43f0fe18964e368bb10d5e9 |