Skip to content
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

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

Open
paulomurray opened this issue May 17, 2021 · 4 comments

Comments

@paulomurray
Copy link

paulomurray commented May 17, 2021

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'

  • and it resolves the issue for this moment -
    but i have these variables already declared in the necessary areas - and i can check
    env | grep SPOTIPY
    and the variables are there

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
Copy link
Author

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
Copy link
Author

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 :)

@xenon0054
Copy link

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
Copy link
Collaborator

doris1347 commented Dec 10, 2022

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,69 and 78

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants