API highest bitrate get fix
This commit is contained in:
parent
f8d7a709e5
commit
645e7cc329
11
twitfix.py
11
twitfix.py
@ -118,12 +118,13 @@ def twitfix(sub_path):
|
|||||||
for i in tmedia:
|
for i in tmedia:
|
||||||
if "video_info" in i:
|
if "video_info" in i:
|
||||||
# find the highest bitrate
|
# find the highest bitrate
|
||||||
highest = 0
|
highest = -1
|
||||||
|
besturl=""
|
||||||
for j in i["video_info"]["variants"]:
|
for j in i["video_info"]["variants"]:
|
||||||
if "bitrate" in j:
|
if j['content_type'] == "video/mp4" and j['bitrate'] > best_bitrate:
|
||||||
if j["bitrate"] > highest:
|
besturl = j['url']
|
||||||
highest = j["bitrate"]
|
best_bitrate = i['bitrate']
|
||||||
media.append(j["url"])
|
media.append(besturl)
|
||||||
else:
|
else:
|
||||||
media.append(i["media_url_https"])
|
media.append(i["media_url_https"])
|
||||||
if "hashtags" in tweetL["extended_entities"]:
|
if "hashtags" in tweetL["extended_entities"]:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user