diff options
author | Felix S <felix.von.s@posteo.de> | 2021-04-28 16:17:30 +0530 |
---|---|---|
committer | Felix S <felix.von.s@posteo.de> | 2021-04-28 17:21:14 +0530 |
commit | 4a2f19abbd61274358211c2e3b1d9658cfbdcdde (patch) | |
tree | b699bd90de1877ff233f9489065db9a1369cda68 /yt_dlp/extractor/common.py | |
parent | 5fbcebed8c41f4406d88318203c69efdc73f4e03 (diff) | |
download | hypervideo-pre-4a2f19abbd61274358211c2e3b1d9658cfbdcdde.tar.lz hypervideo-pre-4a2f19abbd61274358211c2e3b1d9658cfbdcdde.tar.xz hypervideo-pre-4a2f19abbd61274358211c2e3b1d9658cfbdcdde.zip |
[downloader/hls] Assemble single-file WebVTT subtitles from HLS segments
Diffstat (limited to 'yt_dlp/extractor/common.py')
-rw-r--r-- | yt_dlp/extractor/common.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/yt_dlp/extractor/common.py b/yt_dlp/extractor/common.py index 6257c17cd..803c7fa06 100644 --- a/yt_dlp/extractor/common.py +++ b/yt_dlp/extractor/common.py @@ -2035,6 +2035,12 @@ class InfoExtractor(object): 'url': url, 'ext': determine_ext(url), } + if sub_info['ext'] == 'm3u8': + # Per RFC 8216 ยง3.1, the only possible subtitle format m3u8 + # files may contain is WebVTT: + # <https://tools.ietf.org/html/rfc8216#section-3.1> + sub_info['ext'] = 'vtt' + sub_info['protocol'] = 'm3u8_native' subtitles.setdefault(lang, []).append(sub_info) if media_type not in ('VIDEO', 'AUDIO'): return |