Bulk asynchronous downloader for multiple file hosts
Python asynciobunkrcyberdropdownloaderdropboxfilestergofilegoogle-drivemediafiremegamega-nzonedrivepatreonpawchivepinterestpixeldraintransfer-ittwitchtwittervk
fix: do not truncate filename
NTFSvolume16f9970fd015
diff --git a/cyberdrop_dl/clients/scraper_client.py b/cyberdrop_dl/clients/scraper_client.pyindex c3d835665..dfdc5d914 100644--- a/cyberdrop_dl/clients/scraper_client.py+++ b/cyberdrop_dl/clients/scraper_client.py@@ -5,6 +5,7 @@ import jsonfrom contextlib import asynccontextmanagerfrom datetime import datetimefrom functools import wraps+from pathlib import Pathfrom typing import TYPE_CHECKING, Anyimport aiohttp@@ -17,7 +18,7 @@ from curl_cffi.requests.models import Response as CurlResponseimport cyberdrop_dl.utils.constants as constantsfrom cyberdrop_dl.clients.errors import DDOSGuardError, DownloadError, InvalidContentTypeError, ScrapeErrorfrom cyberdrop_dl.utils.logger import log_debug-from cyberdrop_dl.utils.utilities import get_filename_and_ext, get_soup_from_response+from cyberdrop_dl.utils.utilities import get_soup_from_response, sanitize_filenameif TYPE_CHECKING:from collections.abc import Callable@@ -357,8 +358,8 @@ class ScraperClient:log_date = now.strftime(constants.LOGS_DATETIME_FORMAT)url_str = str(url)response_url_str = str(response.url)- stem = f"{url_str[: self.max_html_stem_len]}_{log_date}"- filename, _ = get_filename_and_ext(f"{stem}.html")+ clean_url = sanitize_filename(Path(url_str).as_posix().replace("/", "-"))+ filename = f"{clean_url[: self.max_html_stem_len]}_{log_date}.html"file_path = self.pages_folder / filenameinfo = {"crawler": domain,