mirror of https://github.com/mpv-player/mpv
ytdl_hook: use subtitle `name` as title if available
So far the `ext` was always used as the title, but `name` is more appropriate when it's available.
This commit is contained in:
parent
f46bbde5e6
commit
ac7f3913d3
|
@ -658,7 +658,8 @@ local function add_single_video(json)
|
||||||
edl = edl .. ",codec=" .. codec
|
edl = edl .. ",codec=" .. codec
|
||||||
end
|
end
|
||||||
edl = edl .. ";" .. edl_escape(sub)
|
edl = edl .. ";" .. edl_escape(sub)
|
||||||
mp.commandv("sub-add", edl, "auto", sub_info.ext, lang)
|
local title = sub_info.name or sub_info.ext
|
||||||
|
mp.commandv("sub-add", edl, "auto", title, lang)
|
||||||
else
|
else
|
||||||
msg.verbose("No subtitle data/url for ["..lang.."]")
|
msg.verbose("No subtitle data/url for ["..lang.."]")
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue