mirror of
https://github.com/mpv-player/mpv
synced 2024-12-25 00:02:13 +00:00
ytdl_hook.lua: Disable video when vid option is "no"
When setting options like --no-video, ytdl_hook adds the "-x" argument to youtube-dl, so that bandwith is saved by not downloading the video on some sites.
This commit is contained in:
parent
e76f6929e5
commit
d453600b4f
@ -93,6 +93,13 @@ mp.add_hook("on_load", 10, function ()
|
||||
table.insert(command, "--format")
|
||||
table.insert(command, format)
|
||||
end
|
||||
|
||||
-- Checks if no-video option is set and disables video in ytdl if set
|
||||
if (mp.get_property("options/vid") == "no") then
|
||||
table.insert(command, "-x")
|
||||
msg.verbose("Video disabled. Only using audio")
|
||||
end
|
||||
|
||||
for param, arg in pairs(raw_options) do
|
||||
table.insert(command, "--" .. param)
|
||||
if (arg ~= "") then
|
||||
|
Loading…
Reference in New Issue
Block a user