mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-22 10:42:34 +01:00
[twitter] improve syndication video selection (#2354)
- ignore .m3u8 manifests - always select largest format
This commit is contained in:
parent
0794027100
commit
3e942a58be
@ -1294,7 +1294,10 @@ class TwitterAPI():
|
||||
|
||||
if "video" in tweet:
|
||||
video = tweet["video"]
|
||||
del video["variants"][:-1]
|
||||
video["variants"] = (max(
|
||||
(v for v in video["variants"] if v["type"] == "video/mp4"),
|
||||
key=lambda v: int(v["src"].split("/")[-2].partition("x")[0])
|
||||
),)
|
||||
video["variants"][0]["url"] = video["variants"][0]["src"]
|
||||
tweet["extended_entities"] = {"media": [{
|
||||
"video_info" : video,
|
||||
|
Loading…
Reference in New Issue
Block a user