mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-04-26 16:15:51 +03:00
[GH-ISSUE #584] 500 internal error using PaaS, working fine on local #347
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#347
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 @fullfine909 on GitHub (Oct 7, 2020).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/584
Hi!
I am developing a tool that takes songs of Youtube and creates a playlists in Spotify. I have run the application succesfully in local, but I get an error when I try it in Elastic Beanstalk, the PaaS of Amazon.
I am using a Flask server and the Spotipy python library. I think that the problem is related with the redirect_uri, but I have no idea of what I should do. I create two spotipy objects in my code. The first one, using Client Credentials Flow, works perfectly online. However, when I try to use another one with Authorization Code Flow, I get the error. I can even create it, but when I call to any function, even to search tracks, I get the 500 internal server error. I assume that the redirect_uri has to be the same url where the app is launched.
Thanks in advance!
@stephanebruckert commented on GitHub (Oct 7, 2020):
Hi, does this help? https://github.com/plamere/spotipy/blob/master/FAQ.md#how-do-i-obtain-authorization-in-a-headlessbrowserless-environment
@fullfine909 commented on GitHub (Oct 7, 2020):
Not really. I think that now it works locally because it has the token in the cache. Do you know how can I force to delete it?
@stephanebruckert commented on GitHub (Oct 7, 2020):
There should be a hidden file starting with
.cachein your project folder. You can delete it usingrm@fullfine909 commented on GitHub (Oct 7, 2020):
Okay, I've gotten it to work in a bit of a "dirty" way. Calling SpotifyOAuth () I pass the variable cache_path = '. Mycache' to it, then I upload it to aws and it works, but I think this is just a temporary solution. I attach the link so you can see the work:
http://ys5-env.eba-mjmi37yf.eu-west-1.elasticbeanstalk.com/
Example videos that work:
https://www.youtube.com/watch?v=5lthiQoQiRA&t=2953s&ab_channel=H%C3%96RBERLIN
https://www.youtube.com/watch?v=4utKO75DtBE&t=637s&ab_channel=BE-AT.TV
You can click the title and you will find a playlist with all the songs, you can click a song and the spotify link will open, you can move the mouse over the covers and it will be heard.
@stephanebruckert commented on GitHub (Oct 25, 2020):
I think you are right, it's not a good solution and could be improved.
What I've been doing in my own app is to persist new tokens into a DB and then read from that DB every time I need the token. See
github.com/resident-archive/resident-archive@a869b73f1f/functions/to-spotify/main.py (L129..L157)I'm going to close your issue as you found a temporary solution, and the improvement above can be discussed here https://github.com/plamere/spotipy/issues/51