Hello-
This is not about one of the challenges, just a side project I’ve been working on.
I’m trying to control a SONOS speaker with a Wiimote using a raspberry pi as the controlling device. I’ve been wondering how to start playing music from Google Play Music. When I try:
print(MusicService.get_subscribed_services_names())
it gives me a blank list []
, and when I try
playmusic = MusicService('google play music')
it gives me this error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/soco/music_services/music_service.py", line 329, in __init__
data = self.get_data_for_name(service_name)
File "/usr/local/lib/python2.7/dist-packages/soco/music_services/music_service.py", line 502, in get_data_for_name
"Unknown music service: '%s'" % service_name)
soco.exceptions.MusicServiceException: Unknown music service: 'google play music'
>>> playmusic = MusicService('Google Play Music')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/soco/music_services/music_service.py", line 351, in __init__
"No account found for service: '%s'" % service_name)
soco.exceptions.MusicServiceException: No account found for service: 'Google Play Music'
For some reason SoCo doesn’t know I’m subscribed.
I know I’m subscribed because on my phone I can access my music.
I tried these links but they didn’t seem to help much.
http://docs.python-soco.com/en/latest/api/soco.music_services.music_service.html
Any help is appreciated! Thanks!