-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for authenticated calls to the Spotify Web API #130
Comments
The features that stem from the proposed merge would be greatly appreciated. |
I started on https://github.com/mopidy/mopidy-spotify/tree/feature/oauth based on some other OAuth things I've done before. But I've not had time to fix the existing tests or add new ones. But this should be enough to survive the end-points that should soon require auth. So if someone else has time to finish this up we could get a new release out in time for the API change. And then longer term someone could consider #114 with respect to this. |
I think the API change happened... my search refuses to work (just happened today!) |
Can confirm the API change.
|
Is there a plan of action to get this fixed? |
Someone needs to fix up the tests for https://github.com/mopidy/mopidy-spotify/tree/feature/oauth. In the meantime you can use that branch if you want: |
The search is still broken also on the new OAuth branch. Btw it's quite a shame that we had to wait for things to really break badly before supporting OAuth decently, despite Spotify provided a very very early notice about the deprecation of the old Spotify API... |
Cant confirm that. For me it works. |
My search attempts fail with errors such as:
|
Did you visit https://www.mopidy.com/authenticate/#spotify to get your
EDIT: I've updated the branch README to show this. |
I did, but the situation with the client_id seems to be quite messy now. You are mentioning that the client_id configuration should be in the [spotify] section, while the link you posted mentions the [spotify_web] section. The fact is that I had two different client_ids in those sections - whatever was there before in [spotify_web], and the newly generated one for [spotify], and that configuration didn't work. Using the same for both fixes the search. So, right now we apparently ought to use the same configuration in two modules which are supposed to be distinct. |
Please, feel free to rectify the situation. The code should all be available on here (and at https://github.com/adamcik/oauthclientbridge) |
Possible gotchas and improvements:
|
Confirming that manually upgrading and configuring OAuth credentials fixes this. I'd installed it using |
I updated the tests at #143 |
What if we keep them required and just check that they match those defined for spotify_web (if it's enabled)? |
Fixed by #143. Mopidy-Spotify 3.1.0 has been released to PyPI, apt.mopidy.com and Homebrew. |
@grighi: You're mixing up Mopidy and Mopidy-Spotify. It is Mopidy-Spotify that has been released in version 3.1, and that version is published on GitHub. The Arch Linux Community repo doesn't have Mopidy-Spotify, only Mopidy (which it has in version 2.1 which is the most recent). AUR has Mopidy-Spotify in version 3.1. |
I am running mopidy 2.1 & mopidy-spotify 3.1 on a raspberry pi (raspbian stretch, not jessy), and I can not get around the 401 exception when searching using http api. It used to work on a older Jessy installation I had, but I have no other choice than to move to Stretch now. I started from scratch like 3 times now, always the same results. Strange thing is that nobody else seems to complain about this configuration, so I really start to wonder if I didn't miss something big here... Error: Fetching https://auth.mopidy.com/spotify/token failed: 401 Client Error: UNAUTHORIZED for url: https://auth.mopidy.com/spotify/token Can anyone else confirm if they got the search to work on Stretch? |
@mdundek I got it working on Stretch. I didn't do anything in particular beyond the usual installation and configuration, make sure you set the proper client_id and client_secret retrieved from here https://www.mopidy.com/authenticate/#spotify Running mopidy 2.1 & mopidy-spotify 3.1 as well. |
Spotify recently announced the following:
We currently access the
/search
and/tracks
endpoints so we'll soon need to use Spotify's Authorization Code Flow to continue doing so. The good news is that the infrastructure for doing this has already been setup and is used by mopidy-spotify-web. Merging mopidy-spotify-web and mopidy-spotify together (#114) makes even more sense and might be the first place to start.We would then be able to start using the Web API for more of the features currently provided by libspotify and reduce our dependency on that deprecated library (#110). Except, of course, for streaming which is unfortunately still only possible through libspotify.
The Web API also give us access to features/improvements that are not available in libspotify, such as:
The text was updated successfully, but these errors were encountered: