From 8601a1ed50f5e5cacf80cd684ef89321c56d51fa Mon Sep 17 00:00:00 2001 From: Vxrtrauter <101264710+Vxrtrauter@users.noreply.github.com> Date: Sat, 11 Apr 2026 09:25:32 +0200 Subject: [PATCH] fix: Detect SteamRip hosts by URL Replace brittle index-based host resolution in SteamripScraper with substring checks on the chosen download URL (buzzheavier, gofile, vikingfile, megadb). Add a console log for the resolved link and adjust returned values for gofile. Remove the unnecessary links.index lookup and its exception handling. --- src/data/sources/steamrip.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/data/sources/steamrip.py b/src/data/sources/steamrip.py index 6675ecf..af0c376 100644 --- a/src/data/sources/steamrip.py +++ b/src/data/sources/steamrip.py @@ -110,23 +110,19 @@ class SteamripScraper: consoleLog("SteamRip: No valid download links found") return None, None - try: - idx = links.index(best) - except ValueError: - consoleLog("SteamRip: Failed to resolve download host") - return None, None try: - if idx == 0: + consoleLog(f"Found download link: {best}") + if "buzzheavier" in best: link = scrape_buzzheavier(best) return link - elif idx == 1: + elif "gofile" in best: link, headers = scrape_gofile(best) return link, headers - elif idx == 2: + elif "vikingfile" in best: scrape_vikingfile(best) return None, None - elif idx == 3: + elif "megadb" in best: scrape_megadb(best) return None, None else: