aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--yt_dlp/YoutubeDL.py2
-rw-r--r--yt_dlp/downloader/hls.py12
-rw-r--r--yt_dlp/extractor/common.py5
3 files changed, 14 insertions, 5 deletions
diff --git a/yt_dlp/YoutubeDL.py b/yt_dlp/YoutubeDL.py
index b7b19cf6e..3293a9076 100644
--- a/yt_dlp/YoutubeDL.py
+++ b/yt_dlp/YoutubeDL.py
@@ -598,7 +598,7 @@ class YoutubeDL:
# NB: Keep in sync with the docstring of extractor/common.py
'url', 'manifest_url', 'manifest_stream_number', 'ext', 'format', 'format_id', 'format_note',
'width', 'height', 'aspect_ratio', 'resolution', 'dynamic_range', 'tbr', 'abr', 'acodec', 'asr', 'audio_channels',
- 'vbr', 'fps', 'vcodec', 'container', 'filesize', 'filesize_approx', 'rows', 'columns',
+ 'vbr', 'fps', 'vcodec', 'container', 'filesize', 'filesize_approx', 'rows', 'columns', 'hls_media_playlist_data',
'player_url', 'protocol', 'fragment_base_url', 'fragments', 'is_from_start', 'is_dash_periods', 'request_data',
'preference', 'language', 'language_preference', 'quality', 'source_preference', 'cookies',
'http_headers', 'stretched_ratio', 'no_resume', 'has_drm', 'extra_param_to_segment_url', 'extra_param_to_key_url',
diff --git a/yt_dlp/downloader/hls.py b/yt_dlp/downloader/hls.py
index 7bd116d96..7a47f8f83 100644
--- a/yt_dlp/downloader/hls.py
+++ b/yt_dlp/downloader/hls.py
@@ -72,11 +72,15 @@ class HlsFD(FragmentFD):
def real_download(self, filename, info_dict):
man_url = info_dict['url']
- self.to_screen(f'[{self.FD_NAME}] Downloading m3u8 manifest')
- urlh = self.ydl.urlopen(self._prepare_url(info_dict, man_url))
- man_url = urlh.url
- s = urlh.read().decode('utf-8', 'ignore')
+ s = info_dict.get('hls_media_playlist_data')
+ if s:
+ self.to_screen(f'[{self.FD_NAME}] Using m3u8 manifest from extracted info')
+ else:
+ self.to_screen(f'[{self.FD_NAME}] Downloading m3u8 manifest')
+ urlh = self.ydl.urlopen(self._prepare_url(info_dict, man_url))
+ man_url = urlh.url
+ s = urlh.read().decode('utf-8', 'ignore')
can_download, message = self.can_download(s, info_dict, self.params.get('allow_unplayable_formats')), None
if can_download:
diff --git a/yt_dlp/extractor/common.py b/yt_dlp/extractor/common.py
index 92ddad2b7..3e7734ce1 100644
--- a/yt_dlp/extractor/common.py
+++ b/yt_dlp/extractor/common.py
@@ -201,6 +201,11 @@ class InfoExtractor:
fragment_base_url
* "duration" (optional, int or float)
* "filesize" (optional, int)
+ * hls_media_playlist_data
+ The M3U8 media playlist data as a string.
+ Only use if the data must be modified during extraction and
+ the native HLS downloader should bypass requesting the URL.
+ Does not apply if ffmpeg is used as external downloader
* is_from_start Is a live format that can be downloaded
from the start. Boolean
* preference Order number of this format. If this field is