-- 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("(.-)") if title then title = title:gsub("смотреть", ""):trim() title = title:gsub("в хорошем качестве", ""):trim() title = title:gsub("хорошем качестве" , ""):trim() title = title:gsub("бесплатно", ""):trim() title = title:gsub("онлайн в" , ""):trim() title = title:gsub("онлайн" , ""):trim() title = title:gsub("прямую трансляцию", ""):trim() end item = {} item.path = url item.title = title item.arturl = img item.options = { ":http-user-agent=Mozilla/5.0"; ":http-referrer="..vlc.access.."://"..vlc.path } return { item } end