[GH-ISSUE #1308] Authentication failures #596

Closed
opened 2026-02-27 19:31:27 +03:00 by kerem · 134 comments
Owner

Originally created by @dspearson on GitHub (Jul 29, 2024).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/1308

"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.

Originally created by @dspearson on GitHub (Jul 29, 2024). Original GitHub issue: https://github.com/librespot-org/librespot/issues/1308 "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.
kerem 2026-02-27 19:31:27 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@kingosticks commented on GitHub (Jul 29, 2024):

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).

<!-- gh-comment-id:2256857260 --> @kingosticks commented on GitHub (Jul 29, 2024): 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).
Author
Owner

@azel1 commented on GitHub (Jul 29, 2024):

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

<!-- gh-comment-id:2257037094 --> @azel1 commented on GitHub (Jul 29, 2024): The same code gives bad credentials error on my linux machine, but works everytime on Windows. Tried multiple accounts.
Author
Owner

@quantverse commented on GitHub (Jul 29, 2024):

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

Ubuntu 22.04.

<!-- gh-comment-id:2257043750 --> @quantverse commented on GitHub (Jul 29, 2024): Same problem on my Linux machine since today. Yesterday it was still working fine. Ubuntu 22.04.
Author
Owner

@roderickvd commented on GitHub (Jul 29, 2024):

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.

<!-- gh-comment-id:2257050298 --> @roderickvd commented on GitHub (Jul 29, 2024): 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.
Author
Owner

@eladyn commented on GitHub (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)

<!-- gh-comment-id:2257085891 --> @eladyn commented on GitHub (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)
Author
Owner

@andrewCohn commented on GitHub (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!

<!-- gh-comment-id:2257135661 --> @andrewCohn commented on GitHub (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!
Author
Owner

@Losses commented on GitHub (Jul 30, 2024):

Same issue here

ERROR librespot] could not initialize spirc: Permission denied { Login failed with reason: Bad credentials }
<!-- gh-comment-id:2257506491 --> @Losses commented on GitHub (Jul 30, 2024): Same issue here ``` ERROR librespot] could not initialize spirc: Permission denied { Login failed with reason: Bad credentials } ```
Author
Owner

@Geral3 commented on GitHub (Jul 30, 2024):

Same Here

2024-07-30T05:43:24.314571Z  WARN spotify_player::auth: Failed to authenticate: Login failed with reason: Bad credentials
<!-- gh-comment-id:2257512270 --> @Geral3 commented on GitHub (Jul 30, 2024): Same Here ``` 2024-07-30T05:43:24.314571Z WARN spotify_player::auth: Failed to authenticate: Login failed with reason: Bad credentials ```
Author
Owner

@dspearson commented on GitHub (Jul 30, 2024):

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.

<!-- gh-comment-id:2257560236 --> @dspearson commented on GitHub (Jul 30, 2024): 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.
Author
Owner

@roderickvd commented on GitHub (Jul 30, 2024):

Given it's working on Windows, what if you change this line:
github.com/librespot-org/librespot@299b7dec20/core/src/connection/mod.rs (L91)

To pretend that it's always Windows?

You may need to do the same here:
github.com/librespot-org/librespot@299b7dec20/core/src/connection/handshake.rs (L113)

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.

<!-- gh-comment-id:2257561587 --> @roderickvd commented on GitHub (Jul 30, 2024): Given it's working on Windows, what if you change this line: https://github.com/librespot-org/librespot/blob/299b7dec20b45b9fa19a4a46252079e8a8b7a8ba/core/src/connection/mod.rs#L91 To pretend that it's always Windows? You may need to do the same here: https://github.com/librespot-org/librespot/blob/299b7dec20b45b9fa19a4a46252079e8a8b7a8ba/core/src/connection/handshake.rs#L113 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.
Author
Owner

@IVIanuu commented on GitHub (Jul 30, 2024):

Same issue here.

<!-- gh-comment-id:2257588201 --> @IVIanuu commented on GitHub (Jul 30, 2024): Same issue here.
Author
Owner

@Losses commented on GitHub (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

<!-- gh-comment-id:2257671150 --> @Losses commented on GitHub (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
Author
Owner

@roderickvd commented on GitHub (Jul 30, 2024):

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?

<!-- gh-comment-id:2257681625 --> @roderickvd commented on GitHub (Jul 30, 2024): 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?
Author
Owner

@ssamjh commented on GitHub (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]

<!-- gh-comment-id:2257694410 --> @ssamjh commented on GitHub (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]`
Author
Owner

@Losses commented on GitHub (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
<!-- gh-comment-id:2257695334 --> @Losses commented on GitHub (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 ```
Author
Owner

@noahhaon commented on GitHub (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
<!-- gh-comment-id:2257759381 --> @noahhaon commented on GitHub (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 ```
Author
Owner

@erkr commented on GitHub (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

<!-- gh-comment-id:2257797920 --> @erkr commented on GitHub (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
Author
Owner

@rgon commented on GitHub (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]
<!-- gh-comment-id:2257798190 --> @rgon commented on GitHub (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 <details> <summary>Full log</summary> <pre> 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: <snip>, 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: <snip2>, 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] </pre> </details>
Author
Owner

@bitclick commented on GitHub (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
<!-- gh-comment-id:2257799818 --> @bitclick commented on GitHub (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](https://github.com/user-attachments/files/16424706/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**
Author
Owner

@dspearson commented on GitHub (Jul 30, 2024):

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
<!-- gh-comment-id:2257816825 --> @dspearson commented on GitHub (Jul 30, 2024): 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 ```
Author
Owner

@BGazotti commented on GitHub (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
<!-- gh-comment-id:2257846983 --> @BGazotti commented on GitHub (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
Author
Owner

@rgon commented on GitHub (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.

<!-- gh-comment-id:2257863013 --> @rgon commented on GitHub (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.
Author
Owner

@roderickvd commented on GitHub (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:

github.com/librespot-org/librespot@299b7dec20/core/src/apresolve.rs (L109)

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

github.com/librespot-org/librespot@299b7dec20/core/src/apresolve.rs (L64)

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.

<!-- gh-comment-id:2257881307 --> @roderickvd commented on GitHub (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: https://github.com/librespot-org/librespot/blob/299b7dec20b45b9fa19a4a46252079e8a8b7a8ba/core/src/apresolve.rs#L109 If you want to filter APs then you could do it in the same file, probably here: https://github.com/librespot-org/librespot/blob/299b7dec20b45b9fa19a4a46252079e8a8b7a8ba/core/src/apresolve.rs#L64 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.
Author
Owner

@kingosticks commented on GitHub (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?

<!-- gh-comment-id:2257885188 --> @kingosticks commented on GitHub (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](https://github.com/librespot-org/librespot/blob/dev/core/src/session.rs#L154) 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?
Author
Owner

@kingosticks commented on GitHub (Jul 30, 2024):

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.

They are phasing out the car thing in December. When Spotify started phasing out libspotify (their old official native library) they intermitently repeatedly broke lots of things in the run-up to turning it off. The theory was that they had no idea how the old and new parts of their systems depended on each other.

Does spotify-analyze still work? How can we observe the AP login these days?

<!-- gh-comment-id:2257899255 --> @kingosticks commented on GitHub (Jul 30, 2024): > 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. They are [phasing out the car thing in December](https://github.com/librespot-org/librespot/discussions/1288). When Spotify started phasing out libspotify (their old official native library) they intermitently repeatedly broke lots of things in the run-up to turning it off. The theory was that they had no idea how the old and new parts of their systems depended on each other. Does spotify-analyze still work? How can we observe the AP login these days?
Author
Owner

@SuisChan commented on GitHub (Jul 30, 2024):

Does spotify-analyze still work? How can we observe the AP login these days?

Idk, but on Windows you can use x64dbg to find 'shn_keys' or/and read the client's transmitted data

<!-- gh-comment-id:2257917992 --> @SuisChan commented on GitHub (Jul 30, 2024): > Does spotify-analyze still work? How can we observe the AP login these days? Idk, but on Windows you can use x64dbg to find 'shn_keys' or/and read the client's transmitted data
Author
Owner

@roderickvd commented on GitHub (Jul 30, 2024):

I think spotify-analyze needs on overhaul to make it work again. Have not used it in ages and I remember it was broken two years ago.

<!-- gh-comment-id:2257923725 --> @roderickvd commented on GitHub (Jul 30, 2024): I think `spotify-analyze` needs on overhaul to make it work again. Have not used it in ages and I remember it was broken two years ago.
Author
Owner

@roderickvd commented on GitHub (Jul 30, 2024):

The theory was that they had no idea how the old and new parts of their systems depended on each other.

Yeah, nice that tribal development scheme.

<!-- gh-comment-id:2257926094 --> @roderickvd commented on GitHub (Jul 30, 2024): > The theory was that they had no idea how the old and new parts of their systems depended on each other. Yeah, nice that tribal development scheme.
Author
Owner

@microfx commented on GitHub (Jul 30, 2024):

so what's the workaround? Can I maybe switch to an app API key that authenticates my librespot? Librespot is crashing all the time due to this.

This happened even during playback / using librespot ... just crashed and then stopped being available

Connecting to AP "ap-gew4.spotify.com:4070"

<!-- gh-comment-id:2258012964 --> @microfx commented on GitHub (Jul 30, 2024): so what's the workaround? Can I maybe switch to an app API key that authenticates my librespot? Librespot is crashing all the time due to this. This happened even during playback / using librespot ... just crashed and then stopped being available ` Connecting to AP "ap-gew4.spotify.com:4070" `
Author
Owner

@roderickvd commented on GitHub (Jul 30, 2024):

That’s what we’re trying to find out. If you want to help, please read my posts to see what you can do to help nail it down.

Edit: as a kind reminder, I don’t use Spotify or even have an account anymore, so I’m here to give pointers and think along but it’s up to you guys.

<!-- gh-comment-id:2258036493 --> @roderickvd commented on GitHub (Jul 30, 2024): That’s what we’re trying to find out. If you want to help, please read my posts to see what you can do to help nail it down. Edit: as a kind reminder, I don’t use Spotify or even have an account anymore, so I’m here to give pointers and think along but it’s up to you guys.
Author
Owner

@noahhaon commented on GitHub (Jul 30, 2024):

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:

FWIW I tried this by modifying /etc/hosts and saw it trigger the fallback and got the same result :(

<!-- gh-comment-id:2258045191 --> @noahhaon commented on GitHub (Jul 30, 2024): > 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: FWIW I tried this by modifying `/etc/hosts` and saw it trigger the fallback and got the same result :(
Author
Owner

@SuisChan commented on GitHub (Jul 30, 2024):

Anyway, does the latest spotify version (win, mac etc) connect to port 4070 or not anymore? (last time I checked, the only thing the client was sending to the server was information about listening events). (I don't have access to the desktop right now, but it's easy to check with Wireshark)

<!-- gh-comment-id:2258049111 --> @SuisChan commented on GitHub (Jul 30, 2024): Anyway, does the latest spotify version (win, mac etc) connect to port 4070 or not anymore? (last time I checked, the only thing the client was sending to the server was information about listening events). (I don't have access to the desktop right now, but it's easy to check with Wireshark)
Author
Owner

@microfx commented on GitHub (Jul 30, 2024):

PING ap-gew4.spotify.com(131.0.158.34.bc.googleusercontent.com (64:ff9b::229e:83)) 56 data bytes
64 bytes from 131.0.158.34.bc.googleusercontent.com (64:ff9b::229e:83): icmp_seq=1 ttl=54 time=37.9 ms

telnet  ap-gew4.spotify.com 4070������������12:48
Trying 64:ff9b::229e:83...
Connected to ap-gew4.spotify.com.

does this help?! I will test macOS desktop client now

<!-- gh-comment-id:2258051084 --> @microfx commented on GitHub (Jul 30, 2024): ``` PING ap-gew4.spotify.com(131.0.158.34.bc.googleusercontent.com (64:ff9b::229e:83)) 56 data bytes 64 bytes from 131.0.158.34.bc.googleusercontent.com (64:ff9b::229e:83): icmp_seq=1 ttl=54 time=37.9 ms telnet ap-gew4.spotify.com 4070������������12:48 Trying 64:ff9b::229e:83... Connected to ap-gew4.spotify.com. ``` does this help?! I will test macOS desktop client now
Author
Owner

@rgon commented on GitHub (Jul 30, 2024):

@bitclick

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

Can confirm local (without login) works(at least on master, librespot 0.0.0-dev 299b7de), so @microfx that's one possible workaround! Edit: if your use case can live without remote access, of course.

<!-- gh-comment-id:2258074540 --> @rgon commented on GitHub (Jul 30, 2024): @bitclick > workaround: on another host without credentials its working fine via zeroconf / lan discovery Can confirm local (without login) works(at least on master, librespot 0.0.0-dev 299b7de), so @microfx that's one possible workaround! Edit: if your use case can live without remote access, of course.
Author
Owner

@dspearson commented on GitHub (Jul 30, 2024):

Version 3.203.235

API-Change
Removed SpConnectionLoginPassword API.

My suspicion is that this is the cause.

See: https://developer.spotify.com/documentation/commercial-hardware/implementation/changelog (assuming this is using the Spotify Connect API)

<!-- gh-comment-id:2258098685 --> @dspearson commented on GitHub (Jul 30, 2024): [Version 3.203.235](https://developer.spotify.com/documentation/commercial-hardware/implementation/reference/3.203) API-Change Removed SpConnectionLoginPassword API. My suspicion is that this is the cause. See: https://developer.spotify.com/documentation/commercial-hardware/implementation/changelog (assuming this is using the Spotify Connect API)
Author
Owner

@roderickvd commented on GitHub (Jul 30, 2024):

Well there you seem to have it.
Naive question but how would this impact the login5 approach?

<!-- gh-comment-id:2258113472 --> @roderickvd commented on GitHub (Jul 30, 2024): Well there you seem to have it. Naive question but how would this impact the login5 approach?
Author
Owner

@kingosticks commented on GitHub (Jul 30, 2024):

The latest Linux client still connects to the AP on port 40070, you can get some verbose logging out their binary:

10:48:41.264 I [f:180 ] Resolved rpc host: https://gew1-spclient.spotify.com:443
10:48:41.264 I [f:180 ] Resolved streaming host: wss://gew1-dealer2.spotify.com:443
10:48:41.264 I [f:420 ] High request latency: https://apresolve.spotify.com/ took 160 ms
10:48:41.265 I [f:504 ] Connecting to AP ap-gew1.spotify.com:4070
10:48:41.273 I [f:59 ] Resolved ap-gew1.spotify.com to 104.199.65.124

I've kind of got spotify-analyse running on my WSL machine but annoyingly I can't catch the whole connection, the first thing I capture is ClientResponseEncrypted.

EDIT: I am being dumb, ClientResponseEncrypted is the interesting bit! It's using AUTHENTICATION_STORED_SPOTIFY_CREDENTIALS. I think login5 method is the answer. Their app doesn;t ask for your user and pass anymore, it does an oauth thing via your browser.

<!-- gh-comment-id:2258116092 --> @kingosticks commented on GitHub (Jul 30, 2024): The latest Linux client still connects to the AP on port 40070, you can get some verbose logging out their binary: > 10:48:41.264 I [f:180 ] Resolved rpc host: https://gew1-spclient.spotify.com:443 10:48:41.264 I [f:180 ] Resolved streaming host: wss://gew1-dealer2.spotify.com:443 10:48:41.264 I [f:420 ] High request latency: https://apresolve.spotify.com/ took 160 ms 10:48:41.265 I [f:504 ] Connecting to AP ap-gew1.spotify.com:4070 10:48:41.273 I [f:59 ] Resolved ap-gew1.spotify.com to 104.199.65.124 I've kind of got spotify-analyse running on my WSL machine but annoyingly I can't catch the whole connection, the first thing I capture is ClientResponseEncrypted. EDIT: I am being dumb, ClientResponseEncrypted is the interesting bit! It's using `AUTHENTICATION_STORED_SPOTIFY_CREDENTIALS`. I think login5 method is the answer. Their app doesn;t ask for your user and pass anymore, it does an oauth thing via your browser.
Author
Owner

@SuisChan commented on GitHub (Jul 30, 2024):

I can't catch the whole connection, the first thing I capture is ClientResponseEncrypted.

Isn't this normal behavior? In my case it always worked like that, I mean the first one intercepted was always ClientResponseEncrypted

<!-- gh-comment-id:2258126717 --> @SuisChan commented on GitHub (Jul 30, 2024): > I can't catch the whole connection, the first thing I capture is ClientResponseEncrypted. Isn't this normal behavior? In my case it always worked like that, I mean the first one intercepted was always ClientResponseEncrypted
Author
Owner

@kingosticks commented on GitHub (Jul 30, 2024):

I can't catch the whole connection, the first thing I capture is ClientResponseEncrypted.

Isn't this normal behavior? In my case it always worked like that, I mean the first one intercepted was always ClientResponseEncrypted

yeh sorry, I was being stupid. See edit.

<!-- gh-comment-id:2258127305 --> @kingosticks commented on GitHub (Jul 30, 2024): > > I can't catch the whole connection, the first thing I capture is ClientResponseEncrypted. > > Isn't this normal behavior? In my case it always worked like that, I mean the first one intercepted was always ClientResponseEncrypted yeh sorry, I was being stupid. See edit.
Author
Owner

@dspearson commented on GitHub (Jul 30, 2024):

I guess a way to avoid this issue would be to use tokens a la https://github.com/librespot-org/librespot/issues/242 instead. My Rust is not really strong enough today to implement such a thing though unfortunately.

<!-- gh-comment-id:2258129045 --> @dspearson commented on GitHub (Jul 30, 2024): I guess a way to avoid this issue would be to use tokens a la https://github.com/librespot-org/librespot/issues/242 instead. My Rust is not really strong enough today to implement such a thing though unfortunately.
Author
Owner

@SuisChan commented on GitHub (Jul 30, 2024):

See edit.

Hmm, I see. It turns out the fix should be simple(?), login via login5 and then use the received stored credentials

<!-- gh-comment-id:2258132490 --> @SuisChan commented on GitHub (Jul 30, 2024): > See edit. Hmm, I see. It turns out the fix should be simple(?), login via login5 and then use the received stored credentials
Author
Owner

@rgon commented on GitHub (Jul 30, 2024):

@kingosticks I cannot log in on port 4070 either, with the same AP. Linux client.

librespot  | [2024-07-30T10:56:44Z INFO  librespot_core::session] Connecting to AP "ap-gew1.spotify.com:4070"
librespot  | [2024-07-30T10:56:44Z ERROR librespot] could not initialize spirc: Permission denied { Login failed with reason: Bad credentials }

This is not a windows/linux issue, but rather that the API change is being rolled out progressively, thus not affecting some combination of users/AP sometimes. Annoying to debug indeed...

<!-- gh-comment-id:2258134966 --> @rgon commented on GitHub (Jul 30, 2024): @kingosticks I cannot log in on port 4070 either, with the same AP. Linux client. librespot | [2024-07-30T10:56:44Z INFO librespot_core::session] Connecting to AP "ap-gew1.spotify.com:4070" librespot | [2024-07-30T10:56:44Z ERROR librespot] could not initialize spirc: Permission denied { Login failed with reason: Bad credentials } This is not a windows/linux issue, but rather that the API change is being rolled out progressively, thus not affecting some combination of users/AP sometimes. Annoying to debug indeed...
Author
Owner

@kingosticks commented on GitHub (Jul 30, 2024):

So it's an Oauth flow for the first login and then stored creds afterwards. The description at https://developer.spotify.com/documentation/commercial-hardware/implementation/reference/3.203#spconnectionloginoauthtoken seems to support that.

<!-- gh-comment-id:2258142338 --> @kingosticks commented on GitHub (Jul 30, 2024): So it's an Oauth flow for the first login and then stored creds afterwards. The description at https://developer.spotify.com/documentation/commercial-hardware/implementation/reference/3.203#spconnectionloginoauthtoken seems to support that.
Author
Owner

@eladyn commented on GitHub (Jul 30, 2024):

When I checked yesterday, while the desktop version uses OAuth for the login, the mobile (android) client still lets the user input their credentials (together with a hash cash challenge) and uses login5 to log in and get the stored credentials.

<!-- gh-comment-id:2258191064 --> @eladyn commented on GitHub (Jul 30, 2024): When I checked yesterday, while the desktop version uses OAuth for the login, the mobile (android) client still lets the user input their credentials (together with a hash cash challenge) and uses login5 to log in and get the stored credentials.
Author
Owner

@roderickvd commented on GitHub (Jul 30, 2024):

dev contains an implementation to solve the hash cash challenge that works most of the time. Sometimes it cannot solve it in the amount of time, and bails out. It’s not perfect but it works.

To trigger the hash cash, you must carefully set the right combination of OS and platform in various locations. I can’t tell you what the “right combination” is anymore but if you want it to work on Linux, then I do remember you have to look at the HTTP user agent in combination with the Mercury API key.

<!-- gh-comment-id:2258213362 --> @roderickvd commented on GitHub (Jul 30, 2024): `dev` contains an implementation to solve the hash cash challenge that works most of the time. Sometimes it cannot solve it in the amount of time, and bails out. It’s not perfect but it works. To trigger the hash cash, you must carefully set the right combination of OS and platform in various locations. I can’t tell you what the “right combination” is anymore but if you want it to work on Linux, then I do remember you have to look at the HTTP user agent in combination with the Mercury API key.
Author
Owner

@SuisChan commented on GitHub (Jul 30, 2024):

Sometimes it cannot solve it in the amount of time, and bails out

But it should always work, since it is reverse engineered from an original app, and the code should match

Also it may not solve the challenge in that time, if one use debug build, then yes, it may be slow

or...I don't know, there's not enough data to draw conclusions

<!-- gh-comment-id:2258231424 --> @SuisChan commented on GitHub (Jul 30, 2024): > Sometimes it cannot solve it in the amount of time, and bails out But it should always work, since it is reverse engineered from an original app, and the code should match Also it may not solve the challenge in that time, if one use debug build, then yes, it may be slow or...I don't know, there's not enough data to draw conclusions
Author
Owner

@devgianlu commented on GitHub (Jul 30, 2024):

I think they straight up removed the username password login method, for both the AP and Login5, as @dspearson mentioned. I tried the username password authentication with Login5 (which has always worked well in go-librespot) and it still fails.

This is supported by the fact that their own client doesn't let you enter credentials directly anymore, but just sends you to the website.

EDIT: Didn't read about the mobile client still supporting username and password, but that might be removed at some point too, perhaps the best idea is to just embrace the OAuth2 flow.

<!-- gh-comment-id:2258286519 --> @devgianlu commented on GitHub (Jul 30, 2024): I think they straight up removed the username password login method, for both the AP and Login5, as @dspearson mentioned. I tried the username password authentication with Login5 (which has always worked well in go-librespot) and it still fails. This is supported by the fact that their own client doesn't let you enter credentials directly anymore, but just sends you to the website. EDIT: Didn't read about the mobile client still supporting username and password, but that might be removed at some point too, perhaps the best idea is to just embrace the OAuth2 flow.
Author
Owner

@devgianlu commented on GitHub (Jul 30, 2024):

Did a quick implementation of the OAuth2 flow to replace username password authentication: github.com/devgianlu/go-librespot@1e82a27681

Seems to be working fine.

<!-- gh-comment-id:2258433852 --> @devgianlu commented on GitHub (Jul 30, 2024): Did a quick implementation of the OAuth2 flow to replace username password authentication: https://github.com/devgianlu/go-librespot/commit/1e82a276812d5ef5ca0a52fe7d993ea549667a17 Seems to be working fine.
Author
Owner

@kingosticks commented on GitHub (Jul 30, 2024):

Awesome! OK so the flow is:

  1. Oauth prompt opened in user's web browser at accounts.spotify.com for oauth flow, user completes and code is returned to app
  2. Gets a client-token (can't remember how but we do this already)
  3. Exchange code for short-lived access token with POST https://accounts.spotify.com/api/token (using client-token header),
  4. Swap the temporary access token for stored credentials using Mercury ClientResponseEncrypted request of type AUTHENTICATION_SPOTIFY_TOKEN with our username and the auth_data is just the access token from step 3? Receives APWelcome response containing long-lived reusable_auth_credentials.
  5. All future logins (Mercury and login5) are using reusable creds. e.g. POST https://login5.spotify.com/v3/login (using client-token header) sending LoginRequest using stored_credential LoginRequest method.

Is that right @devgianlu ?

I did some of this in #1098 but I ran into problems when I tried to actually stream music. Was I just using the wrong oauth scopes ?!

p.s. for anyone else trying to mitm the linux client, I had to use /usr/bin/spotify --ignore-certificate-errors.

<!-- gh-comment-id:2258478905 --> @kingosticks commented on GitHub (Jul 30, 2024): Awesome! OK so the flow is: 1. Oauth prompt opened in user's web browser at accounts.spotify.com for oauth flow, user completes and `code` is returned to app 2. Gets a `client-token` (can't remember how but we do this already) 3. Exchange `code` for short-lived access token with POST https://accounts.spotify.com/api/token (using `client-token` header), 4. Swap the temporary access token for stored credentials using Mercury `ClientResponseEncrypted` request of type `AUTHENTICATION_SPOTIFY_TOKEN` with our username and the `auth_data` is just the access token from step 3? Receives `APWelcome` response containing long-lived `reusable_auth_credentials`. 5. All future logins (Mercury and login5) are using reusable creds. e.g. POST https://login5.spotify.com/v3/login (using `client-token` header) sending `LoginRequest` using `stored_credential` `LoginRequest` method. Is that right @devgianlu ? I did some of this in #1098 but I ran into problems when I tried to actually stream music. Was I just using the wrong oauth scopes ?! p.s. for anyone else trying to mitm the linux client, I had to use `/usr/bin/spotify --ignore-certificate-errors`.
Author
Owner

@ejurgensen commented on GitHub (Jul 30, 2024):

OwnTone has an implementation Spotify's OAuth flow + stored credentials that might be a useful reference for you. See for instance login_token() in spotify_librespotc.c. Disregard the login() method, it isn't used, which also means OwnTone hasn't been affected by Spotify's change.

<!-- gh-comment-id:2258565457 --> @ejurgensen commented on GitHub (Jul 30, 2024): [OwnTone](https://github.com/owntone/owntone-server) has an implementation Spotify's OAuth flow + stored credentials that might be a useful reference for you. See for instance login_token() in spotify_librespotc.c. Disregard the login() method, it isn't used, which also means OwnTone hasn't been affected by Spotify's change.
Author
Owner

@devgianlu commented on GitHub (Jul 30, 2024):

Is that right @devgianlu ?

@kingosticks Yes that's about right. I completely forgot about the client-token thing for the OAuth2 flow and it seems to be working anyway. They might have changed a lot of stuff since #1098, I remember this not working too, but perhaps now it's fixed. The scopes I used I just copied from the deskop client, some might not be required.

<!-- gh-comment-id:2258599316 --> @devgianlu commented on GitHub (Jul 30, 2024): > Is that right @devgianlu ? @kingosticks Yes that's about right. I completely forgot about the `client-token` thing for the OAuth2 flow and it seems to be working anyway. They might have changed a lot of stuff since #1098, I remember this not working too, but perhaps now it's fixed. The scopes I used I just copied from the deskop client, some might not be required.
Author
Owner

@kingosticks commented on GitHub (Jul 30, 2024):

Thanks @devgianlu.

I guess one last thing that I am bit confused about is, what stops everyone and their dog who's running a local app (and therefore using localhost as the redirect_uri param) using Spotify's desktop app client ID for requesting access+refresh tokens for use with the web API? Presumaby tokens granted this way won't be rate limited.

Update:
I found https://github.com/librespot-org/librespot-java/issues/445#issuecomment-1006725762 which also mentions how this wasn't working before. Weird!

<!-- gh-comment-id:2258633259 --> @kingosticks commented on GitHub (Jul 30, 2024): Thanks @devgianlu. I guess one last thing that I am bit confused about is, what stops everyone and their dog who's running a local app (and therefore using localhost as the `redirect_uri` param) using Spotify's desktop app client ID for requesting access+refresh tokens for use with the web API? Presumaby tokens granted this way won't be rate limited. Update: I found https://github.com/librespot-org/librespot-java/issues/445#issuecomment-1006725762 which also mentions how this wasn't working before. Weird!
Author
Owner

@3052 commented on GitHub (Jul 30, 2024):

I just tried https://login5.spotify.com/v3/login and it works perfectly with username/password - using the same code I wrote in March

<!-- gh-comment-id:2259243033 --> @3052 commented on GitHub (Jul 30, 2024): I just tried https://login5.spotify.com/v3/login and it works perfectly with username/password - using the same code I wrote in March
Author
Owner

@kingosticks commented on GitHub (Jul 30, 2024):

This issue is specifically about user+pass with the Mercury/Hermes access point and not login5.

<!-- gh-comment-id:2259325237 --> @kingosticks commented on GitHub (Jul 30, 2024): This issue is specifically about user+pass with the Mercury/Hermes access point and not login5.
Author
Owner

@3052 commented on GitHub (Jul 30, 2024):

This issue is specifically about user+pass with the Mercury/Hermes access point and not login5.

why in gods name are you still using Hermes for that? I know at least the Android client has been using login5 for at least 4 months likely longer

<!-- gh-comment-id:2259329170 --> @3052 commented on GitHub (Jul 30, 2024): > This issue is specifically about user+pass with the Mercury/Hermes access point and not login5. why in gods name are you still using Hermes for that? I know at least the Android client has been using login5 for at least 4 months likely longer
Author
Owner

@kingosticks commented on GitHub (Jul 30, 2024):

The flow I outlined above is exactly what the (Linux) desktop client does today. Note, still using Hermes.

Obtaining reusable creds from login5 using user+pass is apparently not working, perhaps it's related to the client ID or client info being used. Feel free to share your recipe.

<!-- gh-comment-id:2259342148 --> @kingosticks commented on GitHub (Jul 30, 2024): The flow I outlined above is exactly what the (Linux) desktop client does today. Note, still using Hermes. Obtaining reusable creds from login5 using user+pass is apparently not working, perhaps it's related to the client ID or client info being used. Feel free to share your recipe.
Author
Owner

@JoeWilder commented on GitHub (Jul 31, 2024):

librespot just started working for me again, not sure why

<!-- gh-comment-id:2259389570 --> @JoeWilder commented on GitHub (Jul 31, 2024): librespot just started working for me again, not sure why
Author
Owner

@Losses commented on GitHub (Jul 31, 2024):

It seems that Spotify rolled back their code, but probably we should switch to web based oauth login work flow, to follow the pace of Spotify's official implementation.

Server information:

ping gew1-spclient.spotify.com
PING edge-web-gew1.dual-gslb.spotify.com (35.186.224.26) 56(84) bytes of data.
<!-- gh-comment-id:2259464870 --> @Losses commented on GitHub (Jul 31, 2024): It seems that Spotify rolled back their code, but probably we should switch to web based oauth login work flow, to follow the pace of Spotify's official implementation. Server information: ``` ping gew1-spclient.spotify.com PING edge-web-gew1.dual-gslb.spotify.com (35.186.224.26) 56(84) bytes of data. ```
Author
Owner

@Laiteux commented on GitHub (Jul 31, 2024):

Can confirm. Works again here as well.

<!-- gh-comment-id:2259466320 --> @Laiteux commented on GitHub (Jul 31, 2024): Can confirm. Works again here as well.
Author
Owner

@kingosticks commented on GitHub (Jul 31, 2024):

It seems that Spotify rolled back their code, but probably we should switch to web based oauth login work flow, to follow the pace of Spotify's official implementation.

Server information:

ping gew1-spclient.spotify.com
PING edge-web-gew1.dual-gslb.spotify.com (35.186.224.26) 56(84) bytes of data.

One issue with that newer method is how to implement it on a headless machine. You can't just paste the oauth URL into a browser running elsewhere as it will redirect afterwards to localhost, which won't work. Unless Spotify allow any redirect_uri to be used with their client ID but that seems unlikely (needs checking). Their flow for headless systems would be device code.

<!-- gh-comment-id:2259741055 --> @kingosticks commented on GitHub (Jul 31, 2024): > It seems that Spotify rolled back their code, but probably we should switch to web based oauth login work flow, to follow the pace of Spotify's official implementation. > > Server information: > > ``` > ping gew1-spclient.spotify.com > PING edge-web-gew1.dual-gslb.spotify.com (35.186.224.26) 56(84) bytes of data. > ``` One issue with that newer method is how to implement it on a headless machine. You can't just paste the oauth URL into a browser running elsewhere as it will redirect afterwards to localhost, which won't work. Unless Spotify allow any redirect_uri to be used with their client ID but that seems unlikely (needs checking). Their flow for headless systems would be device code.
Author
Owner

@Losses commented on GitHub (Jul 31, 2024):

You can't just paste the oauth URL into a browser running elsewhere as it will redirect afterwards to localhost, which won't work.

That is a headache trouble, programs like rclone will recommend users connect to remote machine with port forwarding, but it is not always working, some other solutions pops to my head, and the most practical one is a command line tool, which can help users get their token in the local machine, users can paste it to the remote device which will probably ease the procedure.

Anyway, it's hard.

<!-- gh-comment-id:2259820165 --> @Losses commented on GitHub (Jul 31, 2024): > You can't just paste the oauth URL into a browser running elsewhere as it will redirect afterwards to localhost, which won't work. That is a headache trouble, programs like `rclone` will recommend users connect to remote machine with port forwarding, but it is not always working, some other solutions pops to my head, and the most practical one is a command line tool, which can help users get their token in the local machine, users can paste it to the remote device which will probably ease the procedure. Anyway, it's hard.
Author
Owner

@quantverse commented on GitHub (Jul 31, 2024):

It works again for me now. AP ap-gew4.spotify.com:4070.

<!-- gh-comment-id:2259859644 --> @quantverse commented on GitHub (Jul 31, 2024): It works again for me now. AP `ap-gew4.spotify.com:4070`.
Author
Owner

@dspearson commented on GitHub (Jul 31, 2024):

It works again for me now. AP ap-gew4.spotify.com:4070.

It does not work on ap-guc3 so this issue is still relevant. go-librespot with interactive login flow simply provides the callback URI in the terminal, and curl on a headless server is enough for me to make progress, but there are other issues that prevent me from using the go implementation. Alas.

<!-- gh-comment-id:2259895995 --> @dspearson commented on GitHub (Jul 31, 2024): > It works again for me now. AP `ap-gew4.spotify.com:4070`. It does not work on ap-guc3 so this issue is still relevant. go-librespot with interactive login flow simply provides the callback URI in the terminal, and curl on a headless server is enough for me to make progress, but there are other issues that prevent me from using the go implementation. Alas.
Author
Owner

@Laiteux commented on GitHub (Jul 31, 2024):

I personally could not work with manual-OAuth URLs as I aim for a fully automated login process. Therefore, this unfortunately can not be a solution for me, and I'm sure many others.

<!-- gh-comment-id:2259901055 --> @Laiteux commented on GitHub (Jul 31, 2024): I personally could not work with manual-OAuth URLs as I aim for a fully automated login process. Therefore, this unfortunately can not be a solution for me, and I'm sure many others.
Author
Owner

@kingosticks commented on GitHub (Jul 31, 2024):

Even though it's a one-off operation?!

<!-- gh-comment-id:2259941231 --> @kingosticks commented on GitHub (Jul 31, 2024): Even though it's a one-off operation?!
Author
Owner

@Laiteux commented on GitHub (Jul 31, 2024):

Adding such a step to the login process would imo be a significant change from an automatic to manual flow, and be potentially disruptive for many users, for a few reasons:

  1. Frequent disconnections: Perhaps it's just my experience (please let me know if others face this too), but I experience periodic disconnections (every few days) that require restarting my program / auth flow to reconnect to the Spotify API. This issue at least is present on my side when using librespot through DownOnSpot. A manual login step would exacerbate this inconvenience.

  2. Headless machine compatibility: Implementing a manual login would force users of headless machines to develop a method for transmitting the OAuth URL to a device with a browser. This adds complexity and inconvenience to the process.

<!-- gh-comment-id:2259988688 --> @Laiteux commented on GitHub (Jul 31, 2024): Adding such a step to the login process would imo be a significant change from an automatic to manual flow, and be potentially disruptive for many users, for a few reasons: 1. Frequent disconnections: Perhaps it's just my experience (please let me know if others face this too), but I experience periodic disconnections (every few days) that require restarting my program / auth flow to reconnect to the Spotify API. This issue at least is present on my side when using librespot through [DownOnSpot](https://github.com/oSumAtrIX/DownOnSpot). A manual login step would exacerbate this inconvenience. 2. Headless machine compatibility: Implementing a manual login would force users of headless machines to develop a method for transmitting the OAuth URL to a device with a browser. This adds complexity and inconvenience to the process.
Author
Owner

@devgianlu commented on GitHub (Jul 31, 2024):

@Laiteux The login operation should happen only once manually, then stored credentials can be used for perhaps years to follow.

<!-- gh-comment-id:2259992896 --> @devgianlu commented on GitHub (Jul 31, 2024): @Laiteux The login operation should happen only once manually, then stored credentials can be used for perhaps years to follow.
Author
Owner

@devgianlu commented on GitHub (Jul 31, 2024):

but there are other issues that prevent me from using the go implementation.

@dspearson If it's not something big, we can sort it out!

<!-- gh-comment-id:2259994578 --> @devgianlu commented on GitHub (Jul 31, 2024): > but there are other issues that prevent me from using the go implementation. @dspearson If it's not something big, we can sort it out!
Author
Owner

@Laiteux commented on GitHub (Jul 31, 2024):

@Laiteux The login operation should happen only once manually, then stored credentials can be used for perhaps years to follow.

I understand that and it sounds right. I am not sure what could be causing my (seemingly specific) issue, then, considering I indeed get randomly disconnected, periodically, every few days.

Credentials are indeed being stored and reused, still I sometimes keep getting randomly disconnected, having to re-auth.

Maybe could it be related to the nature of the project I am using (DownOnSpot)? I am unsure but still would appreciate some guidance. @oSumAtrIX, are you any aware of such a thing?

Perhaps this is a different issue and should be discussed elsewhere.

My point about headless machines (firstly mentioned by @kingosticks here) remains.

<!-- gh-comment-id:2260019717 --> @Laiteux commented on GitHub (Jul 31, 2024): > @Laiteux The login operation should happen only once manually, then stored credentials can be used for perhaps years to follow. I understand that and it sounds right. I am not sure what could be causing my (seemingly specific) issue, then, considering I indeed get randomly disconnected, periodically, every few days. Credentials are indeed being stored and reused, still I sometimes keep getting randomly disconnected, having to re-auth. Maybe could it be related to the nature of the project I am using ([DownOnSpot](https://github.com/oSumAtrIX/DownOnSpot))? I am unsure but still would appreciate some guidance. @oSumAtrIX, are you any aware of such a thing? Perhaps this is a different issue and should be discussed elsewhere. My point about headless machines (firstly mentioned by @kingosticks [here](https://github.com/librespot-org/librespot/issues/1308#issuecomment-2259741055)) remains.
Author
Owner

@oSumAtrIX commented on GitHub (Jul 31, 2024):

While I haven't delved much into the issue yet, I have definitely come across your findings. Someone else was reporting the same issue (which is the credentials cache not being reused). I think it was discussed in one of the (closed) issues or PRs in the DownOnSpot repository. In addition to that the author that mentioned this issue decided to PR a fix to librespot which I think got merged. That said, if you bump librespot to one of the latest commits (contains breaking changes from last official release), the issue should disappear. The commit may appear in a future release though anyway. I am pulling this all off my memory, so if relevant, please double check!!

<!-- gh-comment-id:2260040438 --> @oSumAtrIX commented on GitHub (Jul 31, 2024): While I haven't delved much into the issue yet, I have definitely come across your findings. Someone else was reporting the same issue (which is the credentials cache not being reused). I think it was discussed in one of the (closed) issues or PRs in the DownOnSpot repository. In addition to that the author that mentioned this issue decided to PR a fix to librespot which I think got merged. That said, if you bump librespot to one of the latest commits (contains breaking changes from last official release), the issue should disappear. The commit may appear in a future release though anyway. I am pulling this all off my memory, so if relevant, please double check!!
Author
Owner

@Laiteux commented on GitHub (Jul 31, 2024):

This likely was me, and it did not get merged: https://github.com/librespot-org/librespot/pull/1206 - I did not investigate further after that, as I could not understand what exactly was to be fixed then. The issue remains on my side, so not sure of what to do now. Maybe we can keep discussing it on the PR or on the DownOnSpot issue if there was one (can't seem to find it).

<!-- gh-comment-id:2260054838 --> @Laiteux commented on GitHub (Jul 31, 2024): This likely was me, and it did not get merged: https://github.com/librespot-org/librespot/pull/1206 - I did not investigate further after that, as I could not understand what exactly was to be fixed then. The issue remains on my side, so not sure of what to do now. Maybe we can keep discussing it on the PR or on the DownOnSpot issue if there was one (can't seem to find it).
Author
Owner

@Losses commented on GitHub (Jul 31, 2024):

@Laiteux

I would like to kindly remind you to be mindful that this project should not be used for piracy purposes, as this violates Spotify's Terms of Service. While the project may have been applied in illegal contexts, it is possible that this was not the original intent behind its creation.

Repeatedly mentioning piracy-related software could prompt Spotify to initiate legal action against the entire toolchain, which would negatively impact other users who are utilizing librespot for legitimate purposes. We have seen similar situations occur in the past.

Therefore, please consider to exercise caution and restraint in your discussions.

<!-- gh-comment-id:2260246217 --> @Losses commented on GitHub (Jul 31, 2024): @Laiteux I would like to kindly remind you to be mindful that this project should not be used for piracy purposes, as this violates Spotify's Terms of Service. While the project may have been applied in illegal contexts, it is possible that this was not the original intent behind its creation. Repeatedly mentioning piracy-related software could prompt Spotify to initiate legal action against the entire toolchain, which would negatively impact other users who are utilizing librespot for legitimate purposes. We have seen similar situations occur in the past. Therefore, please consider to exercise caution and restraint in your discussions.
Author
Owner

@kingosticks commented on GitHub (Jul 31, 2024):

This all just highlights we should add support for the oauth/token flows. Whatever happens to user+pass in the long-term, it's useful to have another alternative anyway and we've discussed it before so maybe we should pick it up again there or in a new specific issue.

I think we can close this given the issue appears to have been temporary and now we're vearing off-topic (sorry for starting that).

<!-- gh-comment-id:2260499117 --> @kingosticks commented on GitHub (Jul 31, 2024): This all just highlights we should add support for the oauth/token flows. Whatever happens to user+pass in the long-term, it's useful to have another alternative anyway and [we've discussed it before](https://github.com/librespot-org/librespot/issues/1086) so maybe we should pick it up again there or in a new specific issue. I think we can close this given the issue appears to have been temporary and now we're vearing off-topic (sorry for starting that).
Author
Owner

@erkr commented on GitHub (Jul 31, 2024):

I think we can close this given the issue appears to have been temporary and now we're vearing off-topic (sorry for starting that).

Please don't close without opening a PR for implementing the oauth/token flow. I guess that Spotify did a rollback, but it will be just temporary to fix something.

<!-- gh-comment-id:2260547452 --> @erkr commented on GitHub (Jul 31, 2024): > I think we can close this given the issue appears to have been temporary and now we're vearing off-topic (sorry for starting that). Please don't close without opening a PR for implementing the oauth/token flow. I guess that Spotify did a rollback, but it will be just temporary to fix something.
Author
Owner

@dspearson commented on GitHub (Jul 31, 2024):

Indeed. The username/password flow is removed from the official API and as mentioned in a previous comment it still fails for me. Closing would be premature.

<!-- gh-comment-id:2260795637 --> @dspearson commented on GitHub (Jul 31, 2024): Indeed. The username/password flow is removed from the official API and as mentioned in a previous comment it still fails for me. Closing would be premature.
Author
Owner

@kingosticks commented on GitHub (Jul 31, 2024):

and as mentioned in a previous comment it still fails for me

Sorry, I missed that. I thought it was working for everyone again.

<!-- gh-comment-id:2260816934 --> @kingosticks commented on GitHub (Jul 31, 2024): > and as mentioned in a previous comment it still fails for me Sorry, I missed that. I thought it was working for everyone again.
Author
Owner

@dspearson commented on GitHub (Aug 4, 2024):

A suggested workaround while this remains broken: set the cache directory when invoking librespot on local machine, do not use --username/--password, which then will use zeroconf authentication with Spotify's official client running alongside it, then copy the librespot cache directory to remote headless server. Invoke with the same parameters on the remote host. The cached credentials appear to work just fine, at least for the moment.

<!-- gh-comment-id:2267347307 --> @dspearson commented on GitHub (Aug 4, 2024): A suggested workaround while this remains broken: set the cache directory when invoking librespot on local machine, do not use --username/--password, which then will use zeroconf authentication with Spotify's official client running alongside it, then copy the librespot cache directory to remote headless server. Invoke with the same parameters on the remote host. The cached credentials appear to work just fine, at least for the moment.
Author
Owner

@dspearson commented on GitHub (Aug 4, 2024):

In fact, from further reading of the Spotify Connect documentation it now seems clear to me that the ZeroConf API is the only supported authentication method, and is in fact mandatory for certification. Therefore, probably removing the option of username/password authentication and updating documentation is sufficient. Those that have the more unusual use-case (like me) of having librespot being a Spotify Connect client on a remote headless device that is on a separate network to my usual client (and thus ZeroConf is a pain) can probably live with the added step of initial authorisation locally & deployment of credentials file on the remote target if this is made obvious.

To quote from the Spotify Connect implementation documentation: "The following example uses SpConnectionLoginPassword() to log in. This API exists for testing purposes only."

<!-- gh-comment-id:2267563686 --> @dspearson commented on GitHub (Aug 4, 2024): In fact, from further reading of the Spotify Connect documentation it now seems clear to me that the ZeroConf API is the **only** supported authentication method, and is in fact [mandatory for certification](https://developer.spotify.com/documentation/commercial-hardware/implementation/guides/zeroconf). Therefore, probably removing the option of username/password authentication and updating documentation is sufficient. Those that have the more unusual use-case (like me) of having librespot being a Spotify Connect client on a remote headless device that is on a separate network to my usual client (and thus ZeroConf is a pain) can probably live with the added step of initial authorisation locally & deployment of credentials file on the remote target if this is made obvious. To quote from the Spotify Connect implementation documentation: "The following example uses SpConnectionLoginPassword() to log in. This API exists for testing purposes only."
Author
Owner

@Losses commented on GitHub (Aug 4, 2024):

hose that have the more unusual use-case (like me) of having librespot being a Spotify Connect client on a remote headless device that is on a separate network to my usual client (and thus ZeroConf is a pain) can probably live with the added step of initial authorisation locally & deployment of credentials file on the remote target if this is made obvious.

Totally agree

<!-- gh-comment-id:2267569882 --> @Losses commented on GitHub (Aug 4, 2024): > hose that have the more unusual use-case (like me) of having librespot being a Spotify Connect client on a remote headless device that is on a separate network to my usual client (and thus ZeroConf is a pain) can probably live with the added step of initial authorisation locally & deployment of credentials file on the remote target if this is made obvious. Totally agree
Author
Owner

@kingosticks commented on GitHub (Aug 4, 2024):

Just to clarify, Spotify Connect is just one part of this library.

User and password login via login5 (using the android client ID and doing the hashcash stuff) reportedly still works, there's no reason not to support that properly here. Oauth login via login5 (using the desktop client ID) also works just fine and makes sense for some use cases. User and password via Hermes might be on borrowed time but while it still works (for everyone except one person?!), just leave it in, surely.

<!-- gh-comment-id:2267577210 --> @kingosticks commented on GitHub (Aug 4, 2024): Just to clarify, Spotify Connect is just one part of this library. User and password login via login5 (using the android client ID and doing the hashcash stuff) reportedly still works, there's no reason not to support that properly here. Oauth login via login5 (using the desktop client ID) also works just fine and makes sense for some use cases. User and password via Hermes might be on borrowed time but while it still works (for everyone except one person?!), just leave it in, surely.
Author
Owner

@poettig commented on GitHub (Aug 4, 2024):

A suggested workaround while this remains broken: set the cache directory when invoking librespot on local machine, do not use --username/--password, which then will use zeroconf authentication with Spotify's official client running alongside it, then copy the librespot cache directory to remote headless server. Invoke with the same parameters on the remote host. The cached credentials appear to work just fine, at least for the moment.

This works perfectly, thank you! 👍

User and password via Hermes might be on borrowed time but while it still works (for everyone except one person?!), just leave it in, surely.

I'm also affected by username / password still not working, also with the use case "librespot running with no spotify desktop in the network". I tested why that could be - turns out Spotify requires me to enter an email OTP when logging in with the remote server's IP - most likely because it is not a residential IP or something along those lines. I would guess that spotify just blocks logins with only username and password via hermes if the IP is flagged for additional authentication.

<!-- gh-comment-id:2267598560 --> @poettig commented on GitHub (Aug 4, 2024): > A suggested workaround while this remains broken: set the cache directory when invoking librespot on local machine, do not use --username/--password, which then will use zeroconf authentication with Spotify's official client running alongside it, then copy the librespot cache directory to remote headless server. Invoke with the same parameters on the remote host. The cached credentials appear to work just fine, at least for the moment. This works perfectly, thank you! :+1: > User and password via Hermes might be on borrowed time but while it still works (for everyone except one person?!), just leave it in, surely. I'm also affected by username / password still not working, also with the use case "librespot running with no spotify desktop in the network". I tested why that could be - turns out Spotify requires me to enter an email OTP when logging in with the remote server's IP - most likely because it is not a residential IP or something along those lines. I would guess that spotify just blocks logins with only username and password via hermes if the IP is flagged for additional authentication.
Author
Owner

@dspearson commented on GitHub (Aug 4, 2024):

Just to clarify, Spotify Connect is just one part of this library.

Yes, sorry I was not explicit. I mean deprecation/removal of this auth method specifically for Connect functionality, since username/password is documented as "only for testing", and has been removed from the latest eSDK release, so if it still somehow works for some people (possibly from partial rollout?), it's likely not to continue to do so and is definitely documented as not for real-world usage/unsupported. Though I think just a note in the documentation about the API changes, and that for Connect one should prefer ZeroConf, would be enough to steer people away from pain.

I admit I was not even really aware of ZeroConf authentication being a thing that existed until the method I was previously using failed, and I started to look for myself at the internals. Initially it was simple enough to get running correctly, and stable enough to be mostly left alone for over a year, that when things didn't work anymore I was basically completely rediscovering how the thing worked and how to use it... a testament to the quality of the project, honestly.

<!-- gh-comment-id:2267618269 --> @dspearson commented on GitHub (Aug 4, 2024): > Just to clarify, Spotify Connect is just one part of this library. Yes, sorry I was not explicit. I mean deprecation/removal of this auth method specifically for Connect functionality, since username/password is documented as "only for testing", and has been removed from the latest eSDK release, so if it still somehow works for some people (possibly from partial rollout?), it's likely not to continue to do so and is definitely documented as not for real-world usage/unsupported. Though I think just a note in the documentation about the API changes, and that for Connect one should prefer ZeroConf, would be enough to steer people away from pain. I admit I was not even really aware of ZeroConf authentication being a thing that existed until the method I was previously using failed, and I started to look for myself at the internals. Initially it was simple enough to get running correctly, and stable enough to be mostly left alone for over a year, that when things didn't work anymore I was basically completely rediscovering how the thing worked and how to use it... a testament to the quality of the project, honestly.
Author
Owner

@ghost commented on GitHub (Aug 6, 2024):

Same issue, fails if I use username/password, fails if I use email/password

<!-- gh-comment-id:2271029655 --> @ghost commented on GitHub (Aug 6, 2024): Same issue, fails if I use username/password, fails if I use email/password
Author
Owner

@roderickvd commented on GitHub (Aug 8, 2024):

I just got this email:

IMG_3741

Seems genuine - I mean, why fake it? - and actually a nice acknowledgement that they “see” us, and first active communication from them that I’ve seen.

If there’s anything you’d like me to respond to them, please cook up some text for consideration. Who knows they might respond?

<!-- gh-comment-id:2276196094 --> @roderickvd commented on GitHub (Aug 8, 2024): I just got this email: ![IMG_3741](https://github.com/user-attachments/assets/c9fc4786-f82e-4eaa-914b-398f462f5602) Seems genuine - I mean, why fake it? - and actually a nice acknowledgement that they “see” us, and first active communication from them that I’ve seen. If there’s anything you’d like me to respond to them, please cook up some text for consideration. Who knows they might respond?
Author
Owner

@devgianlu commented on GitHub (Aug 8, 2024):

Just received the same email, feels kinda nice for them to do this.

<!-- gh-comment-id:2276199211 --> @devgianlu commented on GitHub (Aug 8, 2024): Just received the same email, feels kinda nice for them to do this.
Author
Owner

@Losses commented on GitHub (Aug 9, 2024):

So, maybe librespot will switch to oauth these days?

<!-- gh-comment-id:2277478864 --> @Losses commented on GitHub (Aug 9, 2024): So, maybe librespot will switch to oauth these days?
Author
Owner

@michaelherger commented on GitHub (Aug 9, 2024):

Wouldn't auth be irrelevant when librespot is used as a Connect endpoint? It would be authenticated through the app automatically, wouldn't it?

<!-- gh-comment-id:2277493667 --> @michaelherger commented on GitHub (Aug 9, 2024): Wouldn't auth be irrelevant when librespot is used as a Connect endpoint? It would be authenticated through the app automatically, wouldn't it?
Author
Owner

@kingosticks commented on GitHub (Aug 9, 2024):

Yes, but Connect is not the only way to use this library so another mechanism is still required.

There's a PR for oauth at https://github.com/librespot-org/librespot/pull/1309 if anyone wants to try/review/improve.

<!-- gh-comment-id:2277591922 --> @kingosticks commented on GitHub (Aug 9, 2024): Yes, but Connect is not the only way to use this library so another mechanism is still required. There's a PR for oauth at https://github.com/librespot-org/librespot/pull/1309 if anyone wants to try/review/improve.
Author
Owner

@microfx commented on GitHub (Aug 9, 2024):

no idea if it's of any interest but since a few hours librespot not working anymore for me.

Tried to remove the username and password arguments but it didn't help.

Aug 09 12:51:46 librespot[2136]: [2024-08-09T10:51:46Z]: WARN  librespot_core::spclient] Unable to get client token: Client specified an invalid argument { Response status code: 400 Bad Request } Trying to continue without... 
Aug 09 12:51:46 librespot[2136]: [2024-08-09T10:51:46Z]: INFO  librespot_playback::player] Loading <some title> with Spotify URI <spotify:episode:someid> 
Aug 09 12:51:46 librespot[2136]: [2024-08-09T10:51:46Z]: WARN  librespot_core::spclient] Unable to get client token: Client specified an invalid argument { Response status code: 400 Bad Request } Trying to continue without... 
Aug 09 12:51:47 librespot[2136]: [2024-08-09T10:51:47Z]: ERROR librespot_core::audio_key] error audio key 0 1 
Aug 09 12:51:47 librespot[2136]: [2024-08-09T10:51:47Z]: WARN  librespot_playback::player] Unable to load key, continuing without decryption: Service unavailable { audio key error } 
<!-- gh-comment-id:2277691744 --> @microfx commented on GitHub (Aug 9, 2024): no idea if it's of any interest but since a few hours librespot not working anymore for me. Tried to remove the username and password arguments but it didn't help. ``` Aug 09 12:51:46 librespot[2136]: [2024-08-09T10:51:46Z]: WARN librespot_core::spclient] Unable to get client token: Client specified an invalid argument { Response status code: 400 Bad Request } Trying to continue without... Aug 09 12:51:46 librespot[2136]: [2024-08-09T10:51:46Z]: INFO librespot_playback::player] Loading <some title> with Spotify URI <spotify:episode:someid> Aug 09 12:51:46 librespot[2136]: [2024-08-09T10:51:46Z]: WARN librespot_core::spclient] Unable to get client token: Client specified an invalid argument { Response status code: 400 Bad Request } Trying to continue without... Aug 09 12:51:47 librespot[2136]: [2024-08-09T10:51:47Z]: ERROR librespot_core::audio_key] error audio key 0 1 Aug 09 12:51:47 librespot[2136]: [2024-08-09T10:51:47Z]: WARN librespot_playback::player] Unable to load key, continuing without decryption: Service unavailable { audio key error } ```
Author
Owner

@dspearson commented on GitHub (Aug 9, 2024):

Wouldn't auth be irrelevant when librespot is used as a Connect endpoint? It would be authenticated through the app automatically, wouldn't it?

Sure, you can use zeroconf trivially if the app is on the same network as librespot, which is not a given (wasn't the case for me). I was using username/password for this very reason. Have switched to authenticating locally and transferring the credentials.json elsewhere.

Nice of Spotify to reach out directly.

<!-- gh-comment-id:2278341335 --> @dspearson commented on GitHub (Aug 9, 2024): > Wouldn't auth be irrelevant when librespot is used as a Connect endpoint? It would be authenticated through the app automatically, wouldn't it? Sure, you can use zeroconf trivially if the app is on the same network as librespot, which is not a given (wasn't the case for me). I was using username/password for this very reason. Have switched to authenticating locally and transferring the credentials.json elsewhere. Nice of Spotify to reach out directly.
Author
Owner

@kingosticks commented on GitHub (Aug 12, 2024):

I just got this email:

IMG_3741

Seems genuine - I mean, why fake it? - and actually a nice acknowledgement that they “see” us, and first active communication from them that I’ve seen.

If there’s anything you’d like me to respond to them, please cook up some text for consideration. Who knows they might respond?

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"?

<!-- gh-comment-id:2283542827 --> @kingosticks commented on GitHub (Aug 12, 2024): > I just got this email: > > ![IMG_3741](https://private-user-images.githubusercontent.com/113727/356299564-c9fc4786-f82e-4eaa-914b-398f462f5602.jpeg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM0NTY0NjgsIm5iZiI6MTcyMzQ1NjE2OCwicGF0aCI6Ii8xMTM3MjcvMzU2Mjk5NTY0LWM5ZmM0Nzg2LWY4MmUtNGVhYS05MTRiLTM5OGY0NjJmNTYwMi5qcGVnP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgxMiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MTJUMDk0OTI4WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YjI1YTUzOTNmOWVjOWIxN2M2Yjc4MTk1YzZlYmJmZmNkZjRmOGNmYjJjYTQyMjJjMDc5NWRmNzM2YTY2NDRjMSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.gxWWHQvtV469U9J4umqsgLUGdhglbnTQQ2tHLucegaI) > > Seems genuine - I mean, why fake it? - and actually a nice acknowledgement that they “see” us, and first active communication from them that I’ve seen. > > If there’s anything you’d like me to respond to them, please cook up some text for consideration. Who knows they might respond? 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"?
Author
Owner

@felipemarinho97 commented on GitHub (Aug 12, 2024):

Spotify Connect and snapcast only woks with auth for me, I hope this gets fixed soon

<!-- gh-comment-id:2284957690 --> @felipemarinho97 commented on GitHub (Aug 12, 2024): Spotify Connect and snapcast only woks with auth for me, I hope this gets fixed soon
Author
Owner

@awsome306 commented on GitHub (Aug 13, 2024):

Same issue here

<!-- gh-comment-id:2285304863 --> @awsome306 commented on GitHub (Aug 13, 2024): Same issue here
Author
Owner

@michaelherger commented on GitHub (Aug 13, 2024):

Spotify Connect and snapcast only woks with auth for me, I hope this gets fixed soon

Make sure your phone is on the same network as the librespot instance.

<!-- gh-comment-id:2285307704 --> @michaelherger commented on GitHub (Aug 13, 2024): > Spotify Connect and snapcast only woks with auth for me, I hope this gets fixed soon Make sure your phone is on the same network as the librespot instance.
Author
Owner

@FlipEverything commented on GitHub (Aug 14, 2024):

I am experiencing the same issue. Login with credentials no longer working:

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

After I removed my credentials from the config then the Spotify Connect Client will start up:

raspberrypi systemd[1]: Started Raspotify (Spotify Connect Client).

But I cannot discover the client via the Spotify API. I am on the same LAN. Until now I used the GET /me/player/devices request and the Spotify Connect Client (raspotify) showed up and I could automatically start up a selected playlist, etc. What can I do to restore this behaviour?

<!-- gh-comment-id:2288189921 --> @FlipEverything commented on GitHub (Aug 14, 2024): I am experiencing the same issue. Login with credentials no longer working: ``` [ERROR librespot] Connection failed: Login failed with reason: Bad credentials ``` After I removed my credentials from the config then the Spotify Connect Client will start up: ``` raspberrypi systemd[1]: Started Raspotify (Spotify Connect Client). ``` But I cannot discover the client via the Spotify API. I am on the same LAN. Until now I used the `GET /me/player/devices` request and the Spotify Connect Client (raspotify) showed up and I could automatically start up a selected playlist, etc. What can I do to restore this behaviour?
Author
Owner

@tig3rmast3r commented on GitHub (Aug 14, 2024):

Yes, but Connect is not the only way to use this library so another mechanism is still required.

There's a PR for oauth at #1309 if anyone wants to try/review/improve.

does anyone gave a try to this pr yet?

<!-- gh-comment-id:2288508224 --> @tig3rmast3r commented on GitHub (Aug 14, 2024): > Yes, but Connect is not the only way to use this library so another mechanism is still required. > > There's a PR for oauth at #1309 if anyone wants to try/review/improve. does anyone gave a try to this pr yet?
Author
Owner

@noahhaon commented on GitHub (Aug 14, 2024):

Yes, but Connect is not the only way to use this library so another mechanism is still required.
There's a PR for oauth at #1309 if anyone wants to try/review/improve.

does anyone gave a try to this pr yet?

Yes I did this to generate credentials.json which I use on a headless librespot with discovery off -O and it has been working great.

<!-- gh-comment-id:2288552102 --> @noahhaon commented on GitHub (Aug 14, 2024): > > Yes, but Connect is not the only way to use this library so another mechanism is still required. > > There's a PR for oauth at #1309 if anyone wants to try/review/improve. > > does anyone gave a try to this pr yet? Yes I did this to generate `credentials.json` which I use on a headless librespot with discovery off `-O` and it has been working great.
Author
Owner

@neekz0r commented on GitHub (Aug 14, 2024):

Yeah, I just got bit by this too. I'm also fairly sure zeroconf work around mentioned here won't work if its on docker.

<!-- gh-comment-id:2289361954 --> @neekz0r commented on GitHub (Aug 14, 2024): Yeah, I just got bit by this too. I'm also fairly sure zeroconf work around mentioned here won't work if its on docker.
Author
Owner

@abiding9072 commented on GitHub (Aug 14, 2024):

Yeah, I just got bit by this too. I'm also fairly sure zeroconf work around mentioned here won't work if its on docker.

I'm using headless on a docker container. I generated the credentials.json on another system then placed in a docker volume linked to a local folder without issue on my headless system.

<!-- gh-comment-id:2290095829 --> @abiding9072 commented on GitHub (Aug 14, 2024): > Yeah, I just got bit by this too. I'm also fairly sure zeroconf work around mentioned here won't work if its on docker. I'm using headless on a docker container. I generated the credentials.json on another system then placed in a docker volume linked to a local folder without issue on my headless system.
Author
Owner

@neekz0r commented on GitHub (Aug 14, 2024):

Yeah, I just got bit by this too. I'm also fairly sure zeroconf work around mentioned here won't work if its on docker.

I'm using headless on a docker container. I generated the credentials.json on another system then placed in a docker volume linked to a local folder without issue on my headless system.

Won't the creds rotate on a (semi)regular basis?

<!-- gh-comment-id:2290096863 --> @neekz0r commented on GitHub (Aug 14, 2024): > > Yeah, I just got bit by this too. I'm also fairly sure zeroconf work around mentioned here won't work if its on docker. > > I'm using headless on a docker container. I generated the credentials.json on another system then placed in a docker volume linked to a local folder without issue on my headless system. Won't the creds rotate on a (semi)regular basis?
Author
Owner

@michaelherger commented on GitHub (Aug 15, 2024):

The credentials.json in my main installation has a timestamp from January 1 2023.

As for docker: you could run the container in host mode instead of the default bridge mode (which does come with some drawbacks). Or probably expose some additional ports?

<!-- gh-comment-id:2290741691 --> @michaelherger commented on GitHub (Aug 15, 2024): The `credentials.json` in my main installation has a timestamp from January 1 2023. As for docker: you could run the container in host mode instead of the default bridge mode (which does come with some drawbacks). Or probably expose some additional ports?
Author
Owner

@Laiteux commented on GitHub (Aug 15, 2024):

Can anybody else confirm if this is failing again? Unable to conclude from previous recent comments, but I've been hitting the error again on my side for the past few days.

<!-- gh-comment-id:2290755849 --> @Laiteux commented on GitHub (Aug 15, 2024): Can anybody else confirm if this is failing again? Unable to conclude from previous recent comments, but I've been hitting the error again on my side for the past few days.
Author
Owner

@capnfabs commented on GitHub (Aug 15, 2024):

Can anybody else confirm if this is failing again? Unable to conclude from previous recent comments, but I've been hitting the error again on my side for the past few days.

Seems to be failing again! Adding another data point: I noticed that user/pass login was broken last night, and got a password reset email from Spotify at some point in the night "due to detected suspicious activity." librespot still works great without user/pass login.

<!-- gh-comment-id:2290760258 --> @capnfabs commented on GitHub (Aug 15, 2024): > Can anybody else confirm if this is failing again? Unable to conclude from previous recent comments, but I've been hitting the error again on my side for the past few days. Seems to be failing again! Adding another data point: I noticed that user/pass login was broken last night, and got a password reset email from Spotify at some point in the night "due to detected suspicious activity." librespot still works great without user/pass login.
Author
Owner

@noahhaon commented on GitHub (Aug 15, 2024):

I noticed that user/pass login was broken last night, and got a password reset email from Spotify at some point in the night "due to detected suspicious activity." librespot still works great without user/pass login.

Yes I was getting this repeatedly too, every day or so. So far the cached credentials seem to work and I don't get the password reset notifications via email anymore

<!-- gh-comment-id:2290772543 --> @noahhaon commented on GitHub (Aug 15, 2024): > I noticed that user/pass login was broken last night, and got a password reset email from Spotify at some point in the night "due to detected suspicious activity." librespot still works great without user/pass login. Yes I was getting this repeatedly too, every day or so. So far the cached credentials seem to work and I don't get the password reset notifications via email anymore
Author
Owner

@michaelherger commented on GitHub (Aug 15, 2024):

Spotify even announced the end of username/password auth here: https://github.com/librespot-org/librespot/issues/1308#issuecomment-2276196094. It's unfortunate Github would hide that posting by default...

<!-- gh-comment-id:2290782760 --> @michaelherger commented on GitHub (Aug 15, 2024): Spotify even announced the end of username/password auth here: https://github.com/librespot-org/librespot/issues/1308#issuecomment-2276196094. It's unfortunate Github would hide that posting by default...
Author
Owner

@psaumur commented on GitHub (Aug 15, 2024):

Works on PC (my primary OS)
Works on Debian (Took Username/Password, no issue)
Try to enter credentials on Linux Mint, authorization fails - fail enough times and Spotify disables your account and resets your password. Not cool.

You can, however, copy the credentials.json file, from Debian to Mint, and it works again - IF you can get it to authorize (even typing them in by hand can fail the auth!!!)

Frustrating with the disabling of account due to failed auth, though.

<!-- gh-comment-id:2292337172 --> @psaumur commented on GitHub (Aug 15, 2024): Works on PC (my primary OS) Works on Debian (Took Username/Password, no issue) Try to enter credentials on Linux Mint, authorization fails - fail enough times and Spotify disables your account and resets your password. Not cool. You can, however, copy the credentials.json file, from Debian to Mint, and it works again - IF you can get it to authorize (even typing them in by hand can fail the auth!!!) Frustrating with the disabling of account due to failed auth, though.
Author
Owner

@dspearson commented on GitHub (Aug 17, 2024):

As others have already mentioned, the credentials generated via the zeroconf authentication mechanism appear long-lived and is the officially sanctioned way to authenticate Spotify Connect devices. I noted some people using downstream clients (those depending upon librespot) were having difficulty in generating the credentials.json file, so I thinly wrapped just this functionality and tried to make it as trivial to use as I could think; maybe it helps others who stumble here with similar problems.

This bug is no longer relevant for me at least. I will defer to maintainers for closing this when appropriate, given that there's still plenty of people here that seem to have trouble. My thanks to all those that helped thus far!

<!-- gh-comment-id:2294947853 --> @dspearson commented on GitHub (Aug 17, 2024): As others have already mentioned, the credentials generated via the zeroconf authentication mechanism appear long-lived and is the officially sanctioned way to authenticate Spotify Connect devices. I noted some people using downstream clients (those depending upon librespot) were having difficulty in generating the `credentials.json` file, so I [thinly wrapped just this functionality](https://github.com/dspearson/librespot-auth) and tried to make it as trivial to use as I could think; maybe it helps others who stumble here with similar problems. This bug is no longer relevant for me at least. I will defer to maintainers for closing this when appropriate, given that there's still plenty of people here that seem to have trouble. My thanks to all those that helped thus far!
Author
Owner

@psaumur commented on GitHub (Aug 18, 2024):

As others have already mentioned, the credentials generated via the zeroconf authentication mechanism appear long-lived and is the officially sanctioned way to authenticate Spotify Connect devices. I noted some people using downstream clients (those depending upon librespot) were having difficulty in generating the credentials.json file, so I thinly wrapped just this functionality and tried to make it as trivial to use as I could think; maybe it helps others who stumble here with similar problems.

"While running on the same network as a Spotify client..."
Does this only work with a locally installed application and not the browser app?

Edit: Downloading the Linux Spotify client, running Dominic's application in the background, pulls out working credentials. Everything works again (for ncspot)

<!-- gh-comment-id:2295347640 --> @psaumur commented on GitHub (Aug 18, 2024): > As others have already mentioned, the credentials generated via the zeroconf authentication mechanism appear long-lived and is the officially sanctioned way to authenticate Spotify Connect devices. I noted some people using downstream clients (those depending upon librespot) were having difficulty in generating the `credentials.json` file, so I [thinly wrapped just this functionality](https://github.com/dspearson/librespot-auth) and tried to make it as trivial to use as I could think; maybe it helps others who stumble here with similar problems. "While running on the same network as a Spotify client..." Does this only work with a locally installed application and not the browser app? Edit: Downloading the Linux Spotify client, running Dominic's application in the background, pulls out working credentials. Everything works again (for ncspot)
Author
Owner

@andrewCohn commented on GitHub (Aug 18, 2024):

Maybe a stupid question, but how exactly do I authenticate with the credientals.json file?

Edit: -C "pathToDirectoryWithCreds" worked for me, and allowed me to configure my daemon

<!-- gh-comment-id:2295421959 --> @andrewCohn commented on GitHub (Aug 18, 2024): Maybe a stupid question, but how exactly do I authenticate with the credientals.json file? Edit: -C "pathToDirectoryWithCreds" worked for me, and allowed me to configure my daemon
Author
Owner

@noahhaon commented on GitHub (Aug 19, 2024):

Maybe a stupid question, but how exactly do I authenticate with the credientals.json file?

Note that you have to disable zeroconf -O and use the -C parameter to point to the directory with the credentials.json file for it to be used.

<!-- gh-comment-id:2295754182 --> @noahhaon commented on GitHub (Aug 19, 2024): > Maybe a stupid question, but how exactly do I authenticate with the credientals.json file? Note that you have to disable zeroconf `-O` and use the `-C` parameter to point to the directory with the `credentials.json` file for it to be used.
Author
Owner

@kingosticks commented on GitHub (Aug 19, 2024):

Just to be clear, you can generate credentials.json via zeroconf using normal librespot as is:

cargo run --no-default-features -- --cache SOME_DIRECTORY

You can then connect to that librespot instance from an official Spotify client, doing so will generate credentials.json in SOME_DIRECTORY which you can move elsewhere as required.

<!-- gh-comment-id:2296802197 --> @kingosticks commented on GitHub (Aug 19, 2024): Just to be clear, you can generate credentials.json via zeroconf using normal librespot as is: ``` cargo run --no-default-features -- --cache SOME_DIRECTORY ``` You can then connect to that librespot instance from an official Spotify client, doing so will generate credentials.json in SOME_DIRECTORY which you can move elsewhere as required.
Author
Owner

@andrewCohn commented on GitHub (Aug 19, 2024):

Maybe a stupid question, but how exactly do I authenticate with the credientals.json file?

Note that you have to disable zeroconf -O and use the -C parameter to point to the directory with the credentials.json file for it to be used.

Strange, I did NOT use -O, as discovery was a feature I needed for this configuration, and it still worked fine. For what reason does discovery need to be disabled to use the credentials.json?

<!-- gh-comment-id:2296816847 --> @andrewCohn commented on GitHub (Aug 19, 2024): > > Maybe a stupid question, but how exactly do I authenticate with the credientals.json file? > > Note that you have to disable zeroconf `-O` and use the `-C` parameter to point to the directory with the `credentials.json` file for it to be used. Strange, I did NOT use -O, as discovery was a feature I needed for this configuration, and it still worked fine. For what reason does discovery need to be disabled to use the credentials.json?
Author
Owner

@noahhaon commented on GitHub (Aug 19, 2024):

Maybe one of the developers can weigh in here, but for Spotify Connect, where via API or the app on another network you can control librespot, it needs to authenticate to the Spotify web API.

Zeroconf fetches those credentials from the spotify app running on another device, so you don't need cached credentials. For me it wouldn't use the cached credentials at all unless I disabled zeroconf. Note that I do not have the spotify app running on the same network as librespot and had to generate the cached credentials using the oauth2 flow from the fork posted earlier in this thread.

<!-- gh-comment-id:2296900143 --> @noahhaon commented on GitHub (Aug 19, 2024): Maybe one of the developers can weigh in here, but for Spotify Connect, where via API or the app on another network you can control librespot, it needs to authenticate to the Spotify web API. Zeroconf fetches those credentials from the spotify app running on another device, so you don't need cached credentials. For me it wouldn't use the cached credentials at all unless I disabled zeroconf. Note that I do not have the spotify app running on the same network as librespot and had to generate the cached credentials using the oauth2 flow from the fork posted earlier in this thread.
Author
Owner

@kingosticks commented on GitHub (Aug 19, 2024):

If cached creds are present, they'll be used unless: a username and password is also specified, or just a username is specified and it is different to what's in the cached credentials.

Using cached credentials and having Zeroconf enabled are orthogonal.

<!-- gh-comment-id:2296956236 --> @kingosticks commented on GitHub (Aug 19, 2024): If cached creds are present, they'll be used unless: a username and password is also specified, or just a username is specified and it is different to what's in the cached credentials. Using cached credentials and having Zeroconf enabled are orthogonal.
Author
Owner

@rwjack commented on GitHub (Aug 21, 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... https://github.com/badaix/snapcast/issues/1275

<!-- gh-comment-id:2301685024 --> @rwjack commented on GitHub (Aug 21, 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... https://github.com/badaix/snapcast/issues/1275
Author
Owner

@roderickvd commented on GitHub (Aug 21, 2024):

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.

<!-- gh-comment-id:2302968558 --> @roderickvd commented on GitHub (Aug 21, 2024): > 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.
Author
Owner

@michaelherger commented on GitHub (Aug 21, 2024):

Thanks for your effort, @roderickvd. Unfortunately I happen to know that they have an issue with the lack of reporting (see https://github.com/librespot-org/librespot/discussions/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 :(.

<!-- gh-comment-id:2303056941 --> @michaelherger commented on GitHub (Aug 21, 2024): Thanks for your effort, @roderickvd. Unfortunately I happen to know that they have an issue with the lack of reporting (see https://github.com/librespot-org/librespot/discussions/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 :(.
Author
Owner

@roderickvd commented on GitHub (Aug 21, 2024):

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...

<!-- gh-comment-id:2303066355 --> @roderickvd commented on GitHub (Aug 21, 2024): 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...
Author
Owner

@fraintt commented on GitHub (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!

<!-- gh-comment-id:2308955759 --> @fraintt commented on GitHub (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](https://github.com/badaix/snapcast/issues/1275) So you basically mean create the credentials.json (with, lets say [this](https://github.com/dspearson/librespot-auth) ) 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!
Author
Owner

@AdrieVanDijk commented on GitHub (Aug 31, 2024):

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 ?

<!-- gh-comment-id:2322937344 --> @AdrieVanDijk commented on GitHub (Aug 31, 2024): 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 ?
Author
Owner

@DarpNagarsheth commented on GitHub (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?

<!-- gh-comment-id:2323036467 --> @DarpNagarsheth commented on GitHub (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?
Author
Owner

@SuisChan commented on GitHub (Aug 31, 2024):

needs to be made in less than 10 seconds

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

<!-- gh-comment-id:2323048411 --> @SuisChan commented on GitHub (Aug 31, 2024): > needs to be made in less than 10 seconds Login challenge (hashcash)? It has always been like that
Author
Owner

@3052 commented on GitHub (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

<!-- gh-comment-id:2323112845 --> @3052 commented on GitHub (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
Author
Owner

@xdfwers commented on GitHub (Sep 10, 2024):

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

<!-- gh-comment-id:2339767387 --> @xdfwers commented on GitHub (Sep 10, 2024): @DarpNagarsheth Have you solved the issue, i am facing the same issue using zspotify.
Author
Owner

@kingosticks commented on GitHub (Sep 10, 2024):

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

There is no support for that tool here. Thanks.

<!-- gh-comment-id:2339800745 --> @kingosticks commented on GitHub (Sep 10, 2024): > @DarpNagarsheth Have you solved the issue, i am facing the same issue using zspotify. There is no support for that tool here. Thanks.
Author
Owner

@curiousercreative commented on GitHub (Oct 12, 2024):

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?

<!-- gh-comment-id:2408614185 --> @curiousercreative commented on GitHub (Oct 12, 2024): 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?
Author
Owner

@roderickvd commented on GitHub (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.

<!-- gh-comment-id:2408621833 --> @roderickvd commented on GitHub (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.
Author
Owner

@rwjack commented on GitHub (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.

<!-- gh-comment-id:2408983921 --> @rwjack commented on GitHub (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.
Author
Owner

@shanemeagher commented on GitHub (Oct 13, 2024):

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

<!-- gh-comment-id:2408987425 --> @shanemeagher commented on GitHub (Oct 13, 2024): 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
Author
Owner

@devgianlu commented on GitHub (Oct 13, 2024):

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.

<!-- gh-comment-id:2408987509 --> @devgianlu commented on GitHub (Oct 13, 2024): 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.
Author
Owner

@michaelherger commented on GitHub (Oct 13, 2024):

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?

<!-- gh-comment-id:2408990734 --> @michaelherger commented on GitHub (Oct 13, 2024): 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?
Author
Owner

@noahhaon commented on GitHub (Oct 13, 2024):

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.

<!-- gh-comment-id:2408996684 --> @noahhaon commented on GitHub (Oct 13, 2024): > 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.
Author
Owner

@noahhaon commented on GitHub (Oct 13, 2024):

@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.

<!-- gh-comment-id:2408999918 --> @noahhaon commented on GitHub (Oct 13, 2024): @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.
Author
Owner

@roderickvd commented on GitHub (Oct 13, 2024):

👮 locking this thread.

Thanks for the sensible comments and taking note of what I already said in https://github.com/librespot-org/librespot/issues/1308#issuecomment-2408621833. 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.

<!-- gh-comment-id:2409005230 --> @roderickvd commented on GitHub (Oct 13, 2024): 👮 locking this thread. Thanks for the sensible comments and taking note of what I already said in https://github.com/librespot-org/librespot/issues/1308#issuecomment-2408621833. 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.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/librespot#596
No description provided.