|
a/src/mediaserver/cdplugins/spotify/spotipy/util.py |
|
b/src/mediaserver/cdplugins/spotify/spotipy/util.py |
|
... |
|
... |
19 |
- client_id - the client id of your app
|
19 |
- client_id - the client id of your app
|
20 |
- client_secret - the client secret of your app
|
20 |
- client_secret - the client secret of your app
|
21 |
- redirect_uri - the redirect URI of your app
|
21 |
- redirect_uri - the redirect URI of your app
|
22 |
- cache_path - path to location to save tokens
|
22 |
- cache_path - path to location to save tokens
|
23 |
|
23 |
|
|
|
24 |
** CHANGE from the offical version: we return the sp_oauth
|
|
|
25 |
object itself, as it is now needed to build the Spotipy object
|
24 |
'''
|
26 |
'''
|
25 |
|
27 |
|
26 |
if not client_id:
|
28 |
if not client_id:
|
27 |
client_id = os.getenv('SPOTIPY_CLIENT_ID')
|
29 |
client_id = os.getenv('SPOTIPY_CLIENT_ID')
|
28 |
|
30 |
|
|
... |
|
... |
86 |
|
88 |
|
87 |
code = sp_oauth.parse_response_code(response)
|
89 |
code = sp_oauth.parse_response_code(response)
|
88 |
token_info = sp_oauth.get_access_token(code)
|
90 |
token_info = sp_oauth.get_access_token(code)
|
89 |
# Auth'ed API request
|
91 |
# Auth'ed API request
|
90 |
if token_info:
|
92 |
if token_info:
|
91 |
return token_info['access_token']
|
93 |
return sp_oauth
|
92 |
else:
|
94 |
else:
|
93 |
return None
|
95 |
return None
|