A bunch of years ago I wrote a python script to send a command to my Sonos speaker to play a napster radio station. It looked something like this:
import soco
zp = soco.SoCo('192.168.0.72')
media_uri = 'x-sonosapi-radio:station%3a%3aps.8647821?sid=202&flags=76&sn=1'
media_metadata = '<DIDL-Lite xmlns:dc="
http://purl.org/dc/elements/1.1/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" xmlns:r="urn:schemas-rinconnetworks-com:metadata-1-0/" xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/"><item id="000c005cstation%3a%3aps.8627841" parentID="00084066radio%3amystations" restricted="true"><dc:title>'80s Rock</dc:title><upnp:class>object.item.audioItem.audioBroadcast</upnp:class><desc id="cdudn" nameSpace="urn:schemas-rinconnetworks-com:metadata-1-0/">
SA_RINCON5...@aol.com</desc></item></DIDL-Lite>'
zp.volume = 65
zp.play_uri(media_uri, media_metadata, start=True)
I got this stream by sniffing it with wireshark while starting a stream from the Sonos controller on my pc.
Is it still possible to sniff these streams to create scripts? I heard that they encrypted these commands and we are no longer able to do this.
I wanted to create scripts for a few other radio stations but when I tried to sniff I saw a bunch of TLS packets and was unable to find anything like I used in my script above. It's been quite a few years so I may be missing something, but I figured I'd ask to see if it was still possible.
Thanks,
Roveer