Bulk asynchronous downloader for multiple file hosts
Python asynciobunkrcyberdropdownloaderdropboxfilestergofilegoogle-drivemediafiremegamega-nzonedrivepatreonpawchivepinterestpixeldraintransfer-ittwitchtwittervk
Update toggleable arguments
Jacob26b95a46ebaa
diff --git a/cyberdrop_dl/managers/manager.py b/cyberdrop_dl/managers/manager.pyindex 3b53f0aa4..87d32f515 100644--- a/cyberdrop_dl/managers/manager.py+++ b/cyberdrop_dl/managers/manager.py@@ -148,7 +148,8 @@ class Manager:if arg in self.args_manager.additive_args:self.config_manager.settings_data[cli_settings_group][arg] += self.args_manager.parsed_args[arg]else:- self.config_manager.settings_data[cli_settings_group][arg] = self.args_manager.parsed_args[arg]+ if self.args_manager.parsed_args[arg] is not None:+ self.config_manager.settings_data[cli_settings_group][arg] = self.args_manager.parsed_args[arg]async def args_logging(self) -> None:"""Logs the runtime arguments"""diff --git a/cyberdrop_dl/utils/args/args.py b/cyberdrop_dl/utils/args/args.pyindex 6bbc2b085..a90316edf 100644--- a/cyberdrop_dl/utils/args/args.py+++ b/cyberdrop_dl/utils/args/args.py@@ -16,20 +16,20 @@ def parse_args() -> argparse.Namespace:general.add_argument("--flaresolverr", type=str, help="IP:PORT for flaresolverr", default="")general.add_argument("--no-ui", action="store_true", help="Disables the UI/Progress view entirely", default=False)general.add_argument("--download", action="store_true", help="Skip the UI and go straight to downloading",- default=False)+ default=False)general.add_argument("--download-all-configs", action="store_true",- help="Skip the UI and go straight to downloading (runs all configs sequentially)",- default=False)+ help="Skip the UI and go straight to downloading (runs all configs sequentially)",+ default=False)general.add_argument("--sort-all-configs", action="store_true", help="Sort all configs sequentially", default=False)general.add_argument("--retry-failed", action="store_true", help="retry failed downloads", default=False)general.add_argument("--retry-all", action="store_true", help="retry all downloads", default=False)general.add_argument("--retry-maintenance", action="store_true",- help="retry all failed downloads due to maintenance, only supports bunkr and requires files to be hashed",- default=False)+ help="retry all failed downloads due to maintenance, only supports bunkr and requires files to be hashed",+ default=False)general.add_argument("--completed-after", help="only download completed downloads at or after this date",- default=None, type=lambda x: None if not x else arrow.get(x))+ default=None, type=lambda x: None if not x else arrow.get(x))general.add_argument("--completed-before", help="only download completed downloads at or before this date",- default=None, type=lambda x: None if not x else arrow.get(x))+ default=None, type=lambda x: None if not x else arrow.get(x))general.add_argument("--max-items-retry", help="max number of links to retry", type=int)# File Paths@@ -55,79 +55,81 @@ def parse_args() -> argparse.Namespace:# Settingsdownload_options = parser.add_argument_group("Download_Options")- download_options.add_argument("--block-download-sub-folders", action="store_true", help="block sub folder creation",- default=False)- download_options.add_argument("--disable-download-attempt-limit", action="store_true",- help="disable download attempt limit", default=False)- download_options.add_argument("--disable-file-timestamps", action="store_true", help="disable file timestamps",- default=False)- download_options.add_argument("--include-album-id-in-folder-name", action="store_true",- help="include album id in folder name", default=False)- download_options.add_argument("--include-thread-id-in-folder-name", action="store_true",- help="include thread id in folder name", default=False)- download_options.add_argument("--remove-domains-from-folder-names", action="store_true",- help="remove website domains from folder names", default=False)- download_options.add_argument("--remove-generated-id-from-filenames", action="store_true",- help="remove site generated id from filenames", default=False)- download_options.add_argument("--scrape-single-forum-post", action="store_true", help="scrape single forum post",- default=False)- download_options.add_argument("--separate-posts", action="store_true", help="separate posts into folders",- default=False)- download_options.add_argument("--skip-download-mark-completed", action="store_true",- help="skip download and mark as completed in history", default=False)+ download_options.add_argument("--block-download-sub-folders", action=argparse.BooleanOptionalAction,+ help="block sub folder creation")+ download_options.add_argument("--disable-download-attempt-limit", action=argparse.BooleanOptionalAction,+ help="disable download attempt limit")+ download_options.add_argument("--disable-file-timestamps", action=argparse.BooleanOptionalAction,+ help="disable file timestamps", )+ download_options.add_argument("--include-album-id-in-folder-name", action=argparse.BooleanOptionalAction,+ help="include album id in folder name")+ download_options.add_argument("--include-thread-id-in-folder-name", action=argparse.BooleanOptionalAction,+ help="include thread id in folder name")+ download_options.add_argument("--remove-domains-from-folder-names", action=argparse.BooleanOptionalAction,+ help="remove website domains from folder names")+ download_options.add_argument("--remove-generated-id-from-filenames", action=argparse.BooleanOptionalAction,+ help="remove site generated id from filenames")+ download_options.add_argument("--scrape-single-forum-post", action=argparse.BooleanOptionalAction,+ help="scrape single forum post")+ download_options.add_argument("--separate-posts", action=argparse.BooleanOptionalAction,+ help="separate posts into folders")+ download_options.add_argument("--skip-download-mark-completed", action=argparse.BooleanOptionalAction,+ help="skip download and mark as completed in history")file_size_limits = parser.add_argument_group("File_Size_Limits")file_size_limits.add_argument("--maximum-image-size", type=int,- help="maximum image size in bytes (default: %(default)s)", default=0)+ help="maximum image size in bytes (default: %(default)s)", default=0)file_size_limits.add_argument("--maximum-video-size", type=int,- help="maximum video size in bytes (default: %(default)s)", default=0)+ help="maximum video size in bytes (default: %(default)s)", default=0)file_size_limits.add_argument("--maximum-other-size", type=int,- help="maximum other size in bytes (default: %(default)s)", default=0)+ help="maximum other size in bytes (default: %(default)s)", default=0)file_size_limits.add_argument("--minimum-image-size", type=int,- help="minimum image size in bytes (default: %(default)s)", default=0)+ help="minimum image size in bytes (default: %(default)s)", default=0)file_size_limits.add_argument("--minimum-video-size", type=int,- help="minimum video size in bytes (default: %(default)s)", default=0)+ help="minimum video size in bytes (default: %(default)s)", default=0)file_size_limits.add_argument("--minimum-other-size", type=int,- help="minimum other size in bytes (default: %(default)s)", default=0)+ help="minimum other size in bytes (default: %(default)s)", default=0)ignore_options = parser.add_argument_group("Ignore_Options")- ignore_options.add_argument("--exclude-videos", action="store_true", help="exclude videos from downloading",- default=False)- ignore_options.add_argument("--exclude-images", action="store_true", help="exclude images from downloading",- default=False)- ignore_options.add_argument("--exclude-audio", action="store_true", help="exclude images from downloading",- default=False)- ignore_options.add_argument("--exclude-other", action="store_true", help="exclude other files from downloading",- default=False)- ignore_options.add_argument("--ignore-coomer-ads", action="store_true", help="ignore coomer ads when scraping",- default=False)+ ignore_options.add_argument("--exclude-videos", action=argparse.BooleanOptionalAction,+ help="exclude videos from downloading")+ ignore_options.add_argument("--exclude-images", action=argparse.BooleanOptionalAction,+ help="exclude images from downloading")+ ignore_options.add_argument("--exclude-audio", action=argparse.BooleanOptionalAction,+ help="exclude images from downloading")+ ignore_options.add_argument("--exclude-other", action=argparse.BooleanOptionalAction,+ help="exclude other files from downloading")+ ignore_options.add_argument("--ignore-coomer-ads", action=argparse.BooleanOptionalAction,+ help="ignore coomer ads when scraping")ignore_options.add_argument("--skip-hosts", choices=SupportedDomains.supported_hosts, action="append",help="skip these domains when scraping", default=[])ignore_options.add_argument("--only-hosts", choices=SupportedDomains.supported_hosts, action="append",help="only scrape these domains", default=[])runtime_options = parser.add_argument_group("Runtime_Options")- runtime_options.add_argument("--ignore-history", action="store_true", help="ignore history when scraping",- default=False)+ runtime_options.add_argument("--ignore-history", action=argparse.BooleanOptionalAction,+ help="ignore history when scraping")runtime_options.add_argument("--log-level", type=int, help="set the log level (default: %(default)s)", default=10)- runtime_options.add_argument("--skip-check-for-partial-files", action="store_true",- help="skip check for partial downloads", default=False)- runtime_options.add_argument("--skip-check-for-empty-folders", action="store_true",- help="skip check (and removal) for empty folders", default=False)- runtime_options.add_argument("--delete-partial-files", action="store_true", help="delete partial downloads",- default=False)- runtime_options.add_argument("--send-unsupported-to-jdownloader", action="store_true",- help="send unsupported urls to jdownloader", default=False)+ runtime_options.add_argument("--skip-check-for-partial-files", action=argparse.BooleanOptionalAction,+ help="skip check for partial downloads")+ runtime_options.add_argument("--skip-check-for-empty-folders", action=argparse.BooleanOptionalAction,+ help="skip check (and removal) for empty folders")+ runtime_options.add_argument("--delete-partial-files", action=argparse.BooleanOptionalAction,+ help="delete partial downloads")+ runtime_options.add_argument("--send-unsupported-to-jdownloader", action=argparse.BooleanOptionalAction,+ help="send unsupported urls to jdownloader")+ runtime_options.add_argument("--update-last-forum-post", action=argparse.BooleanOptionalAction,+ help="update the last forum post")sorting_options = parser.add_argument_group("Sorting")- sorting_options.add_argument("--sort-downloads", action="store_true", help="sort downloads into folders",- default=False)- sorting_options.add_argument("--sort-all-downloads", action="store_true",- help="sort all downloads, not just those downloader by Cyberdrop-DL", default=False)+ sorting_options.add_argument("--sort-downloads", action=argparse.BooleanOptionalAction,+ help="sort downloads into folders")+ sorting_options.add_argument("--sort-all-downloads", action=argparse.BooleanOptionalAction,+ help="sort all downloads, not just those downloaded by Cyberdrop-DL")sorting_options.add_argument("--sort-folder", type=str, help="path to where you want CDL to store it's log files",- default="")+ default="")sorting_options.add_argument("--scan-folder", type=str,- help="path to scan for files, if not set then the download_dir is used", default="")+ help="path to scan for files, if not set then the download_dir is used", default="")ui_options = parser.add_argument_group("UI_Options")ui_options.add_argument("--vi-mode", action="store_true", help="enable VIM keybindings for UI", default=None)