-- Example: http://pokazz.net/337-match-arena.html
-- Trimming spaces
function string.trim(text)
return text:gsub("^%s*(.-)%s*$", "%1")
end
-- Probe function.
function probe()
if vlc.access ~= "http" and vlc.access ~= "https" then
return false
end
return vlc.path:match("pokazz.net")
end
-- Parse function.
function parse()
local urlBase = "http://pokazz.net"
local html = vlc.read(200000) -- get all contents of html page
url = html:match("http[^'\"<>]+%.m3u8%?[^<>'\"]+") -- find link to m3u8 playlist
if not url then
vlc.msg.err("Couldn't find url to stream on the "..vlc.access.."://"..vlc.path)
return {}
end
-- find link to our channel for image
local dataPattern = "(]+href=\"[^\"]+"..vlc.path:gsub("%-", "%%%-")..".-)"
local data = html:match(dataPattern)
if data then
img = html:match("]+src=\"(.-)\"")
if img then img = urlBase..img end
end
title = html:match("