-- Example: http://onelike.tv/mtv-rossiya.html -- Add parameter to url function string.addParam(url, param) if url:match("%?") then return url.."&"..param else return url.."?"..param end end -- 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("onelike.tv") or vlc.path:match("oneliketv.com") end -- Parse function. function parse() local html = vlc.read(100000) if vlc.path:match("oneliketv.com") then url = html:match("file:%s*'([^']+)" ) title = vlc.path:match("title=([^&]+)" ) img = vlc.path:match("poster=([^&]+)") if title then title = vlc.strings.decode_uri(title) end if img then img = vlc.strings.decode_uri(img ) end else baseUrl = "http://onelike.tv" title = html:match('(.+)'); url = html:match(']+src="(http[^"]+%.php)"') img = html:match('class="post".-]+src="(/images.-)"') if img then img = baseUrl..img url = url:addParam("poster="..vlc.strings.encode_uri_component(img)) end if title then title = title:gsub("смотреть онлайн", ""):trim() title = title:gsub("бесплатно" , ""):trim() title = title:gsub("прямой эфир" , ""):trim() url = url:addParam("title="..vlc.strings.encode_uri_component(title)) end end if not url then vlc.msg.err("Couldn't find the url to media of the channel "..vlc.path) 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