[vlc-commits] lua soundcloud: fetch artwork

Ludovic Fauvet git at videolan.org
Thu Sep 13 00:40:54 CEST 2012


vlc | branch: master | Ludovic Fauvet <etix at videolan.org> | Wed Sep 12 15:15:15 2012 +0200| [c163f06ea04ec085539d517749f442746644c0e5] | committer: Jean-Baptiste Kempf

lua soundcloud: fetch artwork

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 share/lua/playlist/soundcloud.lua |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/share/lua/playlist/soundcloud.lua b/share/lua/playlist/soundcloud.lua
index 7b324dc..bd9f5d6 100644
--- a/share/lua/playlist/soundcloud.lua
+++ b/share/lua/playlist/soundcloud.lua
@@ -29,6 +29,7 @@ end
 -- Parse function.
 function parse()
     if string.match ( vlc.path, "soundcloud%.com" ) then
+        arturl = nil
         while true do
             line = vlc.readline()
             if not line then break end
@@ -42,9 +43,13 @@ function parse()
                 -- we only want the first one of these lines
                 break
             end
+            -- try to get the art url
+            if string.match( line, "artwork--download--link" ) then
+                _,_,arturl = string.find( line, " href=\"(.*)\" " )
+            end
         end
         path = "http://media.soundcloud.com/stream/"..uid.."?stream_token="..token
-        return { { path = path; name = name } }
+        return { { path = path; name = name; arturl = arturl } }
     end
     return {}
 end



More information about the vlc-commits mailing list