Skip to content

Commit

Permalink
Upd: notify client about yt-dlp parsing error
Browse files Browse the repository at this point in the history
  • Loading branch information
jcorporation committed May 18, 2024
1 parent 0f8bc35 commit ddb9d00
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/scripting/scripts/yt-dlp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ local function yt_dlp_call(uri, args, parse_json)
-- check result from yt-dlp for malformed format or bad data
if string.sub(output, 1, 2) == "NA" then
mympd.log(3, "[yt-dlp] bad format or no metadata: " ..output)
error("yt-dlp failed to parse --format string, or returned no usable metadata!")
local err_msg = "yt-dlp failed to parse --format string, or returned no usable metadata!"
mympd.notify_client(2, err_msg)
error(err_msg)
end

-- remove any trailing commas, pack into json array, and parse
Expand Down

0 comments on commit ddb9d00

Please sign in to comment.