Bulk asynchronous downloader for multiple file hosts
Python asynciobunkrcyberdropdownloaderdropboxfilestergofilegoogle-drivemediafiremegamega-nzonedrivepatreonpawchivepinterestpixeldraintransfer-ittwitchtwittervk
add a second lock
Jules-WinnfieldXf8a8664382f2
diff --git a/cyberdrop_dl/__init__.py b/cyberdrop_dl/__init__.pyindex 4e4688ee7..e7fb836d0 100644--- a/cyberdrop_dl/__init__.py+++ b/cyberdrop_dl/__init__.py@@ -1 +1 @@-__version__ = "5.0.93"+__version__ = "5.0.94"diff --git a/cyberdrop_dl/downloader/downloader.py b/cyberdrop_dl/downloader/downloader.pyindex 2260f521f..01ec045e3 100644--- a/cyberdrop_dl/downloader/downloader.py+++ b/cyberdrop_dl/downloader/downloader.py@@ -110,7 +110,9 @@ class Downloader:self._unfinished_count = 0self._current_attempt_filesize = {}+self._lock = False+ self._lock2 = Falseself.processed_items: list = []@@ -328,9 +330,13 @@ class Downloader:FL_Filename = media_item.filenametry:+ if self._lock2:+ await asyncio.sleep(gauss(0.1, 0.3))+ self._lock2 = Truewhile await self._file_lock.check_lock(FL_Filename):await asyncio.sleep(gauss(1, 1.5))await self._file_lock.add_lock(FL_Filename)+ self._lock2 = Falseif not isinstance(media_item.current_attempt, int):media_item.current_attempt = 1diff --git a/pyproject.toml b/pyproject.tomlindex 815c0f0a1..a13a260b6 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -1,6 +1,6 @@[tool.poetry]name = "cyberdrop-dl"-version = "5.0.93"+version = "5.0.94"description = "Bulk downloader for multiple file hosts"authors = ["Jules Winnfield <[email protected]>"]readme = "README.md"