michaelherger / Spotty-Plugin

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

Spotty stopped working due to Spotify API changes #137

Open thasd3bu9 opened 1 week ago

thasd3bu9 commented 1 week ago

Hi, I have some troubles with authenticating Spotify within a fresh docker deployment (docker v27.2.0) lmscommunity:logitechmediaserver After Spotify removed the credential auth and i've been on lms 8.1 I decided to upgrade to latest version. I'm running 1 Radio, 1 Boom, 1 Touch, and 2 squeezelightclients.

I can run local media files with no problems and can see all players.

I reinstalled Spotty several times, put the container in Host network mode, tried different Spotify clients (Laptop, mobile, PC) but there's no device showing up

server.log

I appreciate any help and i believe I'm just too noobish :)

thx in advance

Rob

michaelherger commented 1 week ago

It should work in host mode, unless you have something else blocking access to ports.

That said, it looks as if they turned something off. I've been receiving emails from users telling me they were no longer able to listen to Spotify for several days. Today the issue reached me, I believe. I can no longer listen to any Spotify content... I'm sorry, but for the time being I'll have to concentrate on getting things working again at all 😒.

thasd3bu9 commented 1 week ago

Thank you for your quick reply. I was concerning that this is a Spotify related issue but I'm on the road now. I will investigate if there's something blocking ports later on. Even I'm also not able to exec inside the container which gives an 'unable to retrieve image details'

Thanks for your work

wwalterww commented 1 week ago

[quote]That said, it looks as if they turned something off. [/quote] I think that as well. I've got 2 server instances running with spotty. On one, the problem showed up yesterday: it keeped skipping to the end of the playlist, without playing anything. Loading Playlists etc. works. I could temporarily resolve this problem by switching to the fallback access point. On the other one, the problem came up a few hours later. Since a few hours, also the fallback access point stopped working.

There are NO log warnings/errors, though.

smartins4 commented 1 week ago

[quote]That said, it looks as if they turned something off. [/quote] I think that as well. I've got 2 server instances running with spotty. On one, the problem showed up yesterday: it keeped skipping to the end of the playlist, without playing anything. Loading Playlists etc. works. I could temporarily resolve this problem by switching to the fallback access point. On the other one, the problem came up a few hours later. Since a few hours, also the fallback access point stopped working.

There are NO log warnings/errors, though.

same here..

GodfatherX64 commented 1 week ago

unfortunately same here too lms on alpine x86_64

h00t2y commented 1 week ago

same... ERROR librespot_core::channel] channel error: 2 0 https://github.com/librespot-org/librespot/issues/972#issuecomment-2320943137

bbernhard commented 1 week ago

same... ERROR librespot_core::channel] channel error: 2 0 librespot-org/librespot#972 (comment)

Does anyone have success with blocking apresolve.spotify.com? Doesn't work for me unfortunately :/

h00t2y commented 1 week ago

same... ERROR librespot_core::channel] channel error: 2 0 librespot-org/librespot#972 (comment)

Does anyone have success with blocking apresolve.spotify.com? Doesn't work for me unfortunately :/

No success with blocking... maybe AmbientCapabilities=CAP_NET_BIND_SERVICE can work if i only knew how to use this :)

h00t2y commented 1 week ago

looks like dev branch worx https://github.com/librespot-org/librespot/issues/1322#issuecomment-2326893786

bbernhard commented 1 week ago

