librespot-org / librespot-golang

Go port of librespot, the Open Source Spotify client library
MIT License
169 stars 39 forks source link

"authentication failed" #23

Open nolanm1122 opened 4 years ago

nolanm1122 commented 4 years ago

I attempted to run the main.go with my personal username and password as flags, but program throws "authentication failed" error every time. I know these credentials are correct and that it's parsing the flags properly and passing them to librespot.Login function. I've also tried with another valid account and gotten same response. Must be an issue with how login is handled, etc.

drunlade commented 4 years ago

Not that I have a solution for you, but I can say "It works just fine for me", so I suspect it's something you are doing wrong.

winterscar commented 3 years ago

Just throwing my experience in as well, I get the same issue..

joonas-fi commented 2 years ago

Same issue: login failed with username/password. I added a "vote": please add :+1: to issue top if username+password authentication fails for you too!

joonas-fi commented 2 years ago

Seems to be about using a free account. After I updated to Premium, it started working.

This is based on librespot, and it says:

Note: librespot only works with Spotify Premium. This will remain the case. We will not support any features to make librespot compatible with free accounts, such as limited skips and adverts.

See also: https://github.com/librespot-org/librespot/issues/862

corny commented 2 years ago

This issue can be closed.

joonas-fi commented 2 years ago

Pro-tip: if the auth blob doesn't work for you, you can generate the auth blob in some other software (like the Rust version of librespot which seems very actively maintained) and steal its auth blob for use in librespot-golang!

If you use the Rust librespot, you can run:

$ target/release/librespot --name foobar --username <yourUsername>

it asks for your password, and then you can find the auth blob in cache/credentials.json under key auth_data. Make sure to base64-decode the value and then use it as blob.bin content (don't include newline) as here:

https://github.com/librespot-org/librespot-golang/blob/31669e5a889fb671269fab6b87322b3159119f90/main.go#L42