[vlc-commits] koreus.lua: tighten URL probe function

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 01:53:40 2016 +0100| [338b204b26b4e901ddf75350b6d1dcd50bf17156] | committer: Pierre Ynard

koreus.lua: tighten URL probe function

Ref. #17488

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

 share/lua/playlist/koreus.lua | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/share/lua/playlist/koreus.lua b/share/lua/playlist/koreus.lua
index 2385bdf..400cff3 100644
--- a/share/lua/playlist/koreus.lua
+++ b/share/lua/playlist/koreus.lua
@@ -19,14 +19,9 @@
 
 -- Probe function.
 function probe()
-    if vlc.access ~= "http" and vlc.access ~= "https" then
-        return false
-    end
-    koreus_site = string.match( vlc.path, "koreus" )
-    if not koreus_site then
-        return false
-    end
-    return (  string.match( vlc.path, "video" )  ) -- http://www.koreus.com/video/pouet.html
+    local path = vlc.path:gsub("^www%.", "")
+    return ( vlc.access == "http" or vlc.access == "https" )
+        and string.match( path, "^koreus%.com/video/.+" )
 end
 
 -- Parse function.



More information about the vlc-commits mailing list