diff options
author | robin <rderooij685@gmail.com> | 2015-04-27 22:30:10 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-04-27 23:32:59 +0200 |
commit | 5555f6fc2ca7c418e23daa58413148c4267f6ad2 (patch) | |
tree | 5064b04c0333efa6781791c0799430993e6a8458 | |
parent | d3c7fd9d7c971086a3d6fde5f6f1bc4ef0b2e904 (diff) |
ytdl_hook.lua: Change format options when vid is "off"
This will change the format option to "bestaudio/best" instead of
passing the "-x" argument to yt-dl.
Prevents the video still being downloaded in the new mpv versions where
the yt-dl format is set to "best" by default.
-rw-r--r-- | player/lua/ytdl_hook.lua | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/player/lua/ytdl_hook.lua b/player/lua/ytdl_hook.lua index 508c43f543..d6fa1ca7c2 100644 --- a/player/lua/ytdl_hook.lua +++ b/player/lua/ytdl_hook.lua @@ -103,16 +103,17 @@ mp.add_hook("on_load", 10, function () ytdl.path, "--no-warnings", "-J", "--flat-playlist", "--all-subs", "--sub-format", subformat, "--no-playlist" } + + -- Checks if video option is "no", change options accordingly + if (mp.get_property("options/vid") == "no") then + format = "bestaudio/best" + msg.verbose("Video disabled. Only using audio") + end + if (format ~= "") then 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) |