From 335f0d03935d74170b39a4939b31b8da24e20c2c Mon Sep 17 00:00:00 2001 From: Audionut Date: Thu, 14 Nov 2024 23:05:08 +1000 Subject: [PATCH] Might as well make them all work --- src/clients.py | 38 ++++++++++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/src/clients.py b/src/clients.py index fe28bac0..82e0acf9 100644 --- a/src/clients.py +++ b/src/clients.py @@ -478,15 +478,41 @@ async def get_ptp_from_hash(self, meta): for torrent in torrents: if torrent.get('infohash_v1') == info_hash_v1: comment = torrent.get('comment', "") - match = re.search(r'torrentid=(\d+)', comment) - if match: - meta['ptp'] = match.group(1) - console.print(f"[bold cyan]meta['ptp'] set to torrentid: {meta['ptp']}") - else: - console.print("[bold red]No torrentid found in comment.") + + if "https://passthepopcorn.me" in comment: + match = re.search(r'torrentid=(\d+)', comment) + if match: + meta['ptp'] = match.group(1) + console.print(f"[bold cyan]meta['ptp'] set to torrentid: {meta['ptp']}") + + elif "https://aither.cc" in comment: + match = re.search(r'/(\d+)$', comment) + if match: + meta['aither'] = match.group(1) + console.print(f"[bold cyan]meta['aither'] set to ID: {meta['aither']}") + + elif "https://lst.gg" in comment: + match = re.search(r'/(\d+)$', comment) + if match: + meta['lst'] = match.group(1) + console.print(f"[bold cyan]meta['lst'] set to ID: {meta['lst']}") + + elif "https://onlyencodes.cc" in comment: + match = re.search(r'/(\d+)$', comment) + if match: + meta['oe'] = match.group(1) + console.print(f"[bold cyan]meta['oe'] set to ID: {meta['oe']}") + + elif "https://blutopia.cc" in comment: + match = re.search(r'/(\d+)$', comment) + if match: + meta['blu'] = match.group(1) + console.print(f"[bold cyan]meta['blu'] set to ID: {meta['blu']}") + found = True break if not found: console.print("[bold red]Torrent with the specified infohash_v1 not found.") + return meta