mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-04-27 08:35:49 +03:00
[GH-ISSUE #995] EOFError: EOF when reading a line/ Enter the URL you were redirected to: 127.0.0.1 #590
Labels
No labels
api-bug
bug
dependencies
documentation
duplicate
enhancement
external-ide
headless-mode
implicit-grant-flow
invalid
missing-endpoint
pr-welcome
private-api
pull-request
question
spotipy3
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/spotipy#590
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Avishkar15 on GitHub (Jun 19, 2023).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/995
I keep getting
EOFError: EOF when reading a line
Jun 19 04:57:21 PM Enter the URL you were redirected to: 127.0.0.1
when I try to deploy my app from render
My callback function:
@app.route('/callback')
def callback():
cache_handler = spotipy.cache_handler.FlaskSessionCacheHandler(session)
auth_manager = spotipy.oauth2.SpotifyOAuth(scope=SPOTIPY_SCOPE, cache_handler=cache_handler, show_dialog=True)
if request.args.get("code"):
# Step 2. Being redirected from Spotify auth page
auth_manager.get_access_token(request.args.get("code"))
return redirect('/callback')
and my redirect uri is also set properly
@Kudzmat commented on GitHub (Jul 1, 2023):
Hey, did you add the redirect URI as an environmental variable? The Authorization Code Flow needs you to add a redirect URI to your application on your app dashboard and then this needs to be set during authorization. I think you're getting that error because it can't find the redirect URI when you create the Spotify object. Here is an example:
sp = spotipy.Spotify(auth_manager=SpotifyOAuth(client_id= "your client id",
client_secret= "your client secret",
redirect_uri="http://localhost:8080",
scope="your scopes"))
You can read more about it in the documentation: https://spotipy.readthedocs.io/en/2.22.1/#authorization-code-flow
I hope this was helpful to you.
@dieser-niko commented on GitHub (Aug 22, 2024):
Closing as there is no activity or reply from the author.