aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/options.py
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2021-06-25 19:35:41 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2021-06-25 20:10:28 +0530
commit5d3a0e794b50a7f2524bdf37a886e0f436eb2f14 (patch)
tree40aefd561b29e29724f20fa13581205f4d895f13 /yt_dlp/options.py
parent125728b038a17f53397a85584b4e9205ca3a062c (diff)
downloadhypervideo-pre-5d3a0e794b50a7f2524bdf37a886e0f436eb2f14.tar.lz
hypervideo-pre-5d3a0e794b50a7f2524bdf37a886e0f436eb2f14.tar.xz
hypervideo-pre-5d3a0e794b50a7f2524bdf37a886e0f436eb2f14.zip
Add `--extractor-args` to pass extractor-specific arguments
Diffstat (limited to 'yt_dlp/options.py')
-rw-r--r--yt_dlp/options.py23
1 files changed, 18 insertions, 5 deletions
diff --git a/yt_dlp/options.py b/yt_dlp/options.py
index 4ad5223fa..5caf4cb53 100644
--- a/yt_dlp/options.py
+++ b/yt_dlp/options.py
@@ -716,7 +716,8 @@ def parseOpts(overrideArguments=None):
help=(
'Give these arguments to the external downloader. '
'Specify the downloader name and the arguments separated by a colon ":". '
- 'You can use this option multiple times (Alias: --external-downloader-args)'))
+ 'You can use this option multiple times to give different arguments to different downloaders '
+ '(Alias: --external-downloader-args)'))
workarounds = optparse.OptionGroup(parser, 'Workarounds')
workarounds.add_option(
@@ -1344,21 +1345,33 @@ def parseOpts(overrideArguments=None):
dest='hls_split_discontinuity', action='store_false',
help='Do not split HLS playlists to different formats at discontinuities such as ad breaks (default)')
extractor.add_option(
+ '--extractor-args',
+ metavar='KEY:ARGS', dest='extractor_args', default={}, type='str',
+ action='callback', callback=_dict_from_options_callback,
+ callback_kwargs={
+ 'multiple_keys': False,
+ 'process': lambda val: dict(
+ (lambda x: (x[0], x[1].split(',')))(arg.split('=', 1) + ['', '']) for arg in val.split(';'))
+ },
+ help=(
+ 'Pass these arguments to the extractor. See "EXTRACTOR ARGUMENTS" for details. '
+ 'You can use this option multiple times to give different arguments to different extractors'))
+ extractor.add_option(
'--youtube-include-dash-manifest', '--no-youtube-skip-dash-manifest',
action='store_true', dest='youtube_include_dash_manifest', default=True,
- help='Download the DASH manifests and related data on YouTube videos (default) (Alias: --no-youtube-skip-dash-manifest)')
+ help=optparse.SUPPRESS_HELP)
extractor.add_option(
'--youtube-skip-dash-manifest', '--no-youtube-include-dash-manifest',
action='store_false', dest='youtube_include_dash_manifest',
- help='Do not download the DASH manifests and related data on YouTube videos (Alias: --no-youtube-include-dash-manifest)')
+ help=optparse.SUPPRESS_HELP)
extractor.add_option(
'--youtube-include-hls-manifest', '--no-youtube-skip-hls-manifest',
action='store_true', dest='youtube_include_hls_manifest', default=True,
- help='Download the HLS manifests and related data on YouTube videos (default) (Alias: --no-youtube-skip-hls-manifest)')
+ help=optparse.SUPPRESS_HELP)
extractor.add_option(
'--youtube-skip-hls-manifest', '--no-youtube-include-hls-manifest',
action='store_false', dest='youtube_include_hls_manifest',
- help='Do not download the HLS manifests and related data on YouTube videos (Alias: --no-youtube-include-hls-manifest)')
+ help=optparse.SUPPRESS_HELP)
parser.add_option_group(general)
parser.add_option_group(network)