Skip to content

Commit

Permalink
Upd: use mympd.log
Browse files Browse the repository at this point in the history
  • Loading branch information
jcorporation committed May 17, 2024
1 parent 9d88c97 commit c222300
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/scripting/scripts/yt-dlp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
-- yt-dlp helper functions
local function yt_dlp_call(uri, args, parse_json)
local cmd = string.format("yt-dlp %s '%s' 2>/dev/null", args, uri)
print("[yt-dlp] running command: " ..cmd)
mympd.log(6, "[yt-dlp] running command: " ..cmd)
local output = mympd.os_capture(cmd)

-- return if output is nil/the empty string, or we don't have to parse json
Expand All @@ -12,7 +12,7 @@ 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
print("[yt-dlp] bad format or no metadata: " ..output)
mympd.log(3, "[yt-dlp] bad format or no metadata: " ..output)
error("yt-dlp failed to parse --format string, or returned no usable metadata!")
end

Expand Down

0 comments on commit c222300

Please sign in to comment.