michaelherger / Spotty-Plugin

A Spotify plugin for the Lyrion Music Server (fka. Logitech Media Server) and Squeezebox compatible players
119 stars 20 forks source link

Failed to get token / able to play music already queued but not search for new music #63

Open Kezzsim opened 2 years ago

Kezzsim commented 2 years ago

Just updated to version 4.8.2 and now suddenly I cannot browse music to play anymore, I get this error about getting the access token.

Screen Shot 2022-06-08 at 4 34 59 PM

However, when I play music that I've previously queued via Spotty it all streams just fine. These are my server logs:

[22-06-08 14:50:51.9168] Plugins::Spotty::API::Token::_gotTokenInfo (168) Failed to get access token.
[22-06-08 15:18:16.5642] Plugins::Spotty::API::Token::_gotTokenInfo (168) Failed to get access token.
[22-06-08 15:33:58.8496] Plugins::Spotty::API::Token::_gotTokenInfo (168) Failed to get access token.
[22-06-08 16:18:16.5067] Plugins::Spotty::API::Token::_gotTokenInfo (168) Failed to get access token.
[22-06-08 16:31:53.2352] Plugins::Spotty::API::Token::_gotTokenInfo (168) Failed to get access token.
[22-06-08 16:31:53.2364] Plugins::Spotty::OPML::__ANON__ (198) Failed to get featured playlists and/or token - do not continue

Thing's I've tried:

michaelherger commented 2 years ago

Any hint in the Spotty Settings? Are you using your own Spotify Client ID? What OS are you running LMS on?

Kezzsim commented 2 years ago

MacOS Mojave

Screen Shot 2022-06-09 at 12 48 54 AM

I haven't changed any other settings since logging in last night

Is there a more verbose logging option I should enable to see exactly what is happening when playlists are being rendered?

michaelherger commented 2 years ago

In Settings/Advanced/Logging you can enable logging for plugin.spotty. Info should be good enough, debug is super noisy.

Are you using any kind of firewall which might block outgoing traffic on non-standard ports?

What I strongly recommend doing nowadays is getting your own client ID from https://developer.spotify.com/dashboard/ - see instructions hidden behind the little i icon next to "Spotify Client ID" (at the bottom of that page). Please give it a try and let me know whether that helped.

Kezzsim commented 2 years ago
Screen Shot 2022-06-09 at 12 00 40 PM

Little snitch settings, I was prompted that the code signature had changed but the change was accepted which normally returns spotty to normal functionality.

I added my client ID but that did not get it to start working

michaelherger commented 2 years ago

Can you temporarily disable Snitch all together and try to get a log as outlined above.

Kezzsim commented 2 years ago

Here's the logs with Little Snitch disabled. You can see where it has caches of the tracks but it cannot get the token


[22-06-13 12:23:28.0016] Plugins::Spotty::API::Token::_logCommand (136) Trying to get access token: "/Users/kezz/Library/Caches/Squeezebox/InstalledPlugins/Plugins/Spotty/Bin/darwin-thread-multi-2level/spotty" -n "Squeezebox" -c "/Users/kezz/Library/Caches/Squeezebox/spotty/ddf3e0f" -i "f73b934962c24b19" --disable-discovery --scope "user-read-private,user-follow-modify,user-follow-read,user-library-read,user-library-modify,user-top-read,user-read-recently-played,user-read-playback-state,user-modify-playback-state,playlist-read-private,playlist-read-collaborative,playlist-modify-public,playlist-modify-private" --save-token "/var/folders/nf/9mfwk4nj4fd3q67qky/T/CLTO2W7Nm6"
[22-06-13 12:23:29.5113] Plugins::Spotty::API::Token::_gotTokenInfo (149) Got response: {"error":"Failed to get access token."}
[22-06-13 12:23:29.5115] Plugins::Spotty::API::Token::_gotTokenInfo (168) Failed to get access token.
[22-06-13 12:23:29.5120] Plugins::Spotty::OPML::__ANON__ (198) Failed to get featured playlists and/or token - do not continue
[22-06-13 12:23:31.1032] Plugins::Spotty::ProtocolHandler::getMetadataFor (181) Returning metadata cached in song object for spotify://track:3h22YRt7jBsaS4tLAjLQ84
michaelherger commented 2 years ago

Is that log with debug.spotty logging enabled? If not, please enable it to get more information in the server.log file.

Kezzsim commented 2 years ago

With Debug enabled I don't get more information about the failed request, I just see more information about the cached media including it's bitrate and cover art links.

This is still the only error message I actually get out of the thing:


[22-06-20 15:18:13.5081] Plugins::Spotty::API::Token::_logCommand (136) Trying to get access token: "/Users/kezz/Library/Caches/Squeezebox/InstalledPlugins/Plugins/Spotty/Bin/darwin-thread-multi-2level/spotty" -n "Squeezebox" -c "/Users/kezz/Library/Caches/Squeezebox/spotty/ddf3ef" -i "f73b934962c24b19a2" --disable-discovery --scope "user-read-private,user-follow-modify,user-follow-read,user-library-read,user-library-modify,user-top-read,user-read-recently-played,user-read-playback-state,user-modify-playback-state,playlist-read-private,playlist-read-collaborative,playlist-modify-public,playlist-modify-private" --save-token "/var/folders/nf/9mfwk4nj4fd3q67qky/T/DtVFxi"
[22-06-20 15:18:14.5229] Plugins::Spotty::API::Token::_gotTokenInfo (149) Got response: {"error":"Failed to get access token."}
[22-06-20 15:18:14.5231] Plugins::Spotty::API::Token::_gotTokenInfo (168) Failed to get access token.
[22-06-20 15:18:14.5236] Plugins::Spotty::OPML::__ANON__ (198) Failed to get featured playlists and/or token - do not continue```
michaelherger commented 2 years ago

Can you run the following (please replace YOUR_FOLDER with whatever folder name it's using on your system, you might have to tweak the paths a bit):

~/Library/Caches/Squeezebox/InstalledPlugins/Plugins/Spotty/Bin/darwin-thread-multi-2level/spotty -n test -c ~/Library/Caches/Squeezebox/spotty/YOUR_FOLDER --disable-discovery --get-token

Or:

/Users/kezz/Library/Caches/Squeezebox/InstalledPlugins/Plugins/Spotty/Bin/darwin-thread-multi-2level/spotty" -n "Squeezebox" -c "/Users/kezz/Library/Caches/Squeezebox/spotty/ddf3e0f" -I "CLIENT_ID" --disable-discovery --scope "user-read-private,user-follow-modify,user-follow-read,user-library-read,user-library-modify,user-top-read,user-read-recently-played,user-read-playback-state,user-modify-playback-state,playlist-read-private,playlist-read-collaborative,playlist-modify-public,playlist-modify-private" --get-token

You should edit your posting to remove the CLIENT_ID from the posting... and I actually am wondering whether that's the source of the problem: that client ID looks wrong to me. Mine are much longer. Unless you've redacted your posting to modify it, I'd strongly recommend you double check that value.