mirror of
https://git.sr.ht/~cadence/NewLeaf
synced 2024-12-22 04:57:01 +00:00
change order of checks to fix KeyError bug with ytdlp 2023.6
This commit is contained in:
parent
f53dd28ada
commit
28511bdf96
@ -109,16 +109,16 @@ def extract_video(id):
|
||||
# return result
|
||||
|
||||
for format in info["formats"]:
|
||||
# m3u8 playlists cannot be played.
|
||||
if "m3u8" in format["protocol"]:
|
||||
continue
|
||||
|
||||
# Storyboard images are now included in formats, we don't want them.
|
||||
# Storyboards have neither audio nor video, so detect them that way.
|
||||
# They could also be detected with ("storyboard" in format_note), or with (protocol == "mhtml").
|
||||
if format["acodec"] == "none" and format["vcodec"] == "none":
|
||||
continue
|
||||
|
||||
# m3u8 playlists cannot be played.
|
||||
if "m3u8" in format["protocol"]:
|
||||
continue
|
||||
|
||||
# Adaptive formats have either audio or video, format streams have both, storyboard images have neither.
|
||||
is_adaptive = format["acodec"] == "none" or format["vcodec"] == "none"
|
||||
sense = "video" if format["vcodec"] != "none" else "audio"
|
||||
|
Loading…
Reference in New Issue
Block a user