librespot
librespot copied to clipboard
Autoplay failing to get attribute
Describe the bug
Autoplay fails with the warning WARN librespot_connect::spirc] Unable to get autoplay user attribute. Continuing with autoplay disabled.
but it's enabled in the windows desktop UI
To reproduce Steps to reproduce the behavior:
- Play the last song in a playlist, observe the following warning.
Log
[2022-08-18T10:22:28Z DEBUG librespot_connect::spirc] At track 12 of 11 <"spotify:playlist:7t5BQs06tsKXCXUCAouxYc"> update [true]
[2022-08-18T10:22:28Z WARN librespot_connect::spirc] Unable to get autoplay user attribute. Continuing with autoplay disabled.
[2022-08-18T10:22:28Z DEBUG librespot_connect::spirc] Looping around back to start, repeat is false
[2022-08-18T10:22:28Z TRACE librespot_connect::spirc] Sending status to server: [kPlayStatusPause]
[2022-08-18T10:22:28Z DEBUG librespot_playback::player] command=Load(SpotifyId("spotify:track:5rQriQOlPspqLyO38OYBUM"), false, 0)
[2022-08-18T10:22:28Z TRACE librespot_playback::player] == Stopping sink ==
[2022-08-18T10:22:29Z TRACE librespot_connect::spirc] ==> kPlayStatusPause
[2022-08-18T10:22:29Z TRACE librespot_connect::spirc] Sending status to server: [kPlayStatusPause]
Host (what you are running librespot
on):
- OS: Linux
- Platform: Rpi 4b
- librespot 0.5.0-dev 27e1274 (Built on 2022-08-18, Build ID: SbfdVjDd, Profile: release)
Additional context Looks like it's almost certainly related to the new-api efforts, but I'm not familiar enough with rust to debug it further.
Can you please post the full debug log, right from the start, including all messages from the initial login?
Certainly!
Not sure if this is a factor but when I was recording that log, the first run it worked (as in the next song autoplayed) it was only after i added the --onevent
flag it stopped working. It continued to fail though even when I removed the flag again.
That’s interesting. When you toggle the autoplay switch in the client while playing in librespot
, what do the logs then say?
I've attached a full log, but this appears to be the only message when I toggle autoplay in the client
[2022-08-21T02:09:20Z TRACE librespot_connect::spirc] Received attribute mutation for autoplay but key was not found!
I was toggling it before the song ended as well as after
It's really interesting that apparently, Spotify is not consistent in sending the same product info on login. In your case, you are not being pushed an autoplay
property, which myself I do get consistently, at least from The Netherlands. We need to know the initial state, because the mutation message doesn't send a new value, just signals the fact that it's being toggled.
I don't see any other property either that could replace it.
It seems that you have blocked apresolve.spotify.com
, correct? Could you try what happens if you unblock it, so that you don't use a fallback access point?
This brings me to a couple of thoughts:
- Can anyone verify from other countries or access points?
- Does anyone see some alternative way of getting the initial state?
- We might need to re-introduce an
--autoplay {auto|on|off}
command line option to allow for an override.
Bizzare.
I've attached a log with the apresolve.spotify.com
block removed, still fails the same way. I'd initially blocked that as I was having the same issue as #972 but I just saw your comment that it's no longer required.
librespot.log
This should now be fixed in 6dc7a11b09b5eea8f333805374ce0b45757e9539 which re-introduces an autoplay
command-line option as a manual override.
Confirmed that's working a treat! Thanks for the fix