Hi guys,
I now gave it a try, but I'm having problems installing it on my Raspberry using Kodi (osmc with confluence skin).
I did additionally install the plugin under Windows, where it works, and copied over the xyz.cache file to ~/.kodi/userdata/addon_data/plugin.audio.spotify/xyz.cache. But I think my problem starts earlier...
One thing I noticed there - not sure if it is relevant - is that the corresponding directory in Windows has an additional libspotify folder, which is not there in the raspberry version. But I suspect this directory is not created until a successful login occurs (not sure though, I thought I mention it). The settings.xml is identical on Windows and the Raspberry, and of course the cache file too.
When I start the plugin, it just says "Working" for some time, and then returns a "Login Error" (but of course the password is correct, I see it in settings.xml, and it works in the windows version). I enabled debug logging, and that's the output I get:
Code:
21:29:00 366.946259 T:1956275120 DEBUG: CGUIMediaWindow::GetDirectory (plugin://plugin.audio.spotify/)
21:29:00 366.946472 T:1956275120 DEBUG: ParentPath = [addons://sources/audio/]
21:29:00 366.948914 T:1565504496 DEBUG: StartScript - calling plugin Spotify('plugin://plugin.audio.spotify/','1','')
21:29:00 366.949371 T:1506800624 DEBUG: Thread LanguageInvoker start, auto delete: false
21:29:00 366.950256 T:1565504496 DEBUG: WaitOnScriptResult - waiting on the Spotify (id=5) plugin...
21:29:00 366.950592 T:1506800624 INFO: initializing python engine.
21:29:00 366.950958 T:1506800624 DEBUG: CPythonInvoker(5, /home/osmc/.kodi/addons/plugin.audio.spotify/plugin.py): start processing
21:29:01 367.264618 T:1506800624 DEBUG: -->Python Interpreter Initialized<--
21:29:01 367.265198 T:1506800624 DEBUG: CPythonInvoker(5, /home/osmc/.kodi/addons/plugin.audio.spotify/plugin.py): the source file to load is "/home/osmc/.kodi/addons/plugin.audio.spotify/plugin.py"
21:29:01 367.266235 T:1506800624 DEBUG: CPythonInvoker(5, /home/osmc/.kodi/addons/plugin.audio.spotify/plugin.py): setting the Python path to /home/osmc/.kodi/addons/plugin.audio.spotify:/home/osmc/.kodi/addons/script.module.requests/lib:/home/osmc/.kodi/addons/script.module.six/lib:/usr/share/kodi/addons/script.module.simplejson/lib:/usr/share/kodi/addons/script.module.unidecode/lib:/usr/lib/python2.7:/usr/lib/python2.7/plat-arm-linux-gnueabihf:/usr/lib/python2.7/lib-tk:/usr/lib/python2.7/lib-old:/usr/lib/python2.7/lib-dynload:/usr/local/lib/python2.7/dist-packages:/usr/lib/python2.7/dist-packages:/usr/lib/python2.7/dist-packages/PILcompat:/usr/lib/python2.7/dist-packages/gtk-2.0:/usr/lib/pymodules/python2.7
21:29:01 367.266541 T:1506800624 DEBUG: CPythonInvoker(5, /home/osmc/.kodi/addons/plugin.audio.spotify/plugin.py): entering source directory /home/osmc/.kodi/addons/plugin.audio.spotify
21:29:01 367.266815 T:1506800624 DEBUG: CPythonInvoker(5, /home/osmc/.kodi/addons/plugin.audio.spotify/plugin.py): instantiating addon using automatically obtained id of "plugin.audio.spotify" dependent on version 2.1.0 of the xbmc.python api
21:29:01 367.448547 T:1956275120 DEBUG: ------ Window Init (DialogBusy.xml) ------
21:29:03 369.264832 T:1506800624 DEBUG: Spotify --> waiting for service...
21:29:03 369.274445 T:1536885744 DEBUG: Thread LanguageInvoker start, auto delete: false
21:29:03 369.274750 T:1536885744 INFO: initializing python engine.
21:29:03 369.274872 T:1536885744 DEBUG: CPythonInvoker(6, /home/osmc/.kodi/addons/plugin.audio.spotify/spotifyservice.py): start processing
21:29:03 369.571014 T:1536885744 DEBUG: -->Python Interpreter Initialized<--
21:29:03 369.571381 T:1536885744 DEBUG: CPythonInvoker(6, /home/osmc/.kodi/addons/plugin.audio.spotify/spotifyservice.py): the source file to load is "/home/osmc/.kodi/addons/plugin.audio.spotify/spotifyservice.py"
21:29:03 369.572327 T:1536885744 DEBUG: CPythonInvoker(6, /home/osmc/.kodi/addons/plugin.audio.spotify/spotifyservice.py): setting the Python path to /home/osmc/.kodi/addons/plugin.audio.spotify:/home/osmc/.kodi/addons/script.module.requests/lib:/home/osmc/.kodi/addons/script.module.six/lib:/usr/share/kodi/addons/script.module.simplejson/lib:/usr/share/kodi/addons/script.module.unidecode/lib:/usr/lib/python2.7:/usr/lib/python2.7/plat-arm-linux-gnueabihf:/usr/lib/python2.7/lib-tk:/usr/lib/python2.7/lib-old:/usr/lib/python2.7/lib-dynload:/usr/local/lib/python2.7/dist-packages:/usr/lib/python2.7/dist-packages:/usr/lib/python2.7/dist-packages/PILcompat:/usr/lib/python2.7/dist-packages/gtk-2.0:/usr/lib/pymodules/python2.7
21:29:03 369.572510 T:1536885744 DEBUG: CPythonInvoker(6, /home/osmc/.kodi/addons/plugin.audio.spotify/spotifyservice.py): entering source directory /home/osmc/.kodi/addons/plugin.audio.spotify
21:29:03 369.572693 T:1536885744 DEBUG: CPythonInvoker(6, /home/osmc/.kodi/addons/plugin.audio.spotify/spotifyservice.py): instantiating addon using automatically obtained id of "plugin.audio.spotify" dependent on version 2.1.0 of the xbmc.python api
21:29:04 370.440186 T:1506800624 DEBUG: Spotify --> waiting for service...
21:29:04 370.578491 T:1536885744 NOTICE: Spotify --> Your platform (armv7 System.Platform.Linux)
21:29:04 371.072784 T:1536885744 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.ImportError'>
Error Contents: cannot import name MainLoop
Traceback (most recent call last):
File "/home/osmc/.kodi/addons/plugin.audio.spotify/spotifyservice.py", line 3, in <module>
import resources.playbackservice as service
File "/home/osmc/.kodi/addons/plugin.audio.spotify/resources/playbackservice.py", line 11, in <module>
from spotify import MainLoop, ConnectionState, ErrorType, Bitrate, link
ImportError: cannot import name MainLoop
-->End of Python script error report<--
21:29:04 371.074036 T:1956275120 DEBUG: ------ Window Init (DialogKaiToast.xml) ------
21:29:04 371.243042 T:1536885744 INFO: Python script stopped
21:29:04 371.243256 T:1536885744 DEBUG: Thread LanguageInvoker 1536885744 terminating
21:29:05 371.441132 T:1506800624 DEBUG: Spotify --> waiting for service...
21:29:10 376.463623 T:1956275120 DEBUG: Previous line repeats 5 times.
21:29:10 376.463806 T:1956275120 DEBUG: ------ Window Deinit (DialogKaiToast.xml) ------
21:29:11 377.443024 T:1506800624 DEBUG: Spotify --> waiting for service...
21:29:18 384.581482 T:1793315824 DEBUG: Previous line repeats 7 times.
21:29:18 384.581757 T:1793315824 DEBUG: script.module.osmcsetting.updates : - blurp 230 - DialogBusy.xml
21:29:19 385.448730 T:1506800624 DEBUG: Spotify --> waiting for service...
21:29:28 394.331543 T:1956275120 DEBUG: Previous line repeats 8 times.
21:29:28 394.331909 T:1956275120 DEBUG: SECTION:UnloadDelayed(DLL: special://xbmcbin/system/ImageLib-arm.so)
21:29:28 394.453918 T:1506800624 DEBUG: Spotify --> waiting for service...
21:29:30 396.949585 T:1713370096 DEBUG: Previous line repeats 2 times.
21:29:30 396.949982 T:1713370096 DEBUG: Thread JobWorker 1713370096 terminating (autodelete)
21:29:31 397.459320 T:1506800624 DEBUG: Spotify --> waiting for service...
21:29:53 419.477203 T:1506800624 DEBUG: Previous line repeats 22 times.
21:29:53 419.477844 T:1506800624 DEBUG: POParser: loaded 34 strings from file /home/osmc/.kodi/addons/plugin.audio.spotify/resources/language/English/strings.po
21:29:53 419.487396 T:1956275120 DEBUG: ------ Window Init (DialogOK.xml) ------
21:29:53 419.487579 T:1956275120 INFO: Loading skin file: DialogOK.xml, load type: KEEP_IN_MEMORY
21:30:06 432.919556 T:1956275120 DEBUG: ------ Window Deinit (DialogOK.xml) ------
21:30:06 432.930664 T:1565504496 DEBUG: WaitOnScriptResult- plugin returned successfully
21:30:06 432.930908 T:1506800624 INFO: CPythonInvoker(5, /home/osmc/.kodi/addons/plugin.audio.spotify/plugin.py): script successfully run
It seems the "from spotify import MainLoop, ConnectionState, ErrorType, Bitrate, link" line in playbackservice.py does not work... I actually tried a "sudo find / -name spotify.py -print", and it does not return anything. This python file does not seem to be present on my system.... I do have a /usr/local/lib/python2.7/dist-packages/spotify/ directory though, "pip install pyspotify" does not fix the problem (it says it's already present). Here an interactive output:
Code:
>>> from spotify import ConnectionState, ErrorType, Bitrate, link
>>> from spotify import MainLoop
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name MainLoop
>>>
Actually even on my Mac (without anything else installed), when I do a "pip install pyspotify", it is installed, but a manual import check like above gives exactly the same result. Also, spotify.__dict__ does not contain MainLoop... I think I'm missing something trivial - maybe a dependency?
Thanks, Andy