Valentin271 / DeezerKodi

Deezer client for Kodi
GNU General Public License v3.0
24 stars 4 forks source link

Exception class 'KeyError' on trying to play a track #20

Open FA85 opened 1 year ago

FA85 commented 1 year ago

Hi,

thanks for your work on bringing Deezer to Kodi. After I freshly installed DeezerKodi 1.0.0 on LibreElec 10.0.3 on a RPi4 I run into the following error message in the logs. I got a Deezer Premium account and can browse my playlists etc., but playback fails everytime with any song.

2022-12-09 23:54:49.807 T:2329     INFO <general>: DeezerKodi: Starting DeezerKodi v1.0.0
2022-12-09 23:54:49.807 T:2329     INFO <general>: DeezerKodi: Initializing router with location /tracks/1958028657/play
2022-12-09 23:54:49.807 T:2329     INFO <general>: DeezerKodi: Connection: Requesting streaming for track with id 1958028657 ...
2022-12-09 23:54:49.978 T:2329    ERROR <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                                    - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                                   Error Type: <class 'KeyError'>
                                                   Error Contents: 'code'
                                                   Traceback (most recent call last):
                                                     File "/storage/.kodi/addons/plugin.audio.deezer/addon.py", line 13, in <module>
                                                       APP.run()
                                                     File "/storage/.kodi/addons/plugin.audio.deezer/app/application.py", line 52, in run
                                                       items = self.__router.route(self)
                                                     File "/storage/.kodi/addons/plugin.audio.deezer/app/http/router.py", line 56, in route
                                                       return action(**parameters)
                                                     File "/storage/.kodi/addons/plugin.audio.deezer/app/actions/tracks_actions.py", line 20, in play
                                                       url = Api.instance().request_streaming(identifiant)
                                                     File "/storage/.kodi/addons/plugin.audio.deezer/app/http/api.py", line 215, in request_streaming
                                                       self._obtain_access_token()
                                                     File "/storage/.kodi/addons/plugin.audio.deezer/app/http/api.py", line 132, in _obtain_access_token
                                                       Api.check_error(response)
                                                     File "/storage/.kodi/addons/plugin.audio.deezer/app/http/api.py", line 238, in check_error
                                                       ApiExceptionFinder.from_error(response['error'])
                                                     File "/storage/.kodi/addons/plugin.audio.deezer/lib/exceptions/__init__.py", line 26, in from_error
                                                       if exception.CODE == error['code']:
                                                   KeyError: 'code'
                                                   -->End of Python script error report<--

2022-12-09 23:54:50.171 T:2329     INFO <general>: Python interpreter stopped
2022-12-09 23:54:50.194 T:1455    ERROR <general>: Playlist Player: skipping unplayable item: 245, path [plugin://plugin.audio.deezer/?path=%2Ftracks%2F1958028657%2Fplay]

I read about a similar problem in #13 and that you may have fixed it. Maybe I'm running into the same...?

Regards, FA85

Valentin271 commented 1 year ago

Hello,

I couldn't find the root cause of the problem because I don't have enough information. I have fixed the specific error you posted, which occured while handling the real error.

I'll have more information when you update to v1.0.1.