Closed grantbrewster closed 4 years ago
Does it work if you print the link and manually navigate to the page? Then it might be webbrowser
at fault, in which case you could construct another version of the function yourself. However, if you are talking about an automatic login, that's Spotify remembering that you already gave permission to the app. Changing scope might require another login. But in that case, printing the link and opening it in a private window might do the trick!
It seems like the prompt correctly opening a Spotify auth is pretty buggy, but honestly might be on the chrome side of things opposed to the the Spotipy side. Sometimes it works, and other times it does not even if both the local/chrome cache are deleted. The only thing that spotipy caches in this function is the user token correct? Thanks for the quick reply!
For me, when I use an equivalent routine (without token caching, mind you), the redirects are automatic yielding the final redirect url with code immediately. But it works as expected consistently. I think it is a Spotify login session thing before anything else. Can't really speak for you if you think there is something else happening. I'm on Windows 10 and Firefox.
Yes, only the token is cached.
Your browser is still connected to your spotify account, just go to https://www.spotify.com/ and log out
Hi everyone! Looking forward to the updates to this awesome project and hoping to help out. I just started working with this API this weekend, and I made a simple console application that scrapes setlist URLs in order to automatically create playlists for people based on setlist.fm urls. Repo : https://github.com/grantbrewster/SpotifySetlistCreator . However for my auth, after the first time i run the program, it never again correctly opens a browser window to let me log in to spotify, so it limits the app to only work for my account. I tried deleting the cache in the directory as well as clearing my chrome cache and then running it but that does not solve the problem. SO i feel the issue may be in the prompt_for_user_token method. I found this stackoverflow that mentions that webbrowser.open() may be at fault : https://stackoverflow.com/questions/38574629/webbrowser-not-opening-new-windows
here is the code from util
and this is how I get the token:
I am new to Spotipy so maybe i am doing something incorrectly but according to the documentation this seems to be the correct way of doing it ! Any help would be appreciated