mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-06-19 09:13:53 +00:00
parent
d4912c6679
commit
02cd9b0923
@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fixed miscellaneous issues with parsing of callback URL
|
||||||
|
|
||||||
## [2.11.0] - 2020-04-11
|
## [2.11.0] - 2020-04-11
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
@ -314,11 +314,11 @@ class SpotifyOAuth(SpotifyAuthBase):
|
|||||||
Parameters:
|
Parameters:
|
||||||
- url - the response url
|
- url - the response url
|
||||||
"""
|
"""
|
||||||
|
url_split = url.split("?code=")
|
||||||
try:
|
if len(url_split) <= 1:
|
||||||
return url.split("?code=")[1].split("&")[0]
|
return url
|
||||||
except IndexError:
|
else:
|
||||||
return None
|
return url_split[1].split("&")[0]
|
||||||
|
|
||||||
def _make_authorization_headers(self):
|
def _make_authorization_headers(self):
|
||||||
return _make_authorization_headers(self.client_id, self.client_secret)
|
return _make_authorization_headers(self.client_id, self.client_secret)
|
||||||
@ -370,7 +370,9 @@ class SpotifyOAuth(SpotifyAuthBase):
|
|||||||
return self._get_auth_response_interactive()
|
return self._get_auth_response_interactive()
|
||||||
|
|
||||||
def get_authorization_code(self, response=None):
|
def get_authorization_code(self, response=None):
|
||||||
return self.parse_response_code(response or self.get_auth_response())
|
if response:
|
||||||
|
return self.parse_response_code(response)
|
||||||
|
return self.get_auth_response()
|
||||||
|
|
||||||
def get_access_token(self, code=None, as_dict=True, check_cache=True):
|
def get_access_token(self, code=None, as_dict=True, check_cache=True):
|
||||||
""" Gets the access token for the app given the code
|
""" Gets the access token for the app given the code
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user