1
0
mirror of https://git.sr.ht/~cadence/NewLeaf synced 2024-11-24 16:37:29 +00:00

Change http_dash_fragments detection based on yt-dlp translating adaptive streams to fragments

https://matrix.to/#/!vZmGzbsnHuVTLMItyg:cadence.moe/$VHp8D4XgW5jFbA6MhPaI52hZVMt_wpNy9gCSbF6Ot1Y?via=cadence.moe&via=matrix.org&via=envs.net
This commit is contained in:
Cadence Ember 2023-03-13 00:36:08 +13:00
parent 412b4934ed
commit ecb4f4ccd1

View File

@ -105,6 +105,9 @@ def extract_video(id):
"recommendedVideos": [] "recommendedVideos": []
} }
# result = info["formats"]
# return result
for format in info["formats"]: for format in info["formats"]:
# Storyboard images are now included in formats, we don't want them. # Storyboard images are now included in formats, we don't want them.
# Storyboards have neither audio nor video, so detect them that way. # Storyboards have neither audio nor video, so detect them that way.
@ -125,7 +128,7 @@ def extract_video(id):
if is_adaptive: if is_adaptive:
url = "" url = ""
if format["protocol"] == "http_dash_segments": if "fragment_base_url" in format:
# this is http dash, which is annoying and doesn't work in <video>. # this is http dash, which is annoying and doesn't work in <video>.
# we have a fragment_base_url, which seems to be playable for all audio, but only with certain video itags??? very confused # we have a fragment_base_url, which seems to be playable for all audio, but only with certain video itags??? very confused
if format["acodec"] == "none" and format["format_id"] not in ["134", "136"]: if format["acodec"] == "none" and format["format_id"] not in ["134", "136"]: