Hey, im started yo work with spotify API, but there is some problem i couldnt find solution. After running script below before giving app access, i get redirected to page whigh promted me for permission and spotipy is asking for URL i`ve been redirected to. And this is where a problem occurs. When i click accept im not get redirected anywhere, i just get 'Error Oops something went wrong' So i cant provide token to spotipy, but in my account app is looking like it have access, And anytime after that when i run script i redirected to page with only this message 'Error
Oops! Something went wrong, please try again or check out our help area.'.
URI is set on dashboard
import spotipy
from spotipy.oauth2 import SpotifyOAuth
auth_manager = SpotifyOAuth(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET,
redirect_uri='localhost:3000/callback',
scope='user-read-currently-playing,user-modify-playback-state',
)
sp = spotipy.Spotify(auth_manager=auth_manager)
def get_current_song():
track = sp.current_user_playing_track()
artist = track["item"]["artists"][0]["name"]
t_name = track["item"]["name"]
t_url = track['item']["external_urls"]["spotify"]
return artist, t_name,t_url
def search_and_add(query: str):
try:
track_id = sp.search(query, type='track,artist', limit=1)['tracks']['items'][0]['id']
except IndexError:
return False
sp.add_to_queue(track_id)
def main():
get_current_song()
search_and_add('Genesis')
if __name__ == '__main__':
main()
What can i try here?