open
nobody
None
2019-01-22
2019-01-19
Anonymous
No

Hello from Germany,

when i will create a spotify token
that takes, when i copy the url

Traceback (most recent call last):
File "./spotiauthinit.py", line 30, in
data = sp.current_user_recently_played()
File "/tmp/upmpdcli-spotify-authinit/spotipy/client.py", line 696, in current_user_recently_played
return self._get('me/player/recently-played', limit=limit)
File "/tmp/upmpdcli-spotify-authinit/spotipy/client.py", line 154, in _get
return self._internal_call('GET', url, payload, kwargs)
File "/tmp/upmpdcli-spotify-authinit/spotipy/client.py", line 108, in _internal_call
headers = self._auth_headers()
File "/tmp/upmpdcli-spotify-authinit/spotipy/client.py", line 91, in _auth_headers
token_info = self._auth.get_cached_token()
AttributeError: 'str' object has no attribute 'get_cached_token'

Debian Stretch clean install with gui

can you help me

many thanks

Discussion

  • medoc
    medoc
    2019-01-20

    Oops. Please re-download the zip file, it should be ok now.

     
  • Anonymous
    Anonymous
    2019-01-20

    Many thanks, but

    Traceback (most recent call last):
    File "./spotiauthinit.py", line 30, in
    data = sp.current_user_recently_played()
    File "/root/Downloads/upmpdcli-spotify-authinit/spotipy/client.py", line 696, in current_user_recently_played
    return self._get('me/player/recently-played', limit=limit)
    File "/root/Downloads/upmpdcli-spotify-authinit/spotipy/client.py", line 154, in _get
    return self._internal_call('GET', url, payload, kwargs)
    File "/root/Downloads/upmpdcli-spotify-authinit/spotipy/client.py", line 108, in _internal_call
    headers = self._auth_headers()
    File "/root/Downloads/upmpdcli-spotify-authinit/spotipy/client.py", line 91, in _auth_headers
    token_info = self._auth.get_cached_token()
    AttributeError: 'str' object has no attribute 'get_cached_token'

    Sorry

     
  • medoc
    medoc
    2019-01-20

    This is weird. Can you check the spotipy/util.py file, it should end with:

        # Auth'ed API request
        if token_info:
            return sp_oauth
        else:
            return None
    

    the previous version had

        if token_info:
            return token_info['access_token']
        else:
            return None
    
     
  • Anonymous
    Anonymous
    2019-01-21

    Sorry,

    util.py is ok but

    Traceback (most recent call last):
    File "./spotiauthinit.py", line 30, in
    data = sp.current_user_recently_played()
    File "/root/Downloads/upmpdcli-spotify-authinit/spotipy/client.py", line 696, in current_user_recently_played
    return self._get('me/player/recently-played', limit=limit)
    File "/root/Downloads/upmpdcli-spotify-authinit/spotipy/client.py", line 154, in _get
    return self._internal_call('GET', url, payload, kwargs)
    File "/root/Downloads/upmpdcli-spotify-authinit/spotipy/client.py", line 108, in _internal_call
    headers = self._auth_headers()
    File "/root/Downloads/upmpdcli-spotify-authinit/spotipy/client.py", line 91, in _auth_headers
    token_info = self._auth.get_cached_token()
    AttributeError: 'str' object has no attribute 'get_cached_token'

    Cliff

     
  • medoc
    medoc
    2019-01-21

    Please make a zip out of /root/Downloads/upmpdcli-spotify-authinit and attach it. If util.py returns a SpotifyOAuth object, it can't become an str in client.py...

     
  • Anonymous
    Anonymous
    2019-01-22

    Hello,

    if I run it user I have no more error messages. but do not get spotify in an upnp app.

    1. install deb from mopidy
    2. change values in upmpdcli.conf
    3. Copy xxxx.token to / var / cache / upmpdcli / spotify / token

    service upmpdcli restart

     
    Attachments
  • medoc
    medoc
    2019-01-22

    About the tar file: as you can check for yourself, util.py ends with:

       # Auth'ed API request
        if token_info:
            return token_info['access_token']
        else:
            return None
    

    Meaning in the wrong version.

    I guess that you ended up downloading and extracting the right version some place else and that this one worked, so that you have an access token.

    To make sure that the bad version is not used again, you should remove it with something like

    sudo rm -rf /root/Downloads/upmpdcli-spotify-authinit
    

    Then to check what is going wrong now, I think that the best approach would be to run upmpdcli from the command line and save the output:

    sudo systemctl stop upmpdcli
    sudo upmpdcli -c /etc/upmpdcli.conf > /tmp/trace 2>&1
    

    Then

    • try the spotify operation, then
    • exit upmpdcli with ^C
    • have a look at /tmp/trace to make sure that your password is not printed in there,
    • attach the file here or send it to me by email (jf@dockes.org).
     

Cancel   Add attachment