diff options
author | Sergey M․ <dstftw@gmail.com> | 2016-04-21 23:02:17 +0600 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2016-04-21 23:02:17 +0600 |
commit | bf09af3acbafd37e8327b8bab118066bd4c23d31 (patch) | |
tree | 071cf417d741ff9b1d648db3a9765fdcf76e826c /youtube_dl | |
parent | 88296ac326694b8da0f6815efbab988ff6134405 (diff) |
Add --hls-prefer-ffmpeg
Diffstat (limited to 'youtube_dl')
-rwxr-xr-x | youtube_dl/YoutubeDL.py | 4 | ||||
-rw-r--r-- | youtube_dl/downloader/__init__.py | 5 | ||||
-rw-r--r-- | youtube_dl/options.py | 6 |
3 files changed, 12 insertions, 3 deletions
diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py index a89a71a25..055433362 100755 --- a/youtube_dl/YoutubeDL.py +++ b/youtube_dl/YoutubeDL.py @@ -260,7 +260,9 @@ class YoutubeDL(object): The following options determine which downloader is picked: external_downloader: Executable of the external downloader to call. None or unset for standard (built-in) downloader. - hls_prefer_native: Use the native HLS downloader instead of ffmpeg/avconv. + hls_prefer_native: Use the native HLS downloader instead of ffmpeg/avconv + if True, otherwise use ffmpeg/avconv if False, otherwise + use downloader suggested by extractor if None. The following parameters are not used by YoutubeDL itself, they are used by the downloader (see youtube_dl/downloader/common.py): diff --git a/youtube_dl/downloader/__init__.py b/youtube_dl/downloader/__init__.py index 73b34fdae..817591d97 100644 --- a/youtube_dl/downloader/__init__.py +++ b/youtube_dl/downloader/__init__.py @@ -41,9 +41,12 @@ def get_suitable_downloader(info_dict, params={}): if ed.can_download(info_dict): return ed - if protocol == 'm3u8' and params.get('hls_prefer_native'): + if protocol == 'm3u8' and params.get('hls_prefer_native') is True: return HlsFD + if protocol == 'm3u8_native' and params.get('hls_prefer_native') is False: + return FFmpegFD + return PROTOCOL_MAP.get(protocol, HttpFD) diff --git a/youtube_dl/options.py b/youtube_dl/options.py index b60a723c5..d1f8d1331 100644 --- a/youtube_dl/options.py +++ b/youtube_dl/options.py @@ -425,9 +425,13 @@ def parseOpts(overrideArguments=None): help='Set file xattribute ytdl.filesize with expected filesize (experimental)') downloader.add_option( '--hls-prefer-native', - dest='hls_prefer_native', action='store_true', + dest='hls_prefer_native', action='store_true', default=None, help='Use the native HLS downloader instead of ffmpeg') downloader.add_option( + '--hls-prefer-ffmpeg', + dest='hls_prefer_native', action='store_false', default=None, + help='Use ffmpeg instead of the native HLS downloader') + downloader.add_option( '--hls-use-mpegts', dest='hls_use_mpegts', action='store_true', help='Use the mpegts container for HLS videos, allowing to play the ' |