-
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #174 from aymene69/test_rtn
Test rtn
- Loading branch information
Showing
19 changed files
with
258 additions
and
269 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -182,4 +182,3 @@ def get_availability_bulk(self, hashes_or_magnets, ip=None): | |
continue | ||
|
||
return available_torrents | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ bencode.py | |
jinja2 | ||
aiocron | ||
python-dotenv | ||
rank-torrent-name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,42 @@ | ||
from urllib.parse import quote | ||
|
||
from models.media import Media | ||
from models.series import Series | ||
from utils.logger import setup_logger | ||
|
||
|
||
class TorrentItem: | ||
def __init__(self, title, size, magnet, info_hash, link, seeders, languages, quality, quality_spec, indexer, | ||
privacy, | ||
episode=None, season=None, type=None): | ||
def __init__(self, raw_title, size, magnet, info_hash, link, seeders, languages, indexer, | ||
privacy, type=None, parsed_data=None): | ||
self.logger = setup_logger(__name__) | ||
|
||
self.title = title # Title of the torrent | ||
self.size = size # Size of the video file inside of the torrent - it may be updated durring __process_torrent() | ||
self.raw_title = raw_title # Raw title of the torrent | ||
self.size = size # Size of the video file inside the torrent - it may be updated during __process_torrent() | ||
self.magnet = magnet # Magnet to torrent | ||
self.info_hash = info_hash # Hash of the torrent | ||
self.link = link # Link to download torrent file or magnet link | ||
self.seeders = seeders # The number of seeders | ||
self.languages = languages # Language of the torrent | ||
self.quality = quality # Quality of the torrent | ||
self.quality_spec = quality_spec if quality_spec is not None else [] # Quality specifications of the torrent | ||
self.indexer = indexer # Indexer of the torrent | ||
self.episode = episode # Episode if its a series (for example: "E01" or "E14") | ||
self.season = season # Season if its a series (for example: "S01" or "S14") | ||
self.type = type # "series" or "movie" | ||
self.privacy = privacy # "public" or "private" | ||
|
||
self.file_name = None # it may be updated durring __process_torrent() | ||
self.file_name = None # it may be updated during __process_torrent() | ||
self.files = None # The files inside of the torrent. If it's None, it means that there is only one file inside of the torrent | ||
self.torrent_download = None # The torrent jackett download url if its None, it means that there is only a magnet link provided by Jackett. It also means, that we cant do series file filtering before debrid. | ||
self.trackers = [] # Trackers of the torrent | ||
self.file_index = None # Index of the file inside of the torrent - it may be updated durring __process_torrent() and update_availability(). If the index is None and torrent is not None, it means that the series episode is not inside of the torrent. | ||
|
||
self.availability = False # If its instantly available on the debrid service | ||
self.availability = False # If it's instantly available on the debrid service | ||
|
||
def to_debrid_stream_query(self) -> dict: | ||
self.parsed_data = parsed_data # Ranked result | ||
|
||
def to_debrid_stream_query(self, media: Media) -> dict: | ||
return { | ||
"magnet": self.magnet, | ||
"type": self.type, | ||
"file_index": self.file_index, | ||
"season": self.season, | ||
"episode": self.episode, | ||
"season": media.season if isinstance(media, Series) else None, | ||
"episode": media.episode if isinstance(media, Series) else None, | ||
"torrent_download": quote(self.torrent_download) if self.torrent_download is not None else None | ||
} |
Oops, something went wrong.