ldsz / plugin.audio.spotify

Unofficial spotify plugin for Kodi 19
GNU General Public License v3.0
47 stars 17 forks source link

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

Open jcjdammers opened 1 year ago

jcjdammers commented 1 year ago

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

chrisgo67 commented 1 year ago

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 commented 1 year ago

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.

jobass44 commented 1 year ago

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<--

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 commented 1 year ago

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

chrisgo67 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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]