From 550b633663e0c6455ceb15813ee510ad032d0af7 Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Wed, 8 Dec 2021 22:33:48 +1300 Subject: [PATCH] Do not extract storyboards into v/a formats --- extractors/video.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/extractors/video.py b/extractors/video.py index 3e0ab47..68fc86a 100644 --- a/extractors/video.py +++ b/extractors/video.py @@ -106,7 +106,13 @@ def extract_video(id): } for format in info["formats"]: - # Adaptive formats have either audio or video, format streams have both + # 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 + + # 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" mime = sense + "/" + format["ext"]