From 28511bdf9658464a0c1797330a3249698db357f3 Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Sat, 1 Jul 2023 23:48:38 +1200 Subject: [PATCH] change order of checks to fix KeyError bug with ytdlp 2023.6 --- extractors/video.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/extractors/video.py b/extractors/video.py index e92b74f..0aaa993 100644 --- a/extractors/video.py +++ b/extractors/video.py @@ -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"