Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions player/lua/ytdl_hook.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1006,6 +1006,15 @@ local function run_ytdl_hook(url)
if result.status ~= 0 or json == "" then
json = nil
elseif json then
-- trim any preceding text before JSON
local start = json:find("{", 1, true)
if start == nil then
msg.error("youtube-dl failed: couldn't find JSON data")
return
elseif start > 1 then
json = json:sub(start)
end

json, parse_err = utils.parse_json(json)
end

Expand Down