Skip to main content

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 name
  • magent the torrents magnet link
  • seeders number of seeders the torrent has
  • username the username of the torrents uploader
  • status 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

Release files for the-python-bay 1.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for the-python-bay 1.2.3
File Size Uploaded
the-python-bay-1.2.3.tar.gz 3.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for the-python-bay 1.2.3
File Interpreter ABI Platform
the_python_bay-1.2.3-py3-none-any.whl Python 3 none any Details

Total release size: 6.5 kB

Release files / the-python-bay-1.2.3.tar.gz

Download URL the-python-bay-1.2.3.tar.gz
Size 3.0 kB
Tags Source
SHA-256 checksum
How to use checksums
553c000ede5926f751eec7925198fc152710dc6203c4a9e35eab8591d70eb285
BLAKE2b-256 checksum
How to use checksums
96eebbfe6836fc919febee0a9f35a1b23e3ca69105e6196f7d735c2403099d2e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.4 CPython/3.9.1 Darwin/20.2.0

Release files / the_python_bay-1.2.3-py3-none-any.whl

Download URL the_python_bay-1.2.3-py3-none-any.whl
Size 3.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
501de38734722bb69725239022d42d3c255a3af9addbf2d39e6d2aae00e87c25
BLAKE2b-256 checksum
How to use checksums
201c9b8469ef3358a7761864228b5a522a6edaa6e5bcf991cccc12aaf5a702e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.4 CPython/3.9.1 Darwin/20.2.0

Release history Release notifications | RSS feed

This release

1.2.3 This release

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.9

2 release files

1.1.8

2 release files

1.1.7

2 release files

1.1.6

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page