Skip to content

Bulk asynchronous downloader for multiple file hosts

move header check

Jules-WinnfieldX6e3d1b24c197
diff --git a/cyberdrop_dl/__init__.py b/cyberdrop_dl/__init__.py
index 420245a77..f00a4430a 100644
--- a/cyberdrop_dl/__init__.py
+++ b/cyberdrop_dl/__init__.py
@@ -1 +1 @@
-__version__ = "5.1.67"
\ No newline at end of file
+__version__ = "5.1.68"
\ No newline at end of file
diff --git a/cyberdrop_dl/managers/client_manager.py b/cyberdrop_dl/managers/client_manager.py
index 629692c2f..bbe056dd3 100644
--- a/cyberdrop_dl/managers/client_manager.py
+++ b/cyberdrop_dl/managers/client_manager.py
@@ -76,9 +76,6 @@ class ClientManager:
headers = response.headers
response_url = response.url
- if not headers.get('Content-Type'):
- raise DownloadFailure(status=CustomHTTPStatus.IM_A_TEAPOT, message="No content-type in response header")
-
if download:
if headers.get('ETag') in ['"eb669b6362e031fa2b0f1215480c4e30"', '"a9e4cee098dc6f1e09ec124299f26b30"']:
raise DownloadFailure(status="Bunkr Maintenance", message="Bunkr under maintenance")
@@ -96,4 +93,8 @@ class ClientManager:
response_text = await response.text()
if "<title>DDoS-Guard</title>" in response_text:
raise DownloadFailure(status="DDOS-Guard", message="DDoS-Guard detected")
+
+ if not headers.get('Content-Type'):
+ raise DownloadFailure(status=CustomHTTPStatus.IM_A_TEAPOT, message="No content-type in response header")
+
raise DownloadFailure(status=status, message=f"HTTP status code {status}: {phrase}")
diff --git a/pyproject.toml b/pyproject.toml
index 605929f1f..87e686175 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[tool.poetry]
name = "cyberdrop-dl"
-version = "5.1.67"
+version = "5.1.68"
description = "Bulk downloader for multiple file hosts"
authors = ["Jules Winnfield <[email protected]>"]
readme = "README.md"