[extractor] Let `_extract_format` functions obey `--ignore-no-formats`

pull/5878/head
pukkandan 2 years ago
parent 1fc089143c
commit 0b5546c723
No known key found for this signature in database
GPG Key ID: 7EEE9E1E817D0A39

@ -1759,6 +1759,9 @@ class InfoExtractor:
def _extract_f4m_formats(self, manifest_url, video_id, preference=None, quality=None, f4m_id=None, def _extract_f4m_formats(self, manifest_url, video_id, preference=None, quality=None, f4m_id=None,
transform_source=lambda s: fix_xml_ampersands(s).strip(), transform_source=lambda s: fix_xml_ampersands(s).strip(),
fatal=True, m3u8_id=None, data=None, headers={}, query={}): fatal=True, m3u8_id=None, data=None, headers={}, query={}):
if self.get_param('ignore_no_formats_error'):
fatal = False
res = self._download_xml_handle( res = self._download_xml_handle(
manifest_url, video_id, 'Downloading f4m manifest', manifest_url, video_id, 'Downloading f4m manifest',
'Unable to download f4m manifest', 'Unable to download f4m manifest',
@ -1908,6 +1911,9 @@ class InfoExtractor:
errnote=None, fatal=True, live=False, data=None, headers={}, errnote=None, fatal=True, live=False, data=None, headers={},
query={}): query={}):
if self.get_param('ignore_no_formats_error'):
fatal = False
if not m3u8_url: if not m3u8_url:
if errnote is not False: if errnote is not False:
errnote = errnote or 'Failed to obtain m3u8 URL' errnote = errnote or 'Failed to obtain m3u8 URL'
@ -2187,6 +2193,9 @@ class InfoExtractor:
return '/'.join(out) return '/'.join(out)
def _extract_smil_formats_and_subtitles(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):
if self.get_param('ignore_no_formats_error'):
fatal = False
res = self._download_smil(smil_url, video_id, fatal=fatal, transform_source=transform_source) res = self._download_smil(smil_url, video_id, fatal=fatal, transform_source=transform_source)
if res is False: if res is False:
assert not fatal assert not fatal
@ -2462,6 +2471,10 @@ class InfoExtractor:
def _extract_mpd_formats_and_subtitles( def _extract_mpd_formats_and_subtitles(
self, mpd_url, video_id, mpd_id=None, note=None, errnote=None, self, mpd_url, video_id, mpd_id=None, note=None, errnote=None,
fatal=True, data=None, headers={}, query={}): fatal=True, data=None, headers={}, query={}):
if self.get_param('ignore_no_formats_error'):
fatal = False
res = self._download_xml_handle( res = self._download_xml_handle(
mpd_url, video_id, mpd_url, video_id,
note='Downloading MPD manifest' if note is None else note, note='Downloading MPD manifest' if note is None else note,
@ -2831,6 +2844,9 @@ class InfoExtractor:
return fmts return fmts
def _extract_ism_formats_and_subtitles(self, ism_url, video_id, ism_id=None, note=None, errnote=None, fatal=True, data=None, headers={}, query={}): def _extract_ism_formats_and_subtitles(self, ism_url, video_id, ism_id=None, note=None, errnote=None, fatal=True, data=None, headers={}, query={}):
if self.get_param('ignore_no_formats_error'):
fatal = False
res = self._download_xml_handle( res = self._download_xml_handle(
ism_url, video_id, ism_url, video_id,
note='Downloading ISM manifest' if note is None else note, note='Downloading ISM manifest' if note is None else note,

Loading…
Cancel
Save