def refresh_access_token(self, refresh_token):
""" Returns the access token for Spotify Web API using a refresh token.
Args:
refresh_token (string): The token has been returned by the access
token request.
Returns:
SpotifyCredentials: The parsed response from Spotify.
"""
# Get new auth token
payload = {
'grant_type': 'refresh_token',
'refresh_token': refresh_token
}
headers = self._make_authorization_headers()
return requests.post(
'https://accounts.spotify.com/api/token',
data=payload,
headers=headers
).json()
评论列表
文章目录