From cf0842a34bedc44af69dc5c885eb99388d7a5eaf Mon Sep 17 00:00:00 2001 From: xingluo Date: Mon, 26 Jan 2026 19:19:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20play.lua?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- play.lua | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/play.lua b/play.lua index 5b76ea6..be6b8a4 100644 --- a/play.lua +++ b/play.lua @@ -182,21 +182,24 @@ for startIdx = 1, totalFrames, BATCH_SIZE do -- 请求打包 - - local resp,err = http.post( - server_url .. "/api/framepack", - textutils.serializeJSON({ urls = urls }), - { ["Content-Type"] = "application/json" }, - true - ) + while true do + resp1,err = http.post( + server_url .. "/api/framepack", + textutils.serializeJSON({ urls = urls }), + { ["Content-Type"] = "application/json" }, + true + ) + + if resp1 then break end + end - if not resp then error("Failed to download framepack "..err) end + if not resp1 then error("Failed to download framepack "..err) end - local binData = resp.readAll() + local binData = resp1.readAll() print(#binData .. " bytes received") - resp.close() + resp1.close() -- 解包 local batchFrames = unpackFramePack(binData)