Skip to main content

A PirateBay API wrapper

Project description

PirateBay.py

This project is intended to be an API wrapper for apibay & ThePirateBay(only main.js for the trackers)

How it works

It's own functionality is very easy to understand, its composed by a set of function's that points directly to the PirateBay API (apibay) and parses the response for the programmer.

A very simple example that search's "The Tomorrow War" in the Video.Movies category and prints result's

import PirateBay
import typing

# Static Typing isn't required (but recomended)
results: typing.List[PirateBay.SearchElement] = PirateBay.Search(
    "The Tomorrow War", PirateBay.VideoType.Movies)

for result in results:
    print("File: {} {}.Mb (id:{})".format(
        result.name, round(result.size/1024/1024, 2), result.id))

Another example, in this case, we get the download magnet link from the first result of the search

import PirateBay
import typing

# Static Typing isn't required (but recomended)
results: typing.List[PirateBay.SearchElement] = PirateBay.Search(
    "The Tomorrow War", PirateBay.VideoType.Movies)

print("Download Link: {} (size:{}.Mb)".format(
    PirateBay.Download(results[0].id), round(results[0].size/1024/1024, 2)))

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

PirateBayAPI-1.0.0.tar.gz (4.4 kB view hashes)

Uploaded Source

Built Distribution

PirateBayAPI-1.0.0-py3-none-any.whl (5.8 kB view hashes)

Uploaded Python 3

Supported by

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