From 079a7cfc7191cc141ce09940e06ec897983526c3 Mon Sep 17 00:00:00 2001 From: pukkandan Date: Fri, 11 Feb 2022 12:09:03 +0530 Subject: [PATCH] [downloader] Do not use aria2c for non-native `m3u8` Closes #2718 --- yt_dlp/downloader/__init__.py | 2 +- yt_dlp/extractor/common.py | 2 +- yt_dlp/extractor/openrec.py | 3 +-- yt_dlp/extractor/vk.py | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/yt_dlp/downloader/__init__.py b/yt_dlp/downloader/__init__.py index acc19f43a..76841993b 100644 --- a/yt_dlp/downloader/__init__.py +++ b/yt_dlp/downloader/__init__.py @@ -117,7 +117,7 @@ def _get_suitable_downloader(info_dict, protocol, params, default): return FFmpegFD elif (external_downloader or '').lower() == 'native': return HlsFD - elif get_suitable_downloader( + elif protocol == 'm3u8_native' and get_suitable_downloader( info_dict, params, None, protocol='m3u8_frag_urls', to_stdout=info_dict['to_stdout']): return HlsFD elif params.get('hls_prefer_native') is True: diff --git a/yt_dlp/extractor/common.py b/yt_dlp/extractor/common.py index ac9e28560..3b232e89c 100644 --- a/yt_dlp/extractor/common.py +++ b/yt_dlp/extractor/common.py @@ -3108,7 +3108,7 @@ class InfoExtractor(object): }) return formats, subtitles - def _parse_html5_media_entries(self, base_url, webpage, video_id, m3u8_id=None, m3u8_entry_protocol='m3u8', mpd_id=None, preference=None, quality=None): + def _parse_html5_media_entries(self, base_url, webpage, video_id, m3u8_id=None, m3u8_entry_protocol='m3u8_native', mpd_id=None, preference=None, quality=None): def absolute_url(item_url): return urljoin(base_url, item_url) diff --git a/yt_dlp/extractor/openrec.py b/yt_dlp/extractor/openrec.py index 7cdc7d17c..0525b4830 100644 --- a/yt_dlp/extractor/openrec.py +++ b/yt_dlp/extractor/openrec.py @@ -42,8 +42,7 @@ class OpenRecBaseIE(InfoExtractor): if not m3u8_url: continue formats.extend(self._extract_m3u8_formats( - m3u8_url, video_id, ext='mp4', entry_protocol='m3u8', - m3u8_id='hls-%s' % name, live=True)) + m3u8_url, video_id, ext='mp4', live=is_live, m3u8_id='hls-%s' % name)) self._sort_formats(formats) diff --git a/yt_dlp/extractor/vk.py b/yt_dlp/extractor/vk.py index fab16780f..18eb33b57 100644 --- a/yt_dlp/extractor/vk.py +++ b/yt_dlp/extractor/vk.py @@ -688,7 +688,7 @@ class VKWallPostIE(VKBaseIE): 'artist': performer, 'track': title, 'ext': 'mp4', - 'protocol': 'm3u8', + 'protocol': 'm3u8_native', }) for video in re.finditer(