[imgur] fail downloads when redirected to 'removed.png' (#5308)
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user