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.
It is posible?
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
PedirToken ()
It is posible?