1
0
mirror of https://github.com/mpv-player/mpv synced 2025-02-15 03:27:35 +00:00

ytdl_hook.lua: improve check for sub language before inserting all-subs

youtube-dl and yt-dlp both support --sub-langs and --srt-lang in
addition to --sub-lang for defining languages of subtitles. This hook
only checked for sub-lang in --ytdl-raw-options and inserted --all-subs
in its absence.
This commit is contained in:
Umar Javed 2021-11-14 17:30:04 +05:00 committed by sfan5
parent b44f522dba
commit 923c0f0370

View File

@ -762,7 +762,7 @@ function run_ytdl_hook(url)
if (arg ~= "") then
table.insert(command, arg)
end
if (param == "sub-lang") and (arg ~= "") then
if (param == "sub-lang" or param == "sub-langs" or param == "srt-lang") and (arg ~= "") then
allsubs = false
elseif (param == "proxy") and (arg ~= "") then
proxy = arg