-- Parse function.
function parse()
- -- We don't need to get the meta data here since it'll be available in
- -- the GVP file.
- return { { path = string.gsub( vlc.path, "^.*(docid=[^&]*).*$", "http://video.google.com/videogvp?%1" ) } }
+ while true
+ do
+ line = vlc.readline()
+ if not line then break end
+ if string.match( line, "^<title>" ) then
+ title = string.gsub( line, "<title>([^<]*).*", "%1" )
+ end
+ if string.match( line, "src=\"/googleplayer.swf" ) then
+ url = string.gsub( line, ".*videoUrl=([^&]*).*" ,"%1" )
+ arturl = string.gsub( line, ".*thumbnailUrl=([^\"]*).*", "%1" )
+ return { { path = vlc.decode_uri(url), title = title, arturl = vlc.decode_uri(arturl) } }
+ end
+ end
end