From e1ed7e89f9c297d7e8eba03d42b70bf7ecbd586f Mon Sep 17 00:00:00 2001 From: xingluo Date: Mon, 26 Jan 2026 19:09:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20speakerlib.lua?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- speakerlib.lua | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/speakerlib.lua b/speakerlib.lua index 99037ff..ae620c2 100644 --- a/speakerlib.lua +++ b/speakerlib.lua @@ -62,7 +62,7 @@ end local function get_total_duration(url) if _G.Playprint then printlog("Calculating duration...") end - local handle, err = http.get(url) + local handle, err = http.get(url,{["Content-Type"] = "application/json"}, true) if not handle then error(url .. "Could not get duration: " .. (err or "Unknown error")) end @@ -152,21 +152,21 @@ elseif cmd == "play" then local mono_httpfile, left_httpfile, right_httpfile if mono_url and #speakerlist.main > 0 then - mono_httpfile = http.get(mono_url) + mono_httpfile = http.get(mono_url,{["Content-Type"] = "application/json"}, true) if not mono_httpfile then error("Could not open mono audio stream") end end if left_url and #speakerlist.left > 0 then - left_httpfile = http.get(left_url) + left_httpfile = http.get(left_url,{["Content-Type"] = "application/json"}, true) if not left_httpfile then error("Could not open left audio stream") end end if right_url and #speakerlist.right > 0 then - right_httpfile = http.get(right_url) + right_httpfile = http.get(right_url,{["Content-Type"] = "application/json"}, true) if not right_httpfile then error("Could not open right audio stream") end @@ -211,17 +211,17 @@ elseif cmd == "play" then if right_httpfile then right_httpfile.close() end if mono_url and #speakerlist.main > 0 then - mono_httpfile = http.get(mono_url) + mono_httpfile = http.get(mono_url,{["Content-Type"] = "application/json"}, true) if not mono_httpfile then error("Could not reopen mono stream") end end if left_url and #speakerlist.left > 0 then - left_httpfile = http.get(left_url) + left_httpfile = http.get(left_url,{["Content-Type"] = "application/json"}, true) if not left_httpfile then error("Could not reopen left stream") end end if right_url and #speakerlist.right > 0 then - right_httpfile = http.get(right_url) + right_httpfile = http.get(right_url,{["Content-Type"] = "application/json"}, true) if not right_httpfile then error("Could not reopen right stream") end end