diff --git a/comet/api/endpoints/stream.py b/comet/api/endpoints/stream.py index 2a4e880..382b3b8 100644 --- a/comet/api/endpoints/stream.py +++ b/comet/api/endpoints/stream.py @@ -466,7 +466,7 @@ async def stream( if torrent["fileIndex"] is not None: the_stream["fileIdx"] = torrent["fileIndex"] - if len(torrent["sources"]) == 0: + if not torrent["sources"]: the_stream["sources"] = trackers else: the_stream["sources"] = torrent["sources"] diff --git a/comet/scrapers/aiostreams.py b/comet/scrapers/aiostreams.py index 9ac48e3..79736f8 100644 --- a/comet/scrapers/aiostreams.py +++ b/comet/scrapers/aiostreams.py @@ -48,7 +48,7 @@ class AiostreamsScraper(BaseScraper): "seeders": torrent.get("seeders", None), "size": torrent["size"], "tracker": tracker, - "sources": torrent.get("sources", []), + "sources": torrent.get("sources") or [], } ) except Exception as e: