Commit b0beb353 authored by Ludovic Fauvet's avatar Ludovic Fauvet Committed by Jean-Baptiste Kempf

lua soundcloud: fetch artwork

Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
(cherry picked from commit c163f06ea04ec085539d517749f442746644c0e5)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 49152051
...@@ -29,6 +29,7 @@ end ...@@ -29,6 +29,7 @@ end
-- Parse function. -- Parse function.
function parse() function parse()
if string.match ( vlc.path, "soundcloud%.com" ) then if string.match ( vlc.path, "soundcloud%.com" ) then
arturl = nil
while true do while true do
line = vlc.readline() line = vlc.readline()
if not line then break end if not line then break end
...@@ -42,9 +43,13 @@ function parse() ...@@ -42,9 +43,13 @@ function parse()
-- we only want the first one of these lines -- we only want the first one of these lines
break break
end end
-- try to get the art url
if string.match( line, "artwork--download--link" ) then
_,_,arturl = string.find( line, " href=\"(.*)\" " )
end
end end
path = "http://media.soundcloud.com/stream/"..uid.."?stream_token="..token path = "http://media.soundcloud.com/stream/"..uid.."?stream_token="..token
return { { path = path; name = name } } return { { path = path; name = name; arturl = arturl } }
end end
return {} return {}
end 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