--- Update the Futatabi status in the title.
-replay_title = "IPTV"
-cq:wrap(function()
- local req = http_request.new_from_uri(futatabi_server .. "/queue_status")
- while true do
- local headers, stream = req:go()
- if headers == nil then
- replay_title = "IPTV"
- print(futatabi_server .. ": Could not connect to get queue_status")
- elseif 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)
-