[vlc-commits] lua soundcloud: fetch artwork

Ludovic Fauvet git at videolan.org
Thu Sep 13 11:24:55 CEST 2012


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

lua soundcloud: fetch artwork

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
(cherry picked from commit c163f06ea04ec085539d517749f442746644c0e5)

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

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

 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