cq:wrap(function()
while true do
local headers, stream = assert(http_request.new_from_uri(futatabi_server .. "/queue_status"):go())
- replay_title = "IPTV"
- if headers:get ":status" == "200" then
- local body = assert(stream:get_body_as_string())
+ if headers:get(":status") == "200" then
+ local body = stream:get_body_as_string()
if body then
replay_title = "IPTV (" .. body .. ")"
+ else
+ replay_title = "IPTV"
+ print(futatabi_server .. ": Empty body on HTTP request")
end
+ else
+ replay_title = "IPTV"
+ print(futatabi_server .. ": HTTP error " .. headers:get(":status"))
end
end
end)