From b098bb1ed9a60af89e173c527bf4bb579a91a29c Mon Sep 17 00:00:00 2001 From: Goldy <153996346+g0ldyy@users.noreply.github.com> Date: Wed, 24 Jul 2024 19:30:40 +0200 Subject: [PATCH] fix: torrentio proxy --- comet/utils/general.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/comet/utils/general.py b/comet/utils/general.py index 69d2ca8..944ab04 100644 --- a/comet/utils/general.py +++ b/comet/utils/general.py @@ -322,10 +322,13 @@ async def get_torrentio(log_name: str, type: str, full_id: str ): results = [] try: - get_torrentio = requests.get(f"https://torrentio.strem.fun/stream/{type}/{full_id}.json", proxies={ - "http": settings.DEBRID_PROXY_URL, - "https": settings.DEBRID_PROXY_URL, - }).json() + try: + get_torrentio = requests.get(f"https://torrentio.strem.fun/stream/{type}/{full_id}.json").json() + except: + get_torrentio = requests.get(f"https://torrentio.strem.fun/stream/{type}/{full_id}.json", proxies={ + "http": settings.DEBRID_PROXY_URL, + "https": settings.DEBRID_PROXY_URL, + }).json() for torrent in get_torrentio["streams"]: title = torrent["title"]