From 681f19150219c22a22999ac1e41dc5d393d5b9b5 Mon Sep 17 00:00:00 2001 From: Fam0r Date: Tue, 17 May 2022 09:40:40 +0300 Subject: [PATCH] Use the best bitrate video for twitter embeds --- twitfix.py | 1 + 1 file changed, 1 insertion(+) diff --git a/twitfix.py b/twitfix.py index a104f3e..3a2cc5e 100644 --- a/twitfix.py +++ b/twitfix.py @@ -277,6 +277,7 @@ def link_to_vnf_from_api(video_link): for video in tweet['extended_entities']['media'][0]['video_info']['variants']: if video['content_type'] == "video/mp4" and video['bitrate'] > best_bitrate: url = video['url'] + best_bitrate = video['bitrate'] elif tweetType(tweet) == "Text": url = "" thumb = ""