Commit c5c44df6 authored by Marvin Scholz's avatar Marvin Scholz

lua: playlist/appletrailers: Improve error handling

parent fb6d424b
......@@ -50,6 +50,10 @@ function parse_json(url)
string = string .. line
end
if string == "" then
return 0, 0, "Got empty response from server."
end
return json.decode(string)
end
......@@ -72,7 +76,12 @@ function parse()
-- Found a video id
if video_id ~= nil then
-- Lookup info from the json endpoint
local info = filmid_info(video_id)
local info, _, err = filmid_info(video_id)
if err ~= nil then
vlc.msg.err("Error to parse JSON response from Apple trailers: " .. err)
return playlist
end
-- Parse data
if info["clips"] == nil then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment