Skip to main content
Contributor I
March 18, 2021

How to implement Spotify

  • March 18, 2021
  • 22 replies
  • 1242 views

Hi everyone, I am a developer and Im building a .NET app in order to play music from Sonos ZP100 using Spotify. Or alternatively with music plugged into an USB. I tried using the UPnP protocol but it doesn seem to be the right way to reproduce songs. I am only able to play pause stop seek next previous and volume controls but nothing else. Do somebody know how to do something similar?
The perfect example is the SONOS S1 app that after linking spotify account can reproduce songs

This topic has been closed for further comments. You can use the search bar to find a similar topic, or create a new one by clicking Create Topic at the top of the page.

22 replies

controlav
Lead Maestro
March 30, 2021
  1.  
  2. You talk about capture a frame form the sonos app, how can I accomplish this, I was thinking about wireshark but my pc is wired so Im not sure I can get the frame that start from my phone and I guess they are encrypted.
    Thank you

The UPnP calls are not encrypted. I use NetMon to capture them, I know others use Wireshark. Capture PC traffic, its a lot easier than capturing phone traffic in my experience. Wired or wireless makes no difference - its still network traffic. It is possible to capture phone traffic but its harder: I use additional network hardware and a BOOST when I need phone captures.

If you can’t capture anything, give up now, its an essential part of the reverse engineering toolkit.

Author of the leading independent Sonos apps for Android, MacOS, iOS, Windows and Xbox.
Manatee19Author
Contributor I
April 13, 2021
  1.  
  2. You talk about capture a frame form the sonos app, how can I accomplish this, I was thinking about wireshark but my pc is wired so Im not sure I can get the frame that start from my phone and I guess they are encrypted.
    Thank you

The UPnP calls are not encrypted. I use NetMon to capture them, I know others use Wireshark. Capture PC traffic, its a lot easier than capturing phone traffic in my experience. Wired or wireless makes no difference - its still network traffic. It is possible to capture phone traffic but its harder: I use additional network hardware and a BOOST when I need phone captures.

If you can’t capture anything, give up now, its an essential part of the reverse engineering toolkit.

If the UPnP are not encrypted should be “easy”.

I dunno what is a BOOST but probably I will use the SONOS DESKTOP APP so I can grab the traffic and see it without problem in order to understand what kind of call it does.
 

Anyway I thought I reach the solution: after experimenting with Spotify’s API I found that there is a list of devices used to reproduce songs. I grab the list, make another call with device id and playlist and it play. The problem has been that the SONOS devices wasnt in that list…. All my device (alexa, google, my phone, my computer) there were except for sonos… do you have a clue on why this happens?

I will try using the method you said: capture the network traffic and see, then reproduce with code on C# using some custom upnp sender.

Thank you