[Solved] Spotify search doesn't work


Hello there !

I installed mopidy and I can play music from Spotify from Iris.

However, I’m writing a python-script that communicates with mopidy via json-rpc. Whenever I try to search for an artist, or an album, I get the following error from Mopidy :

INFO     2017-08-24 15:43:21,770 [2950:SpotifyBackend-7] mopidy_spotify.search
  Searching Spotify for: "michael jackson"
DEBUG    2017-08-24 15:43:21,770 [2950:SpotifyBackend-7] mopidy_spotify.web
  Fetching OAuth token from https://auth.mopidy.com/spotify/token

ERROR    2017-08-24 15:43:22,512 [2950:SpotifyBackend-7] mopidy_spotify.web
  Fetching https://auth.mopidy.com/spotify/token failed: 401 Client Error: UNAUTHORIZED for url: https://auth.mopidy.com/spotify/token
DEBUG    2017-08-24 15:43:22,539 [2950:HttpServer] mopidy.http.handlers
  Received RPC message from fe80::aebc:32ff:fed5:2fad%eth0: '{"jsonrpc": "2.0", "id": 1, "method": "core.tracklist.get_tl_tracks"}'

If anyone has ever encountered this issue, I’ll be happy if you could help me :wink: !

Cheers !


Does your config contain valid client_id and client_secret values obtained from https://www.mopidy.com/authenticate/#spotify as described at https://github.com/mopidy/mopidy-spotify#configuration ?


That’s awkward, but in fact, I didn’t copy the credentials correctly ! Thanks a lot !