Exclude m3u8 playlist formats

This commit is contained in:
Cadence Ember 2023-03-13 01:00:19 +13:00
parent ecb4f4ccd1
commit 82f28cb99d
1 changed files with 4 additions and 0 deletions

View File

@ -115,6 +115,10 @@ def extract_video(id):
if format["acodec"] == "none" and format["vcodec"] == "none": if format["acodec"] == "none" and format["vcodec"] == "none":
continue 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. # Adaptive formats have either audio or video, format streams have both, storyboard images have neither.
is_adaptive = format["acodec"] == "none" or format["vcodec"] == "none" is_adaptive = format["acodec"] == "none" or format["vcodec"] == "none"
sense = "video" if format["vcodec"] != "none" else "audio" sense = "video" if format["vcodec"] != "none" else "audio"