Skip to content

Bulk asynchronous downloader for multiple file hosts

Trying to fix it still

Jules-WinnfieldX538cad662f9d
diff --git a/cyberdrop_dl/__init__.py b/cyberdrop_dl/__init__.py
index b13076c56..8e7ae2b97 100644
--- a/cyberdrop_dl/__init__.py
+++ b/cyberdrop_dl/__init__.py
@@ -1 +1 @@
-__version__ = "5.0.89"
+__version__ = "5.0.91"
diff --git a/cyberdrop_dl/downloader/downloader.py b/cyberdrop_dl/downloader/downloader.py
index ea0b138c9..4556ef86f 100644
--- a/cyberdrop_dl/downloader/downloader.py
+++ b/cyberdrop_dl/downloader/downloader.py
@@ -110,6 +110,7 @@ class Downloader:
self._unfinished_count = 0
self._current_attempt_filesize = {}
+ self._lock = False
self.processed_items: list = []
@@ -127,8 +128,13 @@ class Downloader:
self.complete = False
self._unfinished_count += 1
media_item.current_attempt = 0
+
+ while self._lock:
+ await asyncio.sleep(gauss(0.1, 0.3))
+ self._lock = True
if not (media_item.url.path in self.processed_items):
self.processed_items.append(media_item.url.path)
+ self._lock = False
await self.manager.progress_manager.download_progress.update_total()
async with self.manager.client_manager.download_session_limit:
@@ -147,6 +153,7 @@ class Downloader:
await log(f"Download Finished: {media_item.url}")
+ self._lock = True
self.download_queue.task_done()
self._unfinished_count -= 1
if self._unfinished_count == 0 and self.download_queue.empty():
diff --git a/pyproject.toml b/pyproject.toml
index f3762acd7..5a5d45c80 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[tool.poetry]
name = "cyberdrop-dl"
-version = "5.0.89"
+version = "5.0.91"
description = "Bulk downloader for multiple file hosts"
authors = ["Jules Winnfield <[email protected]>"]
readme = "README.md"