Skip to main content

Nyaa API written in Python

Project description

Nyaa API written in Python

> HOW TO INSTALL:
The code is hosted on Pypi, so you can install it using pip(x):
$ pip install nyaax

> API:
Six methods are available to use:
- get_view
- get_description
- get_single_torrent
- get_comments
- get_multiple_torrents
- get_multiple_torrents_rss

(Working on get_file_tree)

To use them, import the module 'extractors':

--- Python

import requests
from nyaax import extractors as ex

rs = requests.get("https://nyaa.si/?f=0&c=0_0&q=Initial+D")
torrents = ex.get_multiple_torrents(rs)

# torrents -> [Torrent(seeders=10, code=2, ...), Torrent(info_hash=..., ...), ...]

---

Each method is responsible for extracting data from a particular page or a portion of it.
Below is a brief description of the methods currently available and from which URLs they
extract the data.

[https://nyaa.si/view/...]
- get_view -> View
- get_description -> str
- get_single_torrent -> Torrent
- get_comments -> list[Comment]

[https://nyaa.si/?q=...]
- get_multiple_torrents -> list[Torrent]

[https://nyaa.si/?page=rss&q=...]
- get_multiple_torrents_rss -> list[Torrent]


Below is a description of the objects returned by the 'extractors' module functions:

Torrent:
- size: int
- date: datetime
- seeders: int
- leechers: int
- completed_downloads: int
- category: str
- subcategory: str
- title: str
- code: int
- magnet_link: str
- comments: int
- torrent_type: str | None
- information: str | None
- info_hash: str | None
- submitter: User | None

User:
- name: str
- trusted: bool

View:
- torrent: Torrent
- description: str
- comments: list[Comment]

Comment:
- user: User
- date: str
- text: str
- avatar: str | None

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

nyaax-0.1.1.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

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

nyaax-0.1.1-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file nyaax-0.1.1.tar.gz.

File metadata

  • Download URL: nyaax-0.1.1.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for nyaax-0.1.1.tar.gz
Algorithm Hash digest
SHA256 5a4bb869b364ff93b714d1e57887d0fd196be95704b8661baf332fe7cf285782
MD5 792e118f4c2d2a63623e62359aa00c5f
BLAKE2b-256 b9b9c1dffc9d30b37aaa71eb6a002121130839995d25c46dc27738d925966da3

See more details on using hashes here.

Provenance

The following attestation bundles were made for nyaax-0.1.1.tar.gz:

Publisher: release.yml on gensimone/nyaax

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nyaax-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: nyaax-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for nyaax-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 be207939a0ba3b271bcecb7c7df7fe62ece7198b16f6a693a08729b49330d5d4
MD5 e713ee68bf8184d847937a103b53ae8b
BLAKE2b-256 7b4b789642959f66389976d8a22602a0ba7bb8447db3fbdf1effa774d5397e2f

See more details on using hashes here.

Provenance

The following attestation bundles were made for nyaax-0.1.1-py3-none-any.whl:

Publisher: release.yml on gensimone/nyaax

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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