1#! /bin/python
2
3import requests
4import os
5
6id = input('Enter the client id: ');
7secret = input('Enter the client secret: ');
8code = input('Enter the auth code (obtained from get-auth-code.py): ');
9callback = input('Enter the callback uri: ');
10
11params = {'client_id':id,
12 'client_secret':secret,
13 'grant_type':"authorization_code",
14 'code':code,
15 'redirect_uri':callback}
16
17r = requests.post(url = "https://accounts.spotify.com/api/token", data = params)
18
19print(r.text);