name = string.match( line, "[\"']title[\"'] *: *\"(.-[^\\])\"")
name = string.match( line, "[\"']title[\"'] *: *\"(.-[^\\])\"")
ifnamethen
ifnamethen
...
@@ -92,6 +79,26 @@ function parse()
...
@@ -92,6 +79,26 @@ function parse()
end
end
end
end
if track then
-- API magic
local client_id = "02gUJC0hH2ct1EGOcYXQIzRFU91c72Ea"
-- app_version is not required by the API but we send it anyway
-- to remain unconspicuous
local app_version = "a089efd"
local api = vlc.stream( "https://api.soundcloud.com/i1/tracks/"..track.."/streams?client_id="..client_id.."&app_version="..app_version..( secret and "&secret_token="..secret or "" ) )
if api then
local streams = api:readline() -- data is on one line only
-- For now only quality available is 128 kbps (http_mp3_128_url)