From: Rafaël Carré Date: Thu, 25 Oct 2007 23:45:08 +0000 (+0000) Subject: lua demuxer: update googlevideo X-Git-Tag: 0.9.0-test0~4808 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=18453ab2bb25fec3a9da389a641aae7cd852d818;p=vlc lua demuxer: update googlevideo --- diff --git a/share/luaplaylist/googlevideo.lua b/share/luaplaylist/googlevideo.lua index 3b9d8fc15a..49ead9fa68 100644 --- a/share/luaplaylist/googlevideo.lua +++ b/share/luaplaylist/googlevideo.lua @@ -9,7 +9,17 @@ end -- 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, "^" ) 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