mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-02 17:22:31 +01:00
[common] Add _m3u8_meta_format() template
For extractors who handle m3u8 manifests by themselves. (eg., AnvatoIE) Part of #9522
This commit is contained in:
parent
c8602b2f9b
commit
16da9bbc29
@ -1058,12 +1058,8 @@ def _parse_f4m_formats(self, manifest, manifest_url, video_id, preference=None,
|
|||||||
})
|
})
|
||||||
return formats
|
return formats
|
||||||
|
|
||||||
def _extract_m3u8_formats(self, m3u8_url, video_id, ext=None,
|
def _m3u8_meta_format(self, m3u8_url, ext=None, preference=None, m3u8_id=None):
|
||||||
entry_protocol='m3u8', preference=None,
|
return {
|
||||||
m3u8_id=None, note=None, errnote=None,
|
|
||||||
fatal=True, live=False):
|
|
||||||
|
|
||||||
formats = [{
|
|
||||||
'format_id': '-'.join(filter(None, [m3u8_id, 'meta'])),
|
'format_id': '-'.join(filter(None, [m3u8_id, 'meta'])),
|
||||||
'url': m3u8_url,
|
'url': m3u8_url,
|
||||||
'ext': ext,
|
'ext': ext,
|
||||||
@ -1071,7 +1067,14 @@ def _extract_m3u8_formats(self, m3u8_url, video_id, ext=None,
|
|||||||
'preference': preference - 1 if preference else -1,
|
'preference': preference - 1 if preference else -1,
|
||||||
'resolution': 'multiple',
|
'resolution': 'multiple',
|
||||||
'format_note': 'Quality selection URL',
|
'format_note': 'Quality selection URL',
|
||||||
}]
|
}
|
||||||
|
|
||||||
|
def _extract_m3u8_formats(self, m3u8_url, video_id, ext=None,
|
||||||
|
entry_protocol='m3u8', preference=None,
|
||||||
|
m3u8_id=None, note=None, errnote=None,
|
||||||
|
fatal=True, live=False):
|
||||||
|
|
||||||
|
formats = [self._m3u8_meta_format(m3u8_url, ext, preference, m3u8_id)]
|
||||||
|
|
||||||
format_url = lambda u: (
|
format_url = lambda u: (
|
||||||
u
|
u
|
||||||
|
Loading…
Reference in New Issue
Block a user