spotify2tidal/spotify_to_tidal

KeyError: 'picture'

koraysels opened this issue · 3 comments

Traceback (most recent call last):
  File "/Users/koraysels/PycharmProjects/spotify_to_tidal/sync.py", line 299, in <module>
    tidal_session = open_tidal_session()
                    ^^^^^^^^^^^^^^^^^^^^
  File "/Users/koraysels/PycharmProjects/spotify_to_tidal/auth.py", line 48, in open_tidal_session
    future.result()
  File "/Users/koraysels/.pyenv/versions/3.11.1/lib/python3.11/concurrent/futures/_base.py", line 456, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/Users/koraysels/.pyenv/versions/3.11.1/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/Users/koraysels/.pyenv/versions/3.11.1/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/koraysels/.pyenv/versions/3.11.1/lib/python3.11/site-packages/tidalapi/session.py", line 364, in _process_link_login
    self.user = tidalapi.User(self, user_id=json['userId']).factory()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/koraysels/.pyenv/versions/3.11.1/lib/python3.11/site-packages/tidalapi/user.py", line 48, in factory
    return self.request.map_request('users/%s' % self.id, parse=self.parse)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/koraysels/.pyenv/versions/3.11.1/lib/python3.11/site-packages/tidalapi/request.py", line 118, in map_request
    return self.map_json(json_obj, parse=parse)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/koraysels/.pyenv/versions/3.11.1/lib/python3.11/site-packages/tidalapi/request.py", line 125, in map_json
    return parse(json_obj)
           ^^^^^^^^^^^^^^^
  File "/Users/koraysels/.pyenv/versions/3.11.1/lib/python3.11/site-packages/tidalapi/user.py", line 65, in parse
    return user.parse(json_obj)
           ^^^^^^^^^^^^^^^^^^^^
  File "/Users/koraysels/.pyenv/versions/3.11.1/lib/python3.11/site-packages/tidalapi/user.py", line 104, in parse
    super(LoggedInUser, self).parse(json_obj)
  File "/Users/koraysels/.pyenv/versions/3.11.1/lib/python3.11/site-packages/tidalapi/user.py", line 77, in parse
    self.picture_id = json_obj['picture']
                      ~~~~~~~~^^^^^^^^^^^
KeyError: 'picture'

cannot seem to get it working..

See upstream issue here and associated workaround. I'll update this repo when it gets fixed upstream, for now you'll need to patch your tidalapi version locally (e.g. by commenting out the offending line)

tamland/python-tidal#129

@koraysels This has now finally been fixed in the tidalapi. We will update the PyPI release ASAP.

Just confirmed, it all seems to be working as supposed with version 0.7.1.
Thanks @tehkillerbee.