From 60ecfd283810570d070b1c24f1bba2cc8347902c Mon Sep 17 00:00:00 2001 From: Dylan Date: Wed, 14 Sep 2022 08:26:45 +0100 Subject: [PATCH] Fixes #15 - issue with GIF tweets that return incorrect media bitrate --- twitfix.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/twitfix.py b/twitfix.py index a3cf2e5..e085324 100644 --- a/twitfix.py +++ b/twitfix.py @@ -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: