Open denysvitali opened 8 years ago
You mentioned that the Spotify library for NodeJS was no longer being maintained but I've found another one that looks promising - https://github.com/FrontierPsychiatrist/node-spotify
On further reading - node-spotify is a NodeJS wrapper for libspotify which has been deprecated.
Maybe the best way to go would be making requests directly to the Spotify Web API?
The problem with Spotify is that you can't get a stream URL without using their services. The Spotify Web API uses in fact (IIRC) their web player, and only provides track information / details
Dang, looks like you're right. Reading around on Stack Overflow and similar it looks like it's possible to access a 30 second preview of each treack with the Spotify Web API, but not full tracks.
You're right, but the seconds aren't 30: they are about 7. The unencrypted version (called head) is available via http://heads-akp.spotify.com/head/TRACK_KEY, while the encrypted is available at a similar url with /audio/ instead. The decryption method is available in the Spotify's player .swf file, but it's kind of tricky since it uses both swf and js to retrieve the key. I'll post here my notes when I return home / have some spare time
I think Spotify has recently moved away from Flash, as it will be discontinued in 2020. I think they now use the Content Decryption Module built into most browsers.
I wonder how Sonos does its integration with Spotify.
Last time I checked they were decrypting some MP3 from Spotify's CDN. They may have changed their library though.
If I have time (unlikely this month or the next one) I'll check and report back
any updates on spotify?
Unfortunately their encryption is kinda hard, I stopped looking into this issue a lot of months ago. I don't think it is possible to add support for Spotify for non-premium users. The thing we can do though is to support Spotify for premium users by using SONOS' URIs (I guess they've implemented an x-sonos-spotify://
protocol or something).
Unfortunately I'm in the process of moving to a new apartment and I don't have nor won't have access to my SONOS Play:3 speaker for the next weeks. I'll probably start re-maintaining this project (or start from scratch with sonos-web-rs) as soon as I get my speaker back and I settle down with this moving of mine.
+1 :-)