smartplaylist / smartplaylist-backend

Build smart playlists, based on tracks' audio analysis, and other parameters. Filter newest tracks, that go together well in a DJ set.
MIT License
0 stars 1 forks source link

Why spotipy's Oauth server is not available through 127.0.0.1:8083? #5

Open jkulak opened 2 years ago

jkulak commented 2 years ago

I would expect OAuth browser interaction to work after exposing port 8083 in containers, and then forwarding this port docker run -ti --rm --network spotify-grabtrack_default -p 8083:8083 -v $(pwd)/app/src:/app --env-file .env spotify-grabtrack_app sh

Currently it's only working with open_browser=False in

sp = spotipy.Spotify(auth_manager=SpotifyOAuth(scope=scope, open_browser=False)) so I have to manually copy the URL that is not accessing temporary http server created by Spotipy.

http://127.0.0.1:8080 is working for adminer.

The flow is working when run without Docker.

When I do wget 127.0.0.1:8083/?code=sdfafadf from within the container the local OAuth server reads the code.

So it seems that 127.0.0.1:8083/ is not exposed? Doesn't take requests from the host/from the outside.

jkulak commented 2 years ago

I found the solution, I might suggest changes in Spotipy repository: https://github.com/plamere/spotipy/issues/789