Set httpx.AsyncClient timeout to 60 seconds

This commit is contained in:
Rafael Moraes
2025-12-18 14:21:56 -03:00
parent 25d028bea4
commit 1591f0daf2
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -163,7 +163,7 @@ class AppleMusicBaseDownloader:
@alru_cache()
async def get_cover_bytes(self, cover_url: str) -> bytes | None:
async with httpx.AsyncClient() as client:
async with httpx.AsyncClient(timeout=60.0) as client:
response = await client.get(cover_url)
raise_for_status(response, {200, 404})
+1 -1
View File
@@ -21,7 +21,7 @@ def safe_json(httpx_response: httpx.Response) -> dict:
async def get_response_text(url: str) -> str:
async with httpx.AsyncClient() as client:
async with httpx.AsyncClient(timeout=60.0) as client:
response = await client.get(url)
raise_for_status(response)
return response.text