1 -- Get's an artwork from images.google.com
4 -- Replace non alphanumeric char by +
5 function get_query( title )
6 -- If we have a .EXT remove the extension.
7 str = string.gsub( title, "(.*)%....$", "%1" )
8 return string.gsub( str, "([^%w ])",
9 function (c) return string.format ("%%%02X", string.byte(c)) end)
14 if vlc.artist and vlc.album then
15 title = vlc.artist.." "..vlc.album
16 elseif vlc.title and vlc.artist then
17 title = vlc.artist.." "..vlc.title
25 fd = vlc.stream_new( "http://images.google.com/images?q=" .. get_query( title ) )
26 page = vlc.stream_read( fd, 65653 )
27 vlc.stream_delete( fd )
28 _, _, arturl = string.find( page, "imgurl=([^&]+)" )
29 return vlc.decode_uri(arturl)