Skip to content

Bulk asynchronous downloader for multiple file hosts

Fix invalid link references

Jules-WinnfieldX70edb1b584d4
diff --git a/cyberdrop_dl/__init__.py b/cyberdrop_dl/__init__.py
index 413e8b7d2..e8b5cf65d 100644
--- a/cyberdrop_dl/__init__.py
+++ b/cyberdrop_dl/__init__.py
@@ -1 +1 @@
-__version__ = "5.1.8"
+__version__ = "5.1.9"
diff --git a/cyberdrop_dl/utils/utilities.py b/cyberdrop_dl/utils/utilities.py
index ed235e5d7..fddb0ee33 100644
--- a/cyberdrop_dl/utils/utilities.py
+++ b/cyberdrop_dl/utils/utilities.py
@@ -52,26 +52,26 @@ def error_handling_wrapper(func):
"""Wrapper handles errors for url scraping"""
@wraps(func)
async def wrapper(self, *args, **kwargs):
+ if isinstance(args[0], URL):
+ link = args[0]
+ else:
+ link = args[0].url
+
try:
return await func(self, *args, **kwargs)
except NoExtensionFailure:
- await log(f"Scrape Failed: {args[0].url} (No File Extension)", 40)
- await self.manager.log_manager.write_scrape_error_log(args[0].url, " No File Extension")
+ await log(f"Scrape Failed: {link} (No File Extension)", 40)
+ await self.manager.log_manager.write_scrape_error_log(link, " No File Extension")
await self.manager.progress_manager.scrape_stats_progress.add_failure("No File Extension")
except FailedLoginFailure:
- await log(f"Scrape Failed: {args[0].url} (Failed Login)", 40)
- await self.manager.log_manager.write_scrape_error_log(args[0].url, " Failed Login")
+ await log(f"Scrape Failed: {link} (Failed Login)", 40)
+ await self.manager.log_manager.write_scrape_error_log(link, " Failed Login")
await self.manager.progress_manager.scrape_stats_progress.add_failure("Failed Login")
except InvalidContentTypeFailure:
- await log(f"Scrape Failed: {args[0].url} (Invalid Content Type Received)", 40)
- await self.manager.log_manager.write_scrape_error_log(args[0].url, " Invalid Content Type Received")
+ await log(f"Scrape Failed: {link} (Invalid Content Type Received)", 40)
+ await self.manager.log_manager.write_scrape_error_log(link, " Invalid Content Type Received")
await self.manager.progress_manager.scrape_stats_progress.add_failure("Invalid Content Type")
except Exception as e:
- if isinstance(args[0], URL):
- link = args[0]
- else:
- link = args[0].url
-
if hasattr(e, 'status'):
if hasattr(e, 'message'):
await log(f"Scrape Failed: {link} ({e.status} - {e.message})", 40)
diff --git a/pyproject.toml b/pyproject.toml
index d73ec8bc0..c5bc04a37 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[tool.poetry]
name = "cyberdrop-dl"
-version = "5.1.8"
+version = "5.1."
description = "Bulk downloader for multiple file hosts"
authors = ["Jules Winnfield <[email protected]>"]
readme = "README.md"