dupontgu / retro-ipod-spotify-client

The software that powers the sPot: a 4th generation "Click Wheel" iPod with a full Spotify client.
Apache License 2.0
928 stars 94 forks source link

Spotifypod Doesnt Pull Content - Variables are not being stored - and token always expires #40

Open paulomurray opened 3 years ago

paulomurray commented 3 years ago

hi

so my issues at this juncture

  1. the autostart for spotifypod does not work for me - simply goes to Pi desktop - all the steps are taken in this readme and beyond but it just doesnt autostart

so i end up running - python3 Spotifypod.py and each time i will get the same series of errors

ERROR 1- it will say the access token has expired so i take the steps to "https://accounts.spotify.com/authorize?client_id=....." in PI BROWSER - it returns the callback to the REDIRECT URL - and I can ENTER THE URL into the Spotifypod.py when it requests "what is the URL Spotify redirected you to"

I have a .CACHE file - and it reads logically - showing the Access Token, Refresh Token, Timeout, Scopes.

i have also generated an access token through "Curl -h Authorization" direct to spotify/api/token this will deliver an access token as well - and i can replace the contents of the .cache file in FRONTEND folder and it will resolve the expired token issue

but again - within the hour i will experience the same error - "invalid access token"

ERROR 2 - once i am past the invalid token error - i will get an error that states i must declare my CLIENT ID

here is the error "spotipy.oauth2.SpotifyOauthError: No client_id. Pass it or set a SPOTIPY_CLIENT_ID environment variable."

so set these AGAIN export SPOTIPY_CLIENT_ID='XXXXX' export SPOTIPY_CLIENT_SECRET='XXXXX' export SPOTIPY_REDIRECT_URI='XXXXX'

so why does it forget each time i do the SPOTIFYPOD.PY?

ERROR 3 - tkinter cannot display on localhost:10.1

so i AGAIN enter the following

"export DISPLAY=:0.0" and this resolves this issue

ERROR 4 - so now i run the Spotifypod.py and the SPOT screen renders and i see the following - see screenshot

STRW4547

this is great - i finally get this SPOT to function and display however when you navigate to the any of these items - for example PLAYLISTS - everything is EMPTY there is nothing underneath

meanwhile - the Spotifypod.py is still running in PUTTY and these errors are generating

"return SinglePlaylistPage(self.playlists[index], self) IndexError: list index out of range"

or other times

"no ints no ints Exception in Tkinter callback Traceback (most recent call last): File "/usr/lib/python3.7/tkinter/init.py", line 1705, in call return self.func(args) File "spotifypod.py", line 454, in onKeyPress onSelectPressed() File "spotifypod.py", line 517, in onSelectPressed page = page.nav_select() File "/home/pi/retro-ipod-spotify-client/frontend/view_model.py", line 260, in nav_select return self.page_at(self.index) File "/home/pi/retro-ipod-spotify-client/frontend/view_model.py", line 384, in page_at artist = spotify_manager.DATASTORE.getArtist(index) File "/home/pi/retro-ipod-spotify-client/frontend/datastore.py", line 103, in getArtist return pickle.loads(pickled_pl) TypeError: a bytes-like object is required, not 'NoneType' Exception in Tkinter callback Traceback (most recent call last): File "/usr/lib/python3.7/tkinter/init.py", line 1705, in call return self.func(args) File "spotifypod.py", line 454, in onKeyPress onSelectPressed() File "spotifypod.py", line 517, in onSelectPressed page = page.nav_select() File "/home/pi/retro-ipod-spotify-client/frontend/view_model.py", line 260, in nav_select return self.page_at(self.index) File "/home/pi/retro-ipod-spotify-client/frontend/view_model.py", line 384, in page_at artist = spotify_manager.DATASTORE.getArtist(index) File "/home/pi/retro-ipod-spotify-client/frontend/datastore.py", line 103, in getArtist return pickle.loads(pickled_pl) TypeError: a bytes-like object is required, not 'NoneType'"

