Skip to content

Commit

Permalink
Fix Instagram upload with missing media URL
Browse files Browse the repository at this point in the history
  • Loading branch information
stijn-uva committed May 22, 2024
1 parent d0b4840 commit 807ab77
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion datasources/instagram/search_instagram.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def parse_itemlist_item(node):
# no image links at all :-/
# video is all we have
display_url = media_node["video_versions"][0]["url"]
elif media_node["media_type"] == SearchInstagram.MEDIA_TYPE_PHOTO:
elif media_node["media_type"] == SearchInstagram.MEDIA_TYPE_PHOTO and media_node.get("image_versions2"):
media_url = media_node["image_versions2"]["candidates"][0]["url"]
display_url = media_url
else:
Expand Down

0 comments on commit 807ab77

Please sign in to comment.