Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
Fix DDOSGuard showing as unknown during downloads.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jules-WinnfieldX committed Apr 11, 2024
1 parent 294bb2a commit 9a16a4f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cyberdrop_dl/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "5.2.25"
__version__ = "5.2.26"
12 changes: 11 additions & 1 deletion cyberdrop_dl/downloader/downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>"]
readme = "README.md"
Expand Down

0 comments on commit 9a16a4f

Please sign in to comment.