Skip to content

Bulk asynchronous downloader for multiple file hosts

Fix title safe, and new line chars/tabs

Jules-WinnfieldX5f7be9654bb9
diff --git a/cyberdrop_dl/__init__.py b/cyberdrop_dl/__init__.py
index 1e0f5c76d..f2a9cdfd0 100644
--- a/cyberdrop_dl/__init__.py
+++ b/cyberdrop_dl/__init__.py
@@ -1 +1 @@
-__version__ = "4.0.93"
+__version__ = "4.0.94"
diff --git a/cyberdrop_dl/base_functions/base_functions.py b/cyberdrop_dl/base_functions/base_functions.py
index 46b4abf03..ff640a119 100644
--- a/cyberdrop_dl/base_functions/base_functions.py
+++ b/cyberdrop_dl/base_functions/base_functions.py
@@ -71,6 +71,9 @@ async def sanitize(name: str) -> str:
async def make_title_safe(title: str) -> str:
"""Simple sanitization to remove illegal characters from titles and trim the length to be less than 60 chars"""
+ title = title.replace("\n", "").strip()
+ title = title.replace("\t", "").strip()
+ title = re.sub(' +', ' ', title)
title = re.sub(r'[\\*?:"<>|./]', "-", title)
title = title[:60].strip()
return title
diff --git a/cyberdrop_dl/crawlers/Cyberdrop_Spider.py b/cyberdrop_dl/crawlers/Cyberdrop_Spider.py
index e843dbf27..f1561ae55 100644
--- a/cyberdrop_dl/crawlers/Cyberdrop_Spider.py
+++ b/cyberdrop_dl/crawlers/Cyberdrop_Spider.py
@@ -46,7 +46,7 @@ class CyberdropCrawler:
return album_obj
title = soup.select_one("h1[id=title]").get_text()
- title = await make_title_safe(title.replace("\n", "").strip())
+ title = await make_title_safe(title)
if title is None:
title = url.name
elif self.include_id: