glk1001 / plugin.audio.spotify

Unofficial Spotify for Kodi Add-on updated for Kodi 19 and 20.
GNU General Public License v3.0
10 stars 4 forks source link

test_spotty searches for non-existent binary #2

Closed hsteininger closed 1 year ago

hsteininger commented 1 year ago

Hi,

i'm using:

NAME="LibreELEC" VERSION="11.0.1" LIBREELEC_ARCH="RPi4.arm" Chorus version 19.x-2.4.8 Kodi version 20.1

and installed your spotify-plugin (btw. thanks for continue the development).

But, i was not able to generate a Token.

in kodi.log i had these lines:

2023-08-14 14:38:51.190 T:10006    info <general>: plugin.audio.spotify:main_service:__init__ --> b'Spotify plugin version: 1.3.0.'
2023-08-14 14:38:51.207 T:10006    info <general>: plugin.audio.spotify:utils:get_spotty_binary --> b"Reported architecture: 'aarch64'."
2023-08-14 14:38:51.212 T:10006    info <general>: plugin.audio.spotify:utils:test_spotty --> b'Traceback (most recent call last):\n  File "/storage/.kodi/addons/plugin.audio.spotify/resources/lib/utils.py", line 385, in test_spotty\n    st = os.stat(binary_path)\n         ^^^^^^^^^^^^^^^^^^^^\nFileNotFoundError: [Errno 2] No such file or directory: \'/storage/.kodi/addons/plugin.audio.spotify/resources/lib/deps/spotty/arm-linux/spotty-hf\'\n'
2023-08-14 14:38:51.212 T:10006    info <general>: plugin.audio.spotify:utils:test_spotty --> b'Exception --> Test spotty binary error.'
2023-08-14 14:38:51.222 T:10006    info <general>: plugin.audio.spotify:utils:test_spotty --> b'Traceback (most recent call last):\n  File "/storage/.kodi/addons/plugin.audio.spotify/resources/lib/utils.py", line 393, in test_spotty\n    spotty = subprocess.Popen(\n             ^^^^^^^^^^^^^^^^^\n  File "/usr/lib/python3.11/subprocess.py", line 1024, in __init__\n  File "/usr/lib/python3.11/subprocess.py", line 1901, in _execute_child\nOSError: [Errno 8] Exec format error: \'/storage/.kodi/addons/plugin.audio.spotify/resources/lib/deps/spotty/x86-linux/spotty\'\n'
2023-08-14 14:38:51.222 T:10006    info <general>: plugin.audio.spotify:utils:test_spotty --> b'Exception --> Test spotty binary error.'
2023-08-14 14:38:51.225 T:10006    info <general>: plugin.audio.spotify:utils:get_spotty_binary --> b'Spotty: failed to detect architecture or platform not supported! Local playback will not be available.'
2023-08-14 14:38:51.226 T:10006    info <general>: plugin.audio.spotify:utils:__init__ --> b'Error while verifying spotty. Local playback is disabled.'
2023-08-14 14:38:51.231 T:10006    info <general>: plugin.audio.spotify:httpproxy:__init__ --> b"Set cherrypy host, port to '127.0.0.1:52308'."
2023-08-14 14:38:51.233 T:10011   error <general>: [14/Aug/2023:14:38:51] ENGINE Bus STARTING

2023-08-14 14:38:51.235 T:10011   error <general>: [14/Aug/2023:14:38:51] ENGINE Started monitor thread 'Autoreloader'.

2023-08-14 14:38:51.237 T:10006    info <general>: plugin.audio.spotify:main_service:__init__ --> b'Started webproxy at port 52308.'
2023-08-14 14:38:51.248 T:10006    info <general>: plugin.audio.spotify:main_service:renew_token --> b'Retrieving auth token....'
2023-08-14 14:38:51.250 T:10006    info <general>: plugin.audio.spotify:utils:get_token --> b"Couldn't request authentication token. Username/password error? If you're using a facebook account with Spotify, make sure to generate a device account/password in the Spotify accountdetails."
2023-08-14 14:38:51.338 T:10011   error <general>: [14/Aug/2023:14:38:51] ENGINE Serving on http://127.0.0.1:52308

2023-08-14 14:38:51.339 T:10011   error <general>: [14/Aug/2023:14:38:51] ENGINE Bus STARTED

2023-08-14 14:38:53.188 T:10006    info <general>: plugin.audio.spotify:main_service:close --> b'Shutdown requested!'
2023-08-14 14:38:53.222 T:10006   error <general>: [14/Aug/2023:14:38:53] ENGINE Bus STOPPING

2023-08-14 14:38:53.351 T:10006   error <general>: [14/Aug/2023:14:38:53] ENGINE HTTP Server cherrypy._cpnative_server.CPHTTPServer(('127.0.0.1', 52308)) shut down

2023-08-14 14:38:53.351 T:10006   error <general>: [14/Aug/2023:14:38:53] ENGINE Stopped thread 'Autoreloader'.

2023-08-14 14:38:53.352 T:10006   error <general>: [14/Aug/2023:14:38:53] ENGINE Bus STOPPED

2023-08-14 14:38:53.352 T:10006   error <general>: [14/Aug/2023:14:38:53] ENGINE Bus EXITING

2023-08-14 14:38:53.352 T:10006   error <general>: [14/Aug/2023:14:38:53] ENGINE Bus EXITED

2023-08-14 14:38:53.355 T:10006    info <general>: plugin.audio.spotify:main_service:close --> b'Stopped.'
2023-08-14 14:38:53.355 T:10006    info <general>: CPythonInvoker(271, /storage/.kodi/addons/plugin.audio.spotify/service.py): waiting on thread 3452949120
2023-08-14 14:38:53.446 T:10011   error <general>: [14/Aug/2023:14:38:53] ENGINE Waiting for child threads to terminate...

but i only had these files in that directory:

Kodi:~/.kodi/addons/plugin.audio.spotify/resources/lib/deps/spotty/arm-linux# ls -ltr
total 7716
-rwxr-xr-x    1 root     root       3888464 Aug  9 08:35 spotty-muslhf
-rw-r--r--    1 root     root       4011336 Aug  9 08:35 spotty

so i just created a softlink

$> ln -s spotty-muslhf spotty-hf

after enabling the plugin again, i got authenticated and the token was received.

2023-08-14 14:42:22.170 T:10043    info <general>: plugin.audio.spotify:utils:request_token_spotty --> b'request_token_spotty stdout: b\'{"accessToken":"MySecretToken","expiresIn":3600}\\n\''

So, maybe you want to change the check in

plugin.audio.spotify:utils:test_spotty

which searches for spotty-hf that isn't there or create a symlink, like i did.

Best, Herbert

glk1001 commented 1 year ago

Hi,

Thanks for raising this. I've just done a big refactor that included a fix that now checks for 'spotty-muslhf'. I've put the updated version in "plugin.audio.spotify-1.3.5.zip" on "https://glk1001.github.io/". If you can test this that would be great.

Thanks, Greg

hsteininger commented 1 year ago

Hi,

thanks for the fix, i'm out of office right now, will be back on monday and will then try to check.

Best.

hsteininger commented 1 year ago

Hi,

sorry didn't have much time in the last days, installed the update today and everything seems to work until now.

Thanks for fixing.

Best.

glk1001 commented 1 year ago

Thanks for checking!