Advice on trying to fix spotify album art problem

Hello mates,

Since april spotify modified their source of cover art, from the https://open.spotify.com/image/<song ID> to a new url at https://i.scdn.co/image/<song ID>, however the desktop program on Linux still provides the cover art url over mpris to https://open.spotify.com/. Due to that, no cover art is visible on media controllers.

This was reported back on april on the Spotify forum.

As is known, spotify has discontinued their dedicated dev team for Linux back in 2016 and any work to keep the desktop app working is mostly done on their free time. Last update the client had was on July 2019, no significant features added in the last few years.

I imagine KDE folks won’t mess with this since this is an error on spotify and trying to fix on their end it’s not the right procedure, so I started to think on workarounds.

I guess a more direct aproach would be to modify the mediacontroller plasmoid to change the wrong url to the correct one but I have no knowledge about programming, is there an easier/possible way to change the url so that open.spotify.com redirects to i.scdn.co?

I don’t have Spotify, so cannot test this but if you want to do a redirect locally from open.spotify.com to i.scdn.co you can use the local host file by doing the following:

ping -c 1 i.scdn.co
PING scdnco.spotify.map.fastly.net (151.101.38.248) 56(84) bytes of data.
64 bytes from 151.101.38.248 (151.101.38.248): icmp_seq=1 ttl=57 time=30.4 ms

so that gives you 1 (only one) of the IP addresses of the Spotify cluster (Yours might be different as they might be country or continent-based)

Now you just add that to your hosts file:

sudo nano --backup /etc/hosts:

copy-paste this to the end of what’s already there:

151.101.38.248 open.spotify.com

(remember: don’t just blindly copy-paste, but verify your output above is the same as mine)

and now open.spotify.com will redirect to i.scdn.co.

Verify this by:

ping open.spotify.com
PING scdnco.spotify.map.fastly.net (151.101.38.248) 56(84) bytes of data.
64 bytes from 151.101.38.248 (151.101.38.248): icmp_seq=1 ttl=57 time=30.4 ms

open.spotify.com will now have the IP address of i.scdn.co as the host lookup goes before the DNS lookup and the application has no clue about this so it should just work as the subdomain is the same in both cases: /image/<song ID>

If Spotify would change the subdomain in future versions, you’ll still be out of luck

:blush:

1 Like

Thanks a lot for the help @Fabby.

It didn’t fully work, your suggestion worked as intended, it redirected the IP of the url however I just noticed that the url provided by mpris is HTTPS, so plasma started flashing warnings about bad certificate since the plasmoid was searching for certificate for the domain open.spotify.com, not i.scdn.co. It even crashed plasma after I waited a bit and changed to a new song (it tried again to fetch the album art) so I guess I exposed some kind of bug in this scenario.

This makes this problem more complex unfortunately, but still thanks for the advice, now I see this might be only possible by modifying the plasmoid.

Like I said: I don’t use Spotify so I couldn’t test it for you and the system I advised is a local redirect so It was worth a shot.

The next thing you can try is patch the binary itself with a hex editor as i.scdn.co is shorter than open.spotify.com. That’s really advanced hacking though, so:

do you know what null-terminated strings are?

(Or do you want to give up at this point?)

:smiling_imp:

1 Like

Its also worth noting that there isnt ‘a’ or ‘the’ spotify … well at least not without more context.
There is the AUR package - currently flagged out of date.
But that is specifcally only tracking ‘stable’ (old) releases.
For current ones you have to use SNAP/Flatpak afaik.
In any case … theres a difference … so what are you using exactly?

2 Likes

Thanks for the info @cscs

I’m using the AUR version, 1.1.10.546.ge08ef575, and I erroneously thought that was the latest. I tried installing the snap version, 1.1.26.501, but it crashes before opening, I was able to get it running using snap shell but it crashes after some seconds.

I then installed the flathub version and got it to fullt work, version 1.1.26.501.gbe11e53b, but it’s also providing the same wrong mpris url.

It’s good to see there was an update in February 2020, at least there’s a sign of life although there’s no significant change from one to another, since the mpris problem began in april I guess it’s lined for next update.

:sweat_smile:

Nah, the hassle is not really worth the benefits, aesthetic benefit in this case. There are no good option to fix this. Well, at least now I know upstream is still alive, so it may take some time but I guess it will be fixed, probably in 2021, I’ll control my OCD until then.

If anything this topic might serve as information about the problem being a dead-end street.

1 Like

Speak of the devil and the devil shall come. They just released a new update.

They didn’t fix it.

:clown_face:

Does this post mean you’re wanting to continue an advanced hacking course? (HexEdit - null-terminated strings?)

:thinking: