Update app.py
Browse files
app.py
CHANGED
|
@@ -26,6 +26,8 @@ def spotify_auth(client_id, client_secret, code=None):
|
|
| 26 |
redirect_uri=redirect_uri,
|
| 27 |
scope=scope)
|
| 28 |
if code:
|
|
|
|
|
|
|
| 29 |
auth_manager.get_access_token(code=code, as_dict=False)
|
| 30 |
sp = spotipy.Spotify(auth_manager=auth_manager)
|
| 31 |
devices = sp.devices()
|
|
|
|
| 26 |
redirect_uri=redirect_uri,
|
| 27 |
scope=scope)
|
| 28 |
if code:
|
| 29 |
+
parsed_url = urlparse(code)
|
| 30 |
+
code = parse_qs(parsed_url.query)['code'][0]
|
| 31 |
auth_manager.get_access_token(code=code, as_dict=False)
|
| 32 |
sp = spotipy.Spotify(auth_manager=auth_manager)
|
| 33 |
devices = sp.devices()
|