From e94e2249a0ac9bd99eaee1f90dd3cdfd41bc43ba Mon Sep 17 00:00:00 2001 From: Goldy <153996346+g0ldyy@users.noreply.github.com> Date: Mon, 15 Jul 2024 18:12:40 +0200 Subject: [PATCH] fix: valid debrid api key not needed anymore if results already cached --- comet/api/stream.py | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/comet/api/stream.py b/comet/api/stream.py index a414a01..5528dd9 100644 --- a/comet/api/stream.py +++ b/comet/api/stream.py @@ -45,24 +45,6 @@ async def stream(request: Request, b64config: str, type: str, id: str): connector = aiohttp.TCPConnector(limit=0) async with aiohttp.ClientSession(connector=connector) as session: - debrid = getDebrid(session, config) - - check_premium = await debrid.check_premium() - if not check_premium: - additional_info = "" - if config["debridService"] == "alldebrid": - additional_info = "\nCheck your email!" - - return { - "streams": [ - { - "name": "[⚠️] Comet", - "title": f"Invalid {config['debridService']} account.{additional_info}", - "url": "https://comet.fast", - } - ] - } - season = None episode = None if type == "series": @@ -169,6 +151,24 @@ async def stream(request: Request, b64config: str, type: str, id: str): else: logger.info(f"No cache found for {log_name} with user configuration") + debrid = getDebrid(session, config) + + check_premium = await debrid.check_premium() + if not check_premium: + additional_info = "" + if config["debridService"] == "alldebrid": + additional_info = "\nCheck your email!" + + return { + "streams": [ + { + "name": "[⚠️] Comet", + "title": f"Invalid {config['debridService']} account.{additional_info}", + "url": "https://comet.fast", + } + ] + } + indexer_manager_type = settings.INDEXER_MANAGER_TYPE search_indexer = len(config["indexers"]) != 0