Skip to content

Bulk asynchronous downloader for multiple file hosts

404 for gofile proper handling

Jules-WinnfieldXfd975ce2e009
diff --git a/cyberdrop_dl/__init__.py b/cyberdrop_dl/__init__.py
index 8d1bfbac7..21b8279c5 100644
--- a/cyberdrop_dl/__init__.py
+++ b/cyberdrop_dl/__init__.py
@@ -1 +1 @@
-__version__ = "5.2.18"
+__version__ = "5.2.19"
diff --git a/cyberdrop_dl/managers/client_manager.py b/cyberdrop_dl/managers/client_manager.py
index 22cffd309..7fc96212d 100644
--- a/cyberdrop_dl/managers/client_manager.py
+++ b/cyberdrop_dl/managers/client_manager.py
@@ -7,11 +7,11 @@ from typing import TYPE_CHECKING
import aiohttp
import certifi
-from aiohttp import ClientResponse
+from aiohttp import ClientResponse, ContentTypeError
from aiolimiter import AsyncLimiter
from cyberdrop_dl.clients.download_client import DownloadClient
-from cyberdrop_dl.clients.errors import DownloadFailure, DDOSGuardFailure
+from cyberdrop_dl.clients.errors import DownloadFailure, DDOSGuardFailure, ScrapeFailure
from cyberdrop_dl.clients.scraper_client import ScraperClient
from cyberdrop_dl.utils.utilities import CustomHTTPStatus
@@ -84,6 +84,14 @@ class ClientManager:
if HTTPStatus.OK <= status < HTTPStatus.BAD_REQUEST:
return
+
+ if "gofile" in response.url.host.lower():
+ try:
+ JSON_Resp = await response.json()
+ if "notFound" in JSON_Resp["status"]:
+ raise ScrapeFailure(404, "Does Not Exist")
+ except ContentTypeError:
+ pass
try:
phrase = HTTPStatus(status).phrase
diff --git a/cyberdrop_dl/scraper/crawlers/gofile_crawler.py b/cyberdrop_dl/scraper/crawlers/gofile_crawler.py
index a7ac839a9..3edcef451 100644
--- a/cyberdrop_dl/scraper/crawlers/gofile_crawler.py
+++ b/cyberdrop_dl/scraper/crawlers/gofile_crawler.py
@@ -60,9 +60,6 @@ class GoFileCrawler(Crawler):
else:
raise ScrapeFailure(e.status, e.message)
- if JSON_Resp["status"] != "ok":
- raise ScrapeFailure(404, "Does Not Exist")
-
JSON_Resp = JSON_Resp['data']
title = await self.create_title(JSON_Resp["name"], content_id, None)
diff --git a/poetry.lock b/poetry.lock
index d04a7ff98..70751768a 100644
--- a/poetry.lock
+++ b/poetry.lock
@@ -1102,13 +1102,13 @@ files = [
[[package]]
name = "typing-extensions"
-version = "4.10.0"
+version = "4.11.0"
description = "Backported and Experimental Type Hints for Python 3.8+"
optional = false
python-versions = ">=3.8"
files = [
- {file = "typing_extensions-4.10.0-py3-none-any.whl", hash = "sha256:69b1a937c3a517342112fb4c6df7e72fc39a38e7891a5730ed4985b5214b5475"},
- {file = "typing_extensions-4.10.0.tar.gz", hash = "sha256:b0abd7c89e8fb96f98db18d86106ff1d90ab692004eb746cf6eda2682f91b3cb"},
+ {file = "typing_extensions-4.11.0-py3-none-any.whl", hash = "sha256:c1f94d72897edaf4ce775bb7558d5b79d8126906a14ea5ed1635921406c0387a"},
+ {file = "typing_extensions-4.11.0.tar.gz", hash = "sha256:83f085bd5ca59c80295fc2a82ab5dac679cbe02b9f33f7d83af68e241bea51b0"},
]
[[package]]
diff --git a/pyproject.toml b/pyproject.toml
index c8d87bfb7..622ed67af 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[tool.poetry]
name = "cyberdrop-dl"
-version = "5.2.18"
+version = "5.2.19"
description = "Bulk downloader for multiple file hosts"
authors = ["Jules Winnfield <[email protected]>"]
readme = "README.md"