Fixes #15 - issue with GIF tweets that return incorrect media bitrate

This commit is contained in:
Dylan 2022-09-14 08:26:45 +01:00
parent ad8830838c
commit 60ecfd2838

View File

@ -285,7 +285,7 @@ def link_to_vnf_from_tweet_data(tweet,video_link):
# Check to see if tweet has a video, if not, make the url passed to the VNF the first t.co link in the tweet
if tweetType(tweet) == "Video":
if tweet['extended_entities']['media'][0]['video_info']['variants']:
best_bitrate = 0
best_bitrate = -1
thumb = tweet['extended_entities']['media'][0]['media_url']
for video in tweet['extended_entities']['media'][0]['video_info']['variants']:
if video['content_type'] == "video/mp4" and video['bitrate'] > best_bitrate: