Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when putting in the spotify redirect URL #115

Open
BanHerobrine opened this issue Oct 13, 2024 · 2 comments
Open

Error when putting in the spotify redirect URL #115

BanHerobrine opened this issue Oct 13, 2024 · 2 comments

Comments

@BanHerobrine
Copy link

``
Using localhost as redirect URI without a port. Specify a port (e.g. `localhost:8080`) to allow automatic retrieval of authentication code instead of having to copy and paste the URL your browser is redirected to.
Enter the URL you were redirected to: (the url I got redirected to)
Traceback (most recent call last):
File "C:\Users\comma\pipx\venvs\spotify-to-ytmusic\Lib\site-packages\spotipy\oauth2.py", line 549, in get_access_token
response.raise_for_status()
~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "C:\Users\comma\pipx\venvs\spotify-to-ytmusic\Lib\site-packages\requests\models.py", line 1024, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://accounts.spotify.com/api/token

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in run_code
File "c:\users\comma.local\bin\spotify_to_ytmusic.exe_main
.py", line 7, in
sys.exit(main())
~~~~^^
File "C:\Users\comma\pipx\venvs\spotify-to-ytmusic\Lib\site-packages\spotify_to_ytmusic\main.py", line 98, in main
args.func(args)
~~~~~~~~~^^^^^^
File "C:\Users\comma\pipx\venvs\spotify-to-ytmusic\Lib\site-packages\spotify_to_ytmusic\controllers.py", line 34, in all
pl = spotify.getUserPlaylists(args.user)
File "C:\Users\comma\pipx\venvs\spotify-to-ytmusic\Lib\site-packages\spotify_to_ytmusic\spotify.py", line 70, in getUserPlaylists
pl = self.api.user_playlists(user)["items"]
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
File "C:\Users\comma\pipx\venvs\spotify-to-ytmusic\Lib\site-packages\spotipy\client.py", line 812, in user_playlists
return self._get(
~~~~~~~~~^
f"users/{user}/playlists", limit=limit, offset=offset
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "C:\Users\comma\pipx\venvs\spotify-to-ytmusic\Lib\site-packages\spotipy\client.py", line 327, in _get
return self._internal_call("GET", url, payload, kwargs)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\comma\pipx\venvs\spotify-to-ytmusic\Lib\site-packages\spotipy\client.py", line 251, in _internal_call
headers = self._auth_headers()
File "C:\Users\comma\pipx\venvs\spotify-to-ytmusic\Lib\site-packages\spotipy\client.py", line 242, in _auth_headers
token = self.auth_manager.get_access_token(as_dict=False)
File "C:\Users\comma\pipx\venvs\spotify-to-ytmusic\Lib\site-packages\spotipy\oauth2.py", line 555, in get_access_token
self._handle_oauth_error(http_error)
~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
File "C:\Users\comma\pipx\venvs\spotify-to-ytmusic\Lib\site-packages\spotipy\oauth2.py", line 139, in _handle_oauth_error
raise SpotifyOauthError(
...<3 lines>...
)
spotipy.oauth2.SpotifyOauthError: error: invalid_request, error_description: code must be supplied
``

@ZefBoner
Copy link

Hi, i have the same issue, i try to lod out and uninstall de spotify app but it didn't work.

@newyork167
Copy link

For me it ended up being that I reused an app I had already created on Spotify, and didn't have the correct redirect URI of "http://localhost" added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants