2 Parse YouTube homepage and browse pages. Next step is to recode firefox
3 in VLC ... using Lua of course ;)
7 return vlc.access == "http" and ( string.match( vlc.path, "youtube.com/%?$" ) or string.match( vlc.path, "youtube.com/browse" ) )
15 if not line then break end
16 for _path, _artist, _name in string.gmatch( line, "href=\"(/watch%?v=[^\"]*)\" onclick=\"_hbLink%('([^']*)','Vid[^\']*'%);\">([^<]*)</a><br/>" )
18 path = "http://www.youtube.com" .. _path
19 name = vlc.resolve_xml_special_chars( _name )
22 for _min, _sec in string.gmatch( line, "<span class=\"runtime\">(%d*):(%d*)</span>" )
24 duration = 60 * _min + _sec
26 if path and name and artist and duration then
27 table.insert( p, { path = path; name = name; artist = artist; duration = duration } )