Skip to content

Commit

Permalink
Merge pull request #204 from aaronisles/patch-1
Browse files Browse the repository at this point in the history
fix: correctly handle unsuccessful api calls
  • Loading branch information
g0ldyy authored Nov 21, 2024
2 parents d7b92e1 + c14195e commit 46207a7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions comet/api/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ async def stream(request: Request, b64config: str, type: str, id: str):
}

connector = aiohttp.TCPConnector(limit=0)
async with aiohttp.ClientSession(connector=connector) as session:
async with aiohttp.ClientSession(connector=connector, raise_for_status=True) as session:
full_id = id
season = None
episode = None
Expand Down Expand Up @@ -552,7 +552,7 @@ async def playback(request: Request, b64config: str, hash: str, index: str):
config["debridService"] = settings.PROXY_DEBRID_STREAM_DEBRID_DEFAULT_SERVICE
config["debridApiKey"] = settings.PROXY_DEBRID_STREAM_DEBRID_DEFAULT_APIKEY

async with aiohttp.ClientSession() as session:
async with aiohttp.ClientSession(raise_for_status=True) as session:
# Check for cached download link
cached_link = await database.fetch_one(
f"SELECT link, timestamp FROM download_links WHERE debrid_key = '{config['debridApiKey']}' AND hash = '{hash}' AND file_index = '{index}'"
Expand Down

0 comments on commit 46207a7

Please sign in to comment.