Bulk asynchronous downloader for multiple file hosts
Python asynciobunkrcyberdropdownloaderdropboxfilestergofilegoogle-drivemediafiremegamega-nzonedrivepatreonpawchivepinterestpixeldraintransfer-ittwitchtwittervk
refactor: reduce curl usage at runtime
NTFSvolumeebc90d0f3616
diff --git a/cyberdrop_dl/managers/client_manager.py b/cyberdrop_dl/managers/client_manager.pyindex 58601e10a..c2eb339f0 100644--- a/cyberdrop_dl/managers/client_manager.py+++ b/cyberdrop_dl/managers/client_manager.py@@ -14,7 +14,6 @@ import certififrom aiohttp import ClientResponse, ClientSession, ContentTypeErrorfrom aiolimiter import AsyncLimiterfrom bs4 import BeautifulSoup-from curl_cffi.requests.models import Response as CurlResponsefrom yarl import URLfrom cyberdrop_dl.clients.download_client import DownloadClient@@ -26,6 +25,8 @@ from cyberdrop_dl.utils.logger import log, log_spacerfrom cyberdrop_dl.utils.utilities import get_soup_from_responseif TYPE_CHECKING:+ from curl_cffi.requests.models import Response as CurlResponse+from cyberdrop_dl.managers.manager import Managerfrom cyberdrop_dl.utils.data_enums_classes.url_objects import ScrapeItem@@ -163,7 +164,7 @@ class ClientManager:origin: ScrapeItem | URL | None = None,) -> None:"""Checks the HTTP status code and raises an exception if it's not acceptable."""- is_curl = isinstance(response, CurlResponse)+ is_curl = not isinstance(response, ClientResponse)status = response.status_code if is_curl else response.statusheaders = response.headersmessage = Nonediff --git a/cyberdrop_dl/utils/utilities.py b/cyberdrop_dl/utils/utilities.pyindex 8d3c0b778..49cf71b80 100644--- a/cyberdrop_dl/utils/utilities.py+++ b/cyberdrop_dl/utils/utilities.py@@ -15,7 +15,6 @@ import aiofilesimport richfrom aiohttp import ClientConnectorError, ClientResponse, ClientSession, FormDatafrom bs4 import BeautifulSoup-from curl_cffi.requests.models import Response as CurlResponsefrom yarl import URLfrom cyberdrop_dl.clients.errors import (@@ -32,6 +31,7 @@ from cyberdrop_dl.utils.logger import log, log_debug, log_spacer, log_with_colorif TYPE_CHECKING:from collections.abc import Callable+ from curl_cffi.requests.models import Response as CurlResponsefrom rich.text import Textfrom cyberdrop_dl.crawlers import Crawler@@ -415,7 +415,7 @@ def remove_trailing_slash(url: URL) -> URL:async def get_soup_from_response(response: CurlResponse | ClientResponse) -> BeautifulSoup | None:response_text = Nonewith contextlib.suppress(UnicodeDecodeError):- response_text = response.text if isinstance(response, CurlResponse) else await response.text()+ response_text = await response.text() if isinstance(response, ClientResponse) else response.textif not response_text:return