Skip to content

Commit

Permalink
Clarify site name in search existing
Browse files Browse the repository at this point in the history
In unattended especially, where it asyncs and the tracker returns are jumbled, clarify site name in console responses helps to ascertain which site is returning the message.
  • Loading branch information
Audionut committed Dec 27, 2024
1 parent 9ada2c6 commit 025a1ad
Show file tree
Hide file tree
Showing 13 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/trackers/ANT.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ async def edit_desc(self, meta):

async def search_existing(self, meta, disctype):
if meta.get('category') == "TV":
console.print('[bold red]This site only ALLOWS Movies.')
console.print('[bold red]ANT only ALLOWS Movies.')
meta['skipping'] = "ANT"
return []
dupes = []
Expand Down
2 changes: 1 addition & 1 deletion src/trackers/HHD.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ async def upload(self, meta, disctype):

async def search_existing(self, meta, disctype):
dupes = []
console.print("[yellow]Searching for existing torrents on FNP...")
console.print("[yellow]Searching for existing torrents on HHD...")
params = {
'api_token': self.config['TRACKERS'][self.tracker]['api_key'].strip(),
'tmdbId': meta['tmdb'],
Expand Down
2 changes: 1 addition & 1 deletion src/trackers/HUNO.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ async def is_plex_friendly(self, meta):

async def search_existing(self, meta, disctype):
if meta['video_codec'] != "HEVC" and (meta['type'] == "ENCODE" or meta['type'] == "WEBRIP" or meta['type'] == "DVDRIP"):
console.print('[bold red]Only x265/HEVC encodes are allowed')
console.print('[bold red]Only x265/HEVC encodes are allowed at HUNO')
meta['skipping'] = "HUNO"
return
dupes = []
Expand Down
2 changes: 1 addition & 1 deletion src/trackers/NBL.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ async def search_existing(self, meta, disctype):
return []

if meta.get('is_disc') is not None:
console.print('[bold red]This site does not allow raw discs')
console.print('[bold red]NBL does not allow raw discs')
meta['skipping'] = "NBL"
return []

Expand Down
6 changes: 1 addition & 5 deletions src/trackers/OE.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,11 +319,7 @@ def process_languages(tracks):

async def search_existing(self, meta, disctype):
if 'concert' in meta['keywords']:
console.print('[bold red]Concerts not allowed.')
meta['skipping'] = "OE"
return
if meta['is_disc'] == "DVD":
console.print('[bold red]Skipping DVD')
console.print('[bold red]Concerts not allowed at OE.')
meta['skipping'] = "OE"
return
dupes = []
Expand Down
2 changes: 1 addition & 1 deletion src/trackers/OTW.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ async def upload(self, meta, disctype):

async def search_existing(self, meta, disctype):
if not any(genre in meta['genres'] for genre in ['Animation', 'Family']):
console.print('[bold red]Content not allowed.')
console.print('[bold red]This content is not allowed at OTW.')
meta['skipping'] = "OTW"
return
dupes = []
Expand Down
2 changes: 1 addition & 1 deletion src/trackers/PTT.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ async def upload(self, meta, disctype):

async def search_existing(self, meta, disctype):
dupes = []
console.print("[yellow]Searching for existing torrents on site...")
console.print("[yellow]Searching for existing torrents on PTT...")
params = {
'api_token': self.config['TRACKERS'][self.tracker]['api_key'].strip(),
'tmdbId': meta['tmdb'],
Expand Down
4 changes: 2 additions & 2 deletions src/trackers/RF.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,11 @@ async def get_res_id(self, resolution):
async def search_existing(self, meta, disctype):
disallowed_keywords = {'XXX', 'Erotic'}
if any(keyword in meta['keywords'] for keyword in disallowed_keywords):
console.print('[bold red]Erotic not allowed.')
console.print('[bold red]Erotic not allowed at RF.')
meta['skipping'] = "RF"
return
if meta.get('category') == "TV":
console.print('[bold red]This site only ALLOWS Movies.')
console.print('[bold red]RF only ALLOWS Movies.')
meta['skipping'] = "RF"
return
dupes = []
Expand Down
2 changes: 1 addition & 1 deletion src/trackers/RTF.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ async def search_existing(self, meta, disctype):
return []

if datetime.date.today().year - meta['year'] <= 9:
console.print("[red]ERROR: Not uploading!\nMust be older than 10 Years as per rules")
console.print("[red]Content must be older than 10 Years to upload at RTF")
meta['skipping'] = "RTF"
return []

Expand Down
1 change: 1 addition & 0 deletions src/trackers/THR.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ async def search_existing(self, session, imdb_id, disctype):
imdb_id = imdb_id.replace('tt', '')
search_url = f"https://www.torrenthr.org/browse.php?search={imdb_id}&blah=2&incldead=1"
dupes = []
console.print("[yellow]Searching for existing torrents on THR...")

try:
async with httpx.AsyncClient(timeout=10.0) as client:
Expand Down
1 change: 1 addition & 0 deletions src/trackers/TTG.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ async def upload(self, meta, disctype):

async def search_existing(self, meta, disctype):
dupes = []
console.print("[yellow]Searching for existing torrents on TTG...")
cookiefile = os.path.abspath(f"{meta['base_dir']}/data/cookies/TTG.pkl")
if not os.path.exists(cookiefile):
console.print("[bold red]Cookie file not found: TTG.pkl")
Expand Down
2 changes: 1 addition & 1 deletion src/trackers/ULCX.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ async def upload(self, meta, disctype):

async def search_existing(self, meta, disctype):
if 'concert' in meta['keywords']:
console.print('[bold red]Concerts not allowed.')
console.print('[bold red]Concerts not allowed at ULCX.')
meta['skipping'] = "ULCX"
return
dupes = []
Expand Down
2 changes: 1 addition & 1 deletion src/trackers/UNIT3D_TEMPLATE.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ async def upload(self, meta, disctype):

async def search_existing(self, meta, disctype):
dupes = []
console.print("[yellow]Searching for existing torrents on site...")
console.print(f"[yellow]Searching for existing torrents on {self.tracker}...")
params = {
'api_token': self.config['TRACKERS'][self.tracker]['api_key'].strip(),
'tmdbId': meta['tmdb'],
Expand Down

0 comments on commit 025a1ad

Please sign in to comment.