ytdl_hook: if ytdl not found in config dirs, use ytdl_path as is

This commit is contained in:
Ricardo Constantino 2020-10-25 21:20:46 +00:00
parent 93f84b514a
commit ad1ecd4350
No known key found for this signature in database
GPG Key ID: EFD16019AE4FF531
1 changed files with 4 additions and 1 deletions

View File

@ -693,7 +693,10 @@ function run_ytdl_hook(url)
if not (ytdl.searched) then
local exesuf = (package.config:sub(1,1) == '\\') and '.exe' or ''
local ytdl_mcd = mp.find_config_file(o.ytdl_path .. exesuf)
if not (ytdl_mcd == nil) then
if ytdl_mcd == nil then
msg.verbose("No youtube-dl found with path "..o.ytdl_path..exesuf.." in config directories")
ytdl.path = o.ytdl_path
else
msg.verbose("found youtube-dl at: " .. ytdl_mcd)
ytdl.path = ytdl_mcd
end