Use the best bitrate video for twitter embeds

This commit is contained in:
Fam0r 2022-05-17 09:40:40 +03:00
parent 82fe66af48
commit 681f191502

View file

@ -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 = ""