pimoroni / pidi-spotify

MIT License
46 stars 12 forks source link

Issues on Ubuntu Mate 18.04: image_cache_path #3

Closed robrecord closed 3 years ago

robrecord commented 4 years ago

Hi, thanks for making this Very Awesome Work of (album-)Art!

I am having issues setting up on Ubuntu Mate 18.04.

First I had to install two python packages:

sudo pip3 install spidev
sudo pip3 install RPi.GPIO

and now I have the following output when I run the program:

PiDi Spotify Running

Listening on FIFO: /tmp/spotify_album_display

Press Ctrl+C to exit

Traceback (most recent call last):
  File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/robrecord/pidi-spotify/pidi_spotify/__main__.py", line 161, in <module>
    globals()[f"command_{command_fn}"](*command_args)
  File "/home/robrecord/pidi-spotify/pidi_spotify/__main__.py", line 84, in command_track
    track = spotify.track(track_id)
  File "/usr/local/lib/python3.7/dist-packages/spotipy/client.py", line 331, in track
    return self._get("tracks/" + trid)
  File "/usr/local/lib/python3.7/dist-packages/spotipy/client.py", line 284, in _get
    return self._internal_call("GET", url, payload, kwargs)
  File "/usr/local/lib/python3.7/dist-packages/spotipy/client.py", line 220, in _internal_call
    headers = self._auth_headers()
  File "/usr/local/lib/python3.7/dist-packages/spotipy/client.py", line 211, in _auth_headers
    token = self.auth_manager.get_access_token(as_dict=False)
  File "/usr/local/lib/python3.7/dist-packages/spotipy/oauth2.py", line 186, in get_access_token
    token_info = self._request_access_token()
  File "/usr/local/lib/python3.7/dist-packages/spotipy/oauth2.py", line 213, in _request_access_token
    error_description=error_payload['error_description'])

Is this something to do with authentication?

robrecord commented 4 years ago

Nevermind - I got a fresh ID and secret from https://developer.spotify.com/dashboard/applications/ and it works!

You may need to add the installation of those two python modules into your install script, though, in case other users have this issue.

robrecord commented 4 years ago

IMG_7961

robrecord commented 4 years ago

A new error:

Missing cached image, loading now..
Traceback (most recent call last):
  File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/robrecord/pidi-spotify/pidi_spotify/__main__.py", line 161, in <module>
    globals()[f"command_{command_fn}"](*command_args)
  File "/home/robrecord/pidi-spotify/pidi_spotify/__main__.py", line 104, in command_track
    with open(image_cache_path, "wb+") as f:
Gadgetoid commented 3 years ago

You should definitely check out this- https://github.com/pimoroni/pidi-spotify/pull/2

Since I think you're working with a version of PiDi Spotify that's already obsolete.

robrecord commented 3 years ago

I'm closing this as #2 fixes all my issues. Thank you!