Merge pull request #1 from Fam0r/main

Use the best bitrate video for twitter embeds
This commit is contained in:
Dylan 2022-05-17 17:14:30 +01:00 committed by GitHub
commit 8df211090c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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']: for video in tweet['extended_entities']['media'][0]['video_info']['variants']:
if video['content_type'] == "video/mp4" and video['bitrate'] > best_bitrate: if video['content_type'] == "video/mp4" and video['bitrate'] > best_bitrate:
url = video['url'] url = video['url']
best_bitrate = video['bitrate']
elif tweetType(tweet) == "Text": elif tweetType(tweet) == "Text":
url = "" url = ""
thumb = "" thumb = ""