Skip to content

Models

Submitter dataclass

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

Represents the user who submitted the torrent.

name instance-attribute

name: str

The username of the submitter.

url instance-attribute

url: str

The profile URL of the submitter.

is_trusted instance-attribute

is_trusted: bool

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

is_banned instance-attribute

is_banned: bool

Indicates whether the user is banned or not.

TorrentFile dataclass

TorrentFile(
    *,
    name: str,
    data: bytes,
    size: int,
    infohash: str,
    url: str,
    magnet: str,
)

Represents a torrent file, including its associated data and metadata.

name instance-attribute

name: str

The name of the torrent.

data instance-attribute

data: bytes

The raw data of the torrent file.

size instance-attribute

size: int

The size of the torrent in bytes.

infohash instance-attribute

infohash: str

The infohash of the torrent.

url instance-attribute

url: str

The URL to the torrent file.

magnet instance-attribute

magnet: str

The magnet link for the torrent.

NyaaRelease dataclass

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

Represents a specific release (torrent) on Nyaa.

id instance-attribute

id: int

The Nyaa ID of the release (e.g., https://nyaa.si/view/{id}).

url instance-attribute

url: str

The URL to the Nyaa release page (e.g., https://nyaa.si/view/123456).

title instance-attribute

title: str

The title of the release.

category instance-attribute

category: Category

The release's category.

submitter instance-attribute

submitter: Submitter | None

The user who submitted the release. This is None if the submitter is anonymous.

datetime instance-attribute

datetime: datetime

The date and time at which the release was submitted.

information instance-attribute

information: str | None

Additional information about the release.

seeders class-attribute instance-attribute

seeders: int = field(compare=False)

The number of seeders.

leechers class-attribute instance-attribute

leechers: int = field(compare=False)

The number of leechers.

completed class-attribute instance-attribute

completed: int = field(compare=False)

The number of completed downloads.

is_trusted instance-attribute

is_trusted: bool

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

Note

A release can be both trusted and a remake. In this case, the remake status takes priority, so is_remake will be True and is_trusted will be False.

is_remake instance-attribute

is_remake: bool

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

Note

A release can be both trusted and a remake. In this case, the remake status takes priority, so is_remake will be True and is_trusted will be False.

torrent instance-attribute

torrent: TorrentFile

The .torrent file associated with this release.

description instance-attribute

description: str | None

The release's description.