From e538e3e5e4525d2964bbfd80874909a8aa384505 Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Fri, 19 Dec 2025 21:29:02 -0800 Subject: only cache on success --- xc.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'xc.lua') diff --git a/xc.lua b/xc.lua index b96d2a1..723f9cb 100644 --- a/xc.lua +++ b/xc.lua @@ -37,7 +37,10 @@ function mt:get(path, params) end function mt:api_get(params) - return mp_utils.parse_json(self:get('/player_api.php', params)) + local json = self:get('/player_api.php', params) + if json then + return mp_utils.parse_json(json) + end end function mt:get_live_categories() @@ -74,6 +77,9 @@ end function mt:get_epg() local xml = self:get('/xmltv.php') + if not xml then + return + end -- this is a bit retarded, but using python to convert xml to json -- avoids having to write an xml parser or pull in external -- cgit v1.2.3-70-g09d2