Skip to content

Bulk asynchronous downloader for multiple file hosts

refactor: drop v4 support (#530)

NTFSvolume86d9173da4a1
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 78a15b0dc..f884e4c12 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,12 @@ All notable changes to this project will be documented here. For more details, v
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## [UNRELEASED]
+
+### Removed
+
+- v4 option names and v4 files import support
+
## [6.5.0] - 2025-02-14
### Added
@@ -49,7 +55,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Files in the download queue are saved to the database and can be retried with `--retry-failed`
-- CLI `--skip-hosts` and `--only-hosts` values will be added to / removed from config values when passing `+` or `-` as the first argument, respectively. See: https://script-ware.gitbook.io/cyberdrop-dl/reference/configuration-options/special_setting_types#AdditiveArgs
+- CLI `--skip-hosts` and `--only-hosts` values will be added to / removed from config values when passing `+` or `-` as the first argument, respectively. See: https://script-ware.gitbook.io/cyberdrop-dl/reference/configuration-options/special_setting_types#additiveargs
- CLI arguments that accept multiple values can now be used multiple times in the same command
- Forum posts are now processed asynchronously instead of sequentially
- Prettify failures messages
diff --git a/cyberdrop_dl/config_definitions/authentication_settings.py b/cyberdrop_dl/config_definitions/authentication_settings.py
index 3c7c53653..ce1a7f315 100644
--- a/cyberdrop_dl/config_definitions/authentication_settings.py
+++ b/cyberdrop_dl/config_definitions/authentication_settings.py
@@ -1,6 +1,6 @@
from pydantic import BaseModel, Field
-from .pydantic.custom_types import AliasModel
+from .custom.types import AliasModel
class ForumAuth(BaseModel):
@@ -74,10 +74,10 @@ class RealDebridAuth(AliasModel):
class AuthSettings(AliasModel):
coomer: CoomerAuth = Field(validation_alias="Coomer", default=CoomerAuth())
forums: ForumAuth = Field(validation_alias="Forums", default=ForumAuth())
- gofile: GoFileAuth = Field(validation_alias="GoFile", default=GoFileAuth())
- imgur: ImgurAuth = Field(validation_alias="Imgur", default=ImgurAuth())
- jdownloader: JDownloaderAuth = Field(validation_alias="JDownloader", default=JDownloaderAuth())
- pixeldrain: PixeldrainAuth = Field(validation_alias="PixelDrain", default=PixeldrainAuth())
- realdebrid: RealDebridAuth = Field(validation_alias="RealDebrid", default=RealDebridAuth())
- reddit: RedditAuth = Field(validation_alias="Reddit", default=RedditAuth())
- xxxbunker: XXXBunkerAuth = Field(validation_alias="XXXBunker", default=XXXBunkerAuth())
+ gofile: GoFileAuth = Field(validation_alias="GoFile", default=GoFileAuth()) # type: ignore
+ imgur: ImgurAuth = Field(validation_alias="Imgur", default=ImgurAuth()) # type: ignore
+ jdownloader: JDownloaderAuth = Field(validation_alias="JDownloader", default=JDownloaderAuth()) # type: ignore
+ pixeldrain: PixeldrainAuth = Field(validation_alias="PixelDrain", default=PixeldrainAuth()) # type: ignore
+ realdebrid: RealDebridAuth = Field(validation_alias="RealDebrid", default=RealDebridAuth()) # type: ignore
+ reddit: RedditAuth = Field(validation_alias="Reddit", default=RedditAuth()) # type: ignore
+ xxxbunker: XXXBunkerAuth = Field(validation_alias="XXXBunker", default=XXXBunkerAuth()) # type: ignore
diff --git a/cyberdrop_dl/config_definitions/config_settings.py b/cyberdrop_dl/config_definitions/config_settings.py
index 101f130e2..27cf80b27 100644
--- a/cyberdrop_dl/config_definitions/config_settings.py
+++ b/cyberdrop_dl/config_definitions/config_settings.py
@@ -3,14 +3,25 @@ from logging import DEBUG
from pathlib import Path
from typing import Literal
-from pydantic import BaseModel, ByteSize, Field, NonNegativeInt, PositiveInt, field_serializer, field_validator
+from pydantic import BaseModel, ByteSize, Field, NonNegativeInt, PositiveInt, field_validator
-from cyberdrop_dl.config_definitions.pydantic.validators import parse_duration_to_timedelta
from cyberdrop_dl.utils.constants import APP_STORAGE, BROWSERS, DOWNLOAD_STORAGE
from cyberdrop_dl.utils.data_enums_classes.hash import Hashing
from cyberdrop_dl.utils.data_enums_classes.supported_domains import SUPPORTED_SITES_DOMAINS
-from .pydantic.custom_types import AliasModel, HttpAppriseURL, NonEmptyStr
+from .custom.types import (
+ AliasModel,
+ ByteSizeSerilized,
+ HttpAppriseURL,
+ ListNonEmptyStr,
+ ListNonNegativeInt,
+ LogPath,
+ MainLogPath,
+ NonEmptyStr,
+ NonEmptyStrOrNone,
+ PathOrNone,
+)
+from .custom.validators import parse_duration_as_timedelta, parse_falsy_as
class DownloadOptions(BaseModel):
@@ -19,88 +30,52 @@ class DownloadOptions(BaseModel):
disable_file_timestamps: bool = False
include_album_id_in_folder_name: bool = False
include_thread_id_in_folder_name: bool = False
+ maximum_number_of_children: ListNonNegativeInt = []
remove_domains_from_folder_names: bool = False
remove_generated_id_from_filenames: bool = False
scrape_single_forum_post: bool = False
- separate_posts: bool = False
separate_posts_format: NonEmptyStr = "{default}"
+ separate_posts: bool = False
skip_download_mark_completed: bool = False
skip_referer_seen_before: bool = False
- maximum_number_of_children: list[NonNegativeInt] = []
maximum_thread_depth: NonNegativeInt = 0
- @field_validator("maximum_number_of_children", mode="before")
- @classmethod
- def handle_falsy(cls, value: list) -> list:
- if not value:
- return []
- return value
-
class Files(AliasModel):
- input_file: Path = Field(validation_alias="i", default=APP_STORAGE / "Configs" / "{config}" / "URLs.txt")
download_folder: Path = Field(validation_alias="d", default=DOWNLOAD_STORAGE)
+ input_file: Path = Field(validation_alias="i", default=APP_STORAGE / "Configs" / "{config}" / "URLs.txt")
class Logs(AliasModel):
+ download_error_urls: LogPath = Field(Path("Download_Error_URLs.csv"), validation_alias="download_error_urls_filename") # fmt: skip
+ last_forum_post: LogPath = Field(Path("Last_Scraped_Forum_Posts.csv"), validation_alias="last_forum_post_filename")
log_folder: Path = APP_STORAGE / "Configs" / "{config}" / "Logs"
- webhook: HttpAppriseURL | None = Field(validation_alias="webhook_url", default=None)
- main_log: Path = Field(Path("downloader.log"), validation_alias="main_log_filename")
- last_forum_post: Path = Field(Path("Last_Scraped_Forum_Posts.csv"), validation_alias="last_forum_post_filename")
- unsupported_urls: Path = Field(Path("Unsupported_URLs.csv"), validation_alias="unsupported_urls_filename")
- download_error_urls: Path = Field(Path("Download_Error_URLs.csv"), validation_alias="download_error_urls_filename")
- scrape_error_urls: Path = Field(Path("Scrape_Error_URLs.csv"), validation_alias="scrape_error_urls_filename")
- rotate_logs: bool = False
log_line_width: PositiveInt = Field(default=240, ge=50)
logs_expire_after: timedelta | None = None
+ main_log: MainLogPath = Field(Path("downloader.log"), validation_alias="main_log_filename")
+ rotate_logs: bool = False
+ scrape_error_urls: LogPath = Field(Path("Scrape_Error_URLs.csv"), validation_alias="scrape_error_urls_filename")
+ unsupported_urls: LogPath = Field(Path("Unsupported_URLs.csv"), validation_alias="unsupported_urls_filename")
+ webhook: HttpAppriseURL | None = Field(validation_alias="webhook_url", default=None)
@field_validator("webhook", mode="before")
@classmethod
def handle_falsy(cls, value: str) -> str | None:
- if not value:
- return None
- return value
-
- @field_validator("main_log", mode="after")
- @classmethod
- def fix_main_log_extension(cls, value: Path) -> Path:
- return value.with_suffix(".log")
-
- @field_validator("last_forum_post", "unsupported_urls", "download_error_urls", "scrape_error_urls", mode="after")
- @classmethod
- def fix_other_logs_extensions(cls, value: Path) -> Path:
- return value.with_suffix(".csv")
+ return parse_falsy_as(value, None)
@field_validator("logs_expire_after", mode="before")
@staticmethod
- def parse_logs_duration(input_date: timedelta | str | int | None) -> timedelta:
- """Parses `datetime.timedelta`, `str` or `int` into a timedelta format.
-
- for `str`, the expected format is `value unit`, ex: `5 days`, `10 minutes`, `1 year`
-
- valid units:
- year(s), week(s), day(s), hour(s), minute(s), second(s), millisecond(s), microsecond(s)
-
- for `int`, value is assumed as `days`
- """
- if input_date is None:
- return None
- return parse_duration_to_timedelta(input_date)
+ def parse_logs_duration(input_date: timedelta | str | int | None) -> timedelta | str | None:
+ return parse_falsy_as(input_date, None, parse_duration_as_timedelta)
class FileSizeLimits(BaseModel):
- maximum_image_size: ByteSize = ByteSize(0)
- maximum_other_size: ByteSize = ByteSize(0)
- maximum_video_size: ByteSize = ByteSize(0)
- minimum_image_size: ByteSize = ByteSize(0)
- minimum_other_size: ByteSize = ByteSize(0)
- minimum_video_size: ByteSize = ByteSize(0)
-
- @field_serializer("*")
- def human_readable(self, value: ByteSize | int) -> str:
- if not isinstance(value, ByteSize):
- value = ByteSize(value)
- return value.human_readable(decimal=True)
+ maximum_image_size: ByteSizeSerilized = ByteSize(0)
+ maximum_other_size: ByteSizeSerilized = ByteSize(0)
+ maximum_video_size: ByteSizeSerilized = ByteSize(0)
+ minimum_image_size: ByteSizeSerilized = ByteSize(0)
+ minimum_other_size: ByteSizeSerilized = ByteSize(0)
+ minimum_video_size: ByteSizeSerilized = ByteSize(0)
class MediaDurationLimits(BaseModel):
@@ -120,118 +95,80 @@ class MediaDurationLimits(BaseModel):
"""
if input_date is None:
return timedelta(seconds=0)
- return parse_duration_to_timedelta(input_date)
+ return parse_duration_as_timedelta(input_date)
class IgnoreOptions(BaseModel):
- exclude_videos: bool = False
- exclude_images: bool = False
exclude_audio: bool = False
+ exclude_images: bool = False
exclude_other: bool = False
+ exclude_videos: bool = False
+ filename_regex_filter: NonEmptyStrOrNone = None
ignore_coomer_ads: bool = False
- skip_hosts: list[NonEmptyStr] = []
- only_hosts: list[NonEmptyStr] = []
- filename_regex_filter: NonEmptyStr | None = None
+ only_hosts: ListNonEmptyStr = []
+ skip_hosts: ListNonEmptyStr = []
exclude_files_with_no_extension: bool = True
- @field_validator("skip_hosts", "only_hosts", mode="before")
- @classmethod
- def handle_falsy(cls, value: list) -> list:
- if not value:
- return []
- return value
-
class RuntimeOptions(BaseModel):
+ console_log_level: NonNegativeInt = 100
+ deep_scrape: bool = False
+ delete_partial_files: bool = False
ignore_history: bool = False
+ jdownloader_autostart: bool = False
+ jdownloader_download_dir: PathOrNone = None
+ jdownloader_whitelist: ListNonEmptyStr = []
log_level: NonNegativeInt = DEBUG
- console_log_level: NonNegativeInt = 100
- skip_check_for_partial_files: bool = False
+ send_unsupported_to_jdownloader: bool = False
skip_check_for_empty_folders: bool = False
- delete_partial_files: bool = False
+ skip_check_for_partial_files: bool = False
+ slow_download_speed: ByteSizeSerilized = ByteSize(0)
update_last_forum_post: bool = True
- send_unsupported_to_jdownloader: bool = False
- jdownloader_download_dir: Path | None = None
- jdownloader_autostart: bool = False
- jdownloader_whitelist: list[NonEmptyStr] = []
- deep_scrape: bool = False
- slow_download_speed: ByteSize = ByteSize(0)
- @field_validator("jdownloader_download_dir", mode="before")
- @classmethod
- def handle_falsy(cls, value: str) -> str | None:
- if not value or value == "None":
- return None
- return value
- @field_validator("jdownloader_whitelist", mode="before")
- @classmethod
- def handle_list(cls, value: list) -> list:
- if not value:
- return []
- return value
-
- @field_serializer("slow_download_speed")
- def human_readable(self, value: ByteSize | int) -> str:
- if not isinstance(value, ByteSize):
- value = ByteSize(value)
- return value.human_readable(decimal=True)
-
-
-# TODO: allow None values in sorting format to skip that type of file
class Sorting(BaseModel):
+ scan_folder: PathOrNone = None
sort_downloads: bool = False
sort_folder: Path = DOWNLOAD_STORAGE / "Cyberdrop-DL Sorted Downloads"
- scan_folder: Path | None = None
sort_incrementer_format: NonEmptyStr = " ({i})"
- sorted_audio: NonEmptyStr | None = "{sort_dir}/{base_dir}/Audio/{filename}{ext}"
- sorted_image: NonEmptyStr | None = "{sort_dir}/{base_dir}/Images/{filename}{ext}"
- sorted_other: NonEmptyStr | None = "{sort_dir}/{base_dir}/Other/{filename}{ext}"
- sorted_video: NonEmptyStr | None = "{sort_dir}/{base_dir}/Videos/{filename}{ext}"
-
- @field_validator("scan_folder", "sorted_audio", "sorted_image", "sorted_other", "sorted_video", mode="before")
- @classmethod
- def handle_falsy(cls, value: str) -> str | None:
- if not value or value == "None":
- return None
- return value
+ sorted_audio: NonEmptyStrOrNone = "{sort_dir}/{base_dir}/Audio/{filename}{ext}"
+ sorted_image: NonEmptyStrOrNone = "{sort_dir}/{base_dir}/Images/{filename}{ext}"
+ sorted_other: NonEmptyStrOrNone = "{sort_dir}/{base_dir}/Other/{filename}{ext}"
+ sorted_video: NonEmptyStrOrNone = "{sort_dir}/{base_dir}/Videos/{filename}{ext}"
class BrowserCookies(BaseModel):
- browsers: list[BROWSERS] = [BROWSERS.chrome]
auto_import: bool = False
+ browsers: list[BROWSERS] = [BROWSERS.chrome]
sites: list[Literal[*SUPPORTED_SITES_DOMAINS]] = SUPPORTED_SITES_DOMAINS # type: ignore
@field_validator("browsers", "sites", mode="before")
@classmethod
def handle_list(cls, values: list) -> list:
- if not values:
- return []
+ values = parse_falsy_as(values, [])
if isinstance(values, list):
return [str(value).lower() for value in values]
return values
-class DupeCleanupOptions(BaseModel):
- hashing: Hashing = Hashing.IN_PLACE
- auto_dedupe: bool = True
+class DupeCleanup(BaseModel):
add_md5_hash: bool = False
add_sha256_hash: bool = False
+ auto_dedupe: bool = True
+ hashing: Hashing = Hashing.IN_PLACE
send_deleted_to_trash: bool = True
class ConfigSettings(AliasModel):
browser_cookies: BrowserCookies = Field(validation_alias="Browser_Cookies", default=BrowserCookies())
download_options: DownloadOptions = Field(validation_alias="Download_Options", default=DownloadOptions())
- dupe_cleanup_options: DupeCleanupOptions = Field(
- validation_alias="Dupe_Cleanup_Options", default=DupeCleanupOptions()
- )
+ dupe_cleanup_options: DupeCleanup = Field(validation_alias="Dupe_Cleanup_Options", default=DupeCleanup())
file_size_limits: FileSizeLimits = Field(validation_alias="File_Size_Limits", default=FileSizeLimits())
media_duration_limits: MediaDurationLimits = Field(
validation_alias="Media_Duration_Limits", default=MediaDurationLimits()
)
files: Files = Field(validation_alias="Files", default=Files())
ignore_options: IgnoreOptions = Field(validation_alias="Ignore_Options", default=IgnoreOptions())
- logs: Logs = Field(validation_alias="Logs", default=Logs())
+ logs: Logs = Field(validation_alias="Logs", default=Logs()) # type: ignore
runtime_options: RuntimeOptions = Field(validation_alias="Runtime_Options", default=RuntimeOptions())
sorting: Sorting = Field(validation_alias="Sorting", default=Sorting())
diff --git a/cyberdrop_dl/config_definitions/custom/converters.py b/cyberdrop_dl/config_definitions/custom/converters.py
new file mode 100644
index 000000000..11fbc9608
--- /dev/null
+++ b/cyberdrop_dl/config_definitions/custom/converters.py
@@ -0,0 +1,64 @@
+"""
+Functions to use with `AfterValidator`, `field_validator(mode="after")` or `model_validator(mode="after")`
+"""
+
+import re
+from datetime import timedelta
+from pathlib import Path
+
+from pydantic import AnyUrl, ByteSize, TypeAdapter
+from yarl import URL
+
+DATE_PATTERN_REGEX = r"(\d+)\s*(second|seconds|minute|minutes|hour|hours|day|days|week|weeks|month|months|year|years)"
+DATE_PATTERN = re.compile(DATE_PATTERN_REGEX, re.IGNORECASE)
+
+byte_size_adapter = TypeAdapter(ByteSize)
+
+
+def convert_byte_size_to_str(value: ByteSize) -> str:
+ if not isinstance(value, ByteSize):
+ value = ByteSize(value)
+ return value.human_readable(decimal=True)
+
+
+def convert_to_yarl(value: AnyUrl) -> URL:
+ return URL(str(value))
+
+
+def change_path_suffix(value: Path, suffix: str) -> Path:
+ return value.with_suffix(suffix)
+
+
+def convert_to_byte_size(value: ByteSize | str | int) -> ByteSize:
+ return byte_size_adapter.validate_python(value)
+
+
+def convert_str_to_timedelta(input_date: str) -> timedelta:
+ time_str = input_date.casefold()
+ matches: list[str] = re.findall(DATE_PATTERN, time_str)
+ seen_units = set()
+ time_dict = {"days": 0}
+
+ for value, unit in matches:
+ value = int(value)
+ unit = unit.lower()
+ normalized_unit = unit.rstrip("s")
+ plural_unit = normalized_unit + "s"
+ if normalized_unit in seen_units:
+ msg = f"Duplicate time unit detected: '{unit}' conflicts with another entry"
+ raise ValueError(msg)
+ seen_units.add(normalized_unit)
+
+ if "day" in unit:
+ time_dict["days"] += value
+ elif "month" in unit:
+ time_dict["days"] += value * 30
+ elif "year" in unit:
+ time_dict["days"] += value * 365
+ else:
+ time_dict[plural_unit] = value
+
+ if not matches:
+ msg = f"Unable to convert '{input_date}' to timedelta object"
+ raise ValueError(msg)
+ return timedelta(**time_dict)
diff --git a/cyberdrop_dl/config_definitions/custom/types.py b/cyberdrop_dl/config_definitions/custom/types.py
new file mode 100644
index 000000000..5674579fa
--- /dev/null
+++ b/cyberdrop_dl/config_definitions/custom/types.py
@@ -0,0 +1,70 @@
+from __future__ import annotations
+
+from functools import partial
+from pathlib import Path
+from typing import TYPE_CHECKING, Annotated
+
+from pydantic import (
+ AfterValidator,
+ AnyUrl,
+ BaseModel,
+ BeforeValidator,
+ ByteSize,
+ ConfigDict,
+ HttpUrl,
+ NonNegativeInt,
+ PlainSerializer,
+ Secret,
+ SerializationInfo,
+ StringConstraints,
+ model_serializer,
+ model_validator,
+)
+
+from .converters import change_path_suffix, convert_byte_size_to_str, convert_to_yarl
+from .validators import parse_apprise_url, parse_falsy_as_none, parse_list
+
+if TYPE_CHECKING:
+ from yarl import URL
+
+ByteSizeSerilized = Annotated[ByteSize, PlainSerializer(convert_byte_size_to_str, return_type=str)]
+HttpURL = Annotated[HttpUrl, AfterValidator(convert_to_yarl)]
+ListNonNegativeInt = Annotated[list[NonNegativeInt], BeforeValidator(parse_list)]
+
+NonEmptyStr = Annotated[str, StringConstraints(min_length=1, strip_whitespace=True)]
+NonEmptyStrOrNone = Annotated[NonEmptyStr | None, BeforeValidator(parse_falsy_as_none)]
+ListNonEmptyStr = Annotated[list[NonEmptyStr], BeforeValidator(parse_list)]
+
+PathOrNone = Annotated[Path | None, BeforeValidator(parse_falsy_as_none)]
+LogPath = Annotated[Path, AfterValidator(partial(change_path_suffix, suffix=".csv"))]
+MainLogPath = Annotated[LogPath, AfterValidator(partial(change_path_suffix, suffix=".log"))]
+
+
+class AliasModel(BaseModel):
+ model_config = ConfigDict(populate_by_name=True)
+
+
+class FrozenModel(BaseModel):
+ model_config = ConfigDict(frozen=True)
+
+
+class AppriseURLModel(FrozenModel):
+ url: Secret[AnyUrl]
+ tags: set[str]
+
+ @model_serializer()
+ def serialize(self, info: SerializationInfo):
+ dump_secret = info.mode != "json"
+ url = self.url.get_secret_value() if dump_secret else self.url
+ tags = self.tags - set("no_logs")
+ tags = sorted(tags)
+ return f"{','.join(tags)}{'=' if tags else ''}{url}"
+
+ @model_validator(mode="before")
+ @staticmethod
+ def parse_input(value: URL | dict | str) -> dict:
+ return parse_apprise_url(value)
+
+
+class HttpAppriseURL(AppriseURLModel):
+ url: Secret[HttpURL]
diff --git a/cyberdrop_dl/config_definitions/custom/validators.py b/cyberdrop_dl/config_definitions/custom/validators.py
new file mode 100644
index 000000000..1ac159e75
--- /dev/null
+++ b/cyberdrop_dl/config_definitions/custom/validators.py
@@ -0,0 +1,96 @@
+"""
+Functions to use with `BeforeValidator`, `field_validator(mode="before")` or `model_validator(mode="before")`
+"""
+
+from collections.abc import Callable
+from datetime import timedelta
+from functools import singledispatch
+from typing import Any
+
+from yarl import URL
+
+from .converters import convert_str_to_timedelta
+
+
+def parse_falsy_as(value: Any, falsy_value: Any, func: Callable | None = None, *args, **kwargs) -> Any:
+ """If `value` is falsy, returns `falsy_value`
+
+ If `value` is NOT falsy AND `func` is provided, returns `func(value, *args, **kwargs)`
+
+ Returns `value` otherwise
+ """
+ if isinstance(value, str) and value.casefold() in ("none", "null"):
+ value = None
+ if not value:
+ return falsy_value
+ if not func:
+ return value
+ return func(value, *args, **kwargs)
+
+
+def parse_duration_as_timedelta(input_date: timedelta | str | int) -> timedelta:
+ """Parses `datetime.timedelta`, `str` or `int` into a timedelta format.
+
+ For `str`, the expected format is `<value> <unit>`, ex: `5 days`, `10 minutes`, `1 year`
+
+ Valid units:
+ `year(s)`, `week(s)`, `day(s)`, `hour(s)`, `minute(s)`, `second(s)`, `millisecond(s)`, `microsecond(s)`
+
+ For `int`, `input_date` is assumed as `days`
+ """
+ return parse_falsy_as(input_date, timedelta(0), _parse_as_timedelta)
+
+
+@singledispatch
+def _parse_as_timedelta(input_date: timedelta) -> timedelta | str:
+ return input_date
+
+
+@_parse_as_timedelta.register
+def _(input_date: int) -> timedelta:
+ return timedelta(days=input_date)
+
+
+@_parse_as_timedelta.register
+def _(input_date: str, raise_error: bool = False) -> timedelta | str:
+ try:
+ return convert_str_to_timedelta(input_date)
+ except ValueError:
+ if raise_error:
+ raise
+ return input_date
+
+
+def parse_list(value: list):
+ return parse_falsy_as(value, [])
+
+
+def parse_falsy_as_none(value: Any):
+ return parse_falsy_as(value, None)
+
+
+@singledispatch
+def parse_apprise_url(value: URL) -> dict:
+ return {"url": str(value), "tags": set()}
+
+
+@parse_apprise_url.register
+def _(value: dict) -> dict:
+ tags = value.get("tags") or set()
+ url = str(value.get("url", ""))
+ if not tags:
+ return parse_apprise_url(url)
+
+ return {"url": url, "tags": tags}
+
+
+@parse_apprise_url.register
+def _(value: str) -> dict:
+ tags = set()
+ url = value
+ parts = url.split("://", 1)[0].split("=", 1)
+ if len(parts) == 2:
+ tags = set(parts[0].split(","))
+ url: str = url.split("=", 1)[-1]
+
+ return {"url": url, "tags": tags}
diff --git a/cyberdrop_dl/config_definitions/global_settings.py b/cyberdrop_dl/config_definitions/global_settings.py
index 8f95bda35..727478345 100644
--- a/cyberdrop_dl/config_definitions/global_settings.py
+++ b/cyberdrop_dl/config_definitions/global_settings.py
@@ -3,45 +3,31 @@ from datetime import timedelta
from pydantic import BaseModel, ByteSize, Field, NonNegativeFloat, PositiveInt, field_serializer, field_validator
from yarl import URL
-from cyberdrop_dl.config_definitions.pydantic.validators import parse_duration_to_timedelta
+from .custom.converters import convert_to_byte_size
+from .custom.types import AliasModel, ByteSizeSerilized, HttpURL, NonEmptyStr
+from .custom.validators import parse_duration_as_timedelta, parse_falsy_as
-from .pydantic.custom_types import AliasModel, HttpURL, NonEmptyStr
-
-MIN_REQUIRED_FREE_SPACE = ByteSize._validate("512MB", "")
-DEFAULT_REQUIRED_FREE_SPACE = ByteSize._validate("5GB", "")
-
-
-def convert_to_str(value: URL | str) -> str | None:
- if not value:
- return None
- if isinstance(value, URL):
- return str(value)
- return value
+MIN_REQUIRED_FREE_SPACE = convert_to_byte_size("512MB")
+DEFAULT_REQUIRED_FREE_SPACE = convert_to_byte_size("5GB")
class General(BaseModel):
allow_insecure_connections: bool = False
- user_agent: NonEmptyStr = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:133.0) Gecko/20100101 Firefox/133.0"
- proxy: HttpURL | None = None
flaresolverr: HttpURL | None = None
max_file_name_length: PositiveInt = 95
max_folder_name_length: PositiveInt = 60
- required_free_space: ByteSize = DEFAULT_REQUIRED_FREE_SPACE
-
- @field_serializer("required_free_space")
- def human_readable(self, value: ByteSize | int) -> str:
- if not isinstance(value, ByteSize):
- value = ByteSize(value)
- return value.human_readable(decimal=True)
+ proxy: HttpURL | None = None
+ required_free_space: ByteSizeSerilized = DEFAULT_REQUIRED_FREE_SPACE
+ user_agent: NonEmptyStr = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:133.0) Gecko/20100101 Firefox/133.0"
@field_serializer("flaresolverr", "proxy")
def serialize(self, value: URL | str) -> str | None:
- return convert_to_str(value)
+ return parse_falsy_as(value, None, str)
@field_validator("flaresolverr", "proxy", mode="before")
@classmethod
def convert_to_str(cls, value: URL | str) -> str | None:
- return convert_to_str(value)
+ return parse_falsy_as(value, None, str)
@field_validator("required_free_space", mode="after")
@classmethod
@@ -49,49 +35,32 @@ class General(BaseModel):
return max(value, MIN_REQUIRED_FREE_SPACE)
-class RateLimitingOptions(BaseModel):
+class RateLimiting(BaseModel):
connection_timeout: PositiveInt = 15
download_attempts: PositiveInt = 5
- read_timeout: PositiveInt = 300
- rate_limit: PositiveInt = 50
download_delay: NonNegativeFloat = 0.5
- max_simultaneous_downloads: PositiveInt = 15
- max_simultaneous_downloads_per_domain: PositiveInt = 3
- download_speed_limit: ByteSize = ByteSize(0)
+ download_speed_limit: ByteSizeSerilized = ByteSize(0)
file_host_cache_expire_after: timedelta = timedelta(days=7)
forum_cache_expire_after: timedelta = timedelta(weeks=4)
-
- @field_serializer("download_speed_limit")
- def human_readable(self, value: ByteSize | int) -> str:
- if not isinstance(value, ByteSize):
- value = ByteSize(value)
- return value.human_readable(decimal=True)
+ max_simultaneous_downloads_per_domain: PositiveInt = 3
+ max_simultaneous_downloads: PositiveInt = 15
+ rate_limit: PositiveInt = 50
+ read_timeout: PositiveInt = 300
@field_validator("file_host_cache_expire_after", "forum_cache_expire_after", mode="before")
@staticmethod
def parse_cache_duration(input_date: timedelta | str | int) -> timedelta:
- """Parses `datetime.timedelta`, `str` or `int` into a timedelta format.
-
- for `str`, the expected format is `value unit`, ex: `5 days`, `10 minutes`, `1 year`
-
- valid units:
- year(s), week(s), day(s), hour(s), minute(s), second(s), millisecond(s), microsecond(s)
-
- for `int`, value is assummed as `days`
- """
- return parse_duration_to_timedelta(input_date)
+ return parse_duration_as_timedelta(input_date)
class UIOptions(BaseModel):
- vi_mode: bool = False
+ downloading_item_limit: PositiveInt = 5
refresh_rate: PositiveInt = 10
scraping_item_limit: PositiveInt = 5
- downloading_item_limit: PositiveInt = 5
+ vi_mode: bool = False
class GlobalSettings(AliasModel):
general: General = Field(validation_alias="General", default=General())
- rate_limiting_options: RateLimitingOptions = Field(
- validation_alias="Rate_Limiting_Options", default=RateLimitingOptions()
- )
+ rate_limiting_options: RateLimiting = Field(validation_alias="Rate_Limiting_Options", default=RateLimiting())
ui_options: UIOptions = Field(validation_alias="UI_Options", default=UIOptions())
diff --git a/cyberdrop_dl/config_definitions/pydantic/validators.py b/cyberdrop_dl/config_definitions/pydantic/validators.py
deleted file mode 100644
index b4f17d6c8..000000000
--- a/cyberdrop_dl/config_definitions/pydantic/validators.py
+++ /dev/null
@@ -1,51 +0,0 @@
-import re
-from datetime import timedelta
-
-DATE_PATTERN = re.compile(
- r"(\d+)\s*(second|seconds|minute|minutes|hour|hours|day|days|week|weeks|month|months|year|years)", re.IGNORECASE
-)
-
-
-def parse_duration_to_timedelta(input_date: timedelta | str | int) -> timedelta:
- """Parses `datetime.timedelta`, `str` or `int` into a timedelta format.
-
- for `str`, the expected format is `value unit`, ex: `5 days`, `10 minutes`, `1 year`
-
- valid units:
- year(s), week(s), day(s), hour(s), minute(s), second(s), millisecond(s), microsecond(s)
-
- for `int`, value is assumed as `days`
- """
- if not input_date:
- return 0
- parsed_timedelta = input_date
- if isinstance(input_date, int):
- parsed_timedelta = timedelta(days=input_date)
- if isinstance(input_date, str):
- time_str = input_date.casefold()
- matches: list[str] = re.findall(DATE_PATTERN, time_str)
- seen_units = set()
- time_dict = {"days": 0}
-
- for value, unit in matches:
- value = int(value)
- unit = unit.lower()
- normalized_unit = unit.rstrip("s")
- plural_unit = normalized_unit + "s"
- if normalized_unit in seen_units:
- raise ValueError(f"Duplicate time unit detected: '{unit}' conflicts with another entry.")
- seen_units.add(normalized_unit)
-
- if "day" in unit:
- time_dict["days"] += value
- elif "month" in unit:
- time_dict["days"] += value * 30
- elif "year" in unit:
- time_dict["days"] += value * 365
- else:
- time_dict[plural_unit] = value
-
- if matches:
- parsed_timedelta = timedelta(**time_dict)
-
- return parsed_timedelta
diff --git a/cyberdrop_dl/managers/config_manager.py b/cyberdrop_dl/managers/config_manager.py
index bb40f4710..9fd783fd7 100644
--- a/cyberdrop_dl/managers/config_manager.py
+++ b/cyberdrop_dl/managers/config_manager.py
@@ -25,7 +25,7 @@ if TYPE_CHECKING:
class ConfigManager:
def __init__(self, manager: Manager) -> None:
self.manager = manager
- self.loaded_config: str = None
+ self.loaded_config: str = None # type: ignore
self.authentication_settings: Path = field(init=False)
self.settings: Path = field(init=False)
@@ -43,7 +43,7 @@ class ConfigManager:
self.loaded_config = self.get_loaded_config()
cli_config = self.manager.parsed_args.cli_only_args.config
if cli_config and cli_config.casefold() != "all":
- self.loaded_config = self.manager.parsed_args.cli_only_args.config
+ self.loaded_config = cli_config
self.settings = self.manager.path_manager.config_folder / self.loaded_config / "settings.yaml"
self.global_settings = self.manager.path_manager.config_folder / "global_settings.yaml"
@@ -56,8 +56,6 @@ class ConfigManager:
self.settings.parent.mkdir(parents=True, exist_ok=True)
self.pydantic_config = self.manager.cache_manager.get("pydantic_config")
self.load_configs()
- if not self.manager.parsed_args.cli_only_args.appdata_folder:
- self.manager.first_time_setup.transfer_v4_to_v6()
def get_loaded_config(self):
loaded_config = self.loaded_config or self.get_default_config()
@@ -86,7 +84,7 @@ class ConfigManager:
self.valid_filename_filter_regex = True
@staticmethod
- def get_model_fields(model: type[BaseModel], *, exclude_unset: bool = True) -> set[str]:
+ def get_model_fields(model: BaseModel, *, exclude_unset: bool = True) -> set[str]:
fields = set()
default_dict: dict = model.model_dump(exclude_unset=exclude_unset)
for submodel_name, submodel in default_dict.items():
@@ -96,11 +94,12 @@ class ConfigManager:
def _load_authentication_config(self) -> None:
"""Verifies the authentication config file and creates it if it doesn't exist."""
+ needs_update = is_in_file("jdownloader_username:", self.authentication_settings)
posible_fields = self.get_model_fields(AuthSettings(), exclude_unset=False)
if self.authentication_settings.is_file():
self.authentication_data = AuthSettings.model_validate(yaml.load(self.authentication_settings))
set_fields = self.get_model_fields(self.authentication_data)
- if posible_fields == set_fields and self.pydantic_config:
+ if posible_fields == set_fields and not needs_update and self.pydantic_config:
return
else:
@@ -110,6 +109,7 @@ class ConfigManager:
def _load_settings_config(self) -> None:
"""Verifies the settings config file and creates it if it doesn't exist."""
+ needs_update = is_in_file("download_error_urls_filename:", self.settings)
posible_fields = self.get_model_fields(ConfigSettings(), exclude_unset=False)
if self.manager.parsed_args.cli_only_args.config_file:
self.settings = self.manager.parsed_args.cli_only_args.config_file
@@ -120,7 +120,7 @@ class ConfigManager:
set_fields = self.get_model_fields(self.settings_data)
self.deep_scrape = self.settings_data.runtime_options.deep_scrape
self.settings_data.runtime_options.deep_scrape = False
- if posible_fields == set_fields and self.pydantic_config and not self.deep_scrape:
+ if posible_fields == set_fields and not needs_update and self.pydantic_config:
return
else:
from cyberdrop_dl.utils import constants
@@ -135,11 +135,12 @@ class ConfigManager:
def _load_global_settings_config(self) -> None:
"""Verifies the global settings config file and creates it if it doesn't exist."""
+ needs_update = is_in_file("Dupe_Cleanup_Options:", self.global_settings)
posible_fields = self.get_model_fields(GlobalSettings(), exclude_unset=False)
if self.global_settings.is_file():
self.global_settings_data = GlobalSettings.model_validate(yaml.load(self.global_settings))
set_fields = self.get_model_fields(self.global_settings_data)
- if posible_fields == set_fields and self.pydantic_config:
+ if posible_fields == set_fields and not needs_update and self.pydantic_config:
return
else:
self.global_settings_data = GlobalSettings()
@@ -211,3 +212,9 @@ class ConfigManager:
return
self.manager.cache_manager.save("pydantic_config", True)
self.pydantic_config = True
+
+
+def is_in_file(search_value: str, file: Path) -> bool:
+ if not file.is_file():
+ return False
+ return search_value.casefold() in file.read_text().casefold()
diff --git a/cyberdrop_dl/managers/manager.py b/cyberdrop_dl/managers/manager.py
index 9fbbdc586..e6e82a5ec 100644
--- a/cyberdrop_dl/managers/manager.py
+++ b/cyberdrop_dl/managers/manager.py
@@ -23,7 +23,7 @@ from cyberdrop_dl.utils import constants
from cyberdrop_dl.utils.args import ParsedArgs
from cyberdrop_dl.utils.data_enums_classes.supported_domains import SUPPORTED_FORUMS
from cyberdrop_dl.utils.logger import log
-from cyberdrop_dl.utils.transfer.db_setup import TransitionManager
+from cyberdrop_dl.utils.transfer import transfer_v5_db_to_v6
if TYPE_CHECKING:
from asyncio import TaskGroup
@@ -48,8 +48,6 @@ class Manager:
self.progress_manager: ProgressManager = field(init=False)
self.live_manager: LiveManager = field(init=False)
- self.first_time_setup: TransitionManager = TransitionManager(self)
-
self._loaded_args_config: bool = False
self._made_portable: bool = False
@@ -124,7 +122,7 @@ class Manager:
if not isinstance(self.db_manager, DBManager):
self.db_manager = DBManager(self, self.path_manager.history_db)
await self.db_manager.startup()
- self.first_time_setup.transfer_v5_to_new_hashtable()
+ transfer_v5_db_to_v6(self.path_manager.history_db)
if not isinstance(self.hash_manager, HashManager):
self.hash_manager = HashManager(self)
await self.hash_manager.startup()
diff --git a/cyberdrop_dl/ui/program_ui.py b/cyberdrop_dl/ui/program_ui.py
index 5d86c7b94..8818c0a26 100644
--- a/cyberdrop_dl/ui/program_ui.py
+++ b/cyberdrop_dl/ui/program_ui.py
@@ -19,8 +19,6 @@ from cyberdrop_dl.ui.prompts.basic_prompts import ask_dir_path, enter_to_continu
from cyberdrop_dl.ui.prompts.defaults import DONE_CHOICE, EXIT_CHOICE
from cyberdrop_dl.utils.cookie_management import clear_cookies
from cyberdrop_dl.utils.sorting import Sorter
-from cyberdrop_dl.utils.transfer.transfer_v4_config import transfer_v4_config
-from cyberdrop_dl.utils.transfer.transfer_v4_db import transfer_v4_db
from cyberdrop_dl.utils.utilities import check_latest_pypi, clear_term, open_in_text_editor
if TYPE_CHECKING:
@@ -61,7 +59,7 @@ class ProgramUI:
enter_to_continue()
@repeat_until_done
- def run(self) -> None:
+ def run(self) -> bool | None:
"""Program UI."""
clear_term()
options_map = {
@@ -73,9 +71,8 @@ class ProgramUI:
5: self._edit_urls,
6: self._change_config,
7: self._manage_configs,
- 8: self._import_from_v4,
- 9: self._check_updates,
- 10: self._view_changelog,
+ 8: self._check_updates,
+ 9: self._view_changelog,
}
answer = user_prompts.main_prompt(self.manager)
@@ -85,11 +82,11 @@ class ProgramUI:
clear_term()
return return_to_main
- def _download(self) -> True:
+ def _download(self) -> bool:
"""Starts download process."""
return True
- def _retry_failed_download(self) -> True:
+ def _retry_failed_download(self) -> bool:
"""Sets retry failed and starts download process."""
self.manager.parsed_args.cli_only_args.retry_failed = True
return True
@@ -109,39 +106,6 @@ class ProgramUI:
check_latest_pypi(call_from_ui=True)
enter_to_continue()
- @repeat_until_done
- def _import_from_v4(self) -> None:
- options_map = {
- 1: self._import_v4_config,
- 2: self._import_v4_download_history,
- }
- answer = user_prompts.import_cyberdrop_v4_items_prompt(self.manager)
- return self._process_answer(answer, options_map)
-
- def _import_v4_config(self) -> None:
- new_config = user_prompts.import_v4_config_prompt(self.manager)
- if not new_config:
- return
- new_config_name, old_config_path = new_config
- transfer_v4_config(self.manager, new_config_name, old_config_path)
- self.manager.config_manager.change_config(new_config_name)
- if user_prompts.switch_default_config_to(self.manager, new_config_name):
- self.manager.config_manager.change_default_config(new_config_name)
-
- def _import_v4_download_history(self) -> None:
- import_download_history_path = user_prompts.import_v4_download_history_prompt()
- if import_download_history_path.is_file():
- transfer_v4_db(import_download_history_path, self.manager.path_manager.history_db)
- return
-
- for item in import_download_history_path.glob("**/*.sqlite"):
- if str(item) == str(self.manager.path_manager.history_db):
- continue
- try:
- transfer_v4_db(item, self.manager.path_manager.history_db)
- except Exception as e:
- self.print_error(f"Unable to import {item.name}: {e!s}")
-
def _change_config(self) -> None:
configs = self.manager.config_manager.get_configs()
selected_config = user_prompts.select_config(configs)
@@ -162,7 +126,7 @@ class ProgramUI:
console.print(Markdown(changelog_content, justify="left"))
@repeat_until_done
- def _manage_configs(self) -> None:
+ def _manage_configs(self) -> Choice | None:
options_map = {
1: self._change_default_config,
2: self._create_new_config,
@@ -185,7 +149,7 @@ class ProgramUI:
enter_to_continue()
def _clear_cache(self) -> None:
- domains = user_prompts.domains_prompt(domain_message="Select site(s) to clear cache for:")
+ domains, _ = user_prompts.domains_prompt(domain_message="Select site(s) to clear cache for:")
if not domains:
console.print("No domains selected", style="red")
enter_to_continue()
@@ -203,20 +167,18 @@ class ProgramUI:
enter_to_continue()
def _edit_auth_config(self) -> None:
- config_file = self.manager.path_manager.config_folder / "authentication.yaml"
+ config_file = self.manager.config_manager.authentication_settings
self._open_in_text_editor(config_file)
def _edit_global_config(self) -> None:
- config_file = self.manager.path_manager.config_folder / "global_settings.yaml"
+ config_file = self.manager.config_manager.global_settings
self._open_in_text_editor(config_file)
def _edit_config(self) -> None:
if self.manager.multiconfig:
self.print_error("Cannot edit 'ALL' config")
return
- config_file = (
- self.manager.path_manager.config_folder / self.manager.config_manager.loaded_config / "settings.yaml"
- )
+ config_file = self.manager.config_manager.settings
self._open_in_text_editor(config_file)
def _create_new_config(self) -> None:
@@ -226,7 +188,7 @@ class ProgramUI:
if user_prompts.switch_default_config_to(self.manager, config_name):
self.manager.config_manager.change_default_config(config_name)
self.manager.config_manager.change_config(config_name)
- config_file = self.manager.path_manager.config_folder / config_name / "settings.yaml"
+ config_file = self.manager.config_manager.settings
self._open_in_text_editor(config_file)
def _edit_urls(self) -> None:
@@ -284,7 +246,7 @@ class ProgramUI:
except ValueError:
self.print_error("No default text editor found")
- def _process_answer(self, answer: Any, options_map=dict) -> Choice | None:
+ def _process_answer(self, answer: Any, options_map: dict) -> Choice | None:
"""Checks prompt answer and executes corresponding function."""
if answer == EXIT_CHOICE.value:
self.manager.cache_manager.close_sync()
@@ -300,7 +262,7 @@ class ProgramUI:
return function_to_call()
- def _get_changelog(self) -> str:
+ def _get_changelog(self) -> str | None:
"""Get latest changelog file from github. Returns its content."""
path = self.manager.path_manager.config_folder.parent / "CHANGELOG.md"
url = "https://raw.githubusercontent.com/jbsparrow/CyberDropDownloader/refs/heads/master/CHANGELOG.md"
diff --git a/cyberdrop_dl/ui/prompts/user_prompts.py b/cyberdrop_dl/ui/prompts/user_prompts.py
index 51fa6acac..4172ec332 100644
--- a/cyberdrop_dl/ui/prompts/user_prompts.py
+++ b/cyberdrop_dl/ui/prompts/user_prompts.py
@@ -34,17 +34,9 @@ def main_prompt(manager: Manager) -> int:
"""Main prompt for the program."""
prompt_header(manager)
OPTIONS = {
- "group_1": [
- "Download",
- "Retry failed downloads",
- "Create file hashes",
- "Sort files in download folder",
- ],
- "group_2": ["Edit URLs.txt", "Change config", "Edit configs", "Import V4 items"],
- "group_3": [
- "Check for updates",
- "View changelog",
- ],
+ "group_1": ["Download", "Retry failed downloads", "Create file hashes", "Sort files in download folder"],
+ "group_2": ["Edit URLs.txt", "Change config", "Edit configs"],
+ "group_3": ["Check for updates", "View changelog"],
}
choices = basic_prompts.create_choices(OPTIONS, append_last=EXIT_CHOICE)
@@ -160,7 +152,7 @@ class DomainType(IntEnum):
FORUM = 1
-def domains_prompt(*, domain_message: str = "Select site(s):") -> list[str]:
+def domains_prompt(*, domain_message: str = "Select site(s):") -> tuple[list[str], list[str]]:
"""Asks the user to select website(s) for cookie actions and cache actions."""
OPTIONS = [["forum", "file-host"]]
choices = basic_prompts.create_choices(OPTIONS)
diff --git a/cyberdrop_dl/utils/apprise.py b/cyberdrop_dl/utils/apprise.py
index 58c09b00b..ce03ac823 100644
--- a/cyberdrop_dl/utils/apprise.py
+++ b/cyberdrop_dl/utils/apprise.py
@@ -13,7 +13,7 @@ import rich
from pydantic import ValidationError
from rich.text import Text
-from cyberdrop_dl.config_definitions.pydantic.custom_types import AppriseURLModel
+from cyberdrop_dl.config_definitions.custom.types import AppriseURLModel
from cyberdrop_dl.utils import constants
from cyberdrop_dl.utils.logger import log, log_debug, log_spacer
from cyberdrop_dl.utils.yaml import handle_validation_error
diff --git a/cyberdrop_dl/utils/args.py b/cyberdrop_dl/utils/args.py
index 4d9e9c447..a7c0e61c4 100644
--- a/cyberdrop_dl/utils/args.py
+++ b/cyberdrop_dl/utils/args.py
@@ -1,17 +1,17 @@
import sys
import time
import warnings
-from argparse import SUPPRESS, ArgumentDefaultsHelpFormatter, ArgumentParser, BooleanOptionalAction
+from argparse import SUPPRESS, ArgumentParser, BooleanOptionalAction, RawDescriptionHelpFormatter
from argparse import _ArgumentGroup as ArgGroup
from datetime import date
from pathlib import Path
from typing import TYPE_CHECKING, Self
-from pydantic import BaseModel, Field, ValidationError, computed_field, field_validator, model_validator
+from pydantic import BaseModel, Field, ValidationError, computed_field, model_validator
from cyberdrop_dl import __version__
from cyberdrop_dl.config_definitions import ConfigSettings, GlobalSettings
-from cyberdrop_dl.config_definitions.pydantic.custom_types import AliasModel, HttpURL
+from cyberdrop_dl.config_definitions.custom.types import AliasModel, HttpURL
from cyberdrop_dl.utils.yaml import handle_validation_error
if TYPE_CHECKING:
@@ -53,7 +53,7 @@ class CommandLineOnlyArgs(BaseModel):
@computed_field
@property
def multiconfig(self) -> bool:
- return self.config and self.config.casefold() == "all"
+ return bool(self.config) and self.config.casefold() == "all"
@model_validator(mode="after")
def mutually_exclusive(self) -> Self:
@@ -66,126 +66,22 @@ class CommandLineOnlyArgs(BaseModel):
return self
-class DeprecatedArgs(BaseModel):
- output_folder: Path | None = Field(
- None,
- deprecated="'--output-folder' is deprecated and will be removed in the future. Use '--download-folder'",
- )
- download_all_configs: bool = Field(
- False,
- description="Skip the UI and go straight to downloading (runs all configs sequentially)",
- deprecated="'--download-all-configs' is deprecated and will be removed in the future. Use '--download --config all'",
- )
- sort_all_configs: bool = Field(
- False,
- description="Sort all configs sequentially",
- deprecated="'--sort-all-configs' is deprecated and will be removed in the future. Use '--sort-downloads --config all'",
- )
- sort_all_downloads: bool = Field(
- False,
- description="sort all downloads, not just those downloaded by Cyberdrop-DL",
- deprecated="'--sort-all-downloads' is deprecated.",
- )
-
- sort_cdl_only: bool = Field(
- False,
- description="only sort files downloaded by Cyberdrop-DL",
- deprecated="'--sort-cdl-only' is deprecated.",
- )
-
- main_log_filename: Path | None = Field(
- None,
- deprecated="'--main-log-filename' is deprecated and will be removed in the future. Use '--main-log'",
- )
- last_forum_post_filename: Path | None = Field(
- None,
- deprecated="'--last-forum-post-filename' is deprecated and will be removed in the future. Use '--last-forum-post'",
- )
- unsupported_urls_filename: Path | None = Field(
- None,
- deprecated="'--unsupported-urls-filename' is deprecated and will be removed in the future. Use '--unsupported-urls'",
- )
- download_error_urls_filename: Path | None = Field(
- None,
- deprecated="'--download-error-urls-filename' is deprecated and will be removed in the future. Use '--download-error-urls'",
- )
- scrape_error_urls_filename: Path | None = Field(
- None,
- deprecated="'--scrape-error-urls-filename' is deprecated and will be removed in the future. Use '--scrape-error-urls'",
- )
-
- @field_validator("main_log_filename", mode="after")
- @classmethod
- def fix_main_log_extension(cls, value: Path) -> Path:
- return value.with_suffix(".log")
-
- @field_validator(
- "last_forum_post_filename",
- "unsupported_urls_filename",
- "download_error_urls_filename",
- "scrape_error_urls_filename",
- mode="after",
- )
- @classmethod
- def fix_other_logs_extensions(cls, value: Path) -> Path:
- return value.with_suffix(".csv")
+class DeprecatedArgs(BaseModel): ...
class ParsedArgs(AliasModel):
- cli_only_args: CommandLineOnlyArgs = CommandLineOnlyArgs()
+ cli_only_args: CommandLineOnlyArgs = CommandLineOnlyArgs() # type: ignore
config_settings: ConfigSettings = ConfigSettings()
deprecated_args: DeprecatedArgs = DeprecatedArgs()
global_settings: GlobalSettings = GlobalSettings()
def model_post_init(self, _) -> None:
exit_on_warning = False
- logs_deprecated_names = [
- "main_log_filename",
- "last_forum_post_filename",
- "unsupported_urls_filename",
- "download_error_urls_filename",
- "scrape_error_urls_filename",
- ]
if self.cli_only_args.retry_all or self.cli_only_args.retry_maintenance:
self.config_settings.runtime_options.ignore_history = True
- warnings_to_emit = set()
- with warnings.catch_warnings():
- warnings.simplefilter("ignore", DeprecationWarning)
-
- def add_warning_msg_from(field_name: str) -> None:
- field_info: FieldInfo = self.deprecated_args.model_fields[field_name]
- warnings_to_emit.add(field_info.deprecated)
-
- if self.deprecated_args.sort_all_configs:
- add_warning_msg_from("sort_all_configs")
- self.config_settings.sorting.sort_downloads = True
- self.cli_only_args.config = "ALL"
-
- if self.deprecated_args.output_folder:
- add_warning_msg_from("output_folder")
- self.config_settings.files.download_folder = self.deprecated_args.output_folder
-
- if self.deprecated_args.download_all_configs:
- add_warning_msg_from("download_all_configs")
- self.cli_only_args.download = True
- self.cli_only_args.config = "ALL"
-
- if self.deprecated_args.sort_all_downloads:
- add_warning_msg_from("sort_all_downloads")
- exit_on_warning = True
-
- if self.deprecated_args.sort_cdl_only:
- add_warning_msg_from("sort_cdl_only")
- exit_on_warning = True
-
- for deprecated_name in logs_deprecated_names:
- cli_value = getattr(self.deprecated_args, deprecated_name, None)
- if cli_value:
- add_warning_msg_from(deprecated_name)
- model_name = deprecated_name.replace("_filename", "")
- setattr(self.config_settings.logs, model_name, cli_value)
+ warnings_to_emit = self.prepare_warnings()
if (
self.cli_only_args.no_ui
@@ -203,13 +99,28 @@ class ParsedArgs(AliasModel):
time.sleep(WARNING_TIMEOUT)
@staticmethod
- def parse_args() -> Self:
+ def parse_args():
"""Parses the command line arguments passed into the program. Returns an instance of `ParsedArgs`"""
return parse_args()
+ def prepare_warnings(self) -> set:
+ warnings_to_emit = set()
+
+ def add_warning_msg_from(field_name: str) -> None:
+ if not field_name:
+ return
+ field_info: FieldInfo = self.deprecated_args.model_fields[field_name]
+ warnings_to_emit.add(field_info.deprecated)
+
+ with warnings.catch_warnings():
+ warnings.simplefilter("ignore", DeprecationWarning)
+ add_warning_msg_from("")
+
+ return warnings_to_emit
+
def _add_args_from_model(
- parser: ArgumentParser, model: type[BaseModel], *, cli_args: bool = False, deprecated: bool = False
+ parser: ArgumentParser | ArgGroup, model: type[BaseModel], *, cli_args: bool = False, deprecated: bool = False
) -> None:
for name, field in model.model_fields.items():
cli_name = name.replace("_", "-")
@@ -220,7 +131,7 @@ def _add_args_from_model(
default = field.default if cli_args else SUPPRESS
default_options = {"default": default, "dest": name, "help": help_text}
name_or_flags = [f"--{cli_name}"]
- alias = field.alias or field.validation_alias or field.serialization_alias
+ alias: str = field.alias or field.validation_alias or field.serialization_alias # type: ignore
if alias and len(alias) == 1:
name_or_flags.insert(0, f"-{alias}")
if arg_type is bool:
@@ -245,20 +156,30 @@ def _add_args_from_model(
def _create_groups_from_nested_models(parser: ArgumentParser, model: type[BaseModel]) -> list[ArgGroup]:
groups: list[ArgGroup] = []
for name, field in model.model_fields.items():
- submodel = field.annotation
+ submodel: type[BaseModel] = field.annotation # type: ignore
submodel_group = parser.add_argument_group(name)
_add_args_from_model(submodel_group, submodel)
groups.append(submodel_group)
return groups
+class CustomHelpFormatter(RawDescriptionHelpFormatter):
+ def __init__(self, prog):
+ super().__init__(prog, max_help_position=50)
+
+ def _get_help_string(self, action):
+ if action.help:
+ return action.help.replace("program's", "CDL") ## The ' messes up the markdown formatting
+ return action.help
+
+
def parse_args() -> ParsedArgs:
"""Parses the command line arguments passed into the program."""
parser = ArgumentParser(
description="Bulk asynchronous downloader for multiple file hosts",
usage="cyberdrop-dl [OPTIONS] URL [URL...]",
epilog="Visit the wiki for additional details: https://script-ware.gitbook.io/cyberdrop-dl",
- formatter_class=ArgumentDefaultsHelpFormatter,
+ formatter_class=CustomHelpFormatter,
)
parser.add_argument("-V", "--version", action="version", version=f"%(prog)s {__version__}")
@@ -271,9 +192,11 @@ def parse_args() -> ParsedArgs:
"cli_only_args": [cli_only],
}
- deprecated = parser.add_argument_group("Deprecated")
- _add_args_from_model(deprecated, DeprecatedArgs, cli_args=True, deprecated=True)
- group_lists["deprecated_args"] = [deprecated]
+ using_deprecated_args: bool = bool(DeprecatedArgs.model_fields)
+ if using_deprecated_args:
+ deprecated = parser.add_argument_group("Deprecated")
+ _add_args_from_model(deprecated, DeprecatedArgs, cli_args=True, deprecated=True)
+ group_lists["deprecated_args"] = [deprecated]
args = parser.parse_intermixed_args()
parsed_args = {}
@@ -288,7 +211,8 @@ def parse_args() -> ParsedArgs:
if group_dict:
parsed_args[name][group.title] = group_dict
- parsed_args["deprecated_args"] = parsed_args["deprecated_args"].get("Deprecated") or {}
+ if using_deprecated_args:
+ parsed_args["deprecated_args"] = parsed_args["deprecated_args"].get("Deprecated") or {}
parsed_args["cli_only_args"] = parsed_args["cli_only_args"]["CLI-only Options"]
try:
parsed_args = ParsedArgs.model_validate(parsed_args)
diff --git a/cyberdrop_dl/utils/transfer/transfer_hash_db.py b/cyberdrop_dl/utils/transfer.py
similarity index 81%
rename from cyberdrop_dl/utils/transfer/transfer_hash_db.py
rename to cyberdrop_dl/utils/transfer.py
index 69751f46a..087401a67 100644
--- a/cyberdrop_dl/utils/transfer/transfer_hash_db.py
+++ b/cyberdrop_dl/utils/transfer.py
@@ -1,18 +1,20 @@
from __future__ import annotations
+import contextlib
+import sqlite3
+from datetime import datetime
from pathlib import Path
+from shutil import copy2
import arrow
from rich.console import Console
from cyberdrop_dl.utils.database.table_definitions import create_files, create_temp_hash
-from cyberdrop_dl.utils.transfer.backup import db_backup
-from cyberdrop_dl.utils.transfer.wrapper import db_transfer_context
console = Console()
-def transfer_from_old_hash_table(db_path):
+def transfer_v5_db_to_v6(db_path: Path) -> None:
"""Transfers data from the old 'hash' table to new 'files' and 'temp_hash' tables, handling potential schema differences and errors.
Args:
@@ -21,7 +23,8 @@ def transfer_from_old_hash_table(db_path):
Raises:
Exception: If a critical error
"""
-
+ if not db_path.is_file():
+ return
with db_transfer_context(db_path) as cursor:
# Check if the 'hash' table exists
cursor.execute("SELECT name FROM sqlite_master WHERE type='table' AND name='hash'")
@@ -83,3 +86,23 @@ def transfer_from_old_hash_table(db_path):
# Rename the 'temp_hash' table to 'hash'
cursor.execute("ALTER TABLE temp_hash RENAME TO hash")
+
+
+def db_backup(db_file: Path) -> None:
+ new_file = Path(db_file.parent, f"cyberdrop_v5_{datetime.now().strftime('%Y%m%d_%H%M%S')}.bak.db")
+ copy2(db_file, new_file)
+
+
+def db_transfer_context(db_file):
+ conn = sqlite3.connect(db_file)
+ cursor = conn.cursor()
+ try:
+ yield cursor
+ conn.commit() # commit changes if no exception occurs
+ except Exception as e:
+ conn.rollback()
+ raise e
+ finally:
+ cursor.close()
+ conn.close()
diff --git a/cyberdrop_dl/utils/transfer/__init__.py b/cyberdrop_dl/utils/transfer/__init__.py
deleted file mode 100644
index e69de29bb..000000000
diff --git a/cyberdrop_dl/utils/transfer/backup.py b/cyberdrop_dl/utils/transfer/backup.py
deleted file mode 100644
index f70720693..000000000
--- a/cyberdrop_dl/utils/transfer/backup.py
+++ /dev/null
@@ -1,8 +0,0 @@
-from datetime import datetime
-from pathlib import Path
-from shutil import copy2
-
-
-def db_backup(db_file):
- new_file = Path(db_file.parent, f"cyberdrop_v5_{datetime.now().strftime('%Y%m%d_%H%M%S')}.bak.db")
- copy2(db_file, new_file)
diff --git a/cyberdrop_dl/utils/transfer/db_setup.py b/cyberdrop_dl/utils/transfer/db_setup.py
deleted file mode 100644
index b2a490fc4..000000000
--- a/cyberdrop_dl/utils/transfer/db_setup.py
+++ /dev/null
@@ -1,109 +0,0 @@
-from __future__ import annotations
-
-import shutil
-from pathlib import Path
-from typing import TYPE_CHECKING
-
-import platformdirs
-
-from cyberdrop_dl.utils import constants, yaml
-from cyberdrop_dl.utils.transfer.transfer_hash_db import transfer_from_old_hash_table
-from cyberdrop_dl.utils.transfer.transfer_v4_config import transfer_v4_config
-from cyberdrop_dl.utils.transfer.transfer_v4_db import transfer_v4_db
-
-if TYPE_CHECKING:
- from cyberdrop_dl.managers.manager import Manager
-
-CACHE_FILE = constants.APP_STORAGE / "Cache" / "cache.yaml"
-OLD_DB_FILE = constants.APP_STORAGE / "download_history.sqlite"
-NEW_DB_FILE = constants.APP_STORAGE / "Cache" / "cyberdrop.db"
-
-
-class TransitionManager:
- def __init__(self, manager: Manager) -> None:
- self.manager = manager
-
- def transfer_v5_to_new_hashtable(self):
- """
- transfers from old v5 hash table to new v5 hash table, that supports multiple hash types per file
- """
- if NEW_DB_FILE.exists():
- transfer_from_old_hash_table(NEW_DB_FILE)
-
- def transfer_v4_to_v6(self):
- """
- Makes some changes for transfer from v4 to v5
-
- """
- OLD_APP_STORAGE = Path(platformdirs.user_config_dir("Cyberdrop-DL"))
- OLD_DOWNLOAD_STORAGE = Path(platformdirs.user_downloads_path()) / "Cyberdrop-DL Downloads"
- OLD_DB_STORAGE = Path(platformdirs.user_data_dir("Cyberdrop-DL"))
-
- self.manager.config_manager.settings.parent.mkdir(parents=True, exist_ok=True)
- if self.check_cache_for_moved():
- return
-
- OLD_FILES = Path("./Old Files")
- OLD_FILES.mkdir(parents=True, exist_ok=True)
-
- if OLD_APP_STORAGE.exists():
- if constants.APP_STORAGE.exists():
- if constants.APP_STORAGE.with_name("AppData_OLD").exists():
- constants.APP_STORAGE.rename(constants.APP_STORAGE.with_name("AppData_OLD2"))
- constants.APP_STORAGE.rename(constants.APP_STORAGE.with_name("AppData_OLD"))
- shutil.copytree(OLD_APP_STORAGE, constants.APP_STORAGE, dirs_exist_ok=True)
- shutil.rmtree(OLD_APP_STORAGE)
-
- if OLD_DOWNLOAD_STORAGE.exists():
- shutil.copytree(OLD_DOWNLOAD_STORAGE, constants.DOWNLOAD_STORAGE, dirs_exist_ok=True)
- shutil.rmtree(OLD_DOWNLOAD_STORAGE)
-
- if Path("./download_history.sqlite").is_file():
- transfer_v4_db(Path("./download_history.sqlite"), NEW_DB_FILE)
- Path("./download_history.sqlite").rename(OLD_FILES / "download_history1.sqlite")
-
- if (OLD_DB_FILE).is_file():
- transfer_v4_db(
- OLD_DB_FILE,
- NEW_DB_FILE,
- )
- (OLD_DB_FILE).rename(OLD_FILES / "download_history2.sqlite")
-
- if (OLD_DB_STORAGE / "download_history.sqlite").is_file():
- transfer_v4_db(
- OLD_DB_STORAGE / "download_history.sqlite",
- constants.APP_STORAGE / "Cache" / "cyberdrop.db",
- )
- (OLD_DB_STORAGE / "download_history.sqlite").rename(OLD_FILES / "download_history3.sqlite")
-
- if Path("./config.yaml").is_file():
- try:
- transfer_v4_config(self.manager, "Imported V4", Path("./config.yaml"))
- self.manager.config_manager.change_default_config("Imported V4")
- self.manager.config_manager.change_config("Imported V4")
- except OSError:
- pass
- Path("./config.yaml").rename(OLD_FILES / "config.yaml")
-
- if Path("./Errored_Download_URLs.csv").is_file():
- Path("./Errored_Download_URLs.csv").rename(OLD_FILES / "Errored_Download_URLs.csv")
- if Path("./Errored_Scrape_URLs.csv").is_file():
- Path("./Errored_Scrape_URLs.csv").rename(OLD_FILES / "Errored_Scrape_URLs.csv")
- if Path("./Unsupported_URLs.csv").is_file():
- Path("./Unsupported_URLs.csv").rename(OLD_FILES / "Unsupported_URLs.csv")
-
- self.set_first_startup_completed()
-
- def check_cache_for_moved(self) -> bool:
- """Checks the cache for moved files."""
- cache = yaml.load(CACHE_FILE, create=True)
- if not cache:
- cache = {"first_startup_completed": False}
- self.manager.cache_manager.dump(cache)
- return bool(cache.get("first_startup_completed", False))
-
- def set_first_startup_completed(self) -> None:
- """Updates the cache to reflect the new location."""
- cache = yaml.load(CACHE_FILE, create=True)
- cache["first_startup_completed"] = True
- self.manager.cache_manager.dump(cache)
diff --git a/cyberdrop_dl/utils/transfer/transfer_v4_config.py b/cyberdrop_dl/utils/transfer/transfer_v4_config.py
deleted file mode 100644
index 9150f5b72..000000000
--- a/cyberdrop_dl/utils/transfer/transfer_v4_config.py
+++ /dev/null
@@ -1,145 +0,0 @@
-from __future__ import annotations
-
-import logging
-from pathlib import Path
-from typing import TYPE_CHECKING
-
-from pydantic import ValidationError
-
-from cyberdrop_dl.config_definitions import AuthSettings, ConfigSettings, GlobalSettings
-from cyberdrop_dl.utils import yaml
-
-if TYPE_CHECKING:
- from cyberdrop_dl.managers.manager import Manager
-
-
-def transfer_v4_config(manager: Manager, new_config_name: str, old_config_path: Path) -> None:
- """Transfers a V4 config into V5 possession."""
- try:
- new_auth_data = AuthSettings()
- new_user_data = ConfigSettings()
- new_global_data = GlobalSettings()
- old_data = yaml.load(old_config_path)
- old_data = old_data["Configuration"]
-
- from cyberdrop_dl.managers.path_manager import constants
-
- new_user_data.files.input_file = constants.APP_STORAGE / "Configs" / new_config_name / "URLs.txt"
- new_user_data.files.download_folder = constants.DOWNLOAD_STORAGE / "Cyberdrop-DL Downloads"
- new_user_data.logs.log_folder = constants.APP_STORAGE / "Configs" / new_config_name / "Logs"
- new_user_data.sorting.sort_folder = constants.DOWNLOAD_STORAGE / "Cyberdrop-DL Sorted Downloads"
-
- # Auth data transfer
- new_auth_data.forums.nudostar_username = old_data["Authentication"]["nudostar_username"]
- new_auth_data.forums.nudostar_password = old_data["Authentication"]["nudostar_password"]
- new_auth_data.forums.simpcity_username = old_data["Authentication"]["simpcity_username"]
- new_auth_data.forums.simpcity_password = old_data["Authentication"]["simpcity_password"]
- new_auth_data.forums.socialmediagirls_username = old_data["Authentication"]["socialmediagirls_username"]
- new_auth_data.forums.socialmediagirls_password = old_data["Authentication"]["socialmediagirls_password"]
- new_auth_data.forums.xbunker_username = old_data["Authentication"]["xbunker_username"]
- new_auth_data.forums.xbunker_password = old_data["Authentication"]["xbunker_password"]
-
- new_auth_data.jdownloader.username = old_data["JDownloader"]["jdownloader_username"]
- new_auth_data.jdownloader.password = old_data["JDownloader"]["jdownloader_password"]
- new_auth_data.jdownloader.device = old_data["JDownloader"]["jdownloader_device"]
-
- new_auth_data.reddit.personal_use_script = old_data["Authentication"]["reddit_personal_use_script"]
- new_auth_data.reddit.secret = old_data["Authentication"]["reddit_secret"]
-
- new_auth_data.gofile.api_key = old_data["Authentication"]["gofile_api_key"]
- new_auth_data.imgur.client_id = old_data["Authentication"]["imgur_client_id"]
- new_auth_data.pixeldrain.api_key = old_data["Authentication"]["pixeldrain_api_key"]
-
- # User data transfer
- new_user_data.download_options.block_download_sub_folders = old_data["Runtime"]["block_sub_folders"]
- new_user_data.download_options.disable_download_attempt_limit = old_data["Runtime"]["disable_attempt_limit"]
- new_user_data.download_options.include_album_id_in_folder_name = old_data["Runtime"]["include_id"]
- new_user_data.download_options.remove_generated_id_from_filenames = old_data["Runtime"][
- "remove_bunkr_identifier"
- ]
- new_user_data.download_options.separate_posts = old_data["Forum_Options"]["separate_posts"]
- new_user_data.download_options.skip_download_mark_completed = False
-
- new_user_data.file_size_limits.maximum_image_size = old_data["Runtime"]["filesize_maximum_images"]
- new_user_data.file_size_limits.maximum_other_size = old_data["Runtime"]["filesize_maximum_other"]
- new_user_data.file_size_limits.maximum_video_size = old_data["Runtime"]["filesize_maximum_videos"]
- new_user_data.file_size_limits.minimum_image_size = old_data["Runtime"]["filesize_minimum_images"]
- new_user_data.file_size_limits.minimum_other_size = old_data["Runtime"]["filesize_minimum_other"]
- new_user_data.file_size_limits.minimum_video_size = old_data["Runtime"]["filesize_minimum_videos"]
-
- new_user_data.ignore_options.exclude_videos = old_data["Ignore"]["exclude_videos"]
- new_user_data.ignore_options.exclude_images = old_data["Ignore"]["exclude_images"]
- new_user_data.ignore_options.exclude_other = old_data["Ignore"]["exclude_other"]
- new_user_data.ignore_options.exclude_audio = old_data["Ignore"]["exclude_audio"]
- new_user_data.ignore_options.ignore_coomer_ads = old_data["Ignore"]["skip_coomer_ads"]
- new_user_data.ignore_options.skip_hosts = old_data["Ignore"]["skip_hosts"]
- new_user_data.ignore_options.only_hosts = old_data["Ignore"]["only_hosts"]
-
- new_user_data.runtime_options.ignore_history = old_data["Ignore"]["ignore_history"]
- new_user_data.runtime_options.skip_check_for_partial_files = old_data["Runtime"][
- "skip_check_for_partial_files_and_empty_dirs"
- ]
- new_user_data.runtime_options.skip_check_for_empty_folders = old_data["Runtime"][
- "skip_check_for_partial_files_and_empty_dirs"
- ]
- new_user_data.runtime_options.send_unsupported_to_jdownloader = old_data["JDownloader"]["apply_jdownloader"]
-
- new_user_data.sorting.sort_downloads = old_data["Sorting"]["sort_downloads"]
-
- # Global data transfer
- new_global_data.general.allow_insecure_connections = old_data["Runtime"]["allow_insecure_connections"]
- new_global_data.general.user_agent = old_data["Runtime"]["user_agent"]
- new_global_data.general.proxy = old_data["Runtime"]["proxy"] or None
- new_global_data.general.max_file_name_length = old_data["Runtime"]["max_filename_length"]
- new_global_data.general.max_folder_name_length = old_data["Runtime"]["max_folder_name_length"]
- new_global_data.general.required_free_space = old_data["Runtime"]["required_free_space"]
-
- new_global_data.rate_limiting_options.connection_timeout = old_data["Ratelimiting"]["connection_timeout"]
- new_global_data.rate_limiting_options.download_attempts = old_data["Runtime"]["attempts"]
- new_global_data.rate_limiting_options.download_delay = old_data["Ratelimiting"]["throttle"]
- new_global_data.rate_limiting_options.read_timeout = old_data["Ratelimiting"]["read_timeout"]
- new_global_data.rate_limiting_options.rate_limit = old_data["Ratelimiting"]["ratelimit"]
- new_global_data.rate_limiting_options.max_simultaneous_downloads_per_domain = old_data["Runtime"][
- "max_concurrent_downloads_per_domain"
- ]
-
- # Save Data
- new_settings = manager.path_manager.config_folder / new_config_name / "settings.yaml"
- new_logs = manager.path_manager.config_folder / new_config_name / "Logs"
- new_settings.parent.mkdir(parents=True, exist_ok=True)
- new_logs.mkdir(parents=True, exist_ok=True)
-
- old_config_folder = Path(old_config_path).parent
- old_input_file: str = old_data["Files"]["input_file"]
- old_urls_path = Path(old_input_file.replace("{config}", old_config_folder.name))
-
- new_urls = manager.path_manager.config_folder / new_config_name / "URLs.txt"
- new_urls.touch(exist_ok=True)
-
- if not old_urls_path.is_absolute() and len(old_urls_path.parts) == 1:
- old_urls_path = old_config_folder / old_urls_path.name
-
- if old_urls_path.is_file():
- with old_urls_path.open(encoding="utf8") as urls_file:
- urls = urls_file.readlines()
- with new_urls.open("w", encoding="utf8") as urls_file:
- urls_file.writelines(urls)
- else:
- new_urls.touch(exist_ok=True)
-
- manager.config_manager.authentication_data = AuthSettings.model_validate(new_auth_data.model_dump())
- manager.config_manager.global_settings_data = GlobalSettings.model_validate(new_global_data.model_dump())
- manager.config_manager.save_as_new_config(
- new_settings, ConfigSettings.model_validate(new_user_data.model_dump())
- )
- manager.config_manager.write_updated_authentication_config()
- manager.config_manager.write_updated_global_settings_config()
- manager.config_manager.change_config(new_config_name)
- except ValidationError as e:
- logging.getLogger("cyberdrop_dl_startup").error(
- f"Issue while processing v4 transfer of {old_config_path.absolute()} please update/delete the file before trying again"
- )
- logging.getLogger("cyberdrop_dl_startup").error(
- "Please read the documentation for how to handle v4 transition errors: https://script-ware.gitbook.io/cyberdrop-dl/transition-to-v6#importing-previous-configs"
- )
- raise e
diff --git a/cyberdrop_dl/utils/transfer/transfer_v4_db.py b/cyberdrop_dl/utils/transfer/transfer_v4_db.py
deleted file mode 100644
index 3d40f8c10..000000000
--- a/cyberdrop_dl/utils/transfer/transfer_v4_db.py
+++ /dev/null
@@ -1,34 +0,0 @@
-import sqlite3
-from pathlib import Path
-
-from cyberdrop_dl.utils.database.table_definitions import create_history
-
-
-def transfer_v4_db(db_path: Path, new_db_path: Path) -> None:
- """Transfers a V4 database into V5 possession."""
- old_db_connection = sqlite3.connect(db_path)
- if not new_db_path.exists():
- new_db_path.parent.mkdir(parents=True, exist_ok=True)
- new_db_path.touch()
- new_db_connection = sqlite3.connect(new_db_path)
-
- new_db_connection.execute(create_history)
-
- query = "SELECT domain, url_path, referer, download_path, download_filename, original_filename, completed FROM media WHERE completed = 1"
- old_data_history = old_db_connection.execute(query).fetchall()
-
- old_data_revised = []
- for row in old_data_history:
- row_list = list(row)
- row_list[3] = str(Path(row_list[3]).parent)
- old_data_revised.append(tuple(row_list))
-
- new_db_connection.executemany(
- "insert or ignore into media (domain, url_path, referer, download_path, download_filename, original_filename, completed) values (?, ?, ?, ?, ?, ?, ?)",
- old_data_revised,
- )
- del old_data_history
-
- new_db_connection.commit()
- old_db_connection.close()
- new_db_connection.close()
diff --git a/cyberdrop_dl/utils/transfer/wrapper.py b/cyberdrop_dl/utils/transfer/wrapper.py
deleted file mode 100644
index 6e6842d92..000000000
--- a/cyberdrop_dl/utils/transfer/wrapper.py
+++ /dev/null
@@ -1,17 +0,0 @@
-import contextlib
-import sqlite3
-
-
-def db_transfer_context(db_file):
- conn = sqlite3.connect(db_file)
- cursor = conn.cursor()
- try:
- yield cursor
- conn.commit() # commit changes if no exception occurs
- except Exception as e:
- conn.rollback()
- raise e
- finally:
- cursor.close()
- conn.close()
diff --git a/docs/reference/cli-arguments.md b/docs/reference/cli-arguments.md
index c5295a4e4..5b94b6c92 100644
--- a/docs/reference/cli-arguments.md
+++ b/docs/reference/cli-arguments.md
@@ -32,42 +32,41 @@ For items not explained below, you can find their counterparts in the configurat
### `appdata-folder`
-| Type | Default |
-|----------------|----------|
-| `Path` | `<Current Working Directory>`|
+| Type | Default |
+| ------ | ----------------------------- |
+| `Path` | `<Current Working Directory>` |
Folder where Cyberdrop-DL will store its data files.
-
### `completed-after`
-| Type | Default |
-|----------------|----------|
-| `date` | `None` |
+| Type | Default |
+| ------ | ------- |
+| `date` | `None` |
Only download files that were completed on or after this date. The date should be in ISO 8601 format, for example, `2021-12-23`
### `completed-before`
-| Type | Default |
-|----------------|----------|
-| `date` | `None` |
+| Type | Default |
+| ------ | ------- |
+| `date` | `None` |
Only download files that were completed on or before this date. The date should be in ISO 8601 format, for example, `2021-12-23`
### `config`
-| Type | Default |
-|----------------|----------|
-| `str` | `None` |
+| Type | Default |
+| ----- | ------- |
+| `str` | `None` |
Name of config to load. Use `ALL` to run all configs sequentially
### `config-file`
-| Type | Default |
-|----------------|----------|
-| `Path` | `None` |
+| Type | Default |
+| ------ | ------- |
+| `Path` | `None` |
Path to the CDL `settings.yaml` file to load
@@ -77,57 +76,57 @@ If both `config` and `config-file` are supplied, `config-file` takes priority
### `download`
-| Type | Default | Action |
-|----------------|----------|--------|
-| `BoolFlag` | `False` | `store_true`|
+| Type | Default | Action |
+| ---------- | ------- | ------------ |
+| `BoolFlag` | `False` | `store_true` |
Skips UI, start download immediately
### `download-tiktok-audios`
-| Type | Default | Action |
-|----------------|----------|--------|
-| `BoolFlag` | `False` | `store_true`|
+| Type | Default | Action |
+| ---------- | ------- | ------------ |
+| `BoolFlag` | `False` | `store_true` |
Download TikTok audios from posts and save them as separate files
### `max-items-retry`
-| Type | Default |
-|----------------|----------|
-| `NonNegativeInt` | `0` |
+| Type | Default |
+| ---------------- | ------- |
+| `NonNegativeInt` | `0` |
Max number of links to retry. Using `0` means no limit
### `no-ui`
-| Type | Default | Action |
-|----------------|----------|--------|
-| `BoolFlag` | `False` | `store_true`|
+| Type | Default | Action |
+| ---------- | ------- | ------------ |
+| `BoolFlag` | `False` | `store_true` |
Disables the UI/progress view entirely
### `retry-all`
-| Type | Default | Action |
-|----------------|----------|--------|
-| `BoolFlag` | `False` | `store_true`|
+| Type | Default | Action |
+| ---------- | ------- | ------------ |
+| `BoolFlag` | `False` | `store_true` |
Retry all downloads
### `retry-failed`
-| Type | Default | Action |
-|----------------|----------|--------|
-| `BoolFlag` | `False` | `store_true`|
+| Type | Default | Action |
+| ---------- | ------- | ------------ |
+| `BoolFlag` | `False` | `store_true` |
Retry failed downloads
### `retry-maintenance`
-| Type | Default | Action |
-|----------------|----------|--------|
-| `BoolFlag` | `False` | `store_true`|
+| Type | Default | Action |
+| ---------- | ------- | ------------ |
+| `BoolFlag` | `False` | `store_true` |
Retry download of maintenance files (bunkr). Requires files to be hashed
@@ -143,33 +142,28 @@ usage: cyberdrop-dl [OPTIONS] URL [URL...]
Bulk asynchronous downloader for multiple file hosts
options:
- -h, --help show this help message and exit
- -V, --version show program's version number and exit
+ -h, --help show this help message and exit
+ -V, --version show CDL version number and exit
CLI-only Options:
- LINK(S) link(s) to content to download (passing multiple links is supported)
- --appdata-folder APPDATA_FOLDER
- AppData folder path (default: None)
- --completed-after COMPLETED_AFTER
- only download completed downloads at or after this date (default: None)
- --completed-before COMPLETED_BEFORE
- only download completed downloads at or before this date (default: None)
- --config CONFIG name of config to load (default: None)
- --config-file CONFIG_FILE
- path to the CDL settings.yaml file to load (default: None)
- --download skips UI, start download immediatly (default: False)
- --max-items-retry MAX_ITEMS_RETRY
- max number of links to retry (default: 0)
- --no-ui disables the UI/progress view entirely (default: False)
- --retry-all retry all downloads (default: False)
- --retry-failed retry failed downloads (default: False)
- --retry-maintenance retry download of maintenance files (bunkr). Requires files to be hashed (default: False)
- --download-tiktok-audios
- download TikTok audios (default: False)
+ LINK(S) link(s) to content to download (passing multiple links is supported)
+ --appdata-folder APPDATA_FOLDER AppData folder path
+ --completed-after COMPLETED_AFTER only download completed downloads at or after this date
+ --completed-before COMPLETED_BEFORE only download completed downloads at or before this date
+ --config CONFIG name of config to load
+ --config-file CONFIG_FILE path to the CDL settings.yaml file to load
+ --download skips UI, start download immediatly
+ --max-items-retry MAX_ITEMS_RETRY max number of links to retry
+ --no-ui disables the UI/progress view entirely
+ --retry-all retry all downloads
+ --retry-failed retry failed downloads
+ --retry-maintenance retry download of maintenance files (bunkr). Requires files to be hashed
+ --download-tiktok-audios download TikTok audios
+ --print-stats Show stats report at the end of a run
browser_cookies:
- --browsers [BROWSERS ...]
--auto-import, --no-auto-import
+ --browsers [BROWSERS ...]
--sites [SITES ...]
download_options:
@@ -178,21 +172,21 @@ download_options:
--disable-file-timestamps, --no-disable-file-timestamps
--include-album-id-in-folder-name, --no-include-album-id-in-folder-name
--include-thread-id-in-folder-name, --no-include-thread-id-in-folder-name
+ --maximum-number-of-children [MAXIMUM_NUMBER_OF_CHILDREN ...]
--remove-domains-from-folder-names, --no-remove-domains-from-folder-names
--remove-generated-id-from-filenames, --no-remove-generated-id-from-filenames
--scrape-single-forum-post, --no-scrape-single-forum-post
- --separate-posts, --no-separate-posts
--separate-posts-format SEPARATE_POSTS_FORMAT
+ --separate-posts, --no-separate-posts
--skip-download-mark-completed, --no-skip-download-mark-completed
--skip-referer-seen-before, --no-skip-referer-seen-before
- --maximum-number-of-children [MAXIMUM_NUMBER_OF_CHILDREN ...]
- --maximum-thread-depth MAX_THREAD_NESTING
+ --maximum-thread-depth MAXIMUM_THREAD_DEPTH
dupe_cleanup_options:
- --hashing HASHING
- --auto-dedupe, --no-auto-dedupe
--add-md5-hash, --no-add-md5-hash
--add-sha256-hash, --no-add-sha256-hash
+ --auto-dedupe, --no-auto-dedupe
+ --hashing HASHING
--send-deleted-to-trash, --no-send-deleted-to-trash
file_size_limits:
@@ -210,50 +204,51 @@ media_duration_limits:
--minimum-audio-duration MINIMUM_AUDIO_DURATION
files:
- -i INPUT_FILE, --input-file INPUT_FILE
-d DOWNLOAD_FOLDER, --download-folder DOWNLOAD_FOLDER
+ -i INPUT_FILE, --input-file INPUT_FILE
ignore_options:
- --exclude-videos, --no-exclude-videos
- --exclude-images, --no-exclude-images
--exclude-audio, --no-exclude-audio
+ --exclude-images, --no-exclude-images
--exclude-other, --no-exclude-other
+ --exclude-videos, --no-exclude-videos
+ --filename-regex-filter FILENAME_REGEX_FILTER
--ignore-coomer-ads, --no-ignore-coomer-ads
- --skip-hosts [SKIP_HOSTS ...]
--only-hosts [ONLY_HOSTS ...]
- --filename-regex-filter FILENAME_REGEX_FILTER
+ --skip-hosts [SKIP_HOSTS ...]
+ --exclude-files-with-no-extension, --no-exclude-files-with-no-extension
logs:
- --log-folder LOG_FOLDER
- --webhook WEBHOOK
- --main-log MAIN_LOG
- --last-forum-post LAST_FORUM_POST
- --unsupported-urls UNSUPPORTED_URLS
--download-error-urls DOWNLOAD_ERROR_URLS
- --scrape-error-urls SCRAPE_ERROR_URLS
- --rotate-logs, --no-rotate-logs
+ --last-forum-post LAST_FORUM_POST
+ --log-folder LOG_FOLDER
--log-line-width LOG_LINE_WIDTH
--logs-expire-after LOGS_EXPIRE_AFTER
+ --main-log MAIN_LOG
+ --rotate-logs, --no-rotate-logs
+ --scrape-error-urls SCRAPE_ERROR_URLS
+ --unsupported-urls UNSUPPORTED_URLS
+ --webhook WEBHOOK
runtime_options:
- --ignore-history, --no-ignore-history
- --log-level LOG_LEVEL
--console-log-level CONSOLE_LOG_LEVEL
- --skip-check-for-partial-files, --no-skip-check-for-partial-files
- --skip-check-for-empty-folders, --no-skip-check-for-empty-folders
+ --deep-scrape, --no-deep-scrape
--delete-partial-files, --no-delete-partial-files
- --update-last-forum-post, --no-update-last-forum-post
- --send-unsupported-to-jdownloader, --no-send-unsupported-to-jdownloader
- --jdownloader-download-dir JDOWNLOADER_DOWNLOAD_DIR
+ --ignore-history, --no-ignore-history
--jdownloader-autostart, --no-jdownloader-autostart
+ --jdownloader-download-dir JDOWNLOADER_DOWNLOAD_DIR
--jdownloader-whitelist [JDOWNLOADER_WHITELIST ...]
- --deep-scrape, --no-deep-scrape
+ --log-level LOG_LEVEL
+ --send-unsupported-to-jdownloader, --no-send-unsupported-to-jdownloader
+ --skip-check-for-empty-folders, --no-skip-check-for-empty-folders
+ --skip-check-for-partial-files, --no-skip-check-for-partial-files
--slow-download-speed SLOW_DOWNLOAD_SPEED
+ --update-last-forum-post, --no-update-last-forum-post
sorting:
+ --scan-folder SCAN_FOLDER
--sort-downloads, --no-sort-downloads
--sort-folder SORT_FOLDER
- --scan-folder SCAN_FOLDER
--sort-incrementer-format SORT_INCREMENTER_FORMAT
--sorted-audio SORTED_AUDIO
--sorted-image SORTED_IMAGE
@@ -262,41 +257,29 @@ sorting:
general:
--allow-insecure-connections, --no-allow-insecure-connections
- --user-agent USER_AGENT
- --proxy PROXY
--flaresolverr FLARESOLVERR
--max-file-name-length MAX_FILE_NAME_LENGTH
--max-folder-name-length MAX_FOLDER_NAME_LENGTH
+ --proxy PROXY
--required-free-space REQUIRED_FREE_SPACE
+ --user-agent USER_AGENT
rate_limiting_options:
--connection-timeout CONNECTION_TIMEOUT
--download-attempts DOWNLOAD_ATTEMPTS
- --read-timeout READ_TIMEOUT
- --rate-limit RATE_LIMIT
--download-delay DOWNLOAD_DELAY
- --max-simultaneous-downloads MAX_SIMULTANEOUS_DOWNLOADS
- --max-simultaneous-downloads-per-domain MAX_SIMULTANEOUS_DOWNLOADS_PER_DOMAIN
--download-speed-limit DOWNLOAD_SPEED_LIMIT
--file-host-cache-expire-after FILE_HOST_CACHE_EXPIRE_AFTER
--forum-cache-expire-after FORUM_CACHE_EXPIRE_AFTER
+ --max-simultaneous-downloads-per-domain MAX_SIMULTANEOUS_DOWNLOADS_PER_DOMAIN
+ --max-simultaneous-downloads MAX_SIMULTANEOUS_DOWNLOADS
+ --rate-limit RATE_LIMIT
+ --read-timeout READ_TIMEOUT
ui_options:
- --vi-mode, --no-vi-mode
+ --downloading-item-limit DOWNLOADING_ITEM_LIMIT
--refresh-rate REFRESH_RATE
--scraping-item-limit SCRAPING_ITEM_LIMIT
- --downloading-item-limit DOWNLOADING_ITEM_LIMIT
+ --vi-mode, --no-vi-mode
-Deprecated:
- --output-folder OUTPUT_FOLDER
- --download-all-configs
- Skip the UI and go straight to downloading (runs all configs sequentially)
- --sort-all-configs Sort all configs sequentially
- --sort-all-downloads sort all downloads, not just those downloaded by Cyberdrop-DL
- --sort-cdl-only only sort files downloaded by Cyberdrop-DL
- --main-log-filename MAIN_LOG_FILENAME
- --last-forum-post-filename LAST_FORUM_POST_FILENAME
- --unsupported-urls-filename UNSUPPORTED_URLS_FILENAME
- --download-error-urls-filename DOWNLOAD_ERROR_URLS_FILENAME
- --scrape-error-urls-filename SCRAPE_ERROR_URLS_FILENAME
```
diff --git a/docs/reference/configuration-options/authentication.md b/docs/reference/configuration-options/authentication.md
index a1ac31b4c..06a5ec407 100644
--- a/docs/reference/configuration-options/authentication.md
+++ b/docs/reference/configuration-options/authentication.md
@@ -7,9 +7,9 @@ icon: user-lock
All the options in these list are optional. The default value for all of them is an empty `str`
-|Type |Default|
-|----|---|
-|`str`|`""`|
+| Type | Default |
+| ----- | ------- |
+| `str` | `""` |
<details>
@@ -81,7 +81,6 @@ Some examples of what to put in for what it asks for:
- Description: `Cyberdrop-DL client`
-
## `client_id`
After generating the client above, you will need to give Cyberdrop-DL the client ID.
diff --git a/docs/reference/configuration-options/global-settings/general.md b/docs/reference/configuration-options/global-settings/general.md
index a403941a3..5de7933a1 100644
--- a/docs/reference/configuration-options/global-settings/general.md
+++ b/docs/reference/configuration-options/global-settings/general.md
@@ -5,44 +5,21 @@ description: These are some general settings that will be used regardless of whi
## `allow_insecure_connections`
-| Type | Default |
-|----------------|----------|
-| `bool` | `false`|
+| Type | Default |
+| ------ | ------- |
+| `bool` | `false` |
Setting this to `true` will allow the program to connect to websites without SSL encryption (insecurely).
-
{% hint style="danger" %}
This will make the connection insecure, and sensitive data may be exposed. You should only enable this option if you know what you are doing. For your safety, is recommended to always use a secure HTTPS connection to protect your privacy.
{% endhint %}
-
-## `user_agent`
-
-| Type | Default |
-|----------------|----------|
-| `NonEmptyStr` | `Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:120.0) Gecko/20100101 Firefox/120.0`|
-
-The user agent is the signature of your browser, it's how it is represented to websites you connect to. You can google "what is my user agent" to see what yours may be.
-
-{% hint style="info" %}
-If you use flaresolverr, this value must match with flaresolverr user agent for its cookies to work
-{% endhint %}
-
-
-## `proxy`
-
-| Type | Default |
-|----------------|----------|
-| `HttpURL` or `null` | `null`|
-
-The proxy you want CDL to use. Only `http` proxies are supported. Ex: `https://user:pass@ip:port`
-
## `flaresolverr`
-| Type | Default |
-|----------------|----------|
-| `HttpURL` or `null` | `null`|
+| Type | Default |
+| ------------------- | ------- |
+| `HttpURL` or `null` | `null` |
[FlareSolverr](https://github.com/FlareSolverr/FlareSolverr) is a proxy server to bypass Cloudflare and DDoS-GUARD protection. The provided value must be a valid `http` URL of an existing flaresolverr instance. Ex: `http://ip:port`
@@ -52,24 +29,44 @@ This wiki does not covert flaresolverr setup process. If you need help, refer to
## `max_file_name_length`
-| Type | Default |
-|----------------|----------|
-| `PositiveInt` | `95`|
+| Type | Default |
+| ------------- | ------- |
+| `PositiveInt` | `95` |
This is the maximum number of characters allowable in a filename.
## `max_folder_name_length`
-| Type | Default |
-|----------------|----------|
-| `PositiveInt` | `95`|
+| Type | Default |
+| ------------- | ------- |
+| `PositiveInt` | `95` |
This is the maximum number of characters allowable in a folder name.
+## `proxy`
+
+| Type | Default |
+| ------------------- | ------- |
+| `HttpURL` or `null` | `null` |
+
+The proxy you want CDL to use. Only `http` proxies are supported. Ex: `https://user:pass@ip:port`
+
## `required_free_space`
-| Type | Default | Restrictions |
-|----------------|----------| ----------|
-| `ByteSize` | `5GB`| `>=512MB` |
+| Type | Default | Restrictions |
+| ---------- | ------- | ------------ |
+| `ByteSize` | `5GB` | `>=512MB` |
This is the minimum amount of free space require to start new downloads.
+
+## `user_agent`
+
+| Type | Default |
+| ------------- | ---------------------------------------------------------------------------------- |
+| `NonEmptyStr` | `Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:133.0) Gecko/20100101 Firefox/133.0` |
+
+The user agent is the signature of your browser, it's how it is represented to websites you connect to. You can google "what is my user agent" to see what yours may be.
+
+{% hint style="info" %}
+If you use flaresolverr, this value must match with flaresolverr user agent for its cookies to work
+{% endhint %}
diff --git a/docs/reference/configuration-options/global-settings/rate-limiting-options.md b/docs/reference/configuration-options/global-settings/rate-limiting-options.md
index 99ccab731..fe9a666d7 100644
--- a/docs/reference/configuration-options/global-settings/rate-limiting-options.md
+++ b/docs/reference/configuration-options/global-settings/rate-limiting-options.md
@@ -5,77 +5,39 @@ description: These are limiting options for the program
## `connection_timeout`
-| Type | Default |
-|----------------|----------|
-| `PositiveInt` | `15`|
+| Type | Default |
+| ------------- | ------- |
+| `PositiveInt` | `15` |
The number of seconds to wait while connecting to a website before timing out.
-
## `download_attempts`
-| Type | Default |
-|----------------|----------|
-| `PositiveInt` | `5`|
+| Type | Default |
+| ------------- | ------- |
+| `PositiveInt` | `5` |
The number of download attempts per file. Regardless of this value, some conditions (such as a 404 HTTP status) will cause a file to not be retried at all.
-## `read_timeout`
-
-| Type | Default |
-|----------------|----------|
-| `PositiveInt` | `300`|
-
-The number of seconds to wait while reading data from a website before timing out. If it's a download, it will be retried and won't count against the `download_attempts` limit.
-
-## `rate_limit`
-
-| Type | Default |
-|----------------|----------|
-| `PositiveInt` | `50`|
-
-{% hint style="info" %}
-This setting specifies speed and it's interpreted as `<value> / second`. ex: `50` means `50 requests / second`
-{% endhint %}
-
-This is the maximum number of requests that can be made by the program per second.
-
## `download_delay`
-| Type | Default |
-|----------------|----------|
-| `NonNegativeFloat` | `0.5`|
+| Type | Default |
+| ------------------ | ------- |
+| `NonNegativeFloat` | `0.5` |
This is the number of seconds to wait between downloads to the same domain.
Some domains have internal limits set by the program, which can not be modified:
+
- `bunkrr`: 1
- `cyberfile.me`: 1
- `pixeldrain` : 2
-## `max_simultaneous_downloads`
-
-| Type | Default |
-|----------------|----------|
-| `PositiveInt` | `15`|
-
-This is the maximum number of files that can be downloaded simultaneously.
-
-## `max_simultaneous_downloads_per_domain`
-
-| Type | Default |
-|----------------|----------|
-| `PositiveInt` | `3`|
-
-This is the maximum number of files that can be downloaded from a single domain simultaneously.
-
-Some domains have internal limits set by the program, such as `bunkrr`, `cyberfile.me`, etc.
-
## `download_speed_limit`
-| Type | Default |
-|----------------|----------|
-| `ByteSize` | `0`|
+| Type | Default |
+| ---------- | ------- |
+| `ByteSize` | `0` |
{% hint style="info" %}
This setting specifies speed and it's interpreted as `<value> / second`. ex: `8MB` means `8MB/s`
@@ -85,9 +47,9 @@ This is the max rate of downloading in bytes (per second) for all downloads comb
## `file_host_cache_expire_after`
-| Type | Default |
-|----------------|----------|
-| `timedelta`, `str` or `int` | `7 days`|
+| Type | Default |
+| --------------------------- | -------- |
+| `timedelta`, `str` or `int` | `7 days` |
Cyberdrop-DL caches the requests made to any website. This setting controls how long responses to file host websites are stored before expiring.
@@ -97,7 +59,8 @@ Cyberdrop-DL caches the requests made to any website. This setting controls how
- A `str` input is expected to be in the format; `<value> <unit>`, ex: `10 days`.
-### Valid `str` units:
+### Valid `str` units
+
- `year(s)`
- `month(s)`
- `week(s)`
@@ -114,8 +77,46 @@ You can set the value to `0` to disable caching
## `forum_cache_expire_after`
-| Type | Default |
-|----------------|----------|
-| `timedelta`, `str` or `int` | `4 weeks`|
+| Type | Default |
+| --------------------------- | --------- |
+| `timedelta`, `str` or `int` | `4 weeks` |
Same as `file_host_cache_expire_after` but applied to forums requests.
+
+## `max_simultaneous_downloads`
+
+| Type | Default |
+| ------------- | ------- |
+| `PositiveInt` | `15` |
+
+This is the maximum number of files that can be downloaded simultaneously.
+
+## `max_simultaneous_downloads_per_domain`
+
+| Type | Default |
+| ------------- | ------- |
+| `PositiveInt` | `3` |
+
+This is the maximum number of files that can be downloaded from a single domain simultaneously.
+
+Some domains have internal limits set by the program, such as `bunkrr`, `cyberfile.me`, etc.
+
+## `rate_limit`
+
+| Type | Default |
+| ------------- | ------- |
+| `PositiveInt` | `50` |
+
+{% hint style="info" %}
+This setting specifies speed and it's interpreted as `<value> / second`. ex: `50` means `50 requests / second`
+{% endhint %}
+
+This is the maximum number of requests that can be made by the program per second.
+
+## `read_timeout`
+
+| Type | Default |
+| ------------- | ------- |
+| `PositiveInt` | `300` |
+
+The number of seconds to wait while reading data from a website before timing out. If it's a download, it will be retried and won't count against the `download_attempts` limit.
diff --git a/docs/reference/configuration-options/global-settings/ui-options.md b/docs/reference/configuration-options/global-settings/ui-options.md
index 554dbff8a..fd10fc92f 100644
--- a/docs/reference/configuration-options/global-settings/ui-options.md
+++ b/docs/reference/configuration-options/global-settings/ui-options.md
@@ -5,36 +5,32 @@ description: These are the options for controlling the UI of the program
## `downloading_item_limit`
-
-| Type | Default |
-|----------------|----------|
-| `PositiveInt` | `5`|
+| Type | Default |
+| ------------- | ------- |
+| `PositiveInt` | `5` |
This is the limit on the number of items shown in the UI (while downloading) before they are simply added to the overflow number (`and <X> other files`)
## `refresh_rate`
-
-| Type | Default |
-|----------------|----------|
-| `PositiveInt` | `10`|
+| Type | Default |
+| ------------- | ------- |
+| `PositiveInt` | `10` |
This is the refresh rate per second for the UI.
## `scraping_item_limit`
-
-| Type | Default |
-|----------------|----------|
-| `PositiveInt` | `5`|
+| Type | Default |
+| ------------- | ------- |
+| `PositiveInt` | `5` |
This is the limit on the number of items shown in the UI (while scraping) before they are simply added to the overflow number (`and <X> other links`)
## `vi_mode`
-
-| Type | Default |
-|----------------|----------|
-| `bool` | `false`|
+| Type | Default |
+| ------ | ------- |
+| `bool` | `false` |
This enables vi/vim key binds while editing/entering text in CDL.
diff --git a/docs/reference/configuration-options/settings/browser_cookies.md b/docs/reference/configuration-options/settings/browser_cookies.md
index 3486fb345..1f44a8221 100644
--- a/docs/reference/configuration-options/settings/browser_cookies.md
+++ b/docs/reference/configuration-options/settings/browser_cookies.md
@@ -8,16 +8,16 @@ The `user-agent` config value **MUST** match the `user-agent` of the browser fro
## `auto_import`
-| Type | Default |
-|----------------|----------|
-| `bool` | `false`|
+| Type | Default |
+| ------ | ------- |
+| `bool` | `false` |
Toggles automatic import of cookies at the start of each run
## `browsers`
-| Type | Default |
-|----------------|----------|
+| Type | Default |
+| ---------------- | ---------- |
| `list[BROWSERS]` | `[chrome]` |
List of browsers to use for extraction. Each item must be a supported browser's name, separated by commas
@@ -40,7 +40,6 @@ List of browsers to use for extraction. Each item must be a supported browser's
| Vivaldi | :x: | :white_check_mark: | :white_check_mark: |
| W3M | :x: | :white_check_mark: | :x: |
-
{% hint style="info" %}
If cookies exists on multiple selected browsers, the cookies from the last browser in the list will have priority
{% endhint %}
@@ -51,8 +50,8 @@ If the value entered is `null` or an empty list, no cookies will be extracted fr
## `sites`
-| Type | Default |
-|----------------|----------|
+| Type | Default |
+| --------------- | --------------- |
| `list[DOMAINS]` | `[<ALL_SITES>]` |
List of domains to extract cookies from. You can put any domain on the list, but only sites supported by Cyberdrop-DL will be taken into account
diff --git a/docs/reference/configuration-options/settings/download_options.md b/docs/reference/configuration-options/settings/download_options.md
index 16fa22e16..b75b45212 100644
--- a/docs/reference/configuration-options/settings/download_options.md
+++ b/docs/reference/configuration-options/settings/download_options.md
@@ -2,8 +2,8 @@
## `block_download_sub_folders`
-| Type | Default |
-|----------------|----------|
+| Type | Default |
+| ------ | ------- |
| `bool` | `false` |
When this is set to `true`, downloads that would be in a folder structure like:
@@ -16,8 +16,8 @@ will be changed to:
## `disable_download_attempts`
-| Type | Default |
-|----------------|----------|
+| Type | Default |
+| ------ | ------- |
| `bool` | `false` |
By default the program will retry a download 10 times. You can set this to `true` to disable it and always retry until the download completes.
@@ -26,8 +26,8 @@ However, to make sure the program will not run endlessly, there are certain situ
## `disable_file_timestamps`
-| Type | Default |
-|----------------|----------|
+| Type | Default |
+| ------ | ------- |
| `bool` | `false` |
By default the program will do it's absolute best to try and find when a file was uploaded. It'll then set the `last modified`, `last accessed` and `created` dates on the file to match.
@@ -36,32 +36,83 @@ Setting this to `true` will disable this function, and the dates for those metad
## `include_album_id_in_folder_name`
-| Type | Default |
-|----------------|----------|
+| Type | Default |
+| ------ | ------- |
| `bool` | `false` |
Setting this to `true` will include the album ID (random alphanumeric string) of the album in the download folder name.
## `include_thread_id_in_folder_name`
-| Type | Default |
-|----------------|----------|
+| Type | Default |
+| ------ | ------- |
| `bool` | `false` |
Setting this to `true` will include the thread ID (random alphanumeric string) of the forum thread in the download folder name.
+## `maximum_number_of_children`
+
+| Type | Default |
+| ---------------------- | ------- |
+| `list[NonNegativeInt]` | `[]` |
+
+Limit the number of items to scrape using a tuple of up to 4 positions. Each position defines the maximum number of sub-items (`children_limit`) an specific type of `scrape_item` will have:
+
+1. Max number of children from a **FORUM URL**
+2. Max number of children from a **FORUM POST**
+3. Max number of children from a **FILE HOST PROFILE**
+4. Max number of children from a **FILE HOST ALBUM**
+
+Using `0` on any position means no limit on the number of children for that type of `scrape_item`. Any tailing value not supplied is assumed as `0`
+
+### Examples
+
+{% tabs %}
+{% tab title="example 1" %}
+Limit **FORUM** scrape to 15 posts max, grab all links and media within those posts, but only scrape a maximum of 10 items from each link in a post:
+
+```shell
+--maximum-number-of-children 15 0 10
+
+```
+{% endtab %}
+
+{% tab title="example 2" %}
+Only grab the first link from each post in a forum, but that link will have no `children_limit`:
+
+```shell
+--maximum-number-of-children 0 1
+```
+
+{% endtab %}
+
+{% tab title="example 3" %}
+Only grab the first **POST** / **ALBUM** from a **FILE_HOST_PROFILE**
+```shell
+--maximum-number-of-children 0 0 1
+```
+{% endtab %}
+
+{% tab title="example 4" %}
+No **FORUM** limit, no **FORUM_POST** limit, no **FILE_HOST_PROFILE** limit, maximum of 20 items from any **FILE_HOST_ALBUM**:
+```shell
+ --maximum-number-of-children 0 0 0 20
+```
+{% endtab %}
+{% endtabs %}
+
## `remove_domains_from_folder_names`
-| Type | Default |
-|----------------|----------|
+| Type | Default |
+| ------ | ------- |
| `bool` | `false` |
Setting this to `true` will remove the "(DOMAIN)" portion of folder names on new downloads.
## `remove_generated_id_from_filenames`
-| Type | Default |
-|----------------|----------|
+| Type | Default |
+| ------ | ------- |
| `bool` | `false` |
Setting this to `true` will remove the alphanumeric ID added to the end of filenames by some websites like `cyberdrop.me`.
@@ -72,25 +123,25 @@ Supported formats: `.rar` `.7z` `.tar` `.gz` `.bz2` `.zip`
## `scrape_single_forum_post`
-| Type | Default |
-|----------------|----------|
+| Type | Default |
+| ------ | ------- |
| `bool` | `false` |
Setting this to `true` will prevent Cyberdrop-DL to scrape entire thread if an individual post link was provided as input.
## `separate_posts`
-| Type | Default |
-|----------------|----------|
+| Type | Default |
+| ------ | ------- |
| `bool` | `false` |
Setting this to `true` will separate content from forum and site posts into separate folders. Only affects sites which have 'posts': `Forums`, `reddit`, `coomer`, `kemono` and `nekohouse`.
## `separate_posts_format`
-| Type | Default |
-|----------------|----------|
-| `NonEmptyStr` | `{default}`|
+| Type | Default |
+| ------------- | ----------- |
+| `NonEmptyStr` | `{default}` |
This is the format for the directory created when using `--separate-posts`.
@@ -110,79 +161,28 @@ Not all sites support all possible flags. Ex: Posts from reddit only support the
Setting it to `{default}` will use the default format, which is different for each crawler:
-| Site | Default Format |
-|----------------|----------|
-| `Coomer`, `Kemono` an `Nekohouse` | `{date} - {title}`|
-| `Forums` | `post-{number}`|
-| `Reddit` | `{title}`|
+| Site | Default Format |
+| --------------------------------- | ------------------ |
+| `Coomer`, `Kemono` an `Nekohouse` | `{date} - {title}` |
+| `Forums` | `post-{number}` |
+| `Reddit` | `{title}` |
-## `skip_download_mark_complete`
+## `skip_download_mark_completed`
-| Type | Default |
-|----------------|----------|
+| Type | Default |
+| ------ | ------- |
| `bool` | `false` |
Setting this to `true` will skip the download process for every file and mark them as downloaded in the database.
## `skip_referer_seen_before`
-| Type | Default |
-|----------------|----------|
+| Type | Default |
+| ------ | ------- |
| `bool` | `false` |
Setting this to `true` will skip downloading files from any referer that have been scraped before. The file (s) will always be skipped, regardless of whether the referer was successfully scraped or not
-## `maximum_number_of_children`
-
-| Type | Default |
-|----------------|----------|
-| `list[NonNegativeInt]` | `[]` |
-
-Limit the number of items to scrape using a tuple of up to 4 positions. Each position defines the maximum number of sub-items (`children_limit`) an specific type of `scrape_item` will have:
-
-1. Max number of children from a **FORUM URL**
-2. Max number of children from a **FORUM POST**
-3. Max number of children from a **FILE HOST PROFILE**
-4. Max number of children from a **FILE HOST ALBUM**
-
-Using `0` on any position means no limit on the number of children for that type of `scrape_item`. Any tailing value not supplied is assumed as `0`
-
-### Examples
-
-{% tabs %}
-{% tab title="example 1" %}
-Limit **FORUM** scrape to 15 posts max, grab all links and media within those posts, but only scrape a maximum of 10 items from each link in a post:
-
-```shell
---maximum-number-of-children 15 0 10
-
-```
-{% endtab %}
-
-{% tab title="example 2" %}
-Only grab the first link from each post in a forum, but that link will have no `children_limit`:
-
-```shell
---maximum-number-of-children 0 1
-```
-
-{% endtab %}
-
-{% tab title="example 3" %}
-Only grab the first **POST** / **ALBUM** from a **FILE_HOST_PROFILE**
-```shell
---maximum-number-of-children 0 0 1
-```
-{% endtab %}
-
-{% tab title="example 4" %}
-No **FORUM** limit, no **FORUM_POST** limit, no **FILE_HOST_PROFILE** limit, maximum of 20 items from any **FILE_HOST_ALBUM**:
-```shell
- --maximum-number-of-children 0 0 0 20
-```
-{% endtab %}
-{% endtabs %}
-
## `maximum_thread_depth`
diff --git a/docs/reference/configuration-options/settings/dupe_cleanup_options.md b/docs/reference/configuration-options/settings/dupe_cleanup_options.md
index eebec836b..9743f6492 100644
--- a/docs/reference/configuration-options/settings/dupe_cleanup_options.md
+++ b/docs/reference/configuration-options/settings/dupe_cleanup_options.md
@@ -8,24 +8,30 @@ Cyberdrop-DL maintains an internal database of all downloaded files, indexed by
1. Set `hashing` to `IN_PLACE` or `POST_DOWNLOAD`
2. Set `auto_dedupe` to `true`
-## `hashing`
+## `add_md5_hash`
-| Type | Default | Restrictions |
-|----------------|----------| ----------- |
-| `HASHING` | `OFF` | Must be `OFF`, `IN_PLACE` or `POST_DOWNLOAD`|
+| Type | Default |
+| ------ | ------- |
+| `bool` | `false` |
-There are three possible options for hashing:
+If enabled, calculates the `md5` hash for every downloaded file and store it in the internal database. This allows the program to match files with sites that provide hash information before downloading them, skipping the download altogether if a match is found
-1. `OFF`: disables hashing
-2. `IN_PLACE`: performs hashing after each download
-3. `POST_DOWNLOAD`: performs hashing after all downloads have completed
+{% hint style="warning" %}
+`md5` was the default hashing algorithm of Cyberdrop-DL V5. If you have a V5 database that you'd like to import into V6, it's recommended to enable `md5` hashing to ensure new downloads match previously hashed files.
+{% endhint %}
-The default hashing algorithm is `xxh128`. You can enable additional hashing algorithms, but you can not replace the default.
+## `add_sha256_hash`
+
+| Type | Default |
+| ------ | ------- |
+| `bool` | `false` |
+
+If enabled, calculates the `sha256` hash for every downloaded file and store it in the internal database. This allows the program to match files with sites that provide hash information before downloading them, skipping the download altogether if a match is found
## `auto_dedupe`
-| Type | Default |
-|----------------|----------|
+| Type | Default |
+| ------ | ------- |
| `bool` | `false` |
Enables deduping files functionality. Needs `hashing` to be enabled
@@ -34,30 +40,24 @@ The auto_dedupe feature scans the database for files with matching hashes and si
Deletion will only occur if two or more matching files are found during the database search.
-## `add_sha256_hash`
-
-| Type | Default |
-|----------------|----------|
-| `bool` | `false` |
-
-If enabled, calculates the `sha256` hash for every downloaded file and store it in the internal database. This allows the program to match files with sites that provide hash information before downloading them, skipping the download altogether if a match is found
+## `hashing`
-## `add_md5_hash`
+| Type | Default | Restrictions |
+| --------- | ------- | -------------------------------------------- |
+| `HASHING` | `OFF` | Must be `OFF`, `IN_PLACE` or `POST_DOWNLOAD` |
-| Type | Default |
-|----------------|----------|
-| `bool` | `false` |
+There are three possible options for hashing:
-If enabled, calculates the `md5` hash for every downloaded file and store it in the internal database. This allows the program to match files with sites that provide hash information before downloading them, skipping the download altogether if a match is found
+1. `OFF`: disables hashing
+2. `IN_PLACE`: performs hashing after each download
+3. `POST_DOWNLOAD`: performs hashing after all downloads have completed
-{% hint style="warning" %}
-`md5` was the default hashing algorithm of Cyberdrop-DL V5. If you have a V5 database that you'd like to import into V6, it's recommended to enable `md5` hashing to ensure new downloads match previously hashed files.
-{% endhint %}
+The default hashing algorithm is `xxh128`. You can enable additional hashing algorithms, but you can not replace the default.
## `send_deleted_to_trash`
-| Type | Default |
-|----------------|----------|
+| Type | Default |
+| ------ | ------- |
| `bool` | `false` |
Deduped files are sent to the trash bin instead of being deleted
diff --git a/docs/reference/configuration-options/settings/file_size_limits.md b/docs/reference/configuration-options/settings/file_size_limits.md
index 0366c11b0..bb319db37 100644
--- a/docs/reference/configuration-options/settings/file_size_limits.md
+++ b/docs/reference/configuration-options/settings/file_size_limits.md
@@ -2,11 +2,11 @@
You can provide the maximum and minimum file size for each file "type".
-All options on this category take a `Bytes` input, which is an `int` representing a number of bytes with optional suffix with the unit. Ex: `6000000` and `6MB` are both valid values
+All options on this category take a `ByteSize` input ([more info here](../special_setting_types.md)).
-|Type|Default|
-|---|---|
-|`ByteSize`|`0`|
+| Type | Default |
+| ---------- | ------- |
+| `ByteSize` | `0` |
Setting any of these options to `0` means that limit is `disabled`
diff --git a/docs/reference/configuration-options/settings/files.md b/docs/reference/configuration-options/settings/files.md
index 2090333b5..f03409aab 100644
--- a/docs/reference/configuration-options/settings/files.md
+++ b/docs/reference/configuration-options/settings/files.md
@@ -1,19 +1,19 @@
# Files
+## `download_folder`
+
+| Type | Default |
+| ------ | ----------- |
+| `Path` | `Downloads` |
+
+The path to the folder you want Cyberdrop-DL to download files to.
+
## `input_file`
-| Type | Default |
-|----------------|----------|
+| Type | Default |
+| ------ | ----------------------------------- |
| `Path` | `AppData/Configs/{config}/URLs.txt` |
The path to the text file containing the URLs you want to download. Each line should be a single URL.
You can also use `html` code. Cyberdrop-DL will parse all the links on the HTML
-
-## `download_folder`
-
-| Type | Default |
-|----------------|----------|
-| `Path` | `Downloads` |
-
-The path to the folder you want Cyberdrop-DL to download files to.
diff --git a/docs/reference/configuration-options/settings/ignore_options.md b/docs/reference/configuration-options/settings/ignore_options.md
index 767addf43..d1b48b462 100644
--- a/docs/reference/configuration-options/settings/ignore_options.md
+++ b/docs/reference/configuration-options/settings/ignore_options.md
@@ -1,33 +1,33 @@
# Ignore Options
-## `exclude_videos`
+## `exclude_audio`
-| Type | Default |
-|----------------|----------|
+| Type | Default |
+| ------ | ------- |
| `bool` | `false` |
-When this is set to `true`, the program will skip downloading video files.
+When this is set to `true`, the program will skip downloading audio files.
## `exclude_images`
-| Type | Default |
-|----------------|----------|
+| Type | Default |
+| ------ | ------- |
| `bool` | `false` |
When this is set to `true`, the program will skip downloading image files.
-## `exclude_audio`
+## `exclude_videos`
-| Type | Default |
-|----------------|----------|
+| Type | Default |
+| ------ | ------- |
| `bool` | `false` |
-When this is set to `true`, the program will skip downloading audio files.
+When this is set to `true`, the program will skip downloading video files.
## `exclude_other`
-| Type | Default |
-|----------------|----------|
+| Type | Default |
+| ------ | ------- |
| `bool` | `false` |
When this is set to `true`, the program will skip downloading non media files files.
@@ -44,34 +44,34 @@ When this is set to `true`, the program will skip downloading files without an e
CDL internally assumes any file without an extension is an `.mp4` file. That means any option that applies to videos like `--exclude-videos` and `--minimum-video-size` will apply to them. The actual file will still be downloaded without an extension
{% endhint %}
-## `ignore_coomer_ads`
+## `filename_regex_filter`
-| Type | Default |
-|----------------|----------|
-| `bool` | `false` |
+| Type | Default |
+| ----------------------- | ------- |
+| `NonEmptyStr` or `null` | `null` |
-When this is set to `true`, the program will skip post marked as ads by models in coomer profiles.
+Any download with a filename that matches this regex expression will be skipped
-## `skip_hosts`
+## `ignore_coomer_ads`
-| Type | Default | Additional Info |
-|---------------------|----------| --------------- |
-| `list[NonEmptyStr]` | `[]` | This is an [`AdditiveArg`](../special_setting_types.md#additiveargs)
+| Type | Default |
+| ------ | ------- |
+| `bool` | `false` |
-You can supply hosts that you'd like the program to skip, to not scrape/download from them. This setting accepts any domain, even if they are no supported.
+When this is set to `true`, the program will skip post marked as ads by models in coomer profiles.
## `only_hosts`
-| Type | Default | Additional Info |
-|---------------------|----------| --------------- |
-| `list[NonEmptyStr]` | `[]` | This is an [`AdditiveArg`](../special_setting_types.md#additiveargs
+| Type | Default | Additional Info |
+| ------------------- | ------- | ------------------------------------------------------------------- |
+| `list[NonEmptyStr]` | `[]` | This is an [`AdditiveArg`](../special_setting_types.md#additiveargs) |
You can supply hosts that you'd like the program to exclusively scrape/download from. This setting accepts any domain, even if they are no supported.
-## `filename_regex_filter`
+## `skip_hosts`
-| Type | Default |
-|----------------|----------|
-| `NonEmptyStr` or `null` | `null` |
+| Type | Default | Additional Info |
+| ------------------- | ------- | -------------------------------------------------------------------- |
+| `list[NonEmptyStr]` | `[]` | This is an [`AdditiveArg`](../special_setting_types.md#additiveargs) |
-Any download with a filename that matches this regex expression will be skipped
+You can supply hosts that you'd like the program to skip, to not scrape/download from them. This setting accepts any domain, even if they are no supported.
diff --git a/docs/reference/configuration-options/settings/logs.md b/docs/reference/configuration-options/settings/logs.md
index bef15f9e6..fbb06b537 100644
--- a/docs/reference/configuration-options/settings/logs.md
+++ b/docs/reference/configuration-options/settings/logs.md
@@ -1,78 +1,75 @@
# Logs
-## `log_folder`
-
-| Type | Default |
-|----------------|----------|
-| `Path` | `AppData/Configs/{config}/Logs` |
-
-The path to the location you want Cyberdrop-DL to store logs in.
+## `download_error_urls`
-## `main_log`
+| Type | Default | Restrictions |
+| ------ | ------------------------- | --------------------------------------------- |
+| `Path` | `Download_Error_URLs.csv` | extension will always be overridden to `.csv` |
-| Type | Default | Restrictions |
-|----------------|----------| ------------ |
-| `Path` | `downloader.log` | extension will always be overridden to `.log` |
+Path of the download error log. For relative paths, the final path will be `log_folder` / `download_error_urls`
-Path of main log file. For relative paths, the final path will be `log_folder` / `main_log`
+Cyberdrop-DL will output the links it fails to download, the reason and their origin in CSV format.
## `last_forum_post`
-| Type | Default | Restrictions |
-|----------------|----------| ------------ |
+| Type | Default | Restrictions |
+| ------ | ------------------------------ | --------------------------------------------- |
| `Path` | `Last_Scraped_Forum_Posts.csv` | extension will always be overridden to `.csv` |
Path of the forum-post log file. For relative paths, the final path will be `log_folder` / `last_forum_post`
Cyberdrop-DL will store the link to the last forum posts it scraped from a given forum thread in this file.
-## `unsupported_urls`
-
-| Type | Default | Restrictions |
-|----------------|----------| ------------ |
-| `Path` | `Unsupported_URLs.csv` | extension will always be overridden to `.csv` |
-
-Path of the unsupported log file. For relative paths, the final path will be `log_folder` / `unsupported_urls`
+## `log_folder`
-Cyberdrop-DL will output links it can't download to this file.
+| Type | Default |
+| ------ | ------------------------------- |
+| `Path` | `AppData/Configs/{config}/Logs` |
-## `download_error_urls`
+The path to the location you want Cyberdrop-DL to store logs in.
-| Type | Default | Restrictions |
-|----------------|----------| ------------ |
-| `Path` | `Download_Error_URLs.csv` | extension will always be overridden to `.csv` |
+## `log_line_width`
-Path of the download error log. For relative paths, the final path will be `log_folder` / `download_error_urls`
+| Type | Default | Restrictions |
+| ------------- | ------- | ------------ |
+| `PositiveInt` | `240` | `>=50` |
-Cyberdrop-DL will output the links it fails to download, the reason and their origin in CSV format.
+Line width to use when writing to the main log file
-## `scrape_error_urls`
+## `logs_expire_after`
-| Type | Default | Restrictions |
-|----------------|----------| ------------ |
-| `Path` | `Scrape_Error_URLs.csv` | extension will always be overridden to `.csv` |
+| Type | Default |
+| --------------------- | ------- |
+| `timedelta` or `null` | `null` |
-What you want Cyberdrop-DL to call the scrape error log. For relative paths, the final path will be `log_folder` / `scrape_error_urls`
+With `rotate_logs` enabled, this setting specifies the retention period for log files before they are deleted
-Cyberdrop-DL will output the links it fails to scrape, the reason and their origin in CSV format.
+- A `timedelta` input is expected to be a valid ISO 8601 timespan, ex: `P10DT2H30M10S`
+- An `int` input is assumed to be the number of days
+- A `str` input is expected to be in the format; `<value> <unit>`, ex: `10 days`.
+- A `null` value means disabled (never delete any logs)
-## `webhook`
+{% hint style="warning" %}
+Any `.log` or `.csv` file within `log_folder` will be deleted, even if CDL did not create them
+{% endhint %}
-| Type | Default | Restrictions |
-|----------------|----------| ------------ |
-| `AppriseURL` or `null` | `null` | The scheme of the URL must be `http` or `https` |
+{% hint style="info" %}
+Log files with an absolute path not relative to `log_folder` will never be deleted
+{% endhint %}
-The URL of a webhook that you want to send download stats to (Ex: Discord). You can add the optional tag `attach_logs=` as a prefix to include a copy of the main log as an attachment.
+## `main_log`
-Example:
+| Type | Default | Restrictions |
+| ------ | ---------------- | --------------------------------------------- |
+| `Path` | `downloader.log` | extension will always be overridden to `.log` |
-> `attach_logs=https://discord.com/api/webhooks/webhook_id/webhook_token`
+Path of main log file. For relative paths, the final path will be `log_folder` / `main_log`
## `rotate_logs`
-| Type | Default |
-|----------------|----------|
-| `bool` | `false`|
+| Type | Default |
+| ------ | ------- |
+| `bool` | `false` |
If enabled, Cyberdrop-DL will add the current date and time as a suffix to each log file, in the format `YYMMDD_HHMMSS`
@@ -80,36 +77,34 @@ Every log file will be created inside a sub folder with the current date
This will prevent overriding old log files
+## `scrape_error_urls`
+| Type | Default | Restrictions |
+| ------ | ----------------------- | --------------------------------------------- |
+| `Path` | `Scrape_Error_URLs.csv` | extension will always be overridden to `.csv` |
-## `logs_expire_after`
-
-| Type | Default |
-|-------------------|----------|
-| `timedelta` or `null`| `null`|
+What you want Cyberdrop-DL to call the scrape error log. For relative paths, the final path will be `log_folder` / `scrape_error_urls`
-With `rotate_logs` enabled, this setting specifies the retention period for log files before they are deleted
+Cyberdrop-DL will output the links it fails to scrape, the reason and their origin in CSV format.
-- A `timedelta` input is expected to be a valid ISO 8601 timespan, ex: `P10DT2H30M10S`
-- An `int` input is assumed to be the number of days
-- A `str` input is expected to be in the format; `<value> <unit>`, ex: `10 days`.
-- A `null` value will disable automatic delection of logs
+## `unsupported_urls`
+| Type | Default | Restrictions |
+| ------ | ---------------------- | --------------------------------------------- |
+| `Path` | `Unsupported_URLs.csv` | extension will always be overridden to `.csv` |
-{% hint style="warning" %}
-Any `.log` or `.csv` file within `log_folder` will be deleted, even if CDL did not create them
-{% endhint %}
+Path of the unsupported log file. For relative paths, the final path will be `log_folder` / `unsupported_urls`
-{% hint style="info" %}
-Log files with an absolute path not relative to `log_folder` will never be deleted
-{% endhint %}
+Cyberdrop-DL will output links it can't download to this file.
+## `webhook`
+| Type | Default | Restrictions |
+| ---------------------- | ------- | ----------------------------------------------- |
+| `AppriseURL` or `null` | `null` | The scheme of the URL must be `http` or `https` |
-## `log_line_width`
+The URL of a webhook that you want to send download stats to (Ex: Discord). You can add the optional tag `attach_logs=` as a prefix to include a copy of the main log as an attachment.
-| Type | Default | Restrictions |
-|----------------|----------|--------------|
-| `PositiveInt` | `240`| `>=50`|
+Example:
-Line width to use when writing to the main log file
+> `attach_logs=https://discord.com/api/webhooks/webhook_id/webhook_token`
diff --git a/docs/reference/configuration-options/settings/runtime_options.md b/docs/reference/configuration-options/settings/runtime_options.md
index d79d3305d..734e986b3 100644
--- a/docs/reference/configuration-options/settings/runtime_options.md
+++ b/docs/reference/configuration-options/settings/runtime_options.md
@@ -2,32 +2,11 @@
These are higher level options that effect the overarching functions of the program.
-## `log_level`
-
-| Type | Default |
-|----------------|----------|
-| `NonNegativeInt` | `10`|
-
-Defines the logging level for messages, according to [Python logging levels](https://docs.python.org/3/library/logging.html#levels). Only messages with a level equal or greater than this setting will be logged, with the exception of `NOTSET` which will disable all logging messages. Setting a value above 50 will also disable logging entirely.
-
-| Level | Value | Description |
-|----------------|----------|----------|
-| `NOTSET` | 0 | Disables all log messages |
-| `DEBUG` | 10 | Offers detailed information, typically useful to troubleshoot problems |
-| `INFO` | 20 | Provides general information about scrape and download progress|
-| `WARNING` | 30 | Highlights a potential issue or something that might need attention (e.g. `Login wasn't provided for <FORUM>`)|
-| `ERROR` | 40 | Denotes a serious problem preventing Cyberdrop-DL to execute some function |
-| `CRITICAL` | 50 | Fatal error that causes Cyberdrop-DL to exit immediately |
-
-{% hint style="info" %}
-Using anything other that `DEBUG` makes troubleshooting issues harder. Practically speaking, this should only be adjusted if you expect CDL to run for an extended period (with a large number of input URLs) to minimize the log files sizes
-{% endhint %}
-
## `console_log_level`
-| Type | Default |
-|----------------|----------|
-| `NonNegativeInt` | `100`|
+| Type | Default |
+| ---------------- | ------- |
+| `NonNegativeInt` | `100` |
Same as `log_level` but it controls which messages are shown on the console.
@@ -35,66 +14,47 @@ Same as `log_level` but it controls which messages are shown on the console.
This option is ignored unless CDL is running with `--no-ui`
{% endhint %}
-## `ignore_history`
-
-| Type | Default |
-|----------------|----------|
-| `bool` | `false`|
-
-By default, the program tracks your downloads to prevent downloading the same files multiple times, helping to save time and reduce strain on the servers you're downloading from.
-
-Setting this to `true` will cause the program to ignore the history, and will allow you to re-download files.
-
-## `skip_check_for_partial_files`
-
-
-| Type | Default |
-|----------------|----------|
-| `bool` | `false`|
-
-After a run is complete, the program will do a check to see if any partially downloaded files remain in the downloads folder and will notify you of them.
-
-Setting this to `true` will skip this check.
+## `deep_scrape`
-## `skip_check_for_empty_folders`
+| Type | Default |
+| ------ | ------- |
+| `bool` | `false` |
+Cyberdrop-DL uses a some tricks to try to reduce the number of requests it needs to make while scraping a site. However, this may cause a few links to be skipped. Use `--deep-scrape` to disable this functionality and always make a new request.
-| Type | Default |
-|----------------|----------|
-| `bool` | `false`|
+This setting is temporary and will always reset to `false` after each run
-After a run is complete, the program will do a check (and remove) any empty files and folders in the download and scan folder.
+{% hint style="warning" %}
+Use this option only when absolutely necessary, as it will significantly increase the number of requests being made.
-Setting this to `true` will disable this functionality.
+For example, scraping an album normally takes one single request. However, with `--deep-scrape`, CDL will make `n` requests per album, where `n` is the total number of items in the album
+{% endhint %}
## `delete_partial_files`
-
-| Type | Default |
-|----------------|----------|
-| `bool` | `false`|
+| Type | Default |
+| ------ | ------- |
+| `bool` | `false` |
The program will leave partial files alone as they will be used to resume downloads on subsequent runs.
Setting this to `true` will remove any partial downloads from the download folder.
-## `send_unsupported_to_jdownloader`
-
+## `ignore_history`
-| Type | Default |
-|----------------|----------|
-| `bool` | `false`|
+| Type | Default |
+| ------ | ------- |
+| `bool` | `false` |
-Cyberdrop-DL has integration with jdownloader. This will allow you to download URLs that Cyberdrop-DL finds but do not support. However, this setting is disabled by default.
+By default, the program tracks your downloads to prevent downloading the same files multiple times, helping to save time and reduce strain on the servers you're downloading from.
-Setting this to `true`, will send unsupported links over.
+Setting this to `true` will cause the program to ignore the history, and will allow you to re-download files.
## `jdownloader_autostart`
-
-| Type | Default |
-|----------------|----------|
-| `bool` | `false`|
+| Type | Default |
+| ------ | ------- |
+| `bool` | `false` |
Setting this to `true` will make jdownloader start downloads as soon as they are sent.
@@ -102,9 +62,9 @@ This option has no effect unless `send_unsupported_to_jdownloader` is `true`
## `jdownloader_download_dir`
-| Type | Default |
-|----------------|----------|
-| `Path` or `null` | `null`|
+| Type | Default |
+| ---------------- | ------- |
+| `Path` or `null` | `null` |
The `download_dir` jdownloader will use. A `null` value (the default) will make jdownloader use the same `download_dir` as Cyberdrop-DL. Use this option as path mapping when jdownloader is running on a different host / docker.
@@ -112,47 +72,81 @@ This option has no effect unless `send_unsupported_to_jdownloader` is `true`
## `jdownloader_whitelist`
-| Type | Default |
-|----------------|----------|
-| `list[NonEmptyStr]` | `[]`|
+| Type | Default |
+| ------------------- | ------- |
+| `list[NonEmptyStr]` | `[]` |
List of domain names. An unsupported URL will only be sent to jdownloader if its host is found on the list. An empty whitelist (the default) will disable this functionality, sending any unsupported URL to jdownloader
This option has no effect unless `send_unsupported_to_jdownloader` is `true`
+## `log_level`
-## `update_last_forum_post`
+| Type | Default |
+| ---------------- | ------- |
+| `NonNegativeInt` | `10` |
-| Type | Default |
-|----------------|----------|
-| `bool` | `false`|
+Defines the logging level for messages, according to [Python logging levels](https://docs.python.org/3/library/logging.html#levels). Only messages with a level equal or greater than this setting will be logged, with the exception of `NOTSET` which will disable all logging messages. Setting a value above 50 will also disable logging entirely.
-Updates `input_file` content, adding the last scraped post id to every forum thread URL
+| Level | Value | Description |
+| ---------- | ----- | -------------------------------------------------------------------------------------------------------------- |
+| `NOTSET` | 0 | Disables all log messages |
+| `DEBUG` | 10 | Offers detailed information, typically useful to troubleshoot problems |
+| `INFO` | 20 | Provides general information about scrape and download progress |
+| `WARNING` | 30 | Highlights a potential issue or something that might need attention (e.g. `Login wasn't provided for <FORUM>`) |
+| `ERROR` | 40 | Denotes a serious problem preventing Cyberdrop-DL to execute some function |
+| `CRITICAL` | 50 | Fatal error that causes Cyberdrop-DL to exit immediately |
-## `deep_scrape`
+{% hint style="info" %}
+Using anything other that `DEBUG` makes troubleshooting issues harder. Practically speaking, this should only be adjusted if you expect CDL to run for an extended period (with a large number of input URLs) to minimize the log files sizes
+{% endhint %}
-| Type | Default |
-|----------------|----------|
-| `bool` | `false`|
+## `send_unsupported_to_jdownloader`
-Cyberdrop-DL uses a some tricks to try to reduce the number of requests it needs to make while scraping a site. However, this may cause a few links to be skipped. Use `--deep-scrape` to disable this functionality and always make a new request.
+| Type | Default |
+| ------ | ------- |
+| `bool` | `false` |
-This setting is temporary and will always reset to `false` after each run
+Cyberdrop-DL has integration with jdownloader. This will allow you to download URLs that Cyberdrop-DL finds but do not support. However, this setting is disabled by default.
-{% hint style="warning" %}
-Use this option only when absolutely necessary, as it will significantly increase the number of requests being made.
+Setting this to `true`, will send unsupported links over.
-For example, scraping an album normally takes one single request. However, with `--deep-scrape`, CDL will make `n` requests per album, where `n` is the total number of items in the album
-{% endhint %}
+## `skip_check_for_empty_folders`
+
+| Type | Default |
+| ------ | ------- |
+| `bool` | `false` |
+
+After a run is complete, the program will do a check (and remove) any empty files and folders in the download and scan folder.
+
+Setting this to `true` will disable this functionality.
+
+## `skip_check_for_partial_files`
+
+| Type | Default |
+| ------ | ------- |
+| `bool` | `false` |
+
+After a run is complete, the program will do a check to see if any partially downloaded files remain in the downloads folder and will notify you of them.
+
+Setting this to `true` will skip this check.
## `slow_download_speed`
-| Type | Default |
-|----------------|----------|
-| `ByteSize` | `0`|
+| Type | Default |
+| ---------- | ------- |
+| `ByteSize` | `0` |
{% hint style="info" %}
This setting specifies speed and it's interpreted as `<value> / second`. ex: `8MB` means `8MB/s`
{% endhint %}
Downloads with a speed lower than this value for more than 10 seconds will be skipped. Set to `0` to disable
+
+## `update_last_forum_post`
+
+| Type | Default |
+| ------ | ------- |
+| `bool` | `false` |
+
+Updates `input_file` content, adding the last scraped post id to every forum thread URL
diff --git a/docs/reference/configuration-options/settings/sorting.md b/docs/reference/configuration-options/settings/sorting.md
index 4a257d92c..87c6cebb4 100644
--- a/docs/reference/configuration-options/settings/sorting.md
+++ b/docs/reference/configuration-options/settings/sorting.md
@@ -18,9 +18,9 @@ Shared path flags:
## `scan_folder`
-| Type | Default |
-|----------------|----------|
-| `Path` or `null` | `null`|
+| Type | Default |
+| ---------------- | ------- |
+| `Path` or `null` | `null` |
Sets the starting point for the file scan
@@ -30,30 +30,29 @@ If this is set to `null` (the default), `download_dir` is used instead
## `sort_downloads`
-| Type | Default |
-|----------------|----------|
-| `bool` | `false`|
+| Type | Default |
+| ------ | ------- |
+| `bool` | `false` |
Setting this to `true` will allow Cyberdrop-DL to sort downloads after a run is complete.
## `sort_folder`
-| Type | Default |
-|----------------|----------|
-| `Path` | `Downloads/Cyberdrop-DL Sorted Downloads`|
+| Type | Default |
+| ------ | ----------------------------------------- |
+| `Path` | `Downloads/Cyberdrop-DL Sorted Downloads` |
This is the path to the folder you'd like sorted downloads to be stored in.
-
{% hint style="warning" %}
Setting `sort_folder` to the same value as `scan_folder` is not officiality supported and will lead to undefined results
{% endhint %}
## `sort_incrementer_format`
-| Type | Default |
-|----------------|----------|
-| `NonEmptyStr` | ` ({i})`|
+| Type | Default |
+| ------------- | ------- |
+| `NonEmptyStr` | `({i})` |
When naming collisions happen, Cyberdrop-DL will rename files automatically
@@ -63,9 +62,9 @@ You can modify the format as needed, but it must include `{i}` to specify where
## `sorted_audio`
-| Type | Default |
-|----------------|----------|
-| `NonEmptyStr` or `null` | `{sort_dir}/{base_dir}/Audio/{filename}{ext}`|
+| Type | Default |
+| ----------------------- | --------------------------------------------- |
+| `NonEmptyStr` or `null` | `{sort_dir}/{base_dir}/Audio/{filename}{ext}` |
This is the format for the directory structure and naming scheme for audio files. Set to `null` skip sorting audio files
@@ -81,9 +80,9 @@ Unique Path Flags:
## `sorted_image`
-| Type | Default |
-|----------------|----------|
-| `NonEmptyStr` or `null` | `{sort_dir}/{base_dir}/Images/{filename}{ext}`|
+| Type | Default |
+| ----------------------- | ---------------------------------------------- |
+| `NonEmptyStr` or `null` | `{sort_dir}/{base_dir}/Images/{filename}{ext}` |
This is the format for the directory structure and naming scheme for image files. Set to `null` skip sorting image files
@@ -97,9 +96,9 @@ Unique Path Flags:
## `sorted_video`
-| Type | Default |
-|----------------|----------|
-| `NonEmptyStr` or `null`| `{sort_dir}/{base_dir}/Video/{filename}{ext}`|
+| Type | Default |
+| ----------------------- | --------------------------------------------- |
+| `NonEmptyStr` or `null` | `{sort_dir}/{base_dir}/Video/{filename}{ext}` |
This is the format for the directory structure and naming scheme for video files. Set to `null` skip sorting video files
@@ -119,12 +118,11 @@ Unique Path Flags:
>
> `resolution`: `width`x`height` ex. 1080x1920
-
## `sorted_other`
-| Type | Default |
-|----------------|----------|
-| `NonEmptyStr` or `null` | `{sort_dir}/{base_dir}/Other/{filename}{ext}`|
+| Type | Default |
+| ----------------------- | --------------------------------------------- |
+| `NonEmptyStr` or `null` | `{sort_dir}/{base_dir}/Other/{filename}{ext}` |
This is the format for the directory structure and naming scheme for other files. Set to `null` skip sorting other files
@@ -138,7 +136,7 @@ To define the end of a group, insert an group with no name. (`---` or `===`)
Here is an example URL file with two groups:
-```
+```text
https://example.com/file1.jpg
=== Group 1
https://example.com/file2.jpg
@@ -155,7 +153,7 @@ https://example.com/file7.jpg
Those downloads would be sorted as follows:
| Loose Files | Group 1 | Group 2 |
-|-------------|-----------|-----------|
+| ----------- | --------- | --------- |
| file1.jpg | file2.jpg | file5.jpg |
| file4.jpg | file3.jpg | file6.jpg |
| file7.jpg | | |
diff --git a/docs/reference/configuration-options/special_setting_types.md b/docs/reference/configuration-options/special_setting_types.md
index 4f525a69f..b0489f782 100644
--- a/docs/reference/configuration-options/special_setting_types.md
+++ b/docs/reference/configuration-options/special_setting_types.md
@@ -5,41 +5,11 @@ icon: sparkles
# Special Setting Types
-## `BoolFlag`
-
-A special kind of `bool`. Within a config file, it can have a `true` or `false` value. However, when used via CLI, the value is assumed from the flag name. The normal name is `true`, and prefixing the name with `--no` means `false`.
-
-### Examples:
-
-| Value you used | Value CDL interpreted |
-| -------------------- | --------------------- |
-| `--auto-dedupe` | auto-dedupe: `true` |
-| `--no-auto-dedupe` | auto-dedupe: `false` |
-
-## `ByteSize`
-
-A special kind of `int` that accepts suffixes like `GB`, `MiB` and `KB`
-
-In conformance with IEC 80000-13 Standard, `1KB` means `1000 bytes`, and `1KiB` means `1024 bytes`. In general, including a middle 'i' will cause the unit to be interpreted as a power of 2, rather than a power of 10.
-
-### Examples:
-
-| Value you used | Value CDL interpreted |
-| -------------- | --------------------- |
-| `1GB` | `1.000.000.000 bytes` |
-| `512` | `512 bytes` |
-| `1MiB` | `1.048.576 bytes` |
-
-{% hint style="info" %}
-`ByteSize` is also used for some settings to specify speed and it's interpreted as `<value> / second`. ex: `8MB` means `8MB/s`
-{% endhint %}
-
-
## `AdditiveArgs`
Special type for some settings that accept multiple values as input (`lists` or `sets`). When passing values as CLI arguments, if the first value is `+`, any value after it will be added to the values specified in the config file instead of overriding it. Similarly, if the first value is `-`, any value after it will be removed from the values specified in the config
-### Examples:
+### Examples
If you have the following `skip_hosts` setting in you config file:
@@ -52,12 +22,41 @@ skip_hosts:
You will get the following results:
-| Value you used | Value CDL interpreted | Details |
-| -------------- | --------------------- | ------- |
-| `--skip-host instagram.com` | `[instagram.com]` | config values were overridden by CLI values |
-| `--skip-host "+" instagram.com` | `[drive.google.com, youtube.com, facebook.com, instagram.com]` | config values and CLI values were merged |
-| `--skip-host "-" drive.google.com youtube.com` | `[facebook.com]` | CLI values were removed from the config values |
+| Value you used | Value CDL interpreted | Details |
+| ---------------------------------------------- | -------------------------------------------------------------- | ---------------------------------------------- |
+| `--skip-host instagram.com` | `[instagram.com]` | config values were overridden by CLI values |
+| `--skip-host "+" instagram.com` | `[drive.google.com, youtube.com, facebook.com, instagram.com]` | config values and CLI values were merged |
+| `--skip-host "-" drive.google.com youtube.com` | `[facebook.com]` | CLI values were removed from the config values |
{% hint style="info" %}
Always use quotes for "+" and "-" to make sure your shell does not try to parse them as additional flags
{% endhint %}
+
+## `BoolFlag`
+
+A special kind of `bool`. Within a config file, it can have a `true` or `false` value. However, when used via CLI, the value is assumed from the flag name. The normal name is `true`, and prefixing the name with `--no` means `false`.
+
+### Examples
+
+| Value you used | Value CDL interpreted |
+| ------------------ | --------------------- |
+| `--auto-dedupe` | auto-dedupe: `true` |
+| `--no-auto-dedupe` | auto-dedupe: `false` |
+
+## `ByteSize`
+
+A special kind of `int` that accepts suffixes like `GB`, `MiB` and `KB`
+
+In conformance with IEC 80000-13 Standard, `1KB` means `1000 bytes`, and `1KiB` means `1024 bytes`. In general, including a middle 'i' will cause the unit to be interpreted as a power of 2, rather than a power of 10.
+
+### Examples
+
+| Value you used | Value CDL interpreted |
+| -------------- | --------------------- |
+| `1GB` | `1.000.000.000 bytes` |
+| `512` | `512 bytes` |
+| `1MiB` | `1.048.576 bytes` |
+
+{% hint style="info" %}
+`ByteSize` is also used for some settings to specify speed and it's interpreted as `<value> / second`. ex: `8MB` means `8MB/s`
+{% endhint %}
diff --git a/docs/reference/supported-websites.md b/docs/reference/supported-websites.md
index e730eb6af..263922135 100644
--- a/docs/reference/supported-websites.md
+++ b/docs/reference/supported-websites.md
@@ -6,51 +6,51 @@ icon: globe-pointer
# Supported Websites
## Content Hosts
-| Domain | Supported URL Paths |
-|-----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-| Bunkrr | Albums: `/a/...` <br> Videos: `/v/...` <br> Others: `/f/...` <br> Direct links |
-| Coomer | Fansly Model: `/fansly/user/<user>` <br> Favorites: `/favorites` <br> Search: `/search?...` <br> Individual Post: `/<service>/user/<user>/post/<post_id>` <br> OnlyFans Model: `/onlyfans/user/<user>` <br> Direct links |
-| Comics.8muses.com | Album: `/comics/album/...` |
-| Cyberdrop | Albums: `/a/...` <br> Files: `/f/...` <br> Direct links |
-| Cyberfile | Files: `/...` <br> Folders: `/folder/...` <br> Shared: `/shared/...` |
-| E-Hentai | Albums: `/g/...` <br> Files: `/s/...` |
-| Erome | Album: `/a/...` <br> Profile: `/...` |
-| Fapello | Individual Post: `/.../...` <br> Model: `/...` |
-| GoFile | Album: `/d/...`|
-| HotPic | Album: `/album/...` <br> Image: `/i/...`|
-| ImageBam | Album: `/view/...` <br> Image: `/view/...` <br> Direct links |
-| ibb imgbb | Album: `/album/...` <br> Image: `/...`|
-| Iceyfile.com | Files: `/...` <br> Folders: `/folder/...` <br> Shared: `/shared/...` |
-| ImgBox | Album: `/g/...` <br> Images: `/...` <br> Direct links |
-| Img.kiwi | Album: `/album/...` <br> Image: `/image/...` <br> Direct links |
-| Imgur | Album: `/a/...` <br> Gallery: `/gallery/...` <br> Image: `/...` <br> Direct links |
-| JPG.Church <br> JPG.Homes <br> JPG.Pet <br> JPEG.Pet <br> JPG1.Su <br> JPG2.Su <br> JPG3.Su <br> JPG4.Su <br> JPG5.Su | Album: `/a/...` <br> Image: `/img/...` <br> Direct links |
-| Imagepond.net | Album: `/a/...` <br> Image: `/img/...` <br> Video: `/video/..` <br> Direct links |
-| Kemono | Afdian Model: `/afdian/user/<user>` <br> Boosty Model: `/boosty/user/<user>` <br> DLSite Model: `/dlsite/user/<user>` <br> Discord Server Channel: `/discord/server/...#...` <br> FanBox Model: `/fanbox/user/<user>` <br> Fantia Model: `/fantia/user/<user>` <br> Gumroad Model: `/gumroad/user/<user>` <br> Individual Post: `/<service>/user/<user>/post/<post_id>` <br> Patreon Model: `/patreon/user/<user>` <br> Search: `/search?...` <br> SubscribeStar Model: `/subscribestar/user/<user>` <br> Direct Links |
-| Members.luscious.net | Album: `/albums/...` |
-| MediaFire | File: `/file/...` <br>Folder: `/folder/...`|
-| Nekohouse.su | Fanbox Model: `/fanbox/user/<user>` <br> Fantia Model: `/fantia/user/<user>` <br> Fantia Products Model: `/fantia_products/user/<user>` <br> Individual Post: `/service/user/<user>/post/...` <br> Subscribestar Model: `/subscribestar/user/<user>` <br> Twitter Model: `/twitter/user/<user>` <br> Direct Links |
-| Nudostar.TV | Model: `/models/...`|
-| OmegaScans | Chapter: `/series/.../...` <br> Series: `/series/...` <br> Direct links |
-| PimpAndHost | Album: `/album/...` <br> Image: `/image/...`|
-| PixHost.to | Gallery: `/gallery/...` <br> Image: `/show/...` |
-| PixelDrain | File: `/u/...` <br> Folder: `/l/...` |
-| PornPics.com | Categories `/categories/....` <br> Channels `/channels/...` <br> Gallery `/galleries/...` <br> Pornstars `/pornstars/...` <br> Search `/?q=<query>` <br> Tags `/tags/...` <br> Direct Links |
-| PostImg | Album: `/gallery/...` <br> Image: `/...` <br> Direct links |
-| RealBooru | File page (id query) <br> Tags (tags query) |
-| RedGifs | User: `/users/<user>` <br> Video: `/watch/...` |
-| Rule34Vault | File page: `/post/...` <br> Playlist: `/playlists/view/...` <br> Tag: `/...` |
-| Rule34.XXX | File page (id query) <br> Tags (tags query) |
-| Rule34.XYZ | File page: `/post/...` <br> Tag: `/...` |
-| Saint | Albums: `/a/...` <br> Video: `/embed/...`, `/d/...` <br> Direct links |
-| SendVid.com | Videos: `/...` <br> Embeds: `/embed/...` <br> Direct Links |
-| Scrolller | Subreddit: `/r/...` |
-| TikTok | User: `/@<user>` <br> Video: `/@<user>/video/<video_id>` <br> Photo: `/@<user>/photo/<photo_id>` <br> |
-| Toonily | Chapter: `/webtoon/.../...` <br> Webtoon: `/webtoon/...` <br> Direct links |
-| Tokyomotion.net | Albums: `/user/<user>/albums/` , `/album/<album_id>` <br> Photo: `/photo/<photo_id>` , `/user/<user>/favorite/photos` <br> Playlist: `/user/<user>/favorite/videos` <br> Profiles: `/user/<user>` <br> Search Results: `/search?...` <br> Video: `/video/<video_id>` |
-| XBunkr | Albums: `/a/...` <br> Direct Links|
-| XXXBunker | Video: `/<video_id>` <br> Search Results: `/search/...` |
+| Domain | Supported URL Paths |
+| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| Bunkrr | Albums: `/a/...` <br> Videos: `/v/...` <br> Others: `/f/...` <br> Direct links |
+| Comics.8muses.com | Album: `/comics/album/...` |
+| Coomer | Fansly Model: `/fansly/user/<user>` <br> Favorites: `/favorites` <br> Search: `/search?...` <br> Individual Post: `/<service>/user/<user>/post/<post_id>` <br> OnlyFans Model: `/onlyfans/user/<user>` <br> Direct links |
+| Cyberdrop | Albums: `/a/...` <br> Files: `/f/...` <br> Direct links |
+| Cyberfile | Files: `/...` <br> Folders: `/folder/...` <br> Shared: `/shared/...` |
+| E-Hentai | Albums: `/g/...` <br> Files: `/s/...` |
+| Erome | Album: `/a/...` <br> Profile: `/...` |
+| Fapello | Individual Post: `/.../...` <br> Model: `/...` |
+| GoFile | Album: `/d/...` |
+| HotPic | Album: `/album/...` <br> Image: `/i/...` |
+| Iceyfile.com | Files: `/...` <br> Folders: `/folder/...` <br> Shared: `/shared/...` |
+| ImageBam | Album: `/view/...` <br> Image: `/view/...` <br> Direct links |
+| Imagepond.net | Album: `/a/...` <br> Image: `/img/...` <br> Video: `/video/..` <br> Direct links |
+| Img.kiwi | Album: `/album/...` <br> Image: `/image/...` <br> Direct links |
+| ImgBox | Album: `/g/...` <br> Images: `/...` <br> Direct links |
+| ImgBB / ibb | Album: `/album/...` <br> Image: `/...` |
+| Imgur | Album: `/a/...` <br> Gallery: `/gallery/...` <br> Image: `/...` <br> Direct links |
+| JPG5.Su | Album: `/a/...` <br> Image: `/img/...` <br> Direct links |
+| Kemono | Afdian Model: `/afdian/user/<user>` <br> Boosty Model: `/boosty/user/<user>` <br> DLSite Model: `/dlsite/user/<user>` <br> Discord Server Channel: `/discord/server/...#...` <br> FanBox Model: `/fanbox/user/<user>` <br> Fantia Model: `/fantia/user/<user>` <br> Gumroad Model: `/gumroad/user/<user>` <br> Individual Post: `/<service>/user/<user>/post/<post_id>` <br> Patreon Model: `/patreon/user/<user>` <br> Search: `/search?...` <br> SubscribeStar Model: `/subscribestar/user/<user>` <br> Direct Links |
+| MediaFire | File: `/file/...` <br>Folder: `/folder/...` |
+| Members.luscious.net | Album: `/albums/...` |
+| Nekohouse.su | Fanbox Model: `/fanbox/user/<user>` <br> Fantia Model: `/fantia/user/<user>` <br> Fantia Products Model: `/fantia_products/user/<user>` <br> Individual Post: `/service/user/<user>/post/...` <br> Subscribestar Model: `/subscribestar/user/<user>` <br> Twitter Model: `/twitter/user/<user>` <br> Direct Links |
+| Nudostar.TV | Model: `/models/...` |
+| OmegaScans | Chapter: `/series/.../...` <br> Series: `/series/...` <br> Direct links |
+| PimpAndHost | Album: `/album/...` <br> Image: `/image/...` |
+| PixHost.to | Gallery: `/gallery/...` <br> Image: `/show/...` |
+| PixelDrain | File: `/u/...` <br> Folder: `/l/...` |
+| PornPics.com | Categories `/categories/....` <br> Channels `/channels/...` <br> Gallery `/galleries/...` <br> Pornstars `/pornstars/...` <br> Search `/?q=<query>` <br> Tags `/tags/...` <br> Direct Links |
+| PostImg | Album: `/gallery/...` <br> Image: `/...` <br> Direct links |
+| RealBooru | File page (id query) <br> Tags (tags query) |
+| RedGifs | User: `/users/<user>` <br> Video: `/watch/...` |
+| Rule34.XXX | File page (id query) <br> Tags (tags query) |
+| Rule34.XYZ | File page: `/post/...` <br> Tag: `/...` |
+| Rule34Vault | File page: `/post/...` <br> Playlist: `/playlists/view/...` <br> Tag: `/...` |
+| Saint | Albums: `/a/...` <br> Video: `/embed/...`, `/d/...` <br> Direct links |
+| Scrolller | Subreddit: `/r/...` |
+| SendVid.com | Videos: `/...` <br> Embeds: `/embed/...` <br> Direct Links |
+| TikTok | User: `/@<user>` <br> Video: `/@<user>/video/<video_id>` <br> Photo: `/@<user>/photo/<photo_id>` <br> |
+| Tokyomotion.net | Albums: `/user/<user>/albums/` , `/album/<album_id>` <br> Photo: `/photo/<photo_id>` , `/user/<user>/favorite/photos` <br> Playlist: `/user/<user>/favorite/videos` <br> Profiles: `/user/<user>` <br> Search Results: `/search?...` <br> Video: `/video/<video_id>` |
+| Toonily | Chapter: `/webtoon/.../...` <br> Webtoon: `/webtoon/...` <br> Direct links |
+| XBunkr | Albums: `/a/...` <br> Direct Links |
+| XXXBunker | Video: `/<video_id>` <br> Search Results: `/search/...` |
### Password Protected Content Hosts
@@ -58,12 +58,12 @@ Cyberdrop-DL can download password protected files and folders from these hosts.
Example: `https://cyberfile.me/folder/xUGg?password=1234`
-| Domain |
-| ------------------------------------------- |
-| GoFile |
-| Cyberfile |
-| Chevereto Sites (`jpg5`, `imagepond` or `img.kiwi`) |
-| Iceyfile.com |
+| Domain |
+| ------------------------------------------------------- |
+| GoFile |
+| Cyberfile |
+| Chevereto Sites (`JPG5`, `ImagePond.net` or `img.kiwi`) |
+| Iceyfile.com |
### Additional Content Hosts with Real-Debrid
@@ -73,15 +73,15 @@ Supported domains via Real-Debrid include `mega.nz`, `rapidgator`, `google drive
## Forums
-| Domain | Supported URL Paths |
-| --------------------------- | -------------------- |
-| Bellazon.com | Threads: `/main/topic/<thread_name>` |
-| CelebForum | Threads: `/threads/<thread_name>`|
-| F95Zone | Threads: `/threads/<thread_name>`|
-| Forums.AllPornComix.com | Threads: `/threads/<thread_name>`|
-| Forums.SocialMediaGirls.com | Threads: `/threads/<thread_name>`|
-| LeakedModels | Threads: `/forum/threads/<thread_name>`|
-| Nudostar | Threads: `/forum/threads/<thread_name>`|
+| Domain | Supported URL Paths |
+| --------------------------- | --------------------------------------------------------------------------------------------------------- |
+| Bellazon.com | Threads: `/main/topic/<thread_name>` |
+| CelebForum | Threads: `/threads/<thread_name>` |
+| F95Zone | Threads: `/threads/<thread_name>` |
+| Forums.AllPornComix.com | Threads: `/threads/<thread_name>` |
+| Forums.SocialMediaGirls.com | Threads: `/threads/<thread_name>` |
+| LeakedModels | Threads: `/forum/threads/<thread_name>` |
+| Nudostar | Threads: `/forum/threads/<thread_name>` |
| Reddit | User: `/user/<user>`, `/user/<user>/...` , `/u/<user>` <br> Subreddit: `/r/<subreddit>` <br> Direct Links |
-| TitsInTops.com | Threads: `/forum/threads/<thread_name>`|
-| XBunker | Threads: `/threads/<thread_name>`|
+| TitsInTops.com | Threads: `/forum/threads/<thread_name>` |
+| XBunker | Threads: `/threads/<thread_name>` |