Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Spotify music_service search fails - AuthTokenExpired #428
Seems simple enough, am I doing something incorrectly?
from soco import SoCo from soco.music_services import MusicService device = SoCo("x.x.x.x") service = MusicService('Spotify') service.search(category='tracks', term='pinball')
Same problem here with any relevant call to a Spotify-service. E.g. I do
Although a bit experienced with programming and using PyCharm, I am not able to fully understand that.
We are seeing a lot of this right now for a large number of music services. My guess (which or more or less specifically mentioned in the traceback of the errors) is that one of the ways Sonos does music service authentication has changed and tha basically all the music services that authenticate that way therefore fails.
If someone wants to help and is up for some internet searching, it is possible that there is already information about this in the Sonos community or with one of the other Sonos driver implementations.
This was referenced
Nov 6, 2016
referenced this issue
Mar 6, 2017
Time for an update - sorry for the long silence
Sonos has changed the way in which music service account data can be accessed. It used to be possible to get the necessary info from the players, but it is now encrypted using AES-CBC. Although other third party Sonos controllers have worked out how to get round this and decrypt the info (see here for a discussion), I am not sure that it would be right for us to do so in an open source project (though I haven't decided yet).
I have today managed to successfully register a python soco script with Google Play Music. The script requires user interaction (you have to go to a web page and input your Google Play credentials). It may therefore be possible to create a workaround where you run a registration script and then use the returned details to allow SoCo to use third party media services. I suppose the details will change from time to time so it might be necessary to run the registration script again.
Research continues ....
@ghcs27 it is not all music services. I have a few running that works just fine. As I understand it, it is restricted to those that use OAuth authentication (@lawrenceakka right?) , most significantly Google Play Music and Spotify.
I think a common issue is a good idea, but we should make sure to get the description right.
@ghcs27 I do however support the idea of making a meta issue. Do you want to formulate it.
I also think, that we should add something in large bold red letters to the github frontpage, which clearly states, that the issue with these services is due to Sonos changing the authentication method to something that open source projects cannot access and that if people want that to change, they should bug Sonos, not us. I think maybe I will do a PR for that.