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

pull/5321/head
Mike Fährmann 6 months ago
parent ac4e29f70a
commit 5842e4928d
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

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

Loading…
Cancel
Save