Bulk asynchronous downloader for multiple file hosts
Python asynciobunkrcyberdropdownloaderdropboxfilestergofilegoogle-drivemediafiremegamega-nzonedrivepatreonpawchivepinterestpixeldraintransfer-ittwitchtwittervk
add error wrapper for cookie extraction
Jules-WinnfieldX7aa78c8899e3
diff --git a/cyberdrop_dl/__init__.py b/cyberdrop_dl/__init__.pyindex 9ec9c0a04..f41e335b7 100644--- a/cyberdrop_dl/__init__.py+++ b/cyberdrop_dl/__init__.py@@ -1 +1 @@-__version__ = "5.0.47"+__version__ = "5.0.48"diff --git a/cyberdrop_dl/utils/args/browser_cookie_extraction.py b/cyberdrop_dl/utils/args/browser_cookie_extraction.pyindex 94286022c..b7af735b4 100644--- a/cyberdrop_dl/utils/args/browser_cookie_extraction.py+++ b/cyberdrop_dl/utils/args/browser_cookie_extraction.py@@ -1,8 +1,11 @@from __future__ import annotations+from functools import wrapsfrom typing import TYPE_CHECKINGimport browser_cookie3+from InquirerPy import inquirer+from rich.console import Consolefrom cyberdrop_dl.utils.dataclasses.supported_domains import SupportedDomains@@ -12,7 +15,25 @@ if TYPE_CHECKING:from cyberdrop_dl.managers.manager import Manager+def cookie_wrapper(func):+ """Wrapper handles errors for url scraping"""+ @wraps(func)+ def wrapper(self, *args, **kwargs):+ try:+ return func(self, *args, **kwargs)+ except PermissionError:+ console = Console()+ console.clear()+ console.print(f"We've encountered a Permissions Error. Please close all browsers and try again.", style="bold red")+ console.print("If you are still having issues, make sure all browsers processes are closed in a Task Manager.", style="bold red")+ console.print("Nothing has been saved.", style="bold red")+ inquirer.confirm(message="Press enter to return menu.").execute()+ return+ return wrapper++# noinspection PyProtectedMember+@cookie_wrapperdef get_forum_cookies(manager: Manager, browser: str) -> None:"""Get the cookies for the forums"""auth_args: Dict = manager.config_manager.authentication_data@@ -31,6 +52,7 @@ def get_forum_cookies(manager: Manager, browser: str) -> None:# noinspection PyProtectedMember+@cookie_wrapperdef get_ddos_guard_cookies(manager: Manager, browser: str) -> None:"""Get the cookies for DDOS-Guard"""auth_args: Dict = manager.config_manager.authentication_datadiff --git a/pyproject.toml b/pyproject.tomlindex 85291b252..171e6d0bd 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -1,6 +1,6 @@[tool.poetry]name = "cyberdrop-dl"-version = "5.0.47"+version = "5.0.48"description = "Bulk downloader for multiple file hosts"authors = ["Jules Winnfield <[email protected]>"]readme = "README.md"