Skip to content

Models

Submitter dataclass

Submitter(
    *,
    name: str,
    url: str,
    is_trusted: bool,
    is_banned: bool,
)

Represents the user who submitted the torrent.

is_banned instance-attribute

is_banned: bool

Indicates whether the user is banned or not.

is_trusted instance-attribute

is_trusted: bool

Indicates whether the user is trusted (green) or not.

name instance-attribute

name: str

Username of the submitter.

url instance-attribute

url: str

Profile URL of the submitter.

NyaaTorrentPage dataclass

NyaaTorrentPage(
    *,
    id: int,
    url: str,
    title: str,
    category: Category,
    submitter: Submitter | None,
    datetime: datetime,
    information: str | None,
    seeders: int,
    leechers: int,
    completed: int,
    size: int,
    infohash: str,
    is_trusted: bool,
    is_remake: bool,
    description: str | None,
    torrent: str,
    magnet: str,
)

Represents Nyaa's torrent page.

category instance-attribute

category: Category

Torrent category.

completed class-attribute instance-attribute

completed: int = field(compare=False)

Number of completed downloads.

datetime instance-attribute

datetime: datetime

Date and time at which the torrent was submitted.

description instance-attribute

description: str | None

Torrent description.

id instance-attribute

id: int

Nyaa ID of the torrent (https://nyaa.si/view/{id}).

infohash instance-attribute

infohash: str

Info hash of the torrent.

information instance-attribute

information: str | None

Information about the torrent.

is_remake instance-attribute

is_remake: bool

Indicates whether the upload is a remake (red) or not.

Note

An upload can be both trusted and a remake, in which case, the remake takes priority, that is, is_remake will be True and is_trusted will be False.

is_trusted instance-attribute

is_trusted: bool

Indicates whether the upload is trusted (green) or not.

Note

An upload can be both trusted and a remake, in which case, the remake takes priority, that is, is_remake will be True and is_trusted will be False.

leechers class-attribute instance-attribute

leechers: int = field(compare=False)

Number of leechers.

magnet instance-attribute

magnet: str

Magnet link of the torrent.

Note

The magnet link provided by Nyaa is different from the one you'll get if you simply generated it from the .torrent file itself because Nyaa strips away all trackers except it's own and the ones listed here.

seeders class-attribute instance-attribute

seeders: int = field(compare=False)

Number of seeders.

size instance-attribute

size: int

Size of the torrent.

submitter instance-attribute

submitter: Submitter | None

User who submitted the torrent. This will be None if the submitter is anonymous.

title instance-attribute

title: str

Title of the torrent.

torrent instance-attribute

torrent: str

URL pointing to the .torrent file (https://nyaa.si/download/123456.torrent)

url instance-attribute

url: str

URL to the Nyaa torrent page (https://nyaa.si/view/123456).