[instagram] fix exception on empty 'video_versions' (#4795)

This commit is contained in:
Mike Fährmann
2023-11-10 14:49:29 +01:00
parent 807ddde7e1
commit 5e58d2b455
2 changed files with 4 additions and 3 deletions

View File

@@ -217,9 +217,10 @@ class InstagramExtractor(Extractor):
data["post_shortcode"])
continue
if "video_versions" in item:
video_versions = item.get("video_versions")
if video_versions:
video = max(
item["video_versions"],
video_versions,
key=lambda x: (x["width"], x["height"], x["type"]),
)
media = video