[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"]) data["post_shortcode"])
continue continue
if "video_versions" in item: video_versions = item.get("video_versions")
if video_versions:
video = max( video = max(
item["video_versions"], video_versions,
key=lambda x: (x["width"], x["height"], x["type"]), key=lambda x: (x["width"], x["height"], x["type"]),
) )
media = video media = video

View File

@@ -6,4 +6,4 @@
# it under the terms of the GNU General Public License version 2 as # it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation. # published by the Free Software Foundation.
__version__ = "1.26.2" __version__ = "1.26.3-dev"