librespot-org / librespot-java

The most up-to-date open source Spotify client
Apache License 2.0
382 stars 94 forks source link

temporary fixes to CDN feed helper which avoid the broken CDN server #779

Closed tagdara closed 11 months ago

tagdara commented 11 months ago

This is related to the issues in Ssl err #742

Spotify has included a server (audio4-gm-fb) in their CDN rotation which has several issues:

This patch watches for the server to be selected, and when it happens, forces a re-selection. This retains the random logic for CDN selection.

Hopefully Spotify will fix this on the back-end and these patches will no longer be needed

devgianlu commented 11 months ago

Thank you!

skeller commented 11 months ago

FWIW, I cherry-picked this commit into my local copy and librespot-java now works much better & reliable. Now listening for several hours already without any interruptions. Thanks @tagdara!

aedeny commented 11 months ago

Thank you! @tagdara I didn't get much into the code yet, but I think it would be more reliable to catch the CDN failure, and then reselect another CDN server while also keeping a dynamic list of the failed CDNs with some TTL that could be selected again after a few hours / days. I think it's better than having to maintain a list of bad servers in code. I know it's a temp fix, but maybe it's a good aproach for the long-run.