Commit f8b1ac11 authored by Pierre Ynard's avatar Pierre Ynard

youtube.lua: more clean-up

parent 9cd79b70
...@@ -24,13 +24,17 @@ function get_url_param( url, name ) ...@@ -24,13 +24,17 @@ function get_url_param( url, name )
return res return res
end end
function get_arturl( path, video_id ) function get_arturl()
if string.match( vlc.path, "iurl=" ) then -- FIXME: vlc.strings() is not a function, it should probably be
return vlc.strings( get_url_param( vlc.path, "iurl" ) ) -- 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 end
if not arturl then
return "http://img.youtube.com/vi/"..video_id.."/default.jpg" return "http://img.youtube.com/vi/"..video_id.."/default.jpg"
end
end end
-- Probe function. -- Probe function.
...@@ -106,8 +110,7 @@ function parse() ...@@ -106,8 +110,7 @@ function parse()
end end
if not arturl then if not arturl then
video_id = get_url_param( vlc.path, "v" ) arturl = get_arturl()
arturl = get_arturl( vlc.path, video_id )
end end
if not path then if not path then
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment