Closed rahims closed 11 years ago
Usernames for all the third-party music services you've set up: http://[Sonos player IP]:1400/status/securesettings
I've actually got new code that will extract the username for the music services. I know how to get pandora stations and play them as well just need some time to implement them. Maybe I'll have some time tonight to throw some code up here for others to play with.
I know 3 is Pandora
Very cool, looking forward to it!
A few more:
2 = Rhapsody 3 = Pandora 11 = Last.fm 1543 = iHeartRadio 2055 = Auepo 2823 = Rdio 3335 = Stitcher Smart Radio 6151 = DAR.fm Record Radio 6663 = Amazon Cloud Player 7431 = Songza 8455 = Murfie 9735 = 7digital
Still needed:
import xml.etree.cElementTree as XML
import requests
import select
import socket
import logging, traceback
import re
response = requests.get('http://192.168.1.59:1400/status/securesettings')
dom = XML.fromstring(response.content)
music_login = dom.findtext('.//Command')
music_login = XML.fromstring(music_login).attrib['Value']
services_login_list = music_login.split(',')
music_service_credentials = [(services_login_list+[services_login_list[0]])[i:i+4] for i in range(0, len(services_login_list), 4)]
search = '3'
for sublist in music_service_credentials:
if sublist[0] == search:
print sublist[1]
break
This will playback a pandora station.
http://192.168.1.59:1400/MediaRenderer/AVTransport/Control
SOAPACTION: urn:schemas-upnp-org:service:AVTransport:1#SetAVTransportURI
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<u:SetAVTransportURI xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>0</InstanceID>
<CurrentURI>pndrradio:381332403794797328</CurrentURI>
<CurrentURIMetaData>
<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="OOOX381332403794797328"
parentID="0"
restricted="true"><dc:title>
Wolfgang Amadeus Mozart Radio<
/dc:title><upnp:class>object.item.audioItem.audioBroadcast<
/upnp:class><desc id="cdudn"
nameSpace="urn:schemas-rinconnetworks-com:metadata-1-0/">
SA_RINCON3_xxxxxx{insert account email}@gmail.com<
/desc></item></DIDL-Lite>
</CurrentURIMetaData>
</u:SetAVTransportURI></s:Body></s:Envelope>
4359 - Slacker
Also you need to send play command after changing the station.
There is also interesting stuff at http://[Sonos player IP]:1400/xml/device_description.xml Could use this to expand get_speaker_info Cheers David
As a part of move I though I would close this thread. I have added all this good information to two pages on the wiki of our new location: https://github.com/SoCo/SoCo/wiki
http://[Sonos player IP]:1400/status
Lot's of interesting information, including the player's temperature and free memory :smiley: