From ed9b7e3dd39796d4537863f8dbd6ee6f07810e43 Mon Sep 17 00:00:00 2001 From: pukkandan Date: Fri, 26 Feb 2021 18:12:30 +0530 Subject: [PATCH] Fix bug with m3u8 format extraction --- yt_dlp/extractor/common.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/yt_dlp/extractor/common.py b/yt_dlp/extractor/common.py index b03582f54..677a61b86 100644 --- a/yt_dlp/extractor/common.py +++ b/yt_dlp/extractor/common.py @@ -1888,8 +1888,10 @@ def _parse_m3u8_formats(self, m3u8_doc, m3u8_url, ext=None, # media playlist and MUST NOT appear in master playlist thus we can # clearly detect media playlist with this criterion. - def _extract_m3u8_playlist_formats(format_url, m3u8_doc=None): + def _extract_m3u8_playlist_formats(format_url=None, m3u8_doc=None): if not m3u8_doc: + if not format_url: + return [] res = self._download_webpage_handle( format_url, video_id, note=False, @@ -1928,7 +1930,7 @@ def _extract_m3u8_playlist_formats(format_url, m3u8_doc=None): if '#EXT-X-TARGETDURATION' in m3u8_doc: # media playlist, return as is - playlist_formats = _extract_m3u8_playlist_formats(m3u8_doc, True) + playlist_formats = _extract_m3u8_playlist_formats(m3u8_doc=m3u8_doc) for format in playlist_formats: format_id = []