diff options
author | Philipp Hagemeister <[email protected]> | 2015-02-17 12:09:12 +0100 |
---|---|---|
committer | Philipp Hagemeister <[email protected]> | 2015-02-17 12:09:12 +0100 |
commit | 85729c51afad484ef784faf5d82bad8acab77d5e (patch) | |
tree | d556af4c7f9fbfaf67cfc7cb3acc1cabc845dc86 | |
parent | 1db5fbcfe3ef95654aa642ebe483fb070852cb49 (diff) | |
download | youtube-dl-85729c51afad484ef784faf5d82bad8acab77d5e.tar.gz youtube-dl-85729c51afad484ef784faf5d82bad8acab77d5e.zip |
[downloader] Add --hls-prefer-native to use the native HLS downloader (#4966)
-rwxr-xr-x | youtube_dl/YoutubeDL.py | 5 | ||||
-rw-r--r-- | youtube_dl/__init__.py | 1 | ||||
-rw-r--r-- | youtube_dl/downloader/__init__.py | 3 | ||||
-rw-r--r-- | youtube_dl/options.py | 4 |
4 files changed, 12 insertions, 1 deletions
diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py index dbb26272d..ea2435e0a 100755 --- a/youtube_dl/YoutubeDL.py +++ b/youtube_dl/YoutubeDL.py @@ -225,7 +225,6 @@ class YoutubeDL(object): call_home: Boolean, true iff we are allowed to contact the youtube-dl servers for debugging. sleep_interval: Number of seconds to sleep before each download. - external_downloader: Executable of the external downloader to call. listformats: Print an overview of available video formats and exit. list_thumbnails: Print a table of all thumbnails and exit. match_filter: A function that gets called with the info_dict of @@ -235,6 +234,10 @@ class YoutubeDL(object): match_filter_func in utils.py is one example for this. no_color: Do not emit color codes in output. + 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. The following parameters are not used by YoutubeDL itself, they are used by the FileDownloader: diff --git a/youtube_dl/__init__.py b/youtube_dl/__init__.py index 108fb3c7a..eac2a26ec 100644 --- a/youtube_dl/__init__.py +++ b/youtube_dl/__init__.py @@ -351,6 +351,7 @@ def _real_main(argv=None): 'match_filter': match_filter, 'no_color': opts.no_color, 'ffmpeg_location': opts.ffmpeg_location, + 'hls_prefer_native': opts.hls_prefer_native, } with YoutubeDL(ydl_opts) as ydl: diff --git a/youtube_dl/downloader/__init__.py b/youtube_dl/downloader/__init__.py index eff1122c5..9fb66e2f7 100644 --- a/youtube_dl/downloader/__init__.py +++ b/youtube_dl/downloader/__init__.py @@ -34,6 +34,9 @@ def get_suitable_downloader(info_dict, params={}): if ed.supports(info_dict): return ed + if protocol == 'm3u8' and params.get('hls_prefer_native'): + return NativeHlsFD + return PROTOCOL_MAP.get(protocol, HttpFD) diff --git a/youtube_dl/options.py b/youtube_dl/options.py index ba35399cf..5f678f76b 100644 --- a/youtube_dl/options.py +++ b/youtube_dl/options.py @@ -425,6 +425,10 @@ def parseOpts(overrideArguments=None): dest='xattr_set_filesize', action='store_true', help='(experimental) set file xattribute ytdl.filesize with expected filesize') downloader.add_option( + '--hls-prefer-native', + dest='hls_prefer_native', action='store_true', + help='(experimental) Use the native HLS downloader instead of ffmpeg.') + downloader.add_option( '--external-downloader', dest='external_downloader', metavar='COMMAND', help='(experimental) Use the specified external downloader. ' |