[vlc-commits] lua: fix and tighten URL probe functions of playlist scripts

Pierre Ynard git at videolan.org
Wed Nov 2 02:21:10 CET 2016


vlc | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Wed Nov  2 02:08:54 2016 +0100| [a1e38a36b508fc592ab453386f1f4f3d2c78ac5c] | committer: Pierre Ynard

lua: fix and tighten URL probe functions of playlist scripts

Fix wrong operator precedence. These scripts are still outdated and
broken though.

Ref. #17488

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a1e38a36b508fc592ab453386f1f4f3d2c78ac5c
---

 share/lua/playlist/extreme.lua | 7 ++++---
 share/lua/playlist/pluzz.lua   | 7 ++++---
 share/lua/playlist/zapiks.lua  | 7 ++++---
 3 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/share/lua/playlist/extreme.lua b/share/lua/playlist/extreme.lua
index 21bcb05..23fb0a8 100644
--- a/share/lua/playlist/extreme.lua
+++ b/share/lua/playlist/extreme.lua
@@ -22,10 +22,11 @@
 
 -- Probe function.
 function probe()
+    local path = vlc.path:gsub("^www%.", "")
     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.
diff --git a/share/lua/playlist/pluzz.lua b/share/lua/playlist/pluzz.lua
index 4a84314..14e4150 100644
--- a/share/lua/playlist/pluzz.lua
+++ b/share/lua/playlist/pluzz.lua
@@ -22,10 +22,11 @@
 
 -- Probe function.
 function probe()
+    local path = vlc.path:gsub("^www%.", "")
     return vlc.access == "http"
-        and string.match( vlc.path, "pluzz.fr/%w+" )
-        or string.match( vlc.path, "info.francetelevisions.fr/.+")
-        or string.match( vlc.path, "france4.fr/%w+")
+        and ( string.match( vlc.path, "^pluzz%.francetv%.fr/%w+" )
+        or string.match( vlc.path, "^info%.francetelevisions%.fr/.+")
+        or string.match( vlc.path, "^france4%.fr/%w+") )
 end
 
 -- Helpers
diff --git a/share/lua/playlist/zapiks.lua b/share/lua/playlist/zapiks.lua
index b46e67d..2c8a421 100644
--- a/share/lua/playlist/zapiks.lua
+++ b/share/lua/playlist/zapiks.lua
@@ -22,10 +22,11 @@
 
 -- Probe function.
 function probe()
+    local path = vlc.path:gsub("^www%.", "")
     return vlc.access == "http"
-        and string.match( vlc.path, "zapiks.fr/(.*).html" )
-            or string.match( vlc.path, "zapiks.fr/view/." )
-            or string.match( vlc.path, "26in.fr/videos/." )
+        and ( string.match( vlc.path, "^zapiks%.fr/(.*)%.html" )
+            or string.match( vlc.path, "^zapiks%.fr/view/.+" )
+            or string.match( vlc.path, "^26in%.fr/videos/.+" ) )
 end
 
 -- Parse function.



More information about the vlc-commits mailing list