summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorfireattack <human.peng@gmail.com>2023-08-13 13:10:27 +0800
committerDudemanguy <random342@airmail.cc>2023-08-13 14:40:36 +0000
commit3954660f034c706526171bae21436a4f326c5efc (patch)
treeb690e3d4a2e5eaefbe8f9ee3168019b90925b204 /player
parent598e30173d4a6b6414b010647e97809729224374 (diff)
downloadmpv-3954660f034c706526171bae21436a4f326c5efc.tar.bz2
mpv-3954660f034c706526171bae21436a4f326c5efc.tar.xz
ytdl_hook: improve Windows exe search with suffix
Diffstat (limited to 'player')
-rw-r--r--player/lua/ytdl_hook.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/player/lua/ytdl_hook.lua b/player/lua/ytdl_hook.lua
index 6a3c6d8530..7e456b9ec7 100644
--- a/player/lua/ytdl_hook.lua
+++ b/player/lua/ytdl_hook.lua
@@ -834,7 +834,7 @@ function run_ytdl_hook(url)
for _, path in pairs(ytdl.paths_to_search) do
-- search for youtube-dl in mpv's config dir
- local exesuf = platform_is_windows() and ".exe" or ""
+ local exesuf = platform_is_windows() and not path:lower():match("%.exe$") and ".exe" or ""
local ytdl_cmd = mp.find_config_file(path .. exesuf)
if ytdl_cmd then
msg.verbose("Found youtube-dl at: " .. ytdl_cmd)
@@ -847,9 +847,9 @@ function run_ytdl_hook(url)
command[1] = path
result = exec(command)
if result.error_string == "init" then
- msg.verbose("youtube-dl with path " .. path .. exesuf .. " not found in PATH or not enough permissions")
+ msg.verbose("youtube-dl with path " .. path .. " not found in PATH or not enough permissions")
else
- msg.verbose("Found youtube-dl with path " .. path .. exesuf .. " in PATH")
+ msg.verbose("Found youtube-dl with path " .. path .. " in PATH")
ytdl.path = path
break
end