Skip to content

Bulk asynchronous downloader for multiple file hosts

Implement no sub folder arg.

Jules-WinnfieldX1ceba8effbb3
diff --git a/cyberdrop_dl/base_functions/config_schema.py b/cyberdrop_dl/base_functions/config_schema.py
index 2187df356..f50f7cc5a 100644
--- a/cyberdrop_dl/base_functions/config_schema.py
+++ b/cyberdrop_dl/base_functions/config_schema.py
@@ -52,6 +52,7 @@ config_default = [
"disable_attempt_limit": False,
"include_id": False,
"mark_downloaded": False,
+ "allow_sub_folders": True,
"output_errored_urls": False,
"output_unsupported_urls": False,
"proxy": "",
diff --git a/cyberdrop_dl/downloader/downloaders.py b/cyberdrop_dl/downloader/downloaders.py
index 39e50378d..58db1362a 100644
--- a/cyberdrop_dl/downloader/downloaders.py
+++ b/cyberdrop_dl/downloader/downloaders.py
@@ -86,6 +86,7 @@ class Downloader:
self.exclude_videos = args["Ignore"]["exclude_videos"]
self.exclude_other = args["Ignore"]["exclude_other"]
+ self.allow_sub_folders = args['Runtime']['allow_sub_folders']
self.allowed_attempts = args["Runtime"]["attempts"]
self.allow_insecure_connections = args["Runtime"]["allow_insecure_connections"]
self.disable_attempt_limit = args["Runtime"]["disable_attempt_limit"]
@@ -187,6 +188,9 @@ class Downloader:
progress.advance(album_task, 1)
return
+ if not self.allow_sub_folders:
+ album = album.split('/')[0]
+
while await self.File_Lock.check_lock(media.filename):
await asyncio.sleep(gauss(1, 1.5))
await self.File_Lock.add_lock(media.filename)