Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
move header check
Browse files Browse the repository at this point in the history
  • Loading branch information
Jules-WinnfieldX committed Feb 8, 2024
1 parent 7a24d3c commit 6e3d1b2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cyberdrop_dl/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "5.1.67"
__version__ = "5.1.68"
7 changes: 4 additions & 3 deletions cyberdrop_dl/managers/client_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,6 @@ async def check_http_status(self, response: ClientResponse, download: bool = Fal
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")
Expand All @@ -96,4 +93,8 @@ async def check_http_status(self, response: ClientResponse, download: bool = Fal
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}")
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down

0 comments on commit 6e3d1b2

Please sign in to comment.