aome510 / spotify-player

A Spotify player in the terminal with full feature parity
MIT License
3.52k stars 153 forks source link

[bug] Authentication Issues #580

Open w-lfchen opened 10 hours ago

w-lfchen commented 10 hours ago

this issue is a write-up of #520 due to that issue being way too long and tiring to read.

summary

spotify deprecated the login api used for authentication. therefore, it is currently impossible to log in with the existing master branch/any version of spotify-player a fix is being worked on in #570, the pr can be used for basic functionality, some issues remain. feel free to contribute by working on the pr or submitting new problems that arise when using spotify-player built from it!

workaround

in an environment with a (somewhat up to date) rust toolchain set up, run the following commands in your home directory:

# build the librespot binary, we need this to generate credentials
git clone https://github.com/librespot-org/librespot.git
cd librespot
cargo build --release --no-default-features
# generate the credentials by running the program we just built
./target/release/librespot --cache ~/.cache/spotify-player/ -j
# Open or copy a link and login to Spotify as usual (this is the new login flow)
...
# cleanup once you've successfully logged in
cd ~
rm -rf ./librespot
# you should now be able to run spotify-player
spotify_player

huge thanks to the original authors and the modification! :heart:

technical details

spotify now requires an oauth2 login flow, which needs to implemented. the library used for authentication is librespot, the dependency needs to be updated to the latest release which adds support for oauth2. since that release contains a lot of breaking changes and the login flow in this application needs to be rewritten, this requires a substantial amount of work. see #570 for the current state/progress made so far on fixing this situation.

w-lfchen commented 2 hours ago

@w-lfchen read #581

doesn't exist..?

WantedToBeAnonymous commented 2 hours ago

Sorry I regretted

Guimarret commented 2 hours ago

The workaround worked ty!

WantedToBeAnonymous commented 1 hour ago

You owe me a GitHub account