]> git.sesse.net Git - vlc/commitdiff
lua: fix build soundcloud.lua
authorAdrian Yanes <devel@ayanes.com>
Wed, 18 Apr 2012 19:45:01 +0000 (21:45 +0200)
committerPierre Ynard <linkfanel@yahoo.fr>
Wed, 18 Apr 2012 19:45:01 +0000 (21:45 +0200)
Details: From Lua 5.2: Change to '\z' escape.
Reject undefined escape sequences. The
proper way to match the dot in Lua is %.

Signed-off-by: Pierre Ynard <linkfanel@yahoo.fr>
share/lua/playlist/soundcloud.lua

index 58f5aacda76f42b1bfd738187b4828e198bd3dea..7b324dc7e43cb861e846a927ba17a4bd13617d44 100644 (file)
 -- Probe function.
 function probe()
     return vlc.access == "http"
-        and string.match( vlc.path, "soundcloud\.com/.+/.+" )
+        and string.match( vlc.path, "soundcloud%.com/.+/.+" )
 end
 
 -- Parse function.
 function parse()
-    if string.match ( vlc.path, "soundcloud\.com" ) then
+    if string.match ( vlc.path, "soundcloud%.com" ) then
         while true do
             line = vlc.readline()
             if not line then break end
-            if string.match( line, "window\.SC\.bufferTracks\.push" ) then
+            if string.match( line, "window%.SC%.bufferTracks%.push" ) then
                 -- all the data is nicely stored on this one line
                 _,_,uid,token,name = string.find (line,
-                        "window\.SC\.bufferTracks\.push.*" ..
+                        "window%.SC%.bufferTracks%.push.*" ..
                         "\"uid\":\"([^\"]*)\".*" ..
                         "\"token\":\"([^\"]*)\".*" ..
                         "\"title\":\"([^\"]*)\"")