Commit 41697f25 authored by Antoine Cellerier's avatar Antoine Cellerier

* share/luaplaylist/youtube_homepage.lua: New lua parser script to open...

* share/luaplaylist/youtube_homepage.lua: New lua parser script to open youtube home/browse pages. This demos the ability to return more than one item in lua playlist scripts.
parent 5f018616
...@@ -238,5 +238,6 @@ DIST_lua= \ ...@@ -238,5 +238,6 @@ DIST_lua= \
luaplaylist/README.txt \ luaplaylist/README.txt \
luaplaylist/dailymotion.lua \ luaplaylist/dailymotion.lua \
luaplaylist/youtube.lua \ luaplaylist/youtube.lua \
luaplaylist/youtube_homepage.lua \
luaplaylist/metacafe.lua \ luaplaylist/metacafe.lua \
luaplaylist/googlevideo.lua luaplaylist/googlevideo.lua
function probe()
return vlc.access == "http" and ( string.match( vlc.path, "youtube.com/$" ) or string.match( vlc.path, "youtube.com/browse" ) )
end
function parse()
p = {}
while true
do
line = vlc.readline()
if not line then break end
for path, artist, name in string.gmatch( line, "href=\"(/watch%?v=[^\"]*)\" onclick=\"_hbLink%('([^']*)','Vid[^\']*'%);\">([^<]*)</a><br/>" )
do
path = "http://www.youtube.com" .. path
name = vlc.resolve_xml_special_chars( name )
table.insert( p, { path = path; name = name; artist = artist } )
end
end
return p
end
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