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

Commit

Permalink
imgur is a dick, and for some reason not returning proper status' and…
Browse files Browse the repository at this point in the history
… json anymore. So work around
  • Loading branch information
Jules-WinnfieldX committed May 11, 2024
1 parent e75d02d commit c33a377
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 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.3.1"
__version__ = "5.3.2"
3 changes: 3 additions & 0 deletions cyberdrop_dl/clients/download_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ async def _append_content(self, media_item, content: aiohttp.StreamReader, updat
await asyncio.sleep(0)
await f.write(chunk)
await update_progress(len(chunk))
if not content.total_bytes and not media_item.partial_file.stat().st_size:
media_item.partial_file.unlink()
raise DownloadFailure(status=HTTPStatus.NOT_FOUND, message="File is empty")

async def download_file(self, manager: Manager, domain: str, media_item: MediaItem) -> None:
"""Starts a file"""
Expand Down
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.3.1"
version = "5.3.2"
description = "Bulk downloader for multiple file hosts"
authors = ["Jules Winnfield <[email protected]>"]
readme = "README.md"
Expand Down

0 comments on commit c33a377

Please sign in to comment.