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

The plugin suddenly stopped working... #157

Open
ponczek666 opened this issue Mar 14, 2021 · 2 comments
Open

The plugin suddenly stopped working... #157

ponczek666 opened this issue Mar 14, 2021 · 2 comments

Comments

@ponczek666
Copy link

ponczek666 commented Mar 14, 2021

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<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.SyntaxError'>
Error Contents: unexpected EOF while parsing (, line 0)
Traceback (most recent call last):
File "/storage/.kodi/addons/plugin.audio.spotify/service.py", line 14, in
MainService()
File "/storage/.kodi/addons/plugin.audio.spotify/resources/lib/main_service.py", line 60, in init
self.renew_token()
File "/storage/.kodi/addons/plugin.audio.spotify/resources/lib/main_service.py", line 155, in renew_token
username = self.get_username()
File "/storage/.kodi/addons/plugin.audio.spotify/resources/lib/main_service.py", line 122, in get_username
username = self.spotty.get_username()
File "/storage/.kodi/addons/plugin.audio.spotify/resources/lib/utils.py", line 523, in get_username
data = eval(data)
File "", line 0

                                            ^
                                        SyntaxError: unexpected EOF while parsing
                                        -->End of Python script error report<--

Brg,
Adam

@ponczek666
Copy link
Author

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

@jfhbrook
Copy link

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!

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

2 participants