[extractor] Always prefer native hls downloader by default

When the manifest is not downloadable by native downloader, it already is able to detect it and switch to `ffmpeg`. So there doesn't seem to be a reason anymore to use ffmpeg as the preferred downloader
This commit is contained in:
pukkandan 2021-05-22 23:58:11 +05:30
parent b25522ba52
commit 177877c544
No known key found for this signature in database
GPG key ID: 0F00D95A001F4698
5 changed files with 434 additions and 438 deletions

File diff suppressed because it is too large Load diff

View file

@ -1902,7 +1902,7 @@ def _extract_m3u8_formats(self, *args, **kwargs):
return fmts return fmts
def _extract_m3u8_formats_and_subtitles( def _extract_m3u8_formats_and_subtitles(
self, m3u8_url, video_id, ext=None, entry_protocol='m3u8', self, m3u8_url, video_id, ext=None, entry_protocol='m3u8_native',
preference=None, quality=None, m3u8_id=None, note=None, preference=None, quality=None, m3u8_id=None, note=None,
errnote=None, fatal=True, live=False, data=None, headers={}, errnote=None, fatal=True, live=False, data=None, headers={},
query={}): query={}):
@ -1926,7 +1926,7 @@ def _extract_m3u8_formats_and_subtitles(
headers=headers, query=query, video_id=video_id) headers=headers, query=query, video_id=video_id)
def _parse_m3u8_formats_and_subtitles( def _parse_m3u8_formats_and_subtitles(
self, m3u8_doc, m3u8_url, ext=None, entry_protocol='m3u8', self, m3u8_doc, m3u8_url, ext=None, entry_protocol='m3u8_native',
preference=None, quality=None, m3u8_id=None, live=False, note=None, preference=None, quality=None, m3u8_id=None, live=False, note=None,
errnote=None, fatal=True, data=None, headers={}, query={}, errnote=None, fatal=True, data=None, headers={}, query={},
video_id=None): video_id=None):

View file

@ -107,8 +107,7 @@ def _real_extract(self, url):
ext = determine_ext(format_url) ext = determine_ext(format_url)
if ext == 'm3u8': if ext == 'm3u8':
formats.extend(self._extract_m3u8_formats( formats.extend(self._extract_m3u8_formats(
format_url, lesson_id, 'mp4', entry_protocol='m3u8', format_url, lesson_id, 'mp4', m3u8_id='hls', fatal=False))
m3u8_id='hls', fatal=False))
elif ext == 'mpd': elif ext == 'mpd':
formats.extend(self._extract_mpd_formats( formats.extend(self._extract_mpd_formats(
format_url, lesson_id, mpd_id='dash', fatal=False)) format_url, lesson_id, mpd_id='dash', fatal=False))

View file

@ -247,8 +247,7 @@ def _real_extract(self, url):
m3u8_url = metadata.get('hlsMasterPlaylistUrl') m3u8_url = metadata.get('hlsMasterPlaylistUrl')
if m3u8_url: if m3u8_url:
formats.extend(self._extract_m3u8_formats( formats.extend(self._extract_m3u8_formats(
m3u8_url, video_id, 'mp4', entry_protocol='m3u8', m3u8_url, video_id, 'mp4', m3u8_id='hls', fatal=False))
m3u8_id='hls', fatal=False))
rtmp_url = metadata.get('rtmpUrl') rtmp_url = metadata.get('rtmpUrl')
if rtmp_url: if rtmp_url:
formats.append({ formats.append({

View file

@ -47,8 +47,7 @@ def _real_extract(self, url):
if hls_url: if hls_url:
hls_fmts = self._extract_m3u8_formats( hls_fmts = self._extract_m3u8_formats(
hls_url, video_id, ext='mp4', entry_protocol='m3u8', hls_url, video_id, ext='mp4', m3u8_id='hls-%s' % name, quality=quality)
m3u8_id='hls-%s' % name, quality=quality)
formats.extend(hls_fmts) formats.extend(hls_fmts)
else: else:
hls_fmts = [] hls_fmts = []
@ -71,8 +70,7 @@ def _real_extract(self, url):
# This contains the same formats as the above manifests and is used only as a fallback # This contains the same formats as the above manifests and is used only as a fallback
formats.extend(self._extract_m3u8_formats( formats.extend(self._extract_m3u8_formats(
hls_url, video_id, ext='mp4', entry_protocol='m3u8', hls_url, video_id, ext='mp4', m3u8_id='hls'))
m3u8_id='hls'))
self._remove_duplicate_formats(formats) self._remove_duplicate_formats(formats)
self._sort_formats(formats) self._sort_formats(formats)