kodi-community-addons / plugin.audio.spotify

Unofficial spotify plugin for Kodi
GNU General Public License v3.0
295 stars 103 forks source link

The plugin suddenly stopped working... #157

Open ponczek666 opened 3 years ago

ponczek666 commented 3 years ago

Hi,

First of all thank you very much for your work. I love the plugin and I've been using it constantly for a long time now. The problem is the plugin suddenly stopped working... I'm using version 1.1.59 on Kodi 17.3 (openelec to be precise) and I'm getting th "please connect to this device or enter your credentials" info whenever I power up the plugin. I did not change anything to the openelec version or the plugin version... The only change I can think of in the infrastructure was I started to use WIFI to connect the HTPC to the network, not the wired connection... The log file says this ...

06:26:23.490 T:140176684726016 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--

Brg, Adam

ponczek666 commented 3 years ago

Btw I tried reinstalling, tried version 1.1.58... issue still here :(

jfhbrook commented 2 years ago

The issue is happening here:

https://github.com/kodi-community-addons/plugin.audio.spotify/blob/master/resources/lib/utils.py#L154-L155

What's going on here is that it's trying to parse JSON results from the output of spotty using eval(), and the line isn't valid Python.

I would start with a fix by replacing the eval() call with a json.loads call. This will make it handle payloads which aren't valid Python but which are valid JSON. If that still crashes, you can catch the exception (it's a JSONDecodeError on Matrix) and go ham on logging to see what spotty is actually giving you.

Cheers!