Skip to content

Bulk asynchronous downloader for multiple file hosts

fix: tcp leak (#1333)

NTFSvolumee9c942bfaed5
diff --git a/cyberdrop_dl/clients/download_client.py b/cyberdrop_dl/clients/download_client.py
index c21327076..af37389bb 100644
--- a/cyberdrop_dl/clients/download_client.py
+++ b/cyberdrop_dl/clients/download_client.py
@@ -153,8 +153,8 @@ class DownloadClient:
while True:
resp = None
try:
- resp = await self.client_manager._download_session.get(download_url, headers=download_headers)
- return await process_response(resp)
+ async with self.client_manager._download_session.get(download_url, headers=download_headers) as resp:
+ return await process_response(resp)
except (DownloadError, DDOSGuardError):
if resp is None:
raise