I saw that Spotty uses its own fork of librespot (https://github.com/michaelherger/librespot), so I am wondering if one can just replace spotty-hf with the dev version? Does that work?

michaelherger commented 1 week ago

I saw that Spotty uses its own fork of librespot (michaelherger/librespot), so I am wondering if one can just replace spotty-hf with the dev version? Does that work?

Nope. I wouldn't have forked it if I hadn't needed to do so in order to make things work for spotty.

I'll hopefully be able to migrate to the latest dev branch work of upstream librespot.

bbernhard commented 1 week ago

I saw that Spotty uses its own fork of librespot (michaelherger/librespot), so I am wondering if one can just replace spotty-hf with the dev version? Does that work?

Nope. I wouldn't have forked it if I hadn't needed to do so in order to make things work for spotty.

I'll hopefully be able to migrate to the latest dev branch work of upstream librespot.

thanks a lot - very much appreciated!

michaelherger commented 1 week ago

Ok, here's something for the brave among you... a somewhat working test version of Spotty! Before you promise too much to your kids, please check these caveats:

If you agree with the above, add the following URL to the plugin manager and install the Spotty update.

https://www.herger.net/slim-plugins/spotty-test.xml

cregeland commented 1 week ago

Great work @michaelherger !

I just updated and re-added accounts. Stuck on unable to get access token for a while but worked shortly after. Moving through the menu and searching seems a litt bit slower than it used to but that might just be on my side. Will continue testing πŸ‘ Running LMS 8.5.2 on win10 VM.

Thanks for your effort!

wwalterww commented 1 week ago

WOW. Quite a disclaimer - but it works! The delay between tracks seems longer than usual though. (docker lmscommunity/logitechmediaserver on linux/intel machine)

I get this error on Spotty's "home page": ERROR: List processing failed TypeError: Cannot read properties of undefined (reading 'length') TypeError: Cannot read properties of undefined (reading 'length') at parseBrowseResp (http://192.168.0.253/html/js/material-deferred.min.js?r=5.2.5:82:145) at http://192.168.0.253/html/js/material.min.js?r=5.2.5:423:300

Thank you @michaelherger ! My kids are as desperate as yours. And me as well, we all kind of depend on Spotty. :)

brunphil commented 1 week ago

just installed the new version and tested it shortly. playback worked again immediatly. thank you very much! looking forward to let the kids test it out tomorrow... will keep you updated...

edit: works like a charm. had to reboot once as the plugin had troubles getting a token. running spotty v4.11.9 on lms version 8.5.2 - 1716215514 i an unraid (x86_64-linux) docker image (repo dlandon/logitechmediaserver)

MarcPlace commented 1 week ago

Can confirm after a short test with LMS 8.5.2 on my 64-Bit Laptop (Archlinux) everything seems to work again as expected. But I can't experience any longer delays between the tracks as mentioned above. Looks pretty quite normal to me. Will do some further testing with v4.11.9.

Unfortunately I'm probably the only one 😁 who's still running an LMS on an old ITX 32-Bit home server. So I think, after all these years (although still very stable and reliable), it's time for something new now. πŸ˜‡ Thanks @michaelherger for all your effort, I'm really appreciate this.

Edit: Just fell over it... Some podcasts can't be played anymore (e.g. https://open.spotify.com/episode/7e65zcGoYOHfWmpe8CD1Uc) while other podcasts play without any issues (e.g. https://open.spotify.com/episode/1wVnctv6Yr2H5FLZ8YXPkI).

michaelherger commented 1 week ago

@MarcPlace you could try to build the binary yourself. It's not that difficult. My difficulties result from the fact that I cross-compile most of it, and rely on Github to do the heavy lifting. And they do not provide support for all platforms (and I was too lazy to build a pipeline for i386 cross-compilation).

Once you've got rust installed (https://rustup.rs) just run cargo build --release from the repo's root folder, wait, and put the resulting target/release/spotty as spotty-custom somewhere in your search path.

FlorentBrianFoxcorner commented 1 week ago

Works, thank you @michaelherger. Will operation be stable if I switch off docker host networking after having logged in?

jasjpp commented 1 week ago

Thank you @michaelherger. Works like a charm on x64 QNAP with QLMS

ebbesmoeller commented 1 week ago

Tested new build with own client ID, on Raspberry Pi 2 Lyrion. Works :+1:

MarcPlace commented 1 week ago

@MarcPlace you could try to build the binary yourself. It's not that difficult. My difficulties result from the fact that I cross-compile most of it, and rely on Github to do the heavy lifting. And they do not provide support for all platforms (and I was too lazy to build a pipeline for i386 cross-compilation).

Will give it a try to compile it 32-Bit native as soon as I'm back home tonight. πŸ‘

michaelherger commented 1 week ago

