]> git.sesse.net Git - vlc/commitdiff
* dailymotion.lua: woops, forgot to include title fetching in previous version.
authorAntoine Cellerier <dionoea@videolan.org>
Mon, 14 May 2007 22:32:43 +0000 (22:32 +0000)
committerAntoine Cellerier <dionoea@videolan.org>
Mon, 14 May 2007 22:32:43 +0000 (22:32 +0000)
share/luaplaylist/dailymotion.lua

index 8943f5f88f601d28e054a044365525791427ad65..3d3777e7885d7898519584c2c2d35b83c7100e54 100644 (file)
@@ -15,8 +15,13 @@ function parse()
         if not line then break end
         if string.match( line, "param name=\"flashvars\" value=\"url=" )
         then
-            return { { url = vlc.decode_uri( string.gsub( line, "^.*param name=\"flashvars\" value=\"url=([^&]*).*$", "%1" ) ) } }
+            url = vlc.decode_uri( string.gsub( line, "^.*param name=\"flashvars\" value=\"url=([^&]*).*$", "%1" ) )
         end
+        if string.match( line, "<title>" )
+        then
+            title = vlc.decode_uri( string.gsub( line, "^.*<title>([^<]*).*$", "%1" ) )
+        end
+        if url and title then break end
     end
-    return {}
+    return { { url = url; title = title } }
 end