From 75ef4b0234c7fdbf0ddd2910fc200c94963a2e40 Mon Sep 17 00:00:00 2001 From: Mikko Vedru Date: Sat, 30 Sep 2023 16:58:30 +0300 Subject: [PATCH 1/2] README.md: improve subtitle explanations I had to test it myself in order to understand how it works. For example, I found out that the subtitle "en-GB" will NOT be downloaded by either `--sub-langs "en*"` or by `--sub-langs "en-*"`. It would be better to decrease the confusion by improving the ReadMe. --- README.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 7bf446572..24e775048 100644 --- a/README.md +++ b/README.md @@ -893,14 +893,17 @@ ## Subtitle Options: --list-subs List available subtitles of each video. Simulate unless --no-simulate is used --sub-format FORMAT Subtitle format; accepts formats preference, - e.g. "srt" or "ass/srt/best" + separated by "/" e.g. "srt" or "ass/srt/best" --sub-langs LANGS Languages of the subtitles to download (can be regex) or "all" separated by commas, e.g. - --sub-langs "en.*,ja". You can prefix the - language code with a "-" to exclude it from - the requested languages, e.g. --sub-langs - all,-live_chat. Use --list-subs for a list - of available language tags + --sub-langs "en.*,ja". Example: "en.*" will + download both subtitles "en" and "en-GB", + while "en" will only download the former. + You can prefix the language code with a "-" + to exclude it from the requested languages, + e.g. --sub-langs all,-live_chat. Use + --list-subs for a list of available + language tags ## Authentication Options: -u, --username USERNAME Login with this account ID From 6248e526cf681257ff4ff5062665df6e3a858c1f Mon Sep 17 00:00:00 2001 From: Mikko Vedru Date: Sat, 30 Sep 2023 18:54:35 +0300 Subject: [PATCH 2/2] Update options.py --- yt_dlp/options.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/yt_dlp/options.py b/yt_dlp/options.py index 163809706..04d87e0cb 100644 --- a/yt_dlp/options.py +++ b/yt_dlp/options.py @@ -876,13 +876,14 @@ def _alias_callback(option, opt_str, value, parser, opts, nargs): subtitles.add_option( '--sub-format', action='store', dest='subtitlesformat', metavar='FORMAT', default='best', - help='Subtitle format; accepts formats preference, e.g. "srt" or "ass/srt/best"') + help='Subtitle format; accepts formats preference, separated by "/" e.g. "srt" or "ass/srt/best"') subtitles.add_option( '--sub-langs', '--srt-langs', action='callback', dest='subtitleslangs', metavar='LANGS', type='str', default=[], callback=_list_from_options_callback, help=( 'Languages of the subtitles to download (can be regex) or "all" separated by commas, e.g. --sub-langs "en.*,ja". ' + 'Example: "en.*" will download both subtitles "en" and "en-GB", while "en" will only download the former. ' 'You can prefix the language code with a "-" to exclude it from the requested languages, e.g. --sub-langs all,-live_chat. ' 'Use --list-subs for a list of available language tags'))