diff --git a/cyberdrop_dl/__init__.py b/cyberdrop_dl/__init__.py index 3635f879d..758cfa00d 100644 --- a/cyberdrop_dl/__init__.py +++ b/cyberdrop_dl/__init__.py @@ -1 +1 @@ -__version__ = "5.2.25" +__version__ = "5.2.26" diff --git a/cyberdrop_dl/downloader/downloader.py b/cyberdrop_dl/downloader/downloader.py index 51549e9e7..92e537575 100644 --- a/cyberdrop_dl/downloader/downloader.py +++ b/cyberdrop_dl/downloader/downloader.py @@ -15,7 +15,7 @@ import filedate from cyberdrop_dl.clients.download_client import is_4xx_client_error -from cyberdrop_dl.clients.errors import DownloadFailure, InvalidContentTypeFailure +from cyberdrop_dl.clients.errors import DownloadFailure, InvalidContentTypeFailure, DDOSGuardFailure from cyberdrop_dl.utils.utilities import CustomHTTPStatus, FILE_FORMATS, log if TYPE_CHECKING: @@ -67,6 +67,16 @@ async def wrapper(self, *args, **kwargs): await log(f"Download Failed: {media_item.url} with error {e}", 40) await log(f"Download Retrying: {media_item.url} with attempt {media_item.current_attempt}", 20) + except DDOSGuardFailure as e: + media_item = args[0] + if not isinstance(media_item.download_task_id, Field): + await self.manager.progress_manager.file_progress.remove_file(media_item.download_task_id) + await log(f"Download Failed: {media_item.url} with error {e}", 40) + await log(traceback.format_exc(), 40) + await self.manager.progress_manager.download_stats_progress.add_failure("DDOSGuard") + await self.manager.progress_manager.download_progress.add_failed() + break + except InvalidContentTypeFailure as e: media_item = args[0] if not isinstance(media_item.download_task_id, Field): diff --git a/pyproject.toml b/pyproject.toml index 58f66f770..2cdb41ad1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "cyberdrop-dl" -version = "5.2.25" +version = "5.2.26" description = "Bulk downloader for multiple file hosts" authors = ["Jules Winnfield "] readme = "README.md"