-- Example: http://only-tv.org/bollywood.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("only%-tv.org") or vlc.path:match("youtvonlinefree.com") end -- Parse function. function parse() local html = vlc.read(200000) if vlc.path:match("youtvonlinefree.com") then url = html:match("file:%s*'([^']+)" ) title = vlc.path:match("title=([^&]+)" ) img = vlc.path:match("poster=([^&]+)") if not url then vlc.msg.err("Couldn't find url to stream in the "..vlc.access.."://"..vlc.path) end if title then title = vlc.strings.decode_uri(title) end if img then img = vlc.strings.decode_uri(img ) end else baseUrl = "http://only-tv.org" title = html:match('(.+)'); url = html:match(']+src="(http[^"]+%.php)"') img = html:match('class="post".-]+src="(/images.-)"') if not url then vlc.msg.err("Couldn't find iframe url in the "..vlc.access.."://"..vlc.path) return {} end 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 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