Skip to content

Bulk asynchronous downloader for multiple file hosts

fix: prevent duplicated extensions in custom filenames (#1434)

NTFSvolume27fcac2ff772
diff --git a/cyberdrop_dl/crawlers/crawler.py b/cyberdrop_dl/crawlers/crawler.py
index 106aa23f7..1c8fef75a 100644
--- a/cyberdrop_dl/crawlers/crawler.py
+++ b/cyberdrop_dl/crawlers/crawler.py
@@ -800,7 +800,7 @@ class Crawler(ABC):
) -> str:
calling_args = {name: value for name, value in locals().items() if value is not None and name not in ("self",)}
# remove OS separators (if any)
- stem = sanitize_filename(Path(name).as_posix().replace("/", "-")).strip()
+ stem = sanitize_filename(Path(name).as_posix().replace("/", "-")).strip().removesuffix(ext).strip()
extra_info: list[str] = []
if _placeholder_config.include_file_id and file_id: