Spotify Connect is already supported. We are doing some tests and will release the firmware soon on our website. Please note that you need Premium subscription in order to work. I'll send you a test firmware to email to try it out
(05.02.2018, 08:02)edgars Wrote: Spotify Connect is already supported. We are doing some tests and will release the firmware soon on our website. Please note that you need Premium subscription in order to work. I'll send you a test firmware to email to try it out
Can you send me that firmware to email CEST189@gmail.com?
Thanks
In LM you cant as it doesn't have speakers You can stream to amati players. When you play music in spotify app you can select device and one of them will be amati or what name you given to it.
04.02.2020, 16:24 (This post was last modified: 04.02.2020, 16:33 by DGrandes.)
Sorry I haven´t explained well,
I don´t want to stream in LM.
I want to send an order from LM to spotify acount and spotify speakers/devices (play specific playlist, pause, get status...) and I can do it with manual token but it expires.
When I try to get token by script with this script I can´t do it.
Code:
local headers_token = {
['Authorization'] = "Basic "..Id_Psw_Encode64,
}
function Data_Pedir_Token ()
url = "https://accounts.spotify.com/api/token"
data = json.encode({
['grant_type'] = "client_credentials",
})
--log(data,url)
return data, url
end
function Comando_token (data,url)
headers = headers_token
url = url
res, err = dorequestPostSpoty(url, headers,"POST", data)
log(res,err)
resjson = json.decode(res)
if resjson[1] == nil then
return nil
end
return resjson
end
function PedirToken ()
local data,url = Data_Pedir_Token ()
Comando_token(data,url)
end
OK, I completely misunderstood you as you posted it under Streaming Player category. Admin should look at it.
PS. I still don't know what is the use for that.
While this can be implemented with manual copying of tokens this solution might stop working at any point. The problem is that OAuth is means for end-user apps with UI not for server-to-server communication (Spotify server-to-server API does not provide player control). You will need a script to refresh the token periodically as it has a short expiration time.
This example might be helpful. It's for different OAuth service but quite similar. You need to put refresh token into storage variable and use access token from storage in scripts that send API requests.
refresh_token = storage.get('oauth_refresh_token')
if not refresh_token then
log('missing refresh_token')
return
end
local function buildqs(chunks)
local qs = {}
for k, v in pairs(chunks) do
qs[ #qs + 1 ] = url.escape(tostring(k)) .. '=' .. url.escape(tostring(v))
end
return table.concat(qs, '&')
end