[imgur] fail downloads when redirected to 'removed.png' (#5308)

This commit is contained in:
Mike Fährmann
2024-03-09 23:35:23 +01:00
parent ac4e29f70a
commit 5842e4928d

View File

@@ -39,10 +39,15 @@ class ImgurExtractor(Extractor):
image["url"] = url = "https://i.imgur.com/{}.{}".format(
image["id"], image["ext"])
image["date"] = text.parse_datetime(image["created_at"])
image["_http_validate"] = self._validate
text.nameext_from_url(url, image)
return url
def _validate(self, response):
return (not response.history or
not response.url.endswith("/removed.png"))
def _items_queue(self, items):
album_ex = ImgurAlbumExtractor
image_ex = ImgurImageExtractor