Skip to content

Data Models

These are the data structures returned by the various methods in the clients.

TorrentItem dataclass

Represents a single torrent item in the search results.

Attributes:

Name Type Description
name str
torrent_id str
url str
seeders str
leechers str
size str
time str
uploader str
uploader_link str
Source code in py1337x/models.py
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
@dataclass
class TorrentItem:
    """Represents a single torrent item in the search results."""

    name: str
    torrent_id: str
    url: str
    seeders: str
    leechers: str
    size: str
    time: str
    uploader: str
    uploader_link: str

    def to_dict(self):
        return asdict(self)

TorrentResult dataclass

Represents the result of a torrent search.

Attributes:

Name Type Description
items List[TorrentItem]
current_page int
item_count int
page_count int
Source code in py1337x/models.py
23
24
25
26
27
28
29
30
31
32
33
@dataclass
class TorrentResult:
    """Represents the result of a torrent search."""

    items: List[TorrentItem]
    current_page: int
    item_count: int
    page_count: int

    def to_dict(self):
        return asdict(self)

TorrentInfo dataclass

Represents information about a torrent.

Attributes:

Name Type Description
name str | None
short_name str | None
description str | None
category str | None
type str | None
genre List[str] | None
language str | None
size str | None
thumbnail str | None
images List[str] | None
uploader str | None
uploader_link str | None
downloads str | None
last_checked str | None
date_uploaded str | None
seeders str | None
leechers str | None
magnet_link str | None
info_hash str | None
Source code in py1337x/models.py
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
@dataclass
class TorrentInfo:
    """Represents information about a torrent."""

    name: Optional[str]
    short_name: Optional[str]
    description: Optional[str]
    category: Optional[str]
    type: Optional[str]
    genre: Optional[List[str]]
    language: Optional[str]
    size: Optional[str]
    thumbnail: Optional[str]
    images: Optional[List[str]]
    uploader: Optional[str]
    uploader_link: Optional[str]
    downloads: Optional[str]
    last_checked: Optional[str]
    date_uploaded: Optional[str]
    seeders: Optional[str]
    leechers: Optional[str]
    magnet_link: Optional[str]
    info_hash: Optional[str]

    def to_dict(self):
        return asdict(self)