aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshirt-dev <2660574+shirt-dev@users.noreply.github.com>2021-03-01 12:05:45 -0500
committerGitHub <noreply@github.com>2021-03-01 12:05:45 -0500
commitb3b30a4bca45bd99c59475c2b4da88f95b646576 (patch)
tree4d71e3555b288cd6b30dce33bed4823d43401c83
parent5372545ddbc6153d8b77b10ec96c364b17ef1375 (diff)
downloadhypervideo-pre-b3b30a4bca45bd99c59475c2b4da88f95b646576.tar.lz
hypervideo-pre-b3b30a4bca45bd99c59475c2b4da88f95b646576.tar.xz
hypervideo-pre-b3b30a4bca45bd99c59475c2b4da88f95b646576.zip
Fix HLS playlist downloading (#127)
Co-authored-by: shirtjs <2660574+shirtjs@users.noreply.github.com>
-rw-r--r--yt_dlp/extractor/common.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/yt_dlp/extractor/common.py b/yt_dlp/extractor/common.py
index 45bc229ff..edfc5a782 100644
--- a/yt_dlp/extractor/common.py
+++ b/yt_dlp/extractor/common.py
@@ -1904,15 +1904,16 @@ class InfoExtractor(object):
# 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=None, m3u8_doc=None):
+ def _extract_m3u8_playlist_formats(format_url=None, m3u8_doc=None, video_id=None,
+ fatal=True, data=None, headers={}):
if not m3u8_doc:
if not format_url:
return []
res = self._download_webpage_handle(
format_url, video_id,
note=False,
- errnote=errnote or 'Failed to download m3u8 playlist information',
- fatal=fatal, data=data, headers=headers, query=query)
+ errnote='Failed to download m3u8 playlist information',
+ fatal=fatal, data=data, headers=headers)
if res is False:
return []
@@ -1984,7 +1985,8 @@ class InfoExtractor(object):
if media_url:
manifest_url = format_url(media_url)
format_id = []
- playlist_formats = _extract_m3u8_playlist_formats(manifest_url)
+ playlist_formats = _extract_m3u8_playlist_formats(manifest_url, video_id=video_id,
+ fatal=fatal, data=data, headers=headers)
for format in playlist_formats:
format_index = format.get('index')
@@ -2045,7 +2047,8 @@ class InfoExtractor(object):
or last_stream_inf.get('BANDWIDTH'), scale=1000)
manifest_url = format_url(line.strip())
- playlist_formats = _extract_m3u8_playlist_formats(manifest_url)
+ playlist_formats = _extract_m3u8_playlist_formats(manifest_url, video_id=video_id,
+ fatal=fatal, data=data, headers=headers)
for format in playlist_formats:
format_id = []