This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Youtube playback
#17
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



PedirToken ()

It is posible?
Reply


Messages In This Thread
Youtube playback - by Jayce - 28.07.2017, 10:40
RE: Youtube playback - by morak - 02.08.2017, 13:54
RE: Youtube playback - by admin - 08.08.2017, 12:55
RE: Youtube playback - by Hippolyte - 03.02.2018, 23:08
RE: Youtube playback - by edgars - 05.02.2018, 08:02
RE: Youtube playback - by Thomas_LV - 14.03.2018, 15:57
RE: Youtube playback - by admin - 15.03.2018, 14:44
RE: Youtube playback - by Thomas_LV - 16.03.2018, 06:47
RE: Youtube playback - by admin - 16.03.2018, 08:18
RE: Youtube playback - by Thomas_LV - 16.03.2018, 09:30
RE: Youtube playback - by DGrandes - 04.02.2020, 15:44
RE: Youtube playback - by Daniel - 04.02.2020, 15:56
RE: Youtube playback - by DGrandes - 04.02.2020, 16:04
RE: Youtube playback - by Daniel - 04.02.2020, 16:05
RE: Youtube playback - by DGrandes - 04.02.2020, 16:12
RE: Youtube playback - by Daniel - 04.02.2020, 16:15
RE: Youtube playback - by DGrandes - 04.02.2020, 16:24
RE: Youtube playback - by Daniel - 04.02.2020, 16:37
RE: Youtube playback - by admin - 05.02.2020, 07:52

Forum Jump: