diff --git a/main.py b/main.py index 7ad2015..b67586b 100644 --- a/main.py +++ b/main.py @@ -54,10 +54,10 @@ async def read_item(request: LinkRequest): challenged = await asyncio.wait_for(bypass_cloudflare(page), timeout=timeout) except asyncio.TimeoutError as e: logger.info("Timed out bypassing Cloudflare") + browser.stop() raise HTTPException( detail="Timed out bypassing Cloudflare", status_code=408 ) from e - browser.stop() except Exception as e: browser.stop() raise HTTPException(detail="Couldn't bypass", status_code=500) from e