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

Commit

Permalink
Fix issues with bunkr
Browse files Browse the repository at this point in the history
Fix issues with non-existent content types.
  • Loading branch information
Jules-WinnfieldX committed Mar 3, 2024
1 parent 5715a79 commit 4441ec8
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 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.77"
__version__ = "5.1.78"
2 changes: 1 addition & 1 deletion cyberdrop_dl/clients/download_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ async def _download(self, domain: str, manager: Manager, media_item: MediaItem,
await self.client_manager.check_http_status(resp, download=True)
content_type = resp.headers.get('Content-Type')
ext = Path(media_item.filename).suffix.lower()
if any(s in content_type.lower() for s in ('html', 'text')) and ext not in FILE_FORMATS['Text']:
if content_type and any(s in content_type.lower() for s in ('html', 'text')) and ext not in FILE_FORMATS['Text']:
raise InvalidContentTypeFailure(message=f"Received {content_type}, was expecting other")

if resp.status != HTTPStatus.PARTIAL_CONTENT and file.is_file():
Expand Down
2 changes: 1 addition & 1 deletion cyberdrop_dl/scraper/crawlers/bunkrr_crawler.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ async def album(self, scrape_item: ScrapeItem) -> None:
filename = card_listing.select_one("div[class*=details]").select_one("p").text
file_ext = "." + filename.split(".")[-1]
if file_ext.lower() not in FILE_FORMATS['Images'] and file_ext.lower() not in FILE_FORMATS['Videos']:
raise Exception()
raise FileNotFoundError()
image_obj = file.select_one("img")
src = image_obj.get("src")
src = src.replace("/thumbs", "")
Expand Down
6 changes: 3 additions & 3 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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.77"
version = "5.1.78"
description = "Bulk downloader for multiple file hosts"
authors = ["Jules Winnfield <[email protected]>"]
readme = "README.md"
Expand Down

1 comment on commit 4441ec8

@gashtal
Copy link
Contributor

@gashtal gashtal commented on 4441ec8 Mar 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Jules-WinnfieldX Thank you for the quick fix; I ran into a download failure a few hours ago and was about to report it, but this commit already fixed it. 😄

Please sign in to comment.