From c32b0aab8a1ac1498ad474559cb097d4927d8324 Mon Sep 17 00:00:00 2001 From: pukkandan Date: Tue, 20 Apr 2021 02:47:09 +0530 Subject: Improve --sub-langs (see desc) * Treat `--sub-langs` entries as regex * `all` can be used to refer to all the subtitles * the language code can be prefixed with `-` to exclude it * Deprecates `--all-subs` Closes #253 --- yt_dlp/options.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'yt_dlp/options.py') diff --git a/yt_dlp/options.py b/yt_dlp/options.py index fef1e4b15..a16604b73 100644 --- a/yt_dlp/options.py +++ b/yt_dlp/options.py @@ -548,7 +548,7 @@ def parseOpts(overrideArguments=None): subtitles.add_option( '--all-subs', action='store_true', dest='allsubtitles', default=False, - help='Download all the available subtitles of the video') + help=optparse.SUPPRESS_HELP) subtitles.add_option( '--list-subs', action='store_true', dest='listsubtitles', default=False, @@ -561,7 +561,10 @@ def parseOpts(overrideArguments=None): '--sub-langs', '--srt-langs', action='callback', dest='subtitleslangs', metavar='LANGS', type='str', default=[], callback=_comma_separated_values_options_callback, - help='Languages of the subtitles to download (optional) separated by commas, use --list-subs for available language tags') + help=( + 'Languages of the subtitles to download (can be regex) or "all" separated by commas. (Eg: --sub-langs en.*,ja) ' + 'You can prefix the language code with a "-" to exempt it from the requested languages. (Eg: --sub-langs all,-live_chat) ' + 'Use --list-subs for a list of available language tags')) downloader = optparse.OptionGroup(parser, 'Download Options') downloader.add_option( -- cgit v1.2.3