1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-22 18:53:21 +01:00

[twitter] ensure card entries have a 'url' (#1868)

This commit is contained in:
Mike Fährmann 2021-09-20 22:32:03 +02:00
parent e69ee41f25
commit da16eabb82
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -139,8 +139,10 @@ class TwitterExtractor(Extractor):
for size in ("original", "x_large", "large", "small"):
key = prefix + size
if key in bvals:
files.append(bvals[key]["image_value"])
return
value = bvals[key].get("image_value")
if value and "url" in value:
files.append(value)
return
elif self.videos:
url = "ytdl:{}/i/web/status/{}".format(self.root, tweet["id_str"])
files.append({"url": url})