[tumblr] attempt to get higher-quality images (#2761)
This commit is contained in:
@@ -110,7 +110,12 @@ class TumblrExtractor(Extractor):
|
|||||||
|
|
||||||
for photo in photos:
|
for photo in photos:
|
||||||
post["photo"] = photo
|
post["photo"] = photo
|
||||||
photo.update(photo["original_size"])
|
best_photo = photo["original_size"]
|
||||||
|
for alt_photo in photo["alt_sizes"]:
|
||||||
|
if (alt_photo["height"] > best_photo["height"] or
|
||||||
|
alt_photo["width"] > best_photo["width"]):
|
||||||
|
best_photo = alt_photo
|
||||||
|
photo.update(best_photo)
|
||||||
del photo["original_size"]
|
del photo["original_size"]
|
||||||
del photo["alt_sizes"]
|
del photo["alt_sizes"]
|
||||||
yield self._prepare_image(photo["url"], post)
|
yield self._prepare_image(photo["url"], post)
|
||||||
|
|||||||
Reference in New Issue
Block a user