[twitter] provide fallback URLs for card images

f2e8aedd74 (commitcomment-64057751)
This commit is contained in:
Mike Fährmann
2022-02-03 23:43:18 +01:00
parent 86fa412b47
commit 70e6e1549e

View File

@@ -168,6 +168,11 @@ class TwitterExtractor(Extractor):
if key in bvals:
value = bvals[key].get("image_value")
if value and "url" in value:
base, sep, size = value["url"].rpartition("&name=")
if sep:
base += sep
value["url"] = base + self._size_image
value["_fallback"] = self._image_fallback(base)
files.append(value)
return
elif name == "unified_card":