Add1E commited on
Commit
7e0a9bb
·
1 Parent(s): 4f4d177

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -11
app.py CHANGED
@@ -54,17 +54,16 @@ def app():
54
  st.write('Please log in to Spotify')
55
  st.markdown(f"[Log In]({AUTH_URL}?{urlencode(auth_params)})", unsafe_allow_html=True)
56
  auth_code = st.session_state['code']
57
-
58
- token_data = {
59
- 'grant_type': 'authorization_code',
60
- 'code': auth_code,
61
- 'redirect_uri': REDIRECT_URI,
62
- 'client_id': CLIENT_ID,
63
- 'client_secret': CLIENT_SECRET,
64
- }
65
- token_r = requests.post(TOKEN_URL, data=token_data)
66
- token_response = token_r.json()
67
- st.session_state['access_token'] = token_response.get('access_token')
68
  else:#
69
  if 'access_token' in st.session_state:
70
  st.write("Enter a Spotify Track URL or URI to get its audio features.")
 
54
  st.write('Please log in to Spotify')
55
  st.markdown(f"[Log In]({AUTH_URL}?{urlencode(auth_params)})", unsafe_allow_html=True)
56
  auth_code = st.session_state['code']
57
+ token_data = {
58
+ 'grant_type': 'authorization_code',
59
+ 'code': auth_code,
60
+ 'redirect_uri': REDIRECT_URI,
61
+ 'client_id': CLIENT_ID,
62
+ 'client_secret': CLIENT_SECRET,
63
+ }
64
+ token_r = requests.post(TOKEN_URL, data=token_data)
65
+ token_response = token_r.json()
66
+ st.session_state['access_token'] = token_response.get('access_token')
 
67
  else:#
68
  if 'access_token' in st.session_state:
69
  st.write("Enter a Spotify Track URL or URI to get its audio features.")