does anyone have any clues as to how to resolve the above ?

thanks in advance paulo

paulomurray commented 3 years ago

OK

so i have solved the issue of ENV variables being SAVED ETERNALLY in the PI i just added the variables to them ETC/ENVIRONMENT

so the DISPLAY works and the IDS for SPOTIFY and SPOTIPY are set each time i reboot

however i still have this issue the sPOT will LAuNCH and NOW PLAYING will be playing music i am listening to in computer for example so the connection is working but the INDEX IS OUT OF RANGE and there are no ARTISTS or PLAYLISTS or any INDICES displayed

"return SinglePlaylistPage(self.playlists[index], self) IndexError: list index out of range" ??

any advise why the index is out of range? the VIEW_MODEL.PY is simple - SELF.INDEX = 0 that was original code?

anyone have this isue?

paulomurray commented 3 years ago

ok i continue to troubleshoot and try different things

"return SinglePlaylistPage(self.playlists[index], self) IndexError: list index out of range"

this error is due to NO REFRESH OF DATA this is in the README file - but i only uncommented #spotify_manager.refresh_devices(), as i misread the additional spotify_manager.refresh_data()

when i correctly followed step number 11 in README it worked - but it did TIMEOUT

HERE IS THE NEW PROBLEM when i attempt to play a song or playlist i get this error

playing spotify:playlist:29PsqPqwo71yUQzyaryJOf spotify:track:3OdCM4mNHCva1AjihjcaUQ error! no devices

anyone know why i get this error

hoping this running commentary helps someone and someone can assist me :)

xenon0054 commented 2 years ago

ok

i continue to troubleshoot and try different things

"return SinglePlaylistPage(self.playlists[index], self)

IndexError: list index out of range"

this error is due to NO REFRESH OF DATA

this is in the README file - but i only uncommented #spotify_manager.refresh_devices(),

as i misread the additional spotify_manager.refresh_data()

when i correctly followed step number 11 in README

it worked - but it did TIMEOUT

  • thru error in connectionpool.py

  • so i replace the DEFAULT.TIMEOUT with explicit timeout="1200"

  • giving it 20 minutes to load

  • it took a couple minutes to refresh all the playlists and artists and such

  • and the full library is now displaying

HERE IS THE NEW PROBLEM

when i attempt to play a song or playlist

i get this error

playing spotify:playlist:29PsqPqwo71yUQzyaryJOf spotify:track:3OdCM4mNHCva1AjihjcaUQ

error! no devices

anyone know why i get this error

hoping this running commentary helps someone

and someone can assist me :)

Hello I'm also stuck on

playing spotify:playlist:5rXvAMHLUmJ83Qyeq4YSuN spotify:track:1VcEVxnZN3OeubcwPvI7MN error! no devices

Did you end up finding the solution?

doris1347 commented 1 year ago

ok i continue to troubleshoot and try different things

"return SinglePlaylistPage(self.playlists[index], self) IndexError: list index out of range"

this error is due to NO REFRESH OF DATA this is in the README file - but i only uncommented #spotify_manager.refresh_devices(), as i misread the additional spotify_manager.refresh_data()

when i correctly followed step number 11 in README it worked - but it did TIMEOUT

  • thru error in connectionpool.py
  • so i replace the DEFAULT.TIMEOUT with explicit timeout="1200"
  • giving it 20 minutes to load
  • it took a couple minutes to refresh all the playlists and artists and such
  • and the full library is now displaying

HERE IS THE NEW PROBLEM when i attempt to play a song or playlist i get this error

playing spotify:playlist:29PsqPqwo71yUQzyaryJOf spotify:track:3OdCM4mNHCva1AjihjcaUQ error! no devices

anyone know why i get this error

hoping this running commentary helps someone and someone can assist me :)

See Issues 65,66 and 69