Browse Source

[common] Add _m3u8_meta_format() template

For extractors who handle m3u8 manifests by themselves. (eg., AnvatoIE)

Part of #9522
totalwebcasting
Yen Chi Hsuan 9 years ago
parent
commit
16da9bbc29
No known key found for this signature in database GPG Key ID: 3FDDD575826C5C30
1 changed files with 10 additions and 7 deletions
  1. +10
    -7
      youtube_dl/extractor/common.py

+ 10
- 7
youtube_dl/extractor/common.py View File

@ -1058,12 +1058,8 @@ class InfoExtractor(object):
}) })
return formats return formats
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 = [{
def _m3u8_meta_format(self, m3u8_url, ext=None, preference=None, m3u8_id=None):
return {
'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 @@ class InfoExtractor(object):
'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…
Cancel
Save