[vlc-devel] [PATCH 1/3] Cleanup lua script escape sequences for lua 5.2. Converting \ to %, since 5.2 no longer accepts \.

Kelly Anderson kelly at silka.with-linux.com
Thu Jan 5 14:23:35 CET 2012


---
 share/lua/extensions/imdb.lua        |    2 +-
 share/lua/playlist/appletrailers.lua |    6 +++---
 share/lua/playlist/extreme.lua       |   10 +++++-----
 share/lua/playlist/katsomo.lua       |    2 +-
 share/lua/playlist/mpora.lua         |    4 ++--
 share/lua/playlist/pinkbike.lua      |    4 ++--
 6 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/share/lua/extensions/imdb.lua b/share/lua/extensions/imdb.lua
index 829948d..194a219 100644
--- a/share/lua/extensions/imdb.lua
+++ b/share/lua/extensions/imdb.lua
@@ -237,7 +237,7 @@ function parse_resultspage(data)
                 if not link then break end -- this would not be normal behavior...
                 _, pos, thistitle = string.find(table, "<a href=\"" .. link .. "\"[^>]*>([^<]+)</a>", pos)
                 if not thistitle then break end -- this would not be normal behavior...
-                local _, _, year = string.find(table, "\((%d+)\)", pos)
+                local _, _, year = string.find(table, "%((%d+)%)", pos)
                 -- Add this title to the list
                 count = count + 1
                 local _, _, imdbID = string.find(link, "/([^/]+)/$")
diff --git a/share/lua/playlist/appletrailers.lua b/share/lua/playlist/appletrailers.lua
index 8bd4bea..4d0f5e7 100644
--- a/share/lua/playlist/appletrailers.lua
+++ b/share/lua/playlist/appletrailers.lua
@@ -67,7 +67,7 @@ function parse()
             description = find( line, "h%d.->(.-)</h%d") .. ' '
         end
         if string.match( line, 'img src=') then
-            for img in string.gmatch(line, '<img src="(http://.*\.jpg)" ') do
+            for img in string.gmatch(line, '<img src="(http://.*%.jpg)" ') do
                 art_url = img
             end
             for i,value in pairs(playlist) do
@@ -76,8 +76,8 @@ function parse()
                 else break end
             end
         end
-        if string.match( line, "class=\"hd\".-\.mov") then
-            for urlline,resolution in string.gmatch(line, "class=\"hd\".-href=\"(.-.mov)\".-(%d+.-p)") do
+        if string.match( line, 'class="hd".-%.mov') then
+            for urlline,resolution in string.gmatch(line, 'class="hd".-href="(.-%.mov)".-(%d+.-p)') do
                 urlline = string.gsub( urlline, "_"..resolution, "_h"..resolution )
                 table.insert( playlist, { path = urlline,
                                           name = description ..  '(' .. resolution .. ')',
diff --git a/share/lua/playlist/extreme.lua b/share/lua/playlist/extreme.lua
index 6fd7251..f5949ce 100644
--- a/share/lua/playlist/extreme.lua
+++ b/share/lua/playlist/extreme.lua
@@ -34,14 +34,14 @@ end
 -- Probe function.
 function probe()
     return vlc.access == "http"
-        and string.match( vlc.path, "extreme.com/." )
-        or string.match( vlc.path, "freecaster.tv/." )
-        or string.match( vlc.path, "player.extreme.com/info/.")
+        and string.match( vlc.path, "extreme%.com/." )
+        or string.match( vlc.path, "freecaster%.tv/." )
+        or string.match( vlc.path, "player%.extreme%.com/info/.")
 end
 
 -- Parse function.
 function parse()
-    if (string.match( vlc.path, "extreme\.com/." ) or string.match( vlc.path, "freecaster\.tv/." )) and not string.match( vlc.path, "player.extreme.com/info/") then
+    if (string.match( vlc.path, "extreme%.com/." ) or string.match( vlc.path, "freecaster%.tv/." )) and not string.match( vlc.path, "player%.extreme%.com/info/") then
         while true do
             line = vlc.readline()
             if not line then break end
@@ -54,7 +54,7 @@ function parse()
         return { { path = "http://player.extreme.com/info/" .. vid; name = "extreme.com video"; } }
     end
 
-    if string.match( vlc.path, "player.extreme.com/info/." ) then
+    if string.match( vlc.path, "player%.extreme%.com/info/." ) then
         prefres = get_prefres()
         gostraight = true
         while true do
diff --git a/share/lua/playlist/katsomo.lua b/share/lua/playlist/katsomo.lua
index bf461c7..6965e4e 100644
--- a/share/lua/playlist/katsomo.lua
+++ b/share/lua/playlist/katsomo.lua
@@ -57,7 +57,7 @@ function parse()
         then
             arturl = "http://www.katsomo.fi"..find( line, " src=\"(.-)\" alt=" )
         end
-        for treeid,name in string.gmatch( line, "/\?treeId=(%d+)\">([^<]+)</a") do
+        for treeid,name in string.gmatch( line, '/%?treeId=(%d+)">([^<]+)</a') do
             name = vlc.strings.resolve_xml_special_chars( name )
             name = vlc.strings.from_charset( "ISO_8859-1", name )
             path = "http://www.katsomo.fi/?treeId="..treeid
diff --git a/share/lua/playlist/mpora.lua b/share/lua/playlist/mpora.lua
index cfee5d0..d48c1e6 100644
--- a/share/lua/playlist/mpora.lua
+++ b/share/lua/playlist/mpora.lua
@@ -23,7 +23,7 @@
 -- Probe function.
 function probe()
     return vlc.access == "http"
-        and string.match( vlc.path, "video.mpora.com/watch/" )
+        and string.match( vlc.path, "video%.mpora%.com/watch/" )
 end
 
 -- Parse function.
@@ -40,7 +40,7 @@ function parse()
             _,_,arturl = string.find( line, "image_src\" href=\"(.*)\" />" )
         end
         if string.match( line, "video_src" ) then
-            _,_,video = string.find( line, "href=\"http://video\.mpora\.com/ep/(.*).swf\" />" )
+            _,_,video = string.find( line, 'href="http://video%.mpora%.com/ep/(.*)%.swf" />' )
         end
 
     end
diff --git a/share/lua/playlist/pinkbike.lua b/share/lua/playlist/pinkbike.lua
index 06105d7..f6787c8 100644
--- a/share/lua/playlist/pinkbike.lua
+++ b/share/lua/playlist/pinkbike.lua
@@ -45,10 +45,10 @@ function parse()
 			end
 			-- Try to find server which has our video
 			if string.match( line, "<link rel=\"videothumbnail\" href=\"http://(.*)/vt/svt-") then
-				_,_,server = string.find (line, "<link rel=\"videothumbnail\"\ href=\"http://(.*)/vt/svt-" )
+				_,_,server = string.find (line, '<link rel="videothumbnail" href="http://(.*)/vt/svt-' )
 			end
 			if string.match( line, "<link rel=\"videothumbnail\" href=\"(.*)\" type=\"image/jpeg\"") then
-				_,_,arturl = string.find (line, "<link rel=\"videothumbnail\" href=\"(.*)\"\ type=\"image/jpeg\"")
+				_,_,arturl = string.find (line, '<link rel="videothumbnail" href="(.*)" type="image/jpeg"')
 			end
 		end
 
-- 
1.7.8.2




More information about the vlc-devel mailing list