aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/options.py
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2021-04-10 20:38:33 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2021-04-10 20:57:52 +0530
commit52a8a1e1b93dbc88f0018d4842f1e90ba96e095f (patch)
tree3708a1e4cd100657896d6aef0eb0f1352fc7cc3d /yt_dlp/options.py
parentd818eb747361117ec86a5c4fe217d5d6956f36d3 (diff)
downloadhypervideo-pre-52a8a1e1b93dbc88f0018d4842f1e90ba96e095f.tar.lz
hypervideo-pre-52a8a1e1b93dbc88f0018d4842f1e90ba96e095f.tar.xz
hypervideo-pre-52a8a1e1b93dbc88f0018d4842f1e90ba96e095f.zip
Option to choose different downloader for different protocols
* Renamed `--external-downloader-args` to `--downloader-args` * Added `native` as an option for the downloader * Use similar syntax to `--downloader-args` etc. Eg: `--downloader dash:native --downloader aria2c` * Deprecated `--hls-prefer-native` and `--hls-prefer-ffmpeg` since the same can now be done with `--downloader "m3u8:native"` and `m3u8:ffmpeg` respectively * Split `frag_urls` protocol into `m3u8_frag_urls` and `dash_frag_urls` * Standardize shortening of protocol names with `downloader.shorten_protocol_name`
Diffstat (limited to 'yt_dlp/options.py')
-rw-r--r--yt_dlp/options.py21
1 files changed, 15 insertions, 6 deletions
diff --git a/yt_dlp/options.py b/yt_dlp/options.py
index 6b4736e97..7f36777d9 100644
--- a/yt_dlp/options.py
+++ b/yt_dlp/options.py
@@ -639,11 +639,11 @@ def parseOpts(overrideArguments=None):
downloader.add_option(
'--hls-prefer-native',
dest='hls_prefer_native', action='store_true', default=None,
- help='Use the native HLS downloader instead of ffmpeg')
+ help=optparse.SUPPRESS_HELP)
downloader.add_option(
'--hls-prefer-ffmpeg',
dest='hls_prefer_native', action='store_false', default=None,
- help='Use ffmpeg instead of the native HLS downloader')
+ help=optparse.SUPPRESS_HELP)
downloader.add_option(
'--hls-use-mpegts',
dest='hls_use_mpegts', action='store_true', default=None,
@@ -659,11 +659,20 @@ def parseOpts(overrideArguments=None):
'Do not use the mpegts container for HLS videos. '
'This is default when not downloading live streams'))
downloader.add_option(
- '--external-downloader',
- dest='external_downloader', metavar='NAME',
+ '--downloader', '--external-downloader',
+ dest='external_downloader', metavar='[PROTO:]NAME', default={}, type='str',
+ action='callback', callback=_dict_from_multiple_values_options_callback,
+ callback_kwargs={
+ 'allowed_keys': 'http|ftp|m3u8|dash|rtsp|rtmp|mms',
+ 'default_key': 'default', 'process': lambda x: x.strip()},
help=(
- 'Name or path of the external downloader to use. '
- 'Currently supports %s (Recommended: aria2c)' % ', '.join(list_external_downloaders())))
+ 'Name or path of the external downloader to use (optionally) prefixed by '
+ 'the protocols (http, ftp, m3u8, dash, rstp, rtmp, mms) to use it for. '
+ 'Currently supports native, %s (Recommended: aria2c). '
+ 'You can use this option multiple times to set different downloaders for different protocols. '
+ 'For example, --downloader aria2c --downloader "dash,m3u8:native" will use '
+ 'aria2c for http/ftp downloads, and the native downloader for dash/m3u8 downloads '
+ '(Alias: --external-downloader)' % ', '.join(list_external_downloaders())))
downloader.add_option(
'--downloader-args', '--external-downloader-args',
metavar='NAME:ARGS', dest='external_downloader_args', default={}, type='str',