Works, thank you @michaelherger. Will operation be stable if I switch off docker host networking after having logged in?

Yes, I believe once authenticated spotty would go back to reaching outside from the inside. You should be good.

xudabit commented 1 week ago

Had the same problem with skipping the playlist over the last few days. Started around tuesday. Now it's working fine again without any update besides the update with the message which says, that it's not working anymore. So I'm currently using 4.11.1 which works just as before.

git-qb commented 1 week ago

I've just reverted my LMS from snap and i confirm that it is working on 4.11.1 without any problems.

DCH-SOCOMEC commented 1 week ago

Works again on my side too, after few days down... Some changes on Spotify side ?

00bins commented 1 week ago

yes it also works for me again - I haven't installed new version of spotty or changed any other settings

On Thu, 5 Sept 2024 at 14:28, DCH-SOCOMEC @.***> wrote:

Works again on my side too, after few days down... Some changes on Spotify side ?

β€” Reply to this email directly, view it on GitHub https://github.com/michaelherger/Spotty-Plugin/issues/137#issuecomment-2331686259, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEZ7UMAVEKWFHNQKWF5UN5DZVBL7ZAVCNFSM6AAAAABNRYAUQKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMZRGY4DMMRVHE . You are receiving this because you are subscribed to this thread.Message ID: @.***>

neumanntv commented 1 week ago

yes it also works for me again - I haven't installed new version of spotty or changed any other settings … On Thu, 5 Sept 2024 at 14:28, DCH-SOCOMEC @.> wrote: Works again on my side too, after few days down... Some changes on Spotify side ? β€” Reply to this email directly, view it on GitHub <#137 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEZ7UMAVEKWFHNQKWF5UN5DZVBL7ZAVCNFSM6AAAAABNRYAUQKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMZRGY4DMMRVHE . You are receiving this because you are subscribed to this thread.Message ID: @.>

Same for me - the old spotty 4.11.1 also works again (with that message...and start missing)

MarcPlace commented 1 week ago

Huh? πŸ€” Same here, running LMS 8.5.2 and Spotty 4.11.1 also without any issues now. Very odd... maybe they've reverted their changes again at Spotify because of too many complaints from 3rd party users.

Nevertheless, I've managed to compile the i386 binary for Spotty 4.11.9 myself successfully using my client ID. Works as expected on my old 32-Bit ITX. πŸ‘

[root@vdr i386-linux]# file spotty-i386 spotty-i386: ELF 32-bit LSB pie executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 3.2.0, stripped

[root@vdr i386-linux]# ./spotty-i386 --help spotty v1.9.9 - using librespot 0.5.0-dev VERGEN_IDEMPOTENT_OUTPUT (Built on 2024-09-05, Build ID: Nyc7nOmS, Profile: release)

CyberKnight-s commented 1 week ago

For me its working now again with v4.11.0. So Spotify must have realized they broke something on their end and fixed it. Because before it would just skip through the playlist without playing anything. Running PicorePlayer btw, piCorePlayer v9.2.0 | www v00029 | linux 6.1.77-pcpCore-v8 (64) | piCore v14.1 | Squeezelite v2.0.0-1476-pCP. Anyway, Michael, thanks so much for your continued support! Spotty = necessity of life for my family & me...

neumanntv commented 1 week ago

now updated to 4.11.2. Issue is back again - likely from spotifys side again. :(

neumanntv commented 1 week ago

now updated to 4.11.2. Issue is back again - likely from spotifys side again. :(

Now it works again...strange.

FlorentBrianFoxcorner commented 1 week ago

With 4.11.9 I seem to have an issue with token refresh.

I'm on docker amd64 stable (8.5.3), still with --net=host.

Once set up using my account from Spotify on Android, Spotty works alright, again thank you Michael!

Then after 1+ hour of operation I get in server.log for each Spotty action:

    [24-09-06 20:06:42.5600] Plugins::Spotty::API::__ANON__ (1464) API call: episodes?ids=4H3aJfrcbS0hPBFkvpmPGl&market=from_token
    [24-09-06 20:06:42.5606] Plugins::Spotty::API::__ANON__ (1468) error: 401 Unauthorized
    [24-09-06 21:05:13.4273] Plugins::Spotty::API::__ANON__ (1464) API call: me
    [24-09-06 21:05:13.4282] Plugins::Spotty::API::__ANON__ (1468) error: 401 Unauthorized
    [24-09-06 21:05:13.4334] Plugins::Spotty::API::__ANON__ (1464) API call: browse/featured-playlists?wakeUpBoo=DE&limit=50&locale=de_DE&timestamp=2024-09-06T21%3A00%3A00

To get it working again, I created a 2nd "App" in Spotify Developers and entered this Client ID to Spotty. This results in Spotty working again for about one hour. Mind in the log above: Around 20:06 I entered the other Client ID and the error popped up again at 21:05.

If I then again switch to the previous Client ID, it works again for about 1h.

michaelherger commented 1 week ago

Yeah, I've seen token expiration issues, too. It's odd, because the code follows the TTL given in the token itself. But in my case Spotty would refresh a minute or two later, and I'd be able to continue to use it without any restart and such.

cregeland commented 4 days ago

Is it still working with the Β«oldΒ» spotty version (not the testversion)? It seems the test version is quite a bit slower to navigate through albums etc. Might take a chance and go back to normal release?

by they way @michaelherger - do you have buymeacoffe? Great work keeping the plugin aliveπŸ˜ƒ

michaelherger commented 4 days ago

Yes, you should go back to the official release - which IMHO is working more reliably than the new one (again).

But no, I don't drink coffee 😁.

bbernhard commented 1 day ago

Does anyone else have issues that the playback sometimes stop? This happens totally random. Sometimes after one or two tracks, sometimes after an hour or so. Not sure if this is related to the API changes, but I've only experienced that issue after Spotify did some changes on their side. Just curious if anyone else experiences those issues?

Apart from those type of entries (which appear to be happening on a regular basis)

file:///usr/local/slimserver/prefs/clientplaylist_0200750c7276.m3u doesn't exist on disk - skipping!
[24-09-14 11:31:30.2910] Slim::Formats::Playlists::Base::playlistEntryIsValid (125) Warning: spotify://track:03qa9kZ75xgpU478VV6Cjy found in playlist

I do not see anything odd in the server.log. The log level is set to Warn though.

GodfatherX64 commented 1 day ago

Does anyone else have issues that the playback sometimes stop? This happens totally random. Sometimes after one or two tracks, sometimes after an hour or so. Not sure if this is related to the API changes, but I've only experienced that issue after Spotify did some changes on their side. Just curious if anyone else experiences those issues?

Apart from those type of entries (which appear to be happening on a regular basis)

file:///usr/local/slimserver/prefs/clientplaylist_0200750c7276.m3u doesn't exist on disk - skipping!
[24-09-14 11:31:30.2910] Slim::Formats::Playlists::Base::playlistEntryIsValid (125) Warning: spotify://track:03qa9kZ75xgpU478VV6Cjy found in playlist

I do not see anything odd in the server.log. The debug level is set to Warn though.

yes, unfortunately, it happens with my setup too

michaelherger commented 1 day ago

Are you still on the test version or back on the release version? I have found an issue in the test version which caused slowness, failed token updates etc. But I didn't bother updating the test repo, as the old version started working again.

bbernhard commented 1 day ago

Are you still on the test version or back on the release version? I have found an issue in the test version which caused slowness, failed token updates etc. But I didn't bother updating the test repo, as the old version started working again.

I am on the latest release version. Wanted to give the test version a try back then, but at that time the release version already worked again (except for the random playback stops).

Haloto commented 1 day ago

I have the same problem as well. Tough I think it happend occasionally before spotify broke playback alltogether for some days. Now it happend very frequently and I did not even manage to have one album play without it stopping at least once. I dug up a somewhat related forum post somewhere that recommended to disable ogg as a file type for spotty. That seems to have fixed the stopping for me even though every 10 or so tracks it skips to the next track in the middle of one track.

Edit: I never used the experimental version