[hotleak] download files with 404 status code (#5395)

This commit is contained in:
Mike Fährmann
2024-04-19 16:08:31 +02:00
parent a7d8cbab0e
commit bffadf35b7
2 changed files with 4 additions and 1 deletions

View File

@@ -98,6 +98,8 @@ class HttpDownloader(DownloaderBase):
metadata = self.metadata
kwdict = pathfmt.kwdict
expected_status = kwdict.get(
"_http_expected_status", ())
adjust_extension = kwdict.get(
"_http_adjust_extension", self.adjust_extension)
@@ -151,7 +153,7 @@ class HttpDownloader(DownloaderBase):
# check response
code = response.status_code
if code == 200: # OK
if code == 200 or code in expected_status: # OK
offset = 0
size = response.headers.get("Content-Length")
elif code == 206: # Partial Content

View File

@@ -23,6 +23,7 @@ class HotleakExtractor(Extractor):
def items(self):
for post in self.posts():
post["_http_expected_status"] = (404,)
yield Message.Directory, post
yield Message.Url, post["url"], post