[HowTo] Spotlight installation (Spotify Client)


#1

#Prerequisites
You need a PREMIUM account nothing else works since Spotify doesn’t allow ARM devices to use free accounts for streaming this is their policy so complain to Spotify and not the developers about free not working.

And if it doesn’t work after you followed these steps report it to appropriate developers, i can try to help but i only have limited time to do support work.

For Spotlight support use this link
https://bitbucket.org/re/spotlight/issues?status=new&status=open

For Pyspotify support use this link

#Step 1
You need to install dependencies in order for Spotlight to work you need to SSH your OSMC installation make sure SSH is enabled under MyOSMC settings then enter your credentials (defualt username is osmc and default password is osmc) if your having problems with this step google it this is pretty basic stuff.

##Installing from apt-repo
copy the content underneath as install_pyspotify.sh using nano or vim then do

sudo chmod +x  install_pyspotify.sh 
./install_pyspotify.sh

Or type in the commands separately in terminal

 #!/bin/bash
if [ $USER != root ]; then
            echo "run as a root" 
            exit 0
fi
apt-get update
apt-get install -y -qq python-spotify
exit

##Compiling from source
This is intended for more advanced users. Copy the content underneath as install_pyspotify.sh then do

sudo chmod +x  install_pyspotify.sh 
./install_pyspotify.sh

Or type in the commands separately in terminal.

 #!/bin/bash
    if [ $USER != root ]; then
            echo "run as a root" 
            exit 0
    fi
    wget -q -O - http://apt.mopidy.com/mopidy.gpg | sudo apt-key add -
    echo "deb http://apt.mopidy.com/ stable main contrib non-free" >> /etc/apt/sources.list
    echo "deb-src http://apt.mopidy.com/ stable main contrib non-free" >> /etc/apt/sources.list
    apt-get update
    apt-get install -y -qq libspotify-dev python-dev libffi-dev python-pip build-essential
    pip install pyspotify
    exit

#Step two
now its time to install the plugin for Kodi

[Download Repo][1][1]: https://bitbucket.org/re/spotlight/get/c045c7a8c338.zip

next step is to install spotlight it all depends on what hardware your running rpi 1 use the plain spotlight files if your running rpi 2 or other use the experimental arm7 version.

install the addon and follow these instructions to the letter don’t rush

Installation
Download zip file from Downloads section.
In XBMC go to System > Add-ons > Install from zip file.
Select downloaded zip and confirm.
Add-on will start running in background. Now you need to provide your Premium account credentials:
Go to Music > Music Add-ons.
Access Spotlight context menu (right click).
Select Add-on settings.
Enter credentials in Account category.
Edit playback settings if needed.
Restart XBMC!

Troubleshooting Vero users have reported that they need to apply a patch for it to work
This patch applies to plugin.audio.spotlight-1.2.0-armv7-experimental.zip not later versions…

#!/bin/bash
    if [ $USER != root ]; then
        echo "run as a root" 
        exit 0
   fi
    
wget https://bitbucket.org/re/spotlight/issue-attachment/18/re/spotlight/1401991471.02/18/0001-Prepend-internal-libraries-to-the-python-path.patch
patch < 0001-Prepend-internal-libraries-to-the-python-path.patch

this small script should take care of that issue this patch might also apply to troubling rpi2 installations.

Finally go to Music > Music Add-ons > Spotlight and enjoy!
Spotlight service add-on uses port 8000 by default. If it is in conflict with your other servers you can change it in Advanced settings.

if it still doesnt work after this try changing port of the client under addon settings for Spotlight, dont forget to REBOOT after changing port.

This should cover how to install and get a working Spotify client for Kodi / OSMC

Tested on RPI2 / OSMC Final June version 2015

Should work on vero and rpi 1/2


Spotify + OSMC = <3
Is it possible to run a webserver on OSMC?
#2

Will it work on Vero, or is this a RPi specific tutorial?


#3

It should work on vero too nothing here is rpi specific

there was a vero user that had a little issue


#4

OK, thanks.


#5

not working for me, I keep on getting an error saying it can’t connect (111)
tried it on a clean install as well
First got an error:

E: Unable to locate package rpi-update E: Unable to locate package upmpdcli
tried step 1 from source, this finished
next, installed the plugin.audio.spotlight-1.2.0-armv7-experimental.zip as i’m on Rpi 2.

part of my log:

-
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.ImportError'>
                                            Error Contents: cannot import name SessionCallbacks
                                            Traceback (most recent call last):
                                              File "/home/osmc/.kodi/addons/plugin.audio.spotlight/server_addon.py", line 27, in <module>
                                                from spotlight.service.Server import Server
                                              File "/home/osmc/.kodi/addons/plugin.audio.spotlight/spotlight/service/Server.py", line 20, in <module>
                                                from spotlight.service.session.SpotifyCallbacks import SpotifyCallbacks
                                              File "/home/osmc/.kodi/addons/plugin.audio.spotlight/spotlight/service/session/SpotifyCallbacks.py", line 20, in <module>
                                                from spotify.session import SessionCallbacks
                                            ImportError: cannot import name SessionCallbacks
                                            -->End of Python script error report<--

#6

Just stumbled upon this topic. Thought I share my experiences. I didn’t like it much, even though it worked OK.
I actually ditched Spotlight completely after a week. With Spotify on your smartphone and/or tablet or laptop, you have much more controls, full benefits of Spotify’s great app for your smartphone. I simply use Bluetooth streaming to play it to my RPi2 which is connected to a sound system. It is such a simple and yet powerful setup. Instead of using Yatse to navigate, I can navigate Spotify directly.

The only thing that could be better than this is if Spotify would release a SpotifyConnect add-on for Kodi. This would eliminate the need to stream the audio from my phone to the RPi but it would still allow me to use Spotify directly on my smartphone.
Work is being done on a Spotify Connect open source reverse engineered solution: http://forum.kodi.tv/showthread.php?tid=221145


#7

I had similar issues that others have reported (resulting in the 111 error). This is what worked for me. First, my setup:

  • Raspberry Pi 2 Model B
  • OSMC 2015.11-1
  • plugin.audio.spotlight-1.2.0-armv7-experimental.zip

Install the Spotlight plugin from the .zip file. Then ssh into the Raspberry Pi and replace the armv7 libspotify.so with the armv6hf version:

cd ~/.kodi/addons/plugin.audio.spotlight/resources/dlls/linux/armv7
cp ../armv6hf/libspotify.so .

Reboot.


#8

Hi everyone! Thanks for your support. It took a while, but finally I’m enjoying Spotify on a Raspberry Pi 2 with OSMC 2016.02-1 and the patched plugin.audio.spotlight-1.2.0-armv7-experimental.zip. The last tip by @lugnuts solved the 111 error.


#10

start other threads on other software dont clutter this thread with other solutions


#11

Hey, thanks for this guide!
However, it didn’t work for me (got the error 111) until I omitted Step 1 (installing of python-spotify). Without that it worked. More details:

Tried it on Raspberry Pi 2 and 3 with fresh osmc 16.02-3 and plugin.audio.spotlight-1.2.0-armv7-experimental.zip. I changed the automatic recognition after installing the addon (in addon settings) and then it worked after a reboot. I had an “invalid credentials” error on the Pi 2, but a reboot resolved it.


#12

I have partial success using the following method on a Vero 2 using the latest OSMC (2016.05-1):

  1. Installed the latest version of the spotlight plugin (47a74be414cb)
  2. Installed pyspotify from pip
  3. Applied the library path patch
  4. Rebooted

I’m able to access the plugin menus. If I search for music, I’m able to play it. If I try to look at any of the content in ‘Starred’ or ‘Playlists’, it won’t show any songs. For ‘Playlists’ specifically, it will show me a menu of my playlists (so I know it’s talking to Spotify), but there’s never any songs in the playlist. The logs when I try to access the playlist are:

19:02:37 T:2666517488 NOTICE: libspotify: notified main thread 19:02:38 T:2737038320 NOTICE: libspotify: music delivery samples = 1368 19:02:39 T:2864444400 NOTICE: Previous line repeats 5 times. 19:02:39 T:2864444400 NOTICE: Creating page from obj:{'start': 0, 'identifier': 'spotify:user:scrubbed-user:playlist:3Gx5EIpIycdFqjB0MeqdAp', 'max_items': 0, 'offset': 0} 19:02:39 T:2864444400 NOTICE: Created page:<spotlight.model.Page.Page instance at 0xa07fed28> 19:02:39 T:2864444400 NOTICE: Creating page from obj:{'start': 0, 'identifier': 'spotify:user:scrubbed-user:playlist:3Gx5EIpIycdFqjB0MeqdAp', 'max_items': 0, 'offset': 0} 19:02:39 T:2864444400 NOTICE: Created page:<spotlight.model.Page.Page instance at 0xa07feda0> 19:02:39 T:2737038320 NOTICE: libspotify: music delivery samples = 1368 19:02:39 T:2864444400 NOTICE: Previous line repeats 1 times. 19:02:39 T:2864444400 NOTICE: Creating page from obj:{'start': 0, 'identifier': 'spotify:user:scrubbed-user:playlist:3Gx5EIpIycdFqjB0MeqdAp', 'max_items': 0, 'offset': 0} 19:02:39 T:2864444400 NOTICE: Created page:<spotlight.model.Page.Page instance at 0xa07fe238> 19:02:39 T:2864444400 ERROR: 127.0.0.1 - - [30/May/2016 19:02:39] "POST /RPC2 HTTP/1.1" 200 - 19:02:39 T:2516435952 NOTICE: Creating page from obj:{'start': 0, 'identifier': '', 'max_items': 0, 'offset': 0} 19:02:39 T:2516435952 NOTICE: Created page:<spotlight.model.Page.Page instance at 0xa07fe6e8> 19:02:39 T:2516435952 NOTICE: page is {'start': 0, 'identifier': '', 'max_items': 2, 'offset': 0} 19:02:39 T:2737038320 NOTICE: libspotify: music delivery samples = 1368 19:02:42 T:2666517488 NOTICE: Previous line repeats 16 times. 19:02:42 T:2666517488 NOTICE: libspotify: notified main thread 19:02:43 T:2737038320 NOTICE: Previous line repeats 1 times. 19:02:43 T:2737038320 NOTICE: libspotify: music delivery samples = 1368 19:02:47 T:2666517488 NOTICE: Previous line repeats 24 times. 19:02:47 T:2666517488 NOTICE: libspotify: notified main thread 19:02:48 T:2737038320 NOTICE: libspotify: music delivery samples = 1368


#13

I figured out a hack for this:


#14

Hi, I’ve been trying to get spotlight working on OSMC 16.8-136 (lastest Krypton test build) without any luck so far.
First, does anyone have a working spotlight right now?

The more I read, about this the more confused I get :slight_smile:
Python-spotify (aka pyspotify) is listed as step 1 in this how to, but a/ I can’t find it in the repos on my OSMC, and b/ the official documentation says “pyspotify use CFFI to make a pure Python wrapper around the official libspotify library” followed by “Note that as of May 2015 libspotify is officially deprecated by Spotify and is no longer actively maintained.” .
I get the feeling pyspotify is not needed, as libspotify is bundled directly into the Spotlight addon package. Can anyone confirm?

Furthermore, I’ve installed the latest version of the addon, plugin.audio.spotlight-1.2.0-armv7-experimental.zip (built in July 2014, yikes). No luck. I rebooted (several times) after entering the spotify credentials. I tried to play with autodetection of the platform and switch it to Linux/ARMv6.
I tried to copy the arm6hf libspotify.so to the armv7 folder:

ie: mv /home/osmc/.kodi/addons/plugin.audio.spotlight/resources/dlls/linux/armv7/libspotify.so /home/osmc/.kodi/addons/plugin.audio.spotlight/resources/dlls/linux/armv7/libspotify.so.armv7.bak &&\ cp /home/osmc/.kodi/addons/plugin.audio.spotlight/resources/dlls/linux/armv6hf/libspotify.so /home/osmc/.kodi/addons/plugin.audio.spotlight/resources/dlls/linux/armv7/libspotify.so

I even tried to patch the .kodi/addons/plugin.audio.spotlight/spotlight/service/util/LibLoader.py file as suggested (change from append to insert), still no luck.

With all this done, I get Errno 111 and no clear error in the debug logs.

Any clues would be much appreciated :slight_smile:


#15

I’ve been having the same problem as you and found the solution here:

TL;DR
You have to change the OS on Settings > Advance (check the Override platform detection)


#17

After many attempts I’ve almost got the spotlight add-on working on OSMC on RPI:…

My setup…
RPI2 B
Fresh install of OSMC February 2017 2017.02-2
Download and install plugin.audio.spotlight-1.2.0-armv7-experimental.zip
Replace libspotify.so in armv7 with libspotify.so in armv6hf
Enter Spotify aching credentials
Override platform detection - Linux, armv6
Reboot

This is virtually the same as @lugnuts did above and had success.

I’m having limited success…
I can browse my playlists, search for tracks etc. But I cannot play any tracks - I get a cannot play, check log msg. I’ve looked at the log but can’t figure out the issue, I’m hoping someone else can… Would anyone like to look at the log file to try and figure out what’s going wrong?

Thanks in advance!
Dan.


#18

Anybody??? I’d really like Spotify on my OSMC setup


#19

Why have you not simply posted your logs? We’re honestly tired of begging users for them… It’s wasting the time I volunteer here as we speak.


#20

Apologies, I don’t really know why I didn’t just upload the logs!

Anyway, here they are… Hope I’ve done it right…

http://paste.osmc.io/fogenunoma

Any help would be greatly appreciated.


#21

here is an awesome idea, i know i opened the thread but there is a plugin author to turn to that handles support :slight_smile: might want to begin there instead of trying a dead thread that noone actually supports anymore and if the other doesnt respond well there are other addons for spotify just check the kodi forum instead of here at osmc forum.


#22

truly recommend people to move over to this since its maintained by the author
http://forum.kodi.tv/showthread.php?tid=265356