Kodi Community Forum

Full Version: Spotify for Kodi
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey, this is a great addon, thank you very much. I use spotify for all my music so this is the one thing missing from my pi media centre.


The only thing thats not working for me (and i see other people saying it works for them) is music fan art. I get the thumbnail image from spotify of the current tracks cover art. However, the rest of the now playing is just a black screen. I suspect its not a plugin thing (related to this addon) but something else. Anyone able to point me in the right direction?

Many thanks, and thanks for the great addon.
Hi,

This has stopped working for me again, if i reboot my pc, i can play one or two songs, then if i go out of spotify, and back in, i get "cannot find a next item to play"

Please find my Debug Log here : http://paste.ubuntu.com/23805883/
(2017-01-12, 21:27)rollcry Wrote: [ -> ]Hello is there a chance to use a parameter for adjusting the audio quality like in spotimc:
class StreamQuality:
Low = 0
Medium = 1
High = 2

Atm not as it's hardcoded to HIGH but I can add it if really needed.
Just assumed everybody wants the high quality ;-)
(2017-01-11, 08:07)MrInternetJunkie Wrote: [ -> ]Can anyone please confirm if they have this addon running on Android and Krypton?

Thanks!

Shamefully bumping my own post in hope for a reply. Big Grin
Hello Marcelveldt,

I have tried the workaround you suggested (for Raspberry users), I have copied the cache file, and it worked for a while, but then after a couple of days the cache file is expiring, so need to do the same process again and again. Do you have some plans to fix this problem in the next release of Spotify?

Anyway it is interesting that other spotify application does not have this kind of problem, for instance "spotimc" needs only correct user name and password, and spotify premium account, but nothing needs to be done with the cache file, not even for the first try. However, I still would prefer to use Spotify app because on advantage on other features Smile, ... but what I say is ... there should be some solution, which can shortcut this extra cache file problem .... the way how spotimc does, it works fine Smile

Thanks in advance,

Attila
Hi all,

This plugin has been working great for some time for me but lately i have been unable to login.

I enter my username and password, the browser starts and it shows https://accounts.spotify.com/blablabla but the page stays blank.

Anyone have any idea?
Hi Marcelveldt,

thanks a lot for your work.

On my Raspi3, navigation through the addon is rather slow. Every step of going from MyMusic->Playlists->MyPlaylist takes 3 to 10 seconds to load. It feels like the lists are not cached at all.

I saw in an earlier post that you planned to integrate some form of caching. I was wondering if this has been done and if I could somehow verify, that caching is actually working.

Thanks
bnw
I can not run the plugin, when I open the kodi hangs and it shuts down.

I'm using, MAC OS X - KODI JARVIS
I tried but it did not work. I have not actually found the files listed.

(2016-12-29, 01:29)klaymen Wrote: [ -> ]
(2016-12-28, 13:54)marcelveldt Wrote: [ -> ]@klaymen: I think it will take some time before Kodi recognizes the update on the repo.
Any with my beta repo I indeed mean my private repo, so you're all set.

Thanks, I now got version 1.0.26...

And wow, it finally works! But not the new version fixed it, it was something else.... and I hope it also helps others with issues:

My problem was a pyspotify installation in my main Python. Because of this, "import spotify" related to pyspotify, instead of the spotify python module of the plugin. This is also the reason it failed to import MainLoop from spotify.py... there is no MainLoop in pyspotify, but there is a MainLoop in the plugin's own spotify module. A "pip uninstall pispotify" solved the problem. I started to believe I'm going crazy... In the end the 2 conflicting spotify modules with the same import name caused the headaches (at least mine)...

Note that there is also another Python Spotify module Spotipy; mgkday, I see in one of your log files a line "Error Type: <class 'spotipy.client.SpotifyException'>" - could it be you have spotipy installed in your main Python? Of course I might be wrong, and the plugins Spotify module actually is spotipy, and hence the spotify in the error message.
Decided to root one of my TV's to try to get this plugin running.
Now it doesn't complain about unsupported platform.
I'm however unable to log in.
It creates the username.cache file correctly I believe but it still doesn't work.

I get this error in the logs.
Code:
18:38:09.271 T:18446744071862570240  NOTICE: Spotify --> Your platform (armv7 System.Platform.Android)
18:38:09.327 T:18446744071862570240   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.OSError'>
                                            Error Contents: dlopen() error
                                            Traceback (most recent call last):
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.audio.spotify/spotifyservice.py", line 3, in <module>
                                                import resources.playbackservice as service
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.audio.spotify/resources/playbackservice.py", line 11, in <module>
                                                from spotify import MainLoop, ConnectionState, ErrorType, Bitrate, link
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.audio.spotify/resources/libs/spotify/__init__.py", line 10, in <module>
                                                import _spotify
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.audio.spotify/resources/libs/_spotify/__init__.py", line 1, in <module>
                                                import struct, os, ctypes, sys
                                              File "/home/jenkins/workspace/Android-ARM/tools/depends/xbmc-depends/arm-linux-androideabi-android-21/lib/python2.7/ctypes/__init__.py", line 450, in <module>
                                              File "/home/jenkins/workspace/Android-ARM/tools/depends/xbmc-depends/arm-linux-androideabi-android-21/lib/python2.7/ctypes/__init__.py", line 362, in __init__
                                            OSError: dlopen() error
                                            -->End of Python script error report<--
18:38:13.465 T:18446744072071860992   ERROR: GetDirectory - Error getting plugin://plugin.audio.spotify/
18:38:13.465 T:18446744072071860992   ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.audio.spotify/) failed
Any ideas?
(2017-01-17, 05:29)MrInternetJunkie Wrote: [ -> ]
(2017-01-11, 08:07)MrInternetJunkie Wrote: [ -> ]Can anyone please confirm if they have this addon running on Android and Krypton?

Thanks!

Shamefully bumping my own post in hope for a reply. Big Grin

Nope, I've this running on both S905X (Droibox 2G/16GB) and X64 Z8300(2G/32GB) Kodi V17 systems, both using Libreelec V7.95, not Android anymore. It does have an issue whereby it fails to load playlists, and all you can do is restart Kodi, 'systemctl restart kodi' from SSH, or pull the plug. Just thought I'd comment.... not the answer you wanted I guess Sad
(2017-01-16, 22:00)marcelveldt Wrote: [ -> ]
(2017-01-12, 21:27)rollcry Wrote: [ -> ]Hello is there a chance to use a parameter for adjusting the audio quality like in spotimc:
class StreamQuality:
Low = 0
Medium = 1
High = 2

Atm not as it's hardcoded to HIGH but I can add it if really needed.
Just assumed everybody wants the high quality ;-)

Thank you very much for this information - I only want to make sure High Quality. In this case there is noch need for further functionalities
(2016-12-09, 23:11)marcelveldt Wrote: [ -> ]
(2016-12-09, 23:08)awiouy Wrote: [ -> ]Hello,

I have tried your addon on LibreELEC 7.90.009 for Odroid C2.
Unfortunately, the aarch64 shared libraries provided with the addon are not compatible with the OS.
Is the source of the library available? If so, I could compile it for all variants of LibreELEC.

Thank you in advance for your attention
@

This has been discussed many, many times and also in the first post.
The libspotify SDK is outdated and not available for the latest platforms.

It's aiting for the spotify devs untill they release something newer or add playback support to the webapi.
Currently libspotify is only used for playback of tracks, all other stuff is already handled by the new webapi.

I have read that Spotify will shutdown their LibSpotify in 2017 finally:

Quote:Please note that we have removed the LibSpotify binaries from our website in an effort to phase out the usage of this deprecated library. LibSpotify has been considered deprecated since 2015 and will be shut down in 2017, so we want to ensure that all developers’ efforts and attention are focused on newer and better APIs that we actively support and maintain. These APIs include the Web API, iOS and Android SDKs, and upcoming embedded libraries for Windows, Mac OS X and Linux. More information regarding upcoming libraries will be provided in the coming months.
Source: https://developer.spotify.com/technologies/libspotify/

Because I want to make Spotify work on my Odroid C2... does this mean, that there is hope they release a new API for this kodi-addon soon?
so, ive got a problem that i think involves this addon but not 100%.. so hopefully the dev can see this and consider the possibilities, maybe has an idea.

so, i had my kodi (raspberry pi) setup all how i wanted it. Movies, TV, Youtube, Twitch and Spotify installed, nothing else. All worked great for about a week. Then all of a sudden, neither spotify, twitch or youtube would load anything (they wouldnt even load the folder lists). Just a generic HTTP Error, nothing special in the logs either.

Ive spent probably the best part of a week tearing my hair out trying to work it out. So tonight, i reinstalled everything, deleted all kodi data, and reinstalled. it all went well, youtube was working fine, twitch also. Installed Aeon Nox, all fine. Then, i tried to setup spotify, i put in my user and password, it sat on working. Then failed (raspberry pi so won't auth), i then copied my cache file to the correct location from a windows machine to the pi. Restarted kodi, tried to launch it and errored again. Then i noticed that youtube and twitch had both stopped working also.

so, i dunno entirely what causes it but between every change i made, on a brand new kodi install, i went and checked the youtube and twitch apps. They all worked up until the spotify error. Now, none of those addons will ever work at all. Just a generic HTTP Error (the most detailed thing in debug logs is error(0) )...

Now, i know this is for the pi and probably not technically supported but something really weird has to be going on if it manages to break two other plugins from loading anything. Its like its breaking all HTTP API calls (although i really done see how this is possible?).

Anyways, yeah im not trying to point blame, merely wanna work out what's is going on. Its super weird. I'm currently reinstalling everything again and leaving spotify out to see if the problem happens again. Hopefully this sparks some sort of idea and can be figured out.

Thanks,
Piercy



edit: After re-installing all again except for spotify everything is working as expected.
edit2: could this be related to the the requirement of a web browser? I know theres a work around with pi but maybe thats where its causing an issue?
First off, thank you for building the plugin! Works great. I also had the some query as klaymen. I wrote a custom Kodi skill for Alexa and would love to be able to playback songs and playlist by calling the json api. Do you have any plans to add support for it?
Thanks!

(2016-12-29, 18:14)klaymen Wrote: [ -> ]Now that I have the plugin running - and it works great, thanks a lot for your effort from myself as well! - I wonder if and how it can be controlled via the kodi json interface (port 9090)? What I mean, is it possible - or could it be added - to trigger functionalities directly via json commands, like

Code:
{"jsonrpc":"2.0","method":"Input.Down"}

for going down in a list, but for more complex actions of the plugin itself and not only the Kodi GUI, like starting to play a certain playlist? If this was possible, I could assign direct buttons on my Logitech remote control, or wall buttons, to it and include Spotify in my home automation setup. I'm not too familiar with the Kodi concept if it comes to these things and don't know how this relates to the "plugin://plugin.audio.spotify/?action=add_track_to_playlist" and similar things mentioned elsewhere - these look like Kodi internal representations that can't be triggered via the TCP port, or am I wrong there?

Thanks, Andy