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

Not working with LE11 and Kodi 20.0 (Nexus) #35

Open
jcjdammers opened this issue Jan 29, 2023 · 7 comments
Open

Not working with LE11 and Kodi 20.0 (Nexus) #35

jcjdammers opened this issue Jan 29, 2023 · 7 comments

Comments

@jcjdammers
Copy link

I just upgraded to LibreELEC 11 with Kodi 20.0 (Nexus) and the addon is no longer working for me.

@chrisgo67
Copy link

chrisgo67 commented Feb 11, 2023

I have it up and running on the nighly from 20230210.
Had to go through some log errors and patch the referenced lines in the .py files.

From top of my head:

In outh2.py:

    response = requests.post(self.OAUTH_TOKEN_URL, data=payload,
        headers=headers, verify=True, proxies=self.proxies)
    if response.status_code != 200:

(last line was if response.status.code is not 200 before)

In /storage/.kodi/addons/plugin.audio.spotify/resources/lib/cherrypy/_cpdispatch.py :

else:
getargspec = inspect.getfullargspec(callable)[:4]
# Python 3 requires using getfullargspec if
# keyword-only arguments are present
if hasattr(inspect, 'getfullargspec'):
def getargspec(callable):
return inspect.getfullargspec(callable)[:4]

(First line was: getargspec = getargspec(callable): before) (Not qiet clean hack - i know!)

@jobass44
Copy link

Same issue for me.
LibreELEC 11 with Kodi 20.0 on RPI 4.

Error appears after installation plugin.audio.spotify-1.2.3.zip through Kodi.
The plugin ask for web browser when launched and Spotify Android App do not see at all Kodi.

A fix would be great.

BlablaBloblo added a commit to BlablaBloblo/plugin.audio.spotify that referenced this issue Mar 11, 2023
BlablaBloblo added a commit to BlablaBloblo/plugin.audio.spotify that referenced this issue Mar 11, 2023
@jobass44
Copy link

Hi BlablaBloblo

I downloded te ZIP file on your branch here : https://github.com/BlablaBloblo/plugin.audio.spotify/tree/nexus
When I install it through Kodi (install from a zip file), Kodi says Spotify plugin installed successfully but immediatly an error occurs. Here is the log file to help you :

2023-03-12 17:47:20.032 T:31485 error : EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <class 'AttributeError'>
Error Contents: module 'inspect' has no attribute 'getargspec'
Traceback (most recent call last):
File "/storage/.kodi/addons/plugin.audio.spotify/service.py", line 13, in
from main_service import MainService
File "/storage/.kodi/addons/plugin.audio.spotify/resources/lib/main_service.py", line 14, in
from httpproxy import ProxyRunner
File "/storage/.kodi/addons/plugin.audio.spotify/resources/lib/httpproxy.py", line 4, in
import cherrypy
File "/storage/.kodi/addons/plugin.audio.spotify/resources/lib/cherrypy/init.py", line 71, in
from . import _cpdispatch as dispatch
File "/storage/.kodi/addons/plugin.audio.spotify/resources/lib/cherrypy/_cpdispatch.py", line 209, in
getargspec = inspect.getargspec(callable)[:4]
^^^^^^^^^^^^^^^^^^
AttributeError: module 'inspect' has no attribute 'getargspec'
-->End of Python script error report<--

After that, when I try to launch Spotify plugin, it still says "The default browser should not be open, follows the directions to authorize this app on Spotify".
I d'oint know if it's normal, there's no browser on Librelec, or I am missing something.
Do you have this behaviour ?

Anyway, I can't manage to have the plugin working well because of the error during install.
Any idea ?

Thanks for you response and I can test your commits whenever you want.
It would be fantastic to make running Spotify on LE 11 and Kodi 20.

@jcjdammers
Copy link
Author

Is there a fix already?
Please let me know, thanks.

@chrisgo67
Copy link

I can only say that it runs quiet fine with the above mentioned changes on my side.
The qad fix is not really clean I know. But I am not an addon developer.

@RolandFelnhofer
Copy link

RolandFelnhofer commented Jun 11, 2023

getargspec = inspect.getargspec(callable)[:4]
^^^^^^^^^^^^^^^^^^
AttributeError: module 'inspect' has no attribute 'getargspec'

Same for me!

I'm using it with Libreelec 11.0.1. It uses Python 3.11.2
Python versions > 3.7 do not support 'inspect.getargspec'.

Anyone here knows how to replace this function with one running under python 3.11.x?

@RolandFelnhofer
Copy link

RolandFelnhofer commented Jun 11, 2023

replacing line 209 of plugin.audio.spotify/resources/lib/cherrypy/_cpdispatch.py
- getargspec = inspect.getargspec(callable)[:4]
+ getargspec = inspect.getfullargspec(callable)[:4]

worked for me!

... a bit 'nicer' version:

--- _cpdispatch.py.ORI  2023-06-11 20:44:30.642732832 +0200
+++ _cpdispatch.py      2023-06-11 20:44:39.854773002 +0200
@@ -206,12 +206,13 @@
     def test_callable_spec(callable, args, kwargs):  # noqa: F811
         return None
 else:
-    getargspec = inspect.getargspec(callable)[:4]
     # Python 3 requires using getfullargspec if
     # keyword-only arguments are present
     if hasattr(inspect, 'getfullargspec'):
-        def getargspec(callable):
-            return inspect.getfullargspec(callable)[:4]
+        getargspec = inspect.getfullargspec(callable)[:4]
+    else:
+        getargspec = inspect.getargspec(callable)[:4]

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

4 participants