Bulk asynchronous downloader for multiple file hosts
Python asynciobunkrcyberdropdownloaderdropboxfilestergofilegoogle-drivemediafiremegamega-nzonedrivepatreonpawchivepinterestpixeldraintransfer-ittwitchtwittervk
perf: use a weakref for file locks (#1303)
NTFSvolume937f013605f8
diff --git a/cyberdrop_dl/managers/client_manager.py b/cyberdrop_dl/managers/client_manager.pyindex 332c5a4ba..8bd576c8b 100644--- a/cyberdrop_dl/managers/client_manager.py+++ b/cyberdrop_dl/managers/client_manager.py@@ -3,6 +3,7 @@ from __future__ import annotationsimport asyncioimport contextlibimport ssl+import weakreffrom base64 import b64encodefrom collections import defaultdictfrom http import HTTPStatus@@ -124,7 +125,7 @@ class FileLocksVault:"""Is this necessary? No. But I want it."""def __init__(self) -> None:- self._locked_files: dict[str, asyncio.Lock] = {}+ self._locked_files: weakref.WeakValueDictionary[str, asyncio.Lock] = weakref.WeakValueDictionary()@contextlib.asynccontextmanagerasync def get_lock(self, filename: str) -> AsyncGenerator: