#! /bin/python import requests import os id = input('Enter the client id: '); secret = input('Enter the client secret: '); code = input('Enter the auth code (obtained from get-auth-code.py): '); callback = input('Enter the callback uri: '); params = {'client_id':id, 'client_secret':secret, 'grant_type':"authorization_code", 'code':code, 'redirect_uri':callback} r = requests.post(url = "https://accounts.spotify.com/api/token", data = params) print(r.text);