diff options
author | Felix S <felix.von.s@posteo.de> | 2021-07-16 16:22:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-16 19:52:56 +0530 |
commit | da1c94ee459bf8ae9e5fae486071e0c2d111f5d9 (patch) | |
tree | c9fc0b3c45786da910766fbc662b3d65a336af1a /yt_dlp/extractor/common.py | |
parent | 3b297919e046082cc4ab26ecb959d9f4f584102b (diff) | |
download | hypervideo-pre-da1c94ee459bf8ae9e5fae486071e0c2d111f5d9.tar.lz hypervideo-pre-da1c94ee459bf8ae9e5fae486071e0c2d111f5d9.tar.xz hypervideo-pre-da1c94ee459bf8ae9e5fae486071e0c2d111f5d9.zip |
[generic] Extract previously missed subtitles (#515)
* [generic] Extract subtitles in cases missed previously
* [common] Detect discarded subtitles in SMIL manifests
* [generic] Extract everything in the SMIL manifest
Authored by: fstirlitz
Diffstat (limited to 'yt_dlp/extractor/common.py')
-rw-r--r-- | yt_dlp/extractor/common.py | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/yt_dlp/extractor/common.py b/yt_dlp/extractor/common.py index 81b88e4fa..0ee7ee3b1 100644 --- a/yt_dlp/extractor/common.py +++ b/yt_dlp/extractor/common.py @@ -2206,7 +2206,7 @@ class InfoExtractor(object): out.append('{%s}%s' % (namespace, c)) return '/'.join(out) - def _extract_smil_formats(self, smil_url, video_id, fatal=True, f4m_params=None, transform_source=None): + def _extract_smil_formats_and_subtitles(self, smil_url, video_id, fatal=True, f4m_params=None, transform_source=None): smil = self._download_smil(smil_url, video_id, fatal=fatal, transform_source=transform_source) if smil is False: @@ -2215,8 +2215,21 @@ class InfoExtractor(object): namespace = self._parse_smil_namespace(smil) - return self._parse_smil_formats( + fmts = self._parse_smil_formats( smil, smil_url, video_id, namespace=namespace, f4m_params=f4m_params) + subs = self._parse_smil_subtitles( + smil, namespace=namespace) + + return fmts, subs + + def _extract_smil_formats(self, *args, **kwargs): + fmts, subs = self._extract_smil_formats_and_subtitles(*args, **kwargs) + if subs: + self.report_warning(bug_reports_message( + "Ignoring subtitle tracks found in the SMIL manifest; " + "if any subtitle tracks are missing," + )) + return fmts def _extract_smil_info(self, smil_url, video_id, fatal=True, f4m_params=None): smil = self._download_smil(smil_url, video_id, fatal=fatal) |