Skip to content

Bulk asynchronous downloader for multiple file hosts

Ruff fixes

Jacobdbabb9ae6933
diff --git a/cyberdrop_dl/clients/scraper_client.py b/cyberdrop_dl/clients/scraper_client.py
index 6cc6f6cae..b6d81e54c 100644
--- a/cyberdrop_dl/clients/scraper_client.py
+++ b/cyberdrop_dl/clients/scraper_client.py
@@ -146,7 +146,9 @@ class ScraperClient:
content_type = response.headers.get("Content-Type")
assert content_type is not None
if not any(s in content_type.lower() for s in ("html", "text")):
- raise InvalidContentTypeError(message=f"Received {content_type}, was expecting text", origin=origin)
+ raise InvalidContentTypeError(
+ message=f"Received {content_type}, was expecting text", origin=origin
+ )
text = await CachedStreamReader(await response.read()).read()
if with_response_url:
return BeautifulSoup(text, "html.parser"), URL(response.url)
@@ -215,7 +217,9 @@ class ScraperClient:
content_type = response.headers.get("Content-Type")
assert content_type is not None
if "json" not in content_type.lower():
- raise InvalidContentTypeError(message=f"Received {content_type}, was expecting JSON", origin=origin)
+ raise InvalidContentTypeError(
+ message=f"Received {content_type}, was expecting JSON", origin=origin
+ )
return await response.json()
else:
async with client_session.get(
diff --git a/cyberdrop_dl/utils/dataclasses/url_objects.py b/cyberdrop_dl/utils/dataclasses/url_objects.py
index 3b3e8882a..d87d56344 100644
--- a/cyberdrop_dl/utils/dataclasses/url_objects.py
+++ b/cyberdrop_dl/utils/dataclasses/url_objects.py
@@ -1,8 +1,8 @@
from __future__ import annotations
from dataclasses import field
-from typing import TYPE_CHECKING
from pathlib import Path
+from typing import TYPE_CHECKING
from cyberdrop_dl.utils.utilities import sanitize_folder