Another fix to API bitrate detection
This commit is contained in:
parent
a1b6ebe73e
commit
a350ecbfa5
@ -120,12 +120,12 @@ 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 = -1
|
best_bitrate = -1
|
||||||
besturl=""
|
besturl=""
|
||||||
for j in i["video_info"]["variants"]:
|
for j in i["video_info"]["variants"]:
|
||||||
if j['content_type'] == "video/mp4" and j['bitrate'] > best_bitrate:
|
if j['content_type'] == "video/mp4" and j['bitrate'] > best_bitrate:
|
||||||
besturl = j['url']
|
besturl = j['url']
|
||||||
best_bitrate = i['bitrate']
|
best_bitrate = j['bitrate']
|
||||||
media.append(besturl)
|
media.append(besturl)
|
||||||
else:
|
else:
|
||||||
media.append(i["media_url_https"])
|
media.append(i["media_url_https"])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user