Models
Submitter
Bases: ParentModel
Model representing the user who submitted the torrent.
Features
- Immutable
- Hashable
- Inherits from
pydantic.BaseModel
, so you get all of pydantic's fancy methods - Supports equality checking (based on the URL)
Examples:
>>> a = Submitter(name="John", url="https://nyaa.si/user/john", is_trusted=True, is_banned=False)
>>> b = Submitter(name="John", url="https://nyaa.si/user/john", is_trusted=True, is_banned=False) # dupe
>>> c = Submitter(name="Jane", url="https://nyaa.si/user/jane", is_trusted=False, is_banned=False)
>>> print(a)
John
>>> a == b
True
>>> a == c
False
>>> set((a, b, c)) == {a, c} == {b, c} # dedupe
True
is_trusted
instance-attribute
is_trusted: bool
Indicates whether the user is trusted (green) or not.
NyaaTorrentPage
Bases: ParentModel
Model representing Nyaa's torrent page.
Features
- Immutable
- Hashable
- Inherits from
pydantic.BaseModel
, so you get all of pydantic's fancy methods - Supports equality checking (based on the URL)
Examples:
>>> from pynyaa import Nyaa
>>> nyaa = Nyaa()
>>> a = nyaa.get(1839783)
>>> b = nyaa.get(1839783) # dupe
>>> c = nyaa.get(1839609)
>>> print(a)
[SubsPlease] Hibike! Euphonium S3 - 13 (1080p) [230618C3].mkv
>>> a == b
True
>>> a == c
False
>>> set((a, b, c)) == {a, c} == {b, c} # dedupe
True
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
.
This is a current limitation that I don't know how to work around.
is_trusted
instance-attribute
is_trusted: bool
Indicates whether the upload is trusted (green) or not.
magnet
instance-attribute
magnet: MagnetUrl
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.
torrent
instance-attribute
torrent: Torrent
A torf.Torrent
object
representing the data stored in the .torrent
file.
torrent_file
instance-attribute
torrent_file: HttpUrl
URL pointing to the .torrent
file (https://nyaa.si/download/123456.torrent
)