[vlc-commits] youtube.lua: more clean-up

Pierre Ynard git at videolan.org
Sun Aug 7 09:29:34 CEST 2011


vlc | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Sun Aug  7 09:28:34 2011 +0200| [f8b1ac11f42233e6e1352f611f296f30112ad28d] | committer: Pierre Ynard

youtube.lua: more clean-up

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

 share/lua/playlist/youtube.lua |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/share/lua/playlist/youtube.lua b/share/lua/playlist/youtube.lua
index 88b9055..95a7a43 100644
--- a/share/lua/playlist/youtube.lua
+++ b/share/lua/playlist/youtube.lua
@@ -24,13 +24,17 @@ function get_url_param( url, name )
     return res
 end
 
-function get_arturl( path, video_id )
-    if string.match( vlc.path, "iurl=" ) then
-        return vlc.strings( get_url_param( vlc.path, "iurl" ) )
-    end
-    if not arturl then
-        return "http://img.youtube.com/vi/"..video_id.."/default.jpg"
+function get_arturl()
+    -- FIXME: vlc.strings() is not a function, it should probably be
+    -- vlc.strings.decode_uri()
+    --if string.match( vlc.path, "iurl=" ) then
+    --    return vlc.strings( get_url_param( vlc.path, "iurl" ) )
+    --end
+    video_id = get_url_param( vlc.path, "v" )
+    if not video_id then
+        return nil
     end
+    return "http://img.youtube.com/vi/"..video_id.."/default.jpg"
 end
 
 -- Probe function.
@@ -106,8 +110,7 @@ function parse()
         end
 
         if not arturl then
-            video_id = get_url_param( vlc.path, "v" )
-            arturl = get_arturl( vlc.path, video_id )
+            arturl = get_arturl()
         end
 
         if not path then



More information about the vlc-commits mailing list