-- $Id$ -- Helper function to get a parameter's value in a URL function get_url_param( url, name ) return string.gsub( url, "^.*[&?]"..name.."=([^&]*).*$", "%1" ) end function get_arturl( path, video_id ) if string.match( vlc.path, "iurl=" ) then return vlc.decode_uri( get_url_param( vlc.path, "iurl" ) ) end if not arturl then return "http://img.youtube.com/vi/"..video_id.."/default.jpg" end end -- Probe function. function probe() return vlc.access == "http" and string.match( vlc.path, "youtube.com" ) and ( string.match( vlc.path, "watch%?v=" ) -- the html page or string.match( vlc.path, "watch_fullscreen%?video_id=" ) -- the fullscreen page or string.match( vlc.path, "p.swf" ) -- the (old?) player url or string.match( vlc.path, "jp.swf" ) -- the (new?) player url (as of 24/08/2007) or string.match( vlc.path, "player2.swf" ) ) -- another player url or ( string.match( vlc.path, "get_video%?video_id=" ) and not string.match( vlc.path, "t=" ) ) -- the video url without the t= parameter which is mandatory (since 24/08/2007) end -- Parse function. function parse() if string.match( vlc.path, "watch%?v=" ) then -- This is the HTML page's URL while true do -- Try to find the video's title line = vlc.readline() if not line then break end if string.match( line, "