From 633147c9596177d42d9651aaf101a426d754cb7c Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Sun, 22 Feb 2015 17:32:42 -0300 Subject: ytdl: add "--ytdl-params" option This option allows the user to pass non-supported options directly to youtube-dl, such as "--proxy URL", "--username USERNAME" and '--password PASSWORD". There is no sanity checking so it's possible to break things (i.e. if you pass "--version" mpv exits with random JSON error). Signed-off-by: wm4 --- player/lua/ytdl_hook.lua | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'player') diff --git a/player/lua/ytdl_hook.lua b/player/lua/ytdl_hook.lua index f757e5a28b..7b0e9222e9 100644 --- a/player/lua/ytdl_hook.lua +++ b/player/lua/ytdl_hook.lua @@ -80,6 +80,7 @@ mp.add_hook("on_load", 10, function () end local format = mp.get_property("options/ytdl-format") + local raw_options = mp.get_property_native("options/ytdl-raw-options") -- subformat workaround local subformat = "ass/srt/best" @@ -92,6 +93,12 @@ mp.add_hook("on_load", 10, function () table.insert(command, "--format") table.insert(command, format) end + for param, arg in pairs(raw_options) do + table.insert(command, "--" .. param) + if (arg ~= "") then + table.insert(command, arg) + end + end table.insert(command, "--") table.insert(command, url) local es, json = exec(command) -- cgit v1.2.3