Librespot and Spotify

Hi ! “tapping on a keyboard until something works” sounds like an accurate description of how I wrote librespot :slight_smile:



@plietar Welcome to the community!
Maybe you can share your thoughts on librespot been used on commercial equipment?


Thanks for your awesome library/application!

1 Like

LOL!!! Good to meet you! And welcome to the community.

Curious as to whether librespot could get cut off by Spotify, or whether it uses libspotify (ie the API is guaranteed to work going forward).

1 Like

I am curious about this my self, But to my understanding their libspotify is also phased out and they are using their closed SDK?

Spotify Connect is going to be supported going forward - it is a brilliant idea on Spotify’s part as it allows them to keep full tracking of your actions while allowing for other vendors to provide rendering.

My question is how that will work in the future. The Spotify page on this is very tailored to hardware vendors and some sort of approval mechanism. Looks to me like Sonore has not gone this route so I wonder how long-lived the effort will be.

Curious as to whether librespot could get cut off by Spotify, or whether it uses libspotify (ie the API is guaranteed to work going forward).

From a technical point of view, it would be very hard for them to cut it off. While it doesn’t use any of their libraries, it uses the same protocol as their official clients. Blocking librespot would block all their users.

While they can change the protocol, and require all users to upgrade (with a silent deprecation period so it doesn’t break overnight), now that their software has been deployed in hard to upgrade speakers they are pretty much stuck with it. Even if they change it, some more reverse engineering can always bring librespot back up to speed.

IANAL, but from a non-technical point of view, I’d be very careful with commercialising products which use librespot, it’s a dark-grey area. I’ve been in contact with some people there, and they’re generally OK with the way it is being used now, but this might not apply to other usecases.


Thanks for your reply. Interesting! I feel uneasy about it personally but hey its not my product. Thanks again!

Very interesting. You’re right that once Spotify Connect has been deployed in hardware that’s very hard (maybe impossible) to upgrade via firmware, they are pretty much stuck with it. I wonder if there’s a client identification mechanism (eg a public/private key or certificate)? You would know since you’ve tapped enough on the keyboard to make librespot work! :wink:

It does send a user agent, which is currently literally “librespot-GITSHA”. If Spotify ever blacklists this I can change it to match what the desktop client uses. There’s no private key or similar involved. In any case, librespot can always be changed to match one of the official clients’ behaviour making it indiscernable, but so far this has not been necessary.

The biggest “risk” is Spotify blocking user accounts when they detect the use of librespot, but that would be pretty agressive on their part, and unlikely to happen IMO.

1 Like

Is there anything in their documentation that would imply something like librespot goes beyond fair use?

I’ve intentionally not implemented features which would be considered as not being a “fair use” of their service, such as allowing free accounts to be used with Spotify Connect or downloading tracks to be used in other applications, even though both of these would have been trivial to do.

This is however just me trying to “play nice”. Any form of reverse engineering in general is something they don’t allow in their EULA.


Hi @plietar
does using Spotify Connect via Librespot limit sampling rates in any way? what technical limitations, if any, does librespot come with?
sorry, not a tech person so my question may not be relevant, but just want to know where I’m going with it.
Thanks for doing this by the way :slight_smile:

My Spotify account has been Premium > Free > Premium. For the period when it was free I was able to divert the stream to any of 3 connected Amazon Fire TV devices using Spotify connect. Are you saying that behaviour should not normally be allowed. When the account was free there a block on diverting the stream to Chromecast Audio devices which was fair enough, so I always thought it odd that I could continue diverting the stream to Fire TV devices.

I have never downloaded anything from Spotify so I do not know how that would have panned out when the account was ‘free’

My understanding from comments from the guy who created/manages librespot is that there are no limitations. However, the use of Spotify Connect is limited to Premium accounts. He mentioned that it is possible to get around this on the API, but that he chose to play by the rules and does not allow this.

Someone mentioned Amazon Fire allowing them to play Spotify Connect when their account was free. Maybe Amazon’s implementation is getting around this (as mentioned above) although frankly I would expect Amazon to be using the official Spotify implementation so that is a bit odd.

As for why bother with librespot, well apparently if you’re not a big player Spotify will not give you the time of day. Makes sense from a business perspective frankly but sucks for the niche players. Sonore went with librespot for this reason.

Haha… I am just repeating what was said above. Sorry for wasting your time!