Skip to content

Bulk asynchronous downloader for multiple file hosts

Add refresh rate arg for progress

Jules-WinnfieldX72c3e03a1189
diff --git a/README.md b/README.md
index 2a18b368a..81022e5f3 100644
--- a/README.md
+++ b/README.md
@@ -177,6 +177,7 @@ optional arguments:
--dont-show-domain-progress removes domain progress section while downloading
--dont-show-album-progress removes album progress section while downloading
--dont-show-file-progress removes file progress section while downloading
+--refresh-rate changes the refresh rate of the progress table
```
diff --git a/cyberdrop_dl/__init__.py b/cyberdrop_dl/__init__.py
index 2b1db1104..6e9a5019f 100644
--- a/cyberdrop_dl/__init__.py
+++ b/cyberdrop_dl/__init__.py
@@ -1 +1 @@
-__version__ = "4.0.61"
+__version__ = "4.0.62"
diff --git a/cyberdrop_dl/base_functions/config_schema.py b/cyberdrop_dl/base_functions/config_schema.py
index 755f27e6b..9f80a1874 100644
--- a/cyberdrop_dl/base_functions/config_schema.py
+++ b/cyberdrop_dl/base_functions/config_schema.py
@@ -46,7 +46,8 @@ config_default = [
"dont_show_thread_progress": False,
"dont_show_domain_progress": False,
"dont_show_album_progress": False,
- "dont_show_file_progress": False
+ "dont_show_file_progress": False,
+ "refresh_rate": 10
},
"Ratelimiting": {
"connection_timeout": 15,
@@ -96,7 +97,7 @@ jdownloader_args = ["apply_jdownloader", "jdownloader_username", "jdownloader_pa
progress_args = ["hide_new_progress", "dont_show_overall_progress", "dont_show_forum_progress",
"dont_show_thread_progress", "dont_show_domain_progress", "dont_show_album_progress",
- "dont_show_file_progress"]
+ "dont_show_file_progress", "refresh_rate"]
ratelimiting_args = ["connection_timeout", "ratelimit", "throttle"]
diff --git a/cyberdrop_dl/downloader/downloaders.py b/cyberdrop_dl/downloader/downloaders.py
index dc4658e32..5be594676 100644
--- a/cyberdrop_dl/downloader/downloaders.py
+++ b/cyberdrop_dl/downloader/downloaders.py
@@ -373,7 +373,7 @@ async def download_cascade(args: dict, Cascade: CascadeItem, SQL_Helper: SQLHelp
files = Files(overall_file_progress.add_task("[green]Completed", total=total_files),
overall_file_progress.add_task("[yellow]Skipped", total=total_files),
overall_file_progress.add_task("[red]Failed", total=total_files))
- with Live(progress_table, refresh_per_second=30):
+ with Live(progress_table, refresh_per_second=args["Progress_Options"]["refresh_rate"]):
cascade_task = cascade_progress.add_task("[light_salmon3]Domains", progress_type="cascade",
total=len(Cascade.domains))
@@ -410,7 +410,7 @@ async def download_forums(args: dict, Forums: ForumItem, SQL_Helper: SQLHelper,
files = Files(overall_file_progress.add_task("[green]Completed", total=total_files),
overall_file_progress.add_task("[yellow]Skipped", total=total_files),
overall_file_progress.add_task("[red]Failed", total=total_files))
- with Live(progress_table, refresh_per_second=10):
+ with Live(progress_table, refresh_per_second=args["Progress_Options"]["refresh_rate"]):
forum_task = forum_progress.add_task("[orange3]FORUM THREADS", total=len(Forums.threads))
for title, Cascade in Forums.threads.items():
cascade_task = cascade_progress.add_task("[light_salmon3]" + title.upper(), total=len(Cascade.domains))
diff --git a/cyberdrop_dl/main.py b/cyberdrop_dl/main.py
index 37feb0eec..341f0c3e9 100644
--- a/cyberdrop_dl/main.py
+++ b/cyberdrop_dl/main.py
@@ -97,6 +97,7 @@ def parse_args() -> argparse.Namespace:
parser.add_argument("--dont-show-domain-progress", help="removes domain progress section while downloading", action="store_true")
parser.add_argument("--dont-show-album-progress", help="removes album progress section while downloading", action="store_true")
parser.add_argument("--dont-show-file-progress", help="removes file progress section while downloading", action="store_true")
+ parser.add_argument("--refresh-rate", type=int, help="refresh rate for the progress table", default=10)
# Links
parser.add_argument("links", metavar="link", nargs="*", help="link to content to download (passing multiple links is supported)", default=[])