Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authentication failures #1308

Closed
dspearson opened this issue Jul 29, 2024 · 143 comments · Fixed by #1309
Closed

Authentication failures #1308

dspearson opened this issue Jul 29, 2024 · 143 comments · Fixed by #1309
Labels

Comments

@dspearson
Copy link

"ERROR librespot] Connection failed: Login failed with reason: Bad credentials"

Credentials are valid.

I assume Spotify has changed the login flow. This affects upstream projects using librespot also, looking at their buglists.

@kingosticks
Copy link
Contributor

It appears to be for some users only. It's still working for me right now. So reproducing it (to debug it) might not be so simple (yet).

@azel1
Copy link

azel1 commented Jul 29, 2024

The same code gives bad credentials error on my linux machine, but works everytime on Windows. Tried multiple accounts.

@quantverse
Copy link

Same problem on my Linux machine since today. Yesterday it was still working fine.

Ubuntu 22.04.

@roderickvd
Copy link
Member

For the record, which version of librespot? 0.4? dev? Those downstream packages use 0.4 I presume. Please try them both. I remember I made some changes on it to dev.

Re: @kingosticks would also not be the first time that something gets broken / changed on Spotify's end, only to have it restored the day or week after.

Anyway, having it work on one platform and not the other is fishy.

@eladyn
Copy link
Contributor

eladyn commented Jul 29, 2024

I tried 0.4.2, dev and one of the proposed login5 changes, but all of them are broken for me. (although reconsidering what currently seems to be broken, the login5 thing should indeed not have much effect)

@andrewCohn
Copy link

andrewCohn commented Jul 29, 2024

0.5.0-dev is also affected on Arch kernel version 6.9.7.

Immediately after posting this, I tried again, and it just worked? I'm not entirely sure what changed; my systemctl script hasn't changed, but after a number of auto-restarts, it came back authenticated? Very strange!

@Losses
Copy link

Losses commented Jul 30, 2024

Same issue here

ERROR librespot] could not initialize spirc: Permission denied { Login failed with reason: Bad credentials }

@Geral3
Copy link

Geral3 commented Jul 30, 2024

Same Here

2024-07-30T05:43:24.314571Z  WARN spotify_player::auth: Failed to authenticate: Login failed with reason: Bad credentials

@dspearson
Copy link
Author

FWIW, the original bug report was made against latest dev on a Debian system that previously was working fine, with no new packages installed since breaking. (I built from git initially to see if it was fixed upstream.)

Feel free to reach out if you need any assistance to debug the issue, I'd be happy to help.

@roderickvd
Copy link
Member

Given it's working on Windows, what if you change this line:

let os = match std::env::consts::OS {

To pretend that it's always Windows?

You may need to do the same here:

let platform = match std::env::consts::OS {

Then in dev there's a similar thing in the HTTP client, but when you're authenticating, that's not yet where you are in the code flow.

It's the only thing I can now think of why it would work on Windows but not on Linux.

@IVIanuu
Copy link

IVIanuu commented Jul 30, 2024

Same issue here.

@Losses
Copy link

Losses commented Jul 30, 2024

@roderickvd Quickly checked the solution, not working, sadly.

librespot_core::session] Connecting to A[2024-07-30T07:32:37Z ERROR librespot] could not initialize spirc: Permission denied { Login failed with reason: Bad credentials }

System: NixOS 24.05.20240727.8c50662 (Uakari) x86_64

@roderickvd
Copy link
Member

Reporters, please add the access point / servers you are connecting to:

  • what the logs say as server
  • the IP that your name server resolves it to

I'm reading that the issue is on Windows also, so let's try to triangulate what's happening.
Are officially supported devices from the past (like stereo receivers, old Sonos thingies, whatever) also having issues?

@ssamjh
Copy link

ssamjh commented Jul 30, 2024

Getting this in New Zealand, using librespot-java v1.6.3 on Windows 10.

Using USER_PASS auth.

2024-07-30 19:45:17,085 DEBUG TimeProvider:90 - Loaded time offset from NTP: 1115ms 2024-07-30 19:45:18,142 INFO ApResolver:99 - Loaded aps into pool: {accesspoint=[ap-gae2.spotify.com:4070, ap-gae2.spotify.com:443, ap-gae2.spotify.com:80, ap-guc3.spotify.com:4070, ap-gue1.spotify.com:443, ap-gew4.spotify.com:80], dealer=[gae2-dealer2.spotify.com:443, guc3-dealer2.spotify.com:443, gue1-dealer2.spotify.com:443, gew4-dealer2.spotify.com:443], spclient=[gae2-spclient.spotify.com:443, guc3-spclient.spotify.com:443, gue1-spclient.spotify.com:443, gew4-spclient.spotify.com:443]} 2024-07-30 19:45:18,359 INFO Session:140 - Created new session! {deviceId: <snip>, ap: ap-guc3.spotify.com:4070, proxy: false} 2024-07-30 19:45:19,194 INFO Session:334 - Connected successfully! 2024-07-30 19:45:19,647 ERROR Log4JUncaughtExceptionHandler:31 - [main] xyz.gianlu.librespot.core.Session$SpotifyAuthenticationException: BadCredentials at xyz.gianlu.librespot.core.Session.authenticatePartial(Session.java:453) ~[librespot-api-1.6.3.jar:1.6.3] at xyz.gianlu.librespot.core.Session.authenticate(Session.java:342) ~[librespot-api-1.6.3.jar:1.6.3] at xyz.gianlu.librespot.core.Session.access$600(Session.java:77) ~[librespot-api-1.6.3.jar:1.6.3] at xyz.gianlu.librespot.core.Session$Builder.create(Session.java:1057) ~[librespot-api-1.6.3.jar:1.6.3] at xyz.gianlu.librespot.api.Main.withPlayer(Main.java:53) ~[librespot-api-1.6.3.jar:1.6.3] at xyz.gianlu.librespot.api.Main.main(Main.java:45) ~[librespot-api-1.6.3.jar:1.6.3]

@Losses
Copy link

Losses commented Jul 30, 2024

@roderickvd

Server:

ap-gew1.spotify.com

Ping Result:

PING ap-gew1.spotify.com (104.199.65.124) 56(84) bytes of data.
64 bytes from 124.65.199.104.bc.googleusercontent.com (104.199.65.124): icmp_seq=1 ttl=52 time=278 ms

@noahhaon
Copy link

noahhaon commented Jul 30, 2024

From a raspberry pi 4 running LibreELEC:

# librespot --bitrate 320 --device-type tv --disable-audio-cache --disable-credential-cache --name Librespot@LibreELEC --onevent onevent.py --quiet -A on -u [REDACTED] -p [REDACTED]-O -v --backend pulseaudio --device librespot

[2024-07-30T08:08:36Z WARN  librespot] `--verbose` and `--quiet` are mutually exclusive. Logging can not be both verbose and quiet. Using verbose mode.
[2024-07-30T08:08:36Z INFO  librespot] librespot 0.5.0-dev 4513878 (Built on 2024-04-24, Build ID: YmZq6K14, Profile: release)
[2024-07-30T08:08:36Z TRACE librespot] Command line argument(s):
[2024-07-30T08:08:36Z TRACE librespot]          bitrate "320"
[2024-07-30T08:08:36Z TRACE librespot]          device-type "tv"
[2024-07-30T08:08:36Z TRACE librespot]          disable-audio-cache
[2024-07-30T08:08:36Z TRACE librespot]          disable-credential-cache
[2024-07-30T08:08:36Z TRACE librespot]          name "Librespot@LibreELEC"
[2024-07-30T08:08:36Z TRACE librespot]          onevent "onevent.py"
[2024-07-30T08:08:36Z TRACE librespot]          quiet
[2024-07-30T08:08:36Z TRACE librespot]          A "on"
[2024-07-30T08:08:36Z TRACE librespot]          u "XXXXXXXX"
[2024-07-30T08:08:36Z TRACE librespot]          p "XXXXXXXX"
[2024-07-30T08:08:36Z TRACE librespot]          O
[2024-07-30T08:08:36Z TRACE librespot]          v
[2024-07-30T08:08:36Z TRACE librespot]          backend "pulseaudio"
[2024-07-30T08:08:36Z TRACE librespot]          device "librespot"
[2024-07-30T08:08:36Z DEBUG librespot_core::session] new Session
[2024-07-30T08:08:36Z INFO  librespot_playback::mixer::softmixer] Mixing with softvol and volume control: Log(60.0)
[2024-07-30T08:08:36Z DEBUG librespot_playback::player] new Player [0]
[2024-07-30T08:08:36Z INFO  librespot_playback::convert] Converting with ditherer: tpdf
[2024-07-30T08:08:36Z INFO  librespot_playback::audio_backend::pulseaudio] Using PulseAudioSink with format: S16
[2024-07-30T08:08:36Z DEBUG librespot_connect::spirc] new Spirc[0]
[2024-07-30T08:08:36Z DEBUG librespot::component] new MercuryManager
[2024-07-30T08:08:36Z DEBUG librespot::component] new ApResolver
[2024-07-30T08:08:36Z DEBUG librespot_core::http_client] Requesting https://apresolve.spotify.com/?type=accesspoint&type=dealer&type=spclient
[2024-07-30T08:08:36Z DEBUG librespot_playback::player] command=AddEventSender
[2024-07-30T08:08:36Z INFO  librespot_core::session] Connecting to AP "ap-gew4.spotify.com:4070"
[2024-07-30T08:08:37Z ERROR librespot] could not initialize spirc: Permission denied { Login failed with reason: Bad credentials }

# nslookup ap-gew4.spotify.com
Server:    xxx
Address 1: xxx

Name:      ap-gew4.spotify.com
Address 1: 34.158.0.131 131.0.158.34.bc.googleusercontent.com

@erkr
Copy link

erkr commented Jul 30, 2024

It appears to be for some users only. It's still working for me right now.

Probably it happens once your token expires

@rgon
Copy link

rgon commented Jul 30, 2024

Using librespot-java and USER_PASS auth
ap: ap-gue1.spotify.com
Ping result:

PING ap-gew1.spotify.com (104.199.65.124) 56(84) bytes of data.
64 bytes from 124.65.199.104.bc.googleusercontent.com (104.199.65.124): icmp_seq=1 ttl=104 time=33.0 ms
Full log
spotifyd     | 2024-07-30 08:33:28,288 INFO  ApResolver:99 - Loaded aps into pool: {accesspoint=[ap-gew1.spotify.com:4070, ap-gew1.spotify.com:443, ap-gew1.spotify.com:80, ap-guc3.spotify.com:4070, ap-gue1.spotify.com:443, ap-gae2.spotify.com:80], dealer=[gew1-dealer2.spotify.com:443, guc3-dealer2.spotify.com:443, gue1-dealer2.spotify.com:443, gae2-dealer2.spotify.com:443], spclient=[gew1-spclient.spotify.com:443, guc3-spclient.spotify.com:443, gue1-spclient.spotify.com:443, gae2-spclient.spotify.com:443]}
spotifyd     | 2024-07-30 08:33:28,441 INFO  Session:140 - Created new session! {deviceId: , ap: ap-gue1.spotify.com:443, proxy: false} 
spotifyd     | 2024-07-30 08:33:29,092 INFO  Session:334 - Connected successfully!
spotifyd     | 2024-07-30 08:33:29,421 ERROR Log4JUncaughtExceptionHandler:31 - [main]
spotifyd     | xyz.gianlu.librespot.core.Session$SpotifyAuthenticationException: BadCredentials
spotifyd     | 	at xyz.gianlu.librespot.core.Session.authenticatePartial(Session.java:453) ~[librespot:1.6.3]
spotifyd     | 	at xyz.gianlu.librespot.core.Session.authenticate(Session.java:342) ~[librespot:1.6.3]
spotifyd     | 	at xyz.gianlu.librespot.core.Session.access$600(Session.java:77) ~[librespot:1.6.3]
spotifyd     | 	at xyz.gianlu.librespot.core.Session$Builder.create(Session.java:1057) ~[librespot:1.6.3]
spotifyd     | 	at xyz.gianlu.librespot.player.Main.main(Main.java:80) ~[librespot:1.6.3]
spotifyd     | 2024-07-30 08:34:30,706 INFO  ApResolver:99 - Loaded aps into pool: {accesspoint=[ap-gew1.spotify.com:4070, ap-gew1.spotify.com:443, ap-gew1.spotify.com:80, ap-guc3.spotify.com:4070, ap-gue1.spotify.com:443, ap-gew4.spotify.com:80], dealer=[gew1-dealer2.spotify.com:443, guc3-dealer2.spotify.com:443, gue1-dealer2.spotify.com:443, gew4-dealer2.spotify.com:443], spclient=[gew1-spclient.spotify.com:443, guc3-spclient.spotify.com:443, gue1-spclient.spotify.com:443, gew4-spclient.spotify.com:443]}
spotifyd     | 2024-07-30 08:34:30,759 INFO  Session:140 - Created new session! {deviceId: , ap: ap-gew1.spotify.com:443, proxy: false} 
spotifyd     | 2024-07-30 08:34:31,235 INFO  Session:334 - Connected successfully!
spotifyd     | 2024-07-30 08:34:31,429 ERROR Log4JUncaughtExceptionHandler:31 - [main]
spotifyd     | xyz.gianlu.librespot.core.Session$SpotifyAuthenticationException: BadCredentials
spotifyd     | 	at xyz.gianlu.librespot.core.Session.authenticatePartial(Session.java:453) ~[librespot:1.6.3]
spotifyd     | 	at xyz.gianlu.librespot.core.Session.authenticate(Session.java:342) ~[librespot:1.6.3]
spotifyd     | 	at xyz.gianlu.librespot.core.Session.access$600(Session.java:77) ~[librespot:1.6.3]
spotifyd     | 	at xyz.gianlu.librespot.core.Session$Builder.create(Session.java:1057) ~[librespot:1.6.3]
spotifyd     | 	at xyz.gianlu.librespot.player.Main.main(Main.java:80) ~[librespot:1.6.3]

@bitclick
Copy link

bitclick commented Jul 30, 2024

librespot 0.4.2 a6e1258 (Built on 2023-06-21, Build ID: AEkvVEBq, Profile: release)
Debian GNU/Linux 11

i am affected too, since 2024-07-29T09:37:23Z (in germany)
see attached logfile for connection attempts and servers (before and after the error started happening)
librespot-connection-attempts.log

  • sometimes it would succeed on a server that otherwise would fail
PING ap-guc3.spotify.com (104.154.127.126) 56(84) bytes of data.
64 bytes from 126.127.154.104.bc.googleusercontent.com (104.154.127.126): icmp_seq=1 ttl=56 time=125 ms

UPDATE:

  • workaround: on another host without credentials its working fine via zeroconf / lan discovery

@dspearson
Copy link
Author

Unfortunately changing the OS in the match clauses as suggested did nothing.

❯ ./target/debug/librespot --verbose  --username=XXXXXXXX --password=XXXXXXXX
[2024-07-30T08:47:26Z INFO  librespot] librespot 0.5.0-dev 299b7de (Built on 2024-07-30, Build ID: j5Xsh0Yw, Profile: debug)
[2024-07-30T08:47:26Z TRACE librespot] Command line argument(s):
[2024-07-30T08:47:26Z TRACE librespot]          verbose
[2024-07-30T08:47:26Z TRACE librespot]          username "XXXXXXXX"
[2024-07-30T08:47:26Z TRACE librespot]          password "XXXXXXXX"
[2024-07-30T08:47:26Z DEBUG librespot_core::session] new Session
[2024-07-30T08:47:26Z DEBUG librespot_discovery::server] Zeroconf server listening on 0.0.0.0:32987
[2024-07-30T08:47:26Z INFO  librespot_playback::mixer::softmixer] Mixing with softvol and volume control: Log(60.0)
[2024-07-30T08:47:26Z DEBUG librespot_connect::spirc] new Spirc[0]
[2024-07-30T08:47:26Z DEBUG librespot::component] new MercuryManager
[2024-07-30T08:47:26Z DEBUG librespot_playback::player] new Player [0]
[2024-07-30T08:47:26Z DEBUG librespot::component] new ApResolver
[2024-07-30T08:47:26Z INFO  librespot_playback::convert] Converting with ditherer: tpdf
[2024-07-30T08:47:26Z INFO  librespot_playback::audio_backend::rodio] Using Rodio sink with format S16 and cpal host: ALSA
[2024-07-30T08:47:26Z INFO  librespot_playback::audio_backend::rodio] Using audio device: default
[2024-07-30T08:47:26Z DEBUG librespot_core::http_client] Requesting https://apresolve.spotify.com/?type=accesspoint&type=dealer&type=spclient
[2024-07-30T08:47:26Z DEBUG librespot_playback::audio_backend::rodio] Rodio sink was created
[2024-07-30T08:47:26Z INFO  librespot_core::session] Connecting to AP "ap-gew4.spotify.com:4070"
[2024-07-30T08:47:26Z ERROR librespot] could not initialize spirc: Permission denied { Login failed with reason: Bad credentials }

❯ dig +short A ap-gew4.spotify.com
34.158.0.131

@BGazotti
Copy link

BGazotti commented Jul 30, 2024

Same here in São Paulo, Brazil, stopped working yesterday afternoon. 6.10.2 kernel on Gentoo.

$ librespot -u not-so-secret-username -p super-secret-password --enable-volume-normalisation --format F32 --normalisation-pregain=-5.5 --autoplay on --name librespot --bitrate 320 --device-type computer -v --backend pulseaudio 2>&1

[2024-07-30T08:55:43Z INFO  librespot] librespot 0.5.0-dev 299b7de (Built on 2024-07-29, Build ID: 9yMh5PUy, Profile: release)
[2024-07-30T08:55:43Z TRACE librespot] Command line argument(s):
[2024-07-30T08:55:43Z TRACE librespot] 		u "XXXXXXXX"
[2024-07-30T08:55:43Z TRACE librespot] 		p "XXXXXXXX"
[2024-07-30T08:55:43Z TRACE librespot] 		enable-volume-normalisation
[2024-07-30T08:55:43Z TRACE librespot] 		format "F32"
[2024-07-30T08:55:43Z TRACE librespot] 		normalisation-pregain "-5.5"
[2024-07-30T08:55:43Z TRACE librespot] 		autoplay "on"
[2024-07-30T08:55:43Z TRACE librespot] 		name "librespot"
[2024-07-30T08:55:43Z TRACE librespot] 		bitrate "320"
[2024-07-30T08:55:43Z TRACE librespot] 		device-type "computer"
[2024-07-30T08:55:43Z TRACE librespot] 		v
[2024-07-30T08:55:43Z TRACE librespot] 		backend "pulseaudio"
[2024-07-30T08:55:43Z DEBUG librespot_core::session] new Session
[2024-07-30T08:55:43Z DEBUG librespot_discovery::server] Zeroconf server listening on 0.0.0.0:38875
[2024-07-30T08:55:43Z INFO  librespot_playback::mixer::softmixer] Mixing with softvol and volume control: Log(60.0)
[2024-07-30T08:55:43Z DEBUG librespot_playback::player] Normalisation Type: Auto
[2024-07-30T08:55:43Z DEBUG librespot_playback::player] Normalisation Pregain: -5.5 dB
[2024-07-30T08:55:43Z DEBUG librespot_playback::player] Normalisation Threshold: -2.0 dBFS
[2024-07-30T08:55:43Z DEBUG librespot_playback::player] Normalisation Method: Dynamic
[2024-07-30T08:55:43Z DEBUG librespot_playback::player] Normalisation Attack: 5 ms
[2024-07-30T08:55:43Z DEBUG librespot_playback::player] Normalisation Release: 100 ms
[2024-07-30T08:55:43Z DEBUG librespot_playback::player] Normalisation Knee: 5 dB
[2024-07-30T08:55:43Z DEBUG librespot_connect::spirc] new Spirc[0]
[2024-07-30T08:55:43Z DEBUG librespot::component] new MercuryManager
[2024-07-30T08:55:43Z DEBUG librespot::component] new ApResolver
[2024-07-30T08:55:43Z DEBUG librespot_core::http_client] Requesting https://apresolve.spotify.com/?type=accesspoint&type=dealer&type=spclient
[2024-07-30T08:55:43Z DEBUG librespot_playback::player] new Player [0]
[2024-07-30T08:55:43Z INFO  librespot_playback::audio_backend::pulseaudio] Using PulseAudioSink with format: F32
[2024-07-30T08:55:43Z INFO  librespot_core::session] Connecting to AP "ap-gue1.spotify.com:4070"
[2024-07-30T08:55:44Z ERROR librespot] could not initialize spirc: Permission denied { Login failed with reason: Bad credentials }
<exit 1>

$ ping ap-gue1.spotify.com
PING ap-gue1.spotify.com (34.158.253.218) 56(84) bytes of data.
64 bytes from 218.253.158.34.bc.googleusercontent.com (34.158.253.218): icmp_seq=1 ttl=60 time=121 ms

@rgon
Copy link

rgon commented Jul 30, 2024

Do we have a way to block or force misbehaving APs? Given these logs, at least the following fail:

ap-gue1.spotify.com
ap-gew1.spotify.com
ap-gew4.spotify.com
ap-gae2.spotify.com

I tried the naive approach of pointing them to 127.0.0.1 in my /etc/hosts, but that triggers a connection error. Pointing them to another ap's IP also does not seem to do anything to avoid it.

@roderickvd
Copy link
Member

roderickvd commented Jul 30, 2024

Is it confirmed that other APs continue to work well?

It's not the first time that an AP starts misbehaving, but I don't remember this many. You could try pointing apresolve.spotify.com to 127.0.0.1 as it will force a fallback mechanism:

warn!("Failed to resolve all access points, using fallbacks");

If you want to filter APs then you could do it in the same file, probably here:

.filter_map(|ap| {

But filtering that many could result in an empty set... don't you only get like three or something?
So that should also make it resort to a fallback. No guarantees the fallback AP will work, although in the past it did.

Edit: misbehaving APs usually get fixed, sometimes in a few days, sometimes weeks. Not sure if this is a transitive failure on Spotify's end, or something that's really changing. That's why it would be good if someone had an old HW device with Connect to test, not something with recent firmware... to see if they're really phasing out this interface.

@kingosticks
Copy link
Contributor

kingosticks commented Jul 30, 2024

It appears to be for some users only. It's still working for me right now.

Probably it happens once your token expires

Yes, actually, I would have been using cached credentials (which don't expire). This session login failure is for the access point, it's not token based.

I've got a Windows 11 machine here today and no cached credentials. Both dev and master fail:

[2024-07-30T09:03:32Z INFO  librespot] librespot 0.4.2 6537c44 (Built on 2024-07-30, Build ID: EBl3oB2x, Profile: release)
[2024-07-30T09:03:32Z DEBUG librespot_discovery::server] Zeroconf server listening on 0.0.0.0:53805
[2024-07-30T09:03:32Z WARN  librespot_core::apresolve] Ignoring blacklisted access point ap-gue1.spotify.com:443
[2024-07-30T09:03:32Z WARN  librespot_core::apresolve] Ignoring blacklisted access point ap-gew4.spotify.com:80
[2024-07-30T09:03:32Z INFO  librespot_core::session] Connecting to AP "ap-gew1.spotify.com:443"
[2024-07-30T09:03:32Z ERROR librespot] Connection failed: Login failed with reason: Bad credentials
[2024-07-30T09:20:27Z INFO  librespot] librespot 0.5.0-dev 299b7de (Built on 2024-07-30, Build ID: Lts5Aikk, Profile: release)
[2024-07-30T09:20:27Z DEBUG librespot_core::session] new Session
[2024-07-30T09:20:27Z DEBUG librespot_discovery::server] Zeroconf server listening on 0.0.0.0:53991
[2024-07-30T09:20:27Z INFO  librespot_playback::mixer::softmixer] Mixing with softvol and volume control: Log(60.0)
[2024-07-30T09:20:27Z DEBUG librespot_connect::spirc] new Spirc[0]
[2024-07-30T09:20:27Z DEBUG librespot::component] new MercuryManager
[2024-07-30T09:20:27Z DEBUG librespot_playback::player] new Player [0]
[2024-07-30T09:20:27Z DEBUG librespot::component] new ApResolver
[2024-07-30T09:20:27Z INFO  librespot_playback::convert] Converting with ditherer: tpdf
[2024-07-30T09:20:27Z DEBUG librespot_core::http_client] Requesting https://apresolve.spotify.com/?type=accesspoint&type=dealer&type=spclient
[2024-07-30T09:20:27Z INFO  librespot_playback::audio_backend::rodio] Using Rodio sink with format S16 and cpal host: WASAPI
[2024-07-30T09:20:27Z INFO  librespot_playback::audio_backend::rodio] Using audio device: Headset Earphone (Poly BT600)
[2024-07-30T09:20:27Z DEBUG librespot_playback::audio_backend::rodio] Rodio sink was created
[2024-07-30T09:20:28Z INFO  librespot_core::session] Connecting to AP "ap-gew1.spotify.com:443"
[2024-07-30T09:20:28Z ERROR librespot] could not initialize spirc: Permission denied { Login failed with reason: Bad credentials }

I wonder if the one reported working Windows env above was also using cached creds? @azel1 can you provide a working log?

@roderickvd
Copy link
Member

We could ask them if username+password login via login5 (using Android client id and doing hashcash stuff) is going to continue to work beyond these "few days"?

I thought it was a good idea to find an opening for more collaboration before I starting shooting more detailed questions at them. This is what I just wrote them:

Dear Sir/Madam,

On behalf of the librespot team, thank you for giving us notice. We are migrating to an OAuth flow and hope to release it in short time.

Appreciating that you have reached out to us, how could we establish more contact?

Our goal remains to create a Spotify cross-platform streaming experience, increasing Spotify reach and presence, in full compatibility while standing against piracy.

On the compatibility front in particular we’re facing some challenges to understand your API, that could otherwise allow us to move to your new HTTP infrastructure entirely, amongst other things.

Thanks again - how do you think we could establish further contact?

Kind regards,

Roderick van Domburg
Librespot maintainer

I'll keep you informed if and how they respond.

@michaelherger
Copy link
Contributor

Thanks for your effort, @roderickvd. Unfortunately I happen to know that they have an issue with the lack of reporting (see #626). It's my vague memory that this was addressed in the Java version, but never made it to the Rust build? I could be wrong though, my memory is failing me way too often :(.

@roderickvd
Copy link
Member

Yes, librespot-java figured it out partially and it hasn't been back ported yet. Could be a good start for someone who wants to contribute - not super hard to send a message from the player to the session when a play finished, so the session can report it back to Spotify.

I remember that the librespot-java version didn't work under all circumstances, and doesn't have all fields figured out, so any clarification from Spotify would be welcome.

This is one of the things I thought of when I wrote "amongst other things" to Spotify - I'm all for artist monetisation but don't know if payout is high on Spotify's agenda. I am happy to hear from you that apparently it is, so if they could help us scratch that itch...

@fraintt
Copy link

fraintt commented Aug 25, 2024

Anyone know how to pass the credentials.json file from @dspearson's tool to Snapcast/Librespot?

I'm already using the params field: https://github.com/badaix/snapcast/blob/develop/doc/configuration.md#available-parameters

echo -n "&params=--disable-discovery" >> "${config}"

But I'm not sure how to append -O and -C to it properly

Update: -O is disable discovery, so no need for that. -C is the cache dir, which can directly be passed to the Snapcast stream variable &cache=/data/librespot (Make sure to create the dir and store credentials.json there)

On another note, I'm having trouble running snapcast with the latest version of alpine... Just get a segfault... badaix/snapcast#1275

So you basically mean create the credentials.json (with, lets say this ) and past the file in /data/librespot, and then in the snapserver.conf in the stream for spotify use this:

source = librespot:///librespot?name=Spotify&bitrate=160&devicename=SoundSystem&cache=/data/librespot

?

Thank you in advance!

@AdrieVanDijk
Copy link

I only removed the -u and -p parameters and it worked again, although it gave a warning:
Unable to get client token. Trying to continue without...
So why do I need a credentials.json ?

@DarpNagarsheth
Copy link

DarpNagarsheth commented Aug 31, 2024

Okay I'm able to get my cred json file but not login, might be newbie question but would love some help.
.
But I can see the way authentication is done now is changed, it was
.
{ "username": "",
"credentials": "",
"type": "AUTHENTICATION_STORED_SPOTIFY_CREDENTIALS" }
.
Now it is
.
{ "username": "",
"auth_type": 1,
"auth_data": "" }
.
how do I adapt my old login to this? I'm using zspotify https://www.reddit.com/r/Piracy/comments/15irsee/ive_updated_zspotifyexe_to_fix_its_bugs_from_the/
.

from librespot.core import Session
def login():
    """ Authenticates with Spotify and saves credentials to a file """
    global SESSION  # pylint: disable=global-statement

    if os.path.isfile("credentials.json"):
        try:
            SESSION = Session.Builder().stored_file().create()
            return
        except RuntimeError:
            pass
    while True:
        user_name = input("Username: ")
        password = input("Password: ")
        try:
            SESSION = Session.Builder().user_pass(user_name, password).create()
            return
        except RuntimeError:
            pass

.
Do I update librespot.core? because that's what's doing the auth?

@SuisChan
Copy link
Contributor

needs to be made in less than 10 seconds

Login challenge (hashcash)? It has always been like that

@3052
Copy link

3052 commented Sep 1, 2024

OK I have a working email/password implementation, again it was just the addition of the user-agent basically:

https://github.com/3052/platform/tree/v1.4.9/spotify

@xdfwers
Copy link

xdfwers commented Sep 10, 2024

@DarpNagarsheth Have you solved the issue, i am facing the same issue using zspotify.

@kingosticks
Copy link
Contributor

@DarpNagarsheth Have you solved the issue, i am facing the same issue using zspotify.

There is no support for that tool here. Thanks.

@curiousercreative
Copy link

I don't agree with the tone of the previous comment, but I've always been curious why the repo doesn't publish releases. Fortunately, I find the latest is often packaged for alpine edge, but the versioning is unclear. Has this been discussed previously and there's a reason new releases aren't created and published?

@roderickvd
Copy link
Member

roderickvd commented Oct 12, 2024

It's not by any policy but by the way things go. Mostly because:

  1. This project needs more contributors and maintainers - myself I don't use Spotify or even have an account anymore;

  2. Given bullet 1 and the not insignificant installed user base, I want to be sure that what we release is stable;

  3. 0.5 presents some major changes and until recently was hardly battle-tested, so of higher risk.

By the way, I am extremely happy with the recent influx of contributions! It's ensured 0.5 is tested and got a couple of much needed fixes in.

So yes I intend to release 0.5 soon, work and family life also permitting, with either of the PRs in to fix the frequent disconnections.

@rwjack
Copy link

rwjack commented Oct 13, 2024

I don't get why this guy is being downvoted. Someone needs to step up and publish a release. There will always be bugs and imperfections that can be straightened out later.

No release means less actual testing. Librespot is not a "production service", everyone who cares about uptime will 200% test before blindly updating to 0.5.

And the whole delay in creating a release is just making everything worse, according to all SE guidelines. Make small changes, perform quick tests and publish releases often - the exact opposite of what we have now.

@shanemeagher
Copy link
Contributor

Guys calm down. I've been following this project since the early days and here's some context.

@roderickvd isn't the original creator, just the person who stepped up to progress it and manage it when no one else could be bothered. He had a Spotify account once and has moved to another service now but he keeps managing the project because nobody else offered to take it over

@devgianlu
Copy link
Member

Please be kind to those that maintain open source projects in their free time. This is not a job for many and focusing on a project you don't use anymore feels like wasted time.

This kind of bad attitude towards open source projects will not get you or the project anywhere.

@michaelherger
Copy link
Contributor

Please re-consider your attitude: this software is provided by volunteers spending their spare time, night and day, on the product. They receive nothing for all the work and hassle and time spend. If you p... them off with your angry attitude, you won't get anything back. They will leave and you can continue to be angry for yourself.

If you know how much effort it is to release such a product, then just build it yourself. If you don't know how to do it, then how can you judge the effort required?

@noahhaon
Copy link

Ok, for Librespot's original creator, Please publish a new release unless I will be.... angry!

@ManiArasteh build it yourself. If you can't, I will compile it for you for 200EUR.

@noahhaon
Copy link

@ManiArasteh so you built your app with dependencies on open source software, whose unpaid maintainers you are being extremely demanding and rude to. And now you are not getting what you want. Sounds like a "you" problem my dude.

Anyhow, offer stands if you want me to build it for you. Just let me know what platform and you can paypal me 300EUR - a special discount for you, today only.

@roderickvd
Copy link
Member

👮 locking this thread.

Thanks for the sensible comments and taking note of what I already said in #1308 (comment). Let's focus on getting either #1357 or #1359 in.

@ManiArasteh I will not accept your behaviour. This is your last and only warning before I block you.

@librespot-org librespot-org locked as too heated and limited conversation to collaborators Oct 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.