|
@ -16,6 +16,8 @@ from .utils import * |
|
|
TIME_FORMAT = '%Y-%m-%d-%H-%M-%S' |
|
|
TIME_FORMAT = '%Y-%m-%d-%H-%M-%S' |
|
|
TRACKS_TO_QUERY = 200 |
|
|
TRACKS_TO_QUERY = 200 |
|
|
AUTH_SCOPE = ['user-library-read', 'user-read-recently-played', ] |
|
|
AUTH_SCOPE = ['user-library-read', 'user-read-recently-played', ] |
|
|
|
|
|
# ROOT_URL = 'http://localhost:8000' |
|
|
|
|
|
ROOT_URL = 'http://spotify-lib-vis.ml' |
|
|
|
|
|
|
|
|
# index {{{ # |
|
|
# index {{{ # |
|
|
|
|
|
|
|
@ -37,7 +39,7 @@ def spotify_login(request): |
|
|
payload = { |
|
|
payload = { |
|
|
'client_id': os.environ['SPOTIFY_CLIENT_ID'], |
|
|
'client_id': os.environ['SPOTIFY_CLIENT_ID'], |
|
|
'response_type': 'code', |
|
|
'response_type': 'code', |
|
|
'redirect_uri': 'http://localhost:8000/login/callback', |
|
|
|
|
|
|
|
|
'redirect_uri': ROOT_URL + '/login/callback', |
|
|
'state': state_str, |
|
|
'state': state_str, |
|
|
'scope': " ".join(AUTH_SCOPE), |
|
|
'scope': " ".join(AUTH_SCOPE), |
|
|
'show_dialog': False |
|
|
'show_dialog': False |
|
@ -64,7 +66,7 @@ def callback(request): |
|
|
payload = { |
|
|
payload = { |
|
|
'grant_type': 'authorization_code', |
|
|
'grant_type': 'authorization_code', |
|
|
'code': code, |
|
|
'code': code, |
|
|
'redirect_uri': 'http://localhost:8000/login/callback', |
|
|
|
|
|
|
|
|
'redirect_uri': ROOT_URL + '/login/callback', |
|
|
'client_id': os.environ['SPOTIFY_CLIENT_ID'], |
|
|
'client_id': os.environ['SPOTIFY_CLIENT_ID'], |
|
|
'client_secret': os.environ['SPOTIFY_CLIENT_SECRET'], |
|
|
'client_secret': os.environ['SPOTIFY_CLIENT_SECRET'], |
|
|
} |
|
|
} |
|
|