Some explanation for the code would be helpful. There's no comments, and there's little documentaiton in the spotipy module for what any of these functions expect in terms of the underlying data structures that get returned. The spotipy api docs doesn't give much info either.
FWIW, here's the error when you run this in a script. I filled the client_id and secret from my spotipy account just like you said. The redirect uri is the set to match the one in the code. It chokes on the extract_drake_data() function where it calls the sp.search() function.
spotipy:exceptions.SpotifyOauthError: Server listening on localhost has not been accessed
Or: my browser gets redirected to a link that says the page cannot be accessed.
I'm sorry to hear you've having issues. Can you double check the URL for localhost matches the one in Spotify Developer app settings. I've just reran the code and had no issues pulling the data. Are you coding within VSCODE or within a different IDE?
Oh thanks. Yes, I doubled checked the redirect callback link many times. It's set at https://localhost:8888/callback for both the code and the spotify dashboard. I'm using emacs, but it still happens just running the code in a regular terminal. Interestingly, now I'm getting different results. It now opens a browser page, and I get a REDIRECT and a cannot access page.
I've been following this tutorial as a sort of refresher for python, so I was able to fill in gaps from my own knowledge. I appreciate the introduction of the third party packages. I apologize if my comment appeared aggressive or hostile in anyway. I wrote the above comment quickly, and I just wanted to let you know of the error. So, the wording may have come off as a bit terse. Thanks again for your prompt attention. I'll look over those docs.
Some explanation for the code would be helpful. There's no comments, and there's little documentaiton in the spotipy module for what any of these functions expect in terms of the underlying data structures that get returned. The spotipy api docs doesn't give much info either.
FWIW, here's the error when you run this in a script. I filled the client_id and secret from my spotipy account just like you said. The redirect uri is the set to match the one in the code. It chokes on the extract_drake_data() function where it calls the sp.search() function.
spotipy:exceptions.SpotifyOauthError: Server listening on localhost has not been accessed
Or: my browser gets redirected to a link that says the page cannot be accessed.
Hi David,
I'm sorry to hear you've having issues. Can you double check the URL for localhost matches the one in Spotify Developer app settings. I've just reran the code and had no issues pulling the data. Are you coding within VSCODE or within a different IDE?
Also with regards to documentation within spotipy docu, there should be a link to official spotify documentation for each function. For example: search() has a link to the specifics: https://developer.spotify.com/documentation/web-api/reference/search
Oh thanks. Yes, I doubled checked the redirect callback link many times. It's set at https://localhost:8888/callback for both the code and the spotify dashboard. I'm using emacs, but it still happens just running the code in a regular terminal. Interestingly, now I'm getting different results. It now opens a browser page, and I get a REDIRECT and a cannot access page.
I've been following this tutorial as a sort of refresher for python, so I was able to fill in gaps from my own knowledge. I appreciate the introduction of the third party packages. I apologize if my comment appeared aggressive or hostile in anyway. I wrote the above comment quickly, and I just wanted to let you know of the error. So, the wording may have come off as a bit terse. Thanks again for your prompt attention. I'll look over those docs.