3 if vlc.access ~= "http"
11 function get_url_param( url, name )
12 return string.gsub( vlc.path, "^.*"..name.."=([^&]*).*$", "%1" )
15 if string.match( vlc.path, "youtube.com" )
17 if string.match( vlc.path, "watch%?v=" )
19 url = string.gsub( vlc.path, "^(.*)watch%?v=([^&]*).*$", "http://%1v/%2" )
27 if string.match( line, "<meta name=\"title\"" )
29 title = string.gsub( line, "^.*content=\"([^\"]*).*$", "%1" )
32 elseif string.match( vlc.path, "watch_fullscreen%?video_id=" ) or string.match( vlc.path, "p.swf" ) or string.match( vlc.path, "player2.swf" )
34 video_id = get_url_param( vlc.path, "video_id" )
35 t = get_url_param( vlc.path, "t" )
36 url = "http://www.youtube.com/get_video.php?video_id="..video_id.."&t="..t
37 if string.match( vlc.path, "title=" )
39 title = get_url_param( vlc.path, "title" )
42 elseif string.match( vlc.path, "dailymotion.com" )
44 len, str = vlc.peek( 9 )
50 if string.match( line, "param name=\"flashvars\" value=\"url=" )
52 url = vlc.decode_uri( string.gsub( line, "^.*param name=\"flashvars\" value=\"url=([^&]*).*$", "%1" ) )
56 elseif string.match( vlc.path, "video.google.com" ) and string.match( vlc.path, "videoplay" )
58 url = string.gsub( vlc.path, "^.*(docid=[^&]*).*$", "http://video.google.com/videogvp?%1" )
59 elseif string.match( vlc.path, "metacafe.com" )
61 if string.match( vlc.path, "watch/" )
63 url = string.gsub( vlc.path, "^.*watch/(.*[^/])/?$", "http://www.metacafe.com/fplayer/%1.swf" )
64 elseif string.match( vlc.path, "mediaURL=" )
66 url = string.gsub( vlc.path, "^.*mediaURL=([^&]*).*$", "%1" )
74 return true, url, title