diff --git a/src/program/services/scrapers/mediafusion.py b/src/program/services/scrapers/mediafusion.py index e7ae9a22..1cbf0d7e 100644 --- a/src/program/services/scrapers/mediafusion.py +++ b/src/program/services/scrapers/mediafusion.py @@ -136,8 +136,18 @@ def scrape(self, item: MediaItem) -> tuple[Dict[str, str], int]: torrents: Dict[str, str] = {} for stream in response.data.streams: - raw_title = stream.description.split("\nšŸ’¾")[0].replace("šŸ“‚ ", "") - info_hash = stream.url.split("?info_hash=")[1] + description_split = stream.description.split("\nšŸ’¾") + if len(description_split) < 2: + logger.warning(f"Invalid stream description: {stream.description}") + continue + raw_title = description_split[0].replace("šŸ“‚ ", "") + + url_split = stream.url.split("?info_hash=") + if len(url_split) < 2: + logger.warning(f"Invalid stream URL: {stream.url}") + continue + info_hash = url_split[1] + if not info_hash or not raw_title: continue