summaryrefslogtreecommitdiffstats
path: root/player/lua/ytdl_hook.lua
diff options
context:
space:
mode:
authorrobin <rderooij685@gmail.com>2015-04-09 15:26:12 +0200
committerwm4 <wm4@nowhere>2015-04-09 20:34:36 +0200
commitd453600b4fe3fb7080cc41f0af11513140693eed (patch)
treeb4a3b25a138e656b4909805b229521539f397821 /player/lua/ytdl_hook.lua
parente76f6929e52ff3a9d2159ad15876d9343ad88788 (diff)
downloadmpv-d453600b4fe3fb7080cc41f0af11513140693eed.tar.bz2
mpv-d453600b4fe3fb7080cc41f0af11513140693eed.tar.xz
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.
Diffstat (limited to 'player/lua/ytdl_hook.lua')
-rw-r--r--player/lua/ytdl_hook.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/player/lua/ytdl_hook.lua b/player/lua/ytdl_hook.lua
index 7b0e9222e9..c3a48941c3 100644
--- a/player/lua/ytdl_hook.lua
+++ b/player/lua/ytdl_hook.lua
@@ -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