Skip to main content

Nyaa API written in Python

Project description

Nyaax - Nyaa API written in Python

Installation

Nyaax is available on Pypi so you can install it using pip

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':

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.2.tar.gz (5.0 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.2-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nyaax-0.1.2.tar.gz
  • Upload date:
  • Size: 5.0 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.2.tar.gz
Algorithm Hash digest
SHA256 c109e4040046d3d58b09a7c9728c445d9b97ceebe5946ce8fc2e51dc4bec3716
MD5 37c16dac1a67d2e81ad9efb169b7c2ef
BLAKE2b-256 6d2ce8a9c10eca19078eab9dc3548d65a9443338a3e474c6f5496c9901a805c4

See more details on using hashes here.

Provenance

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

Publisher: cd.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.2-py3-none-any.whl.

File metadata

  • Download URL: nyaax-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a3cae19fc97b7562262a59b35f988f02366eb1960276695b32c111077ddec741
MD5 614764dd8c9a9d991d075d4732d1154e
BLAKE2b-256 0c873ab71551782c6e01edf5c891c38d84f6504782bce0768634195d5d2dc36b

See more details on using hashes here.

Provenance

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

Publisher: cd.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