更新 play.lua
This commit is contained in:
13
play.lua
13
play.lua
@@ -182,21 +182,24 @@ for startIdx = 1, totalFrames, BATCH_SIZE do
|
|||||||
|
|
||||||
-- 请求打包
|
-- 请求打包
|
||||||
|
|
||||||
|
while true do
|
||||||
local resp,err = http.post(
|
resp1,err = http.post(
|
||||||
server_url .. "/api/framepack",
|
server_url .. "/api/framepack",
|
||||||
textutils.serializeJSON({ urls = urls }),
|
textutils.serializeJSON({ urls = urls }),
|
||||||
{ ["Content-Type"] = "application/json" },
|
{ ["Content-Type"] = "application/json" },
|
||||||
true
|
true
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if resp1 then break end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
if not resp then error("Failed to download framepack "..err) end
|
|
||||||
|
|
||||||
local binData = resp.readAll()
|
if not resp1 then error("Failed to download framepack "..err) end
|
||||||
|
|
||||||
|
local binData = resp1.readAll()
|
||||||
print(#binData .. " bytes received")
|
print(#binData .. " bytes received")
|
||||||
resp.close()
|
resp1.close()
|
||||||
|
|
||||||
-- 解包
|
-- 解包
|
||||||
local batchFrames = unpackFramePack(binData)
|
local batchFrames = unpackFramePack(binData)
|
||||||
|
|||||||
Reference in New Issue
Block a user