XBMC Community Forum
[WIP] XBMC + Spotify = True (an XBMC implementation that uses Spotify's official API) - Printable Version

+- XBMC Community Forum (http://forum.xbmc.org)
+-- Forum: Announcements, Info, and General Discussion (/forumdisplay.php?fid=85)
+--- Forum: XBMC General Discussion (/forumdisplay.php?fid=6)
+--- Thread: [WIP] XBMC + Spotify = True (an XBMC implementation that uses Spotify's official API) (/showthread.php?tid=67012)



- coendeurloo - 2011-09-03 12:56

eversteegt Wrote:In the instructions, it clearly says you NEED a spotify premium account.....

Allright, so I have to get an API key, make the file and...update the script?

Well, that's what I've done, got a premium account, made the appkey.h file, placed it in the root, updated the script...but it seems to have some problems finding the right directory. Here is a screenshot of the last lines of putty:

[Image: py4q0.png]

I'm logged in as root, maybe that's the problem? Should I login as just 'xbmc' (normal user)?


- Flanhare - 2011-09-03 14:15

coendeurloo Wrote:Allright, so I have to get an API key, make the file and...update the script?

Well, that's what I've done, got a premium account, made the appkey.h file, placed it in the root, updated the script...but it seems to have some problems finding the right directory. Here is a screenshot of the last lines of putty:

[Image: py4q0.png]

I'm logged in as root, maybe that's the problem? Should I login as just 'xbmc' (normal user)?
As the error message says, a library is missing. It is hard to tell which one, but open README.ubuntu file and check the requirements and manually do a apt.get install as stated in the file.

So there is a library missing in apt-get install line in the script.

EDIT: Yes, you should do everything as root.


- latigreplata - 2011-09-03 21:52

Hi

I just tried the script on my test-PC. it`s a live-xbmc installation. The script was unsuccessfull... It says something about a missing source. Can anyone help?

Here`s the end of the log:

Err http://ppa.launchpad.net maverick/main Sources
404 Not Found
Hit http://archive.ubuntu.com maverick-backports/universe i386 Packages
Hit http://archive.ubuntu.com maverick-backports/multiverse i386 Packages
Hit http://archive.ubuntu.com maverick-updates/main i386 Packages
Hit http://archive.ubuntu.com maverick-updates/restricted i386 Packages
Err http://ppa.launchpad.net maverick/main i386 Packages
404 Not Found
Hit http://ppa.launchpad.net maverick/main Sources
Hit http://ppa.launchpad.net maverick/main i386 Packages
Hit http://ppa.launchpad.net maverick/main Sources
Hit http://ppa.launchpad.net maverick/main i386 Packages
Hit http://archive.ubuntu.com maverick-updates/universe i386 Packages
Hit http://archive.ubuntu.com maverick-updates/multiverse i386 Packages
W: Failed to fetch http://ppa.launchpad.net/team-iquik/xbmc-stable/ubuntu/dists/maverick/main/source/Sources.gz 404 Not Found

W: Failed to fetch http://ppa.launchpad.net/team-iquik/xbmc-stable/ubuntu/dists/maverick/main/binary-i386/Packages.gz 404 Not Found

E: Some index files failed to download, they have been ignored, or old ones used instead.
Reading package lists...
Building dependency tree...
Reading state information...
Package libgl-dev is a virtual package provided by:
E: Package 'libgl-dev' has no installation candidate
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Could not open file /var/lib/apt/lists/ppa.launchpad.net_team-iquik_xbmc-stable_ubuntu_dists_maverick_main_source_Sources - open (2: No such file or directory)
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Could not open file /var/lib/apt/lists/ppa.launchpad.net_team-iquik_xbmc-stable_ubuntu_dists_maverick_main_source_Sources - open (2: No such file or directory)
mkdir: cannot create directory `/home/xbmc/setup': File exists
./sxgb.sh: line 48: git: command not found
make: *** lib/libnfs: No such file or directory. Stop.
./sxgb.sh: line 50: cd: /home/xbmc/setup/spotyxbmc2: Not a directory
./sxgb.sh: line 52: ./bootstrap: No such file or directory
./sxgb.sh: line 52: ./configure: No such file or directory
make: *** No targets specified and no makefile found. Stop.
make: *** lib/addons/script.module.pil: No such file or directory. Stop.
make: *** No rule to make target `install'. Stop.
xbmc-live start/running, process 13414


- Flanhare - 2011-09-03 23:28

latigreplata Wrote:Hi

I just tried the script on my test-PC. it`s a live-xbmc installation. The script was unsuccessfull... It says something about a missing source. Can anyone help?

Here`s the end of the log:

Err http://ppa.launchpad.net maverick/main Sources
404 Not Found
Hit http://archive.ubuntu.com maverick-backports/universe i386 Packages
Hit http://archive.ubuntu.com maverick-backports/multiverse i386 Packages
Hit http://archive.ubuntu.com maverick-updates/main i386 Packages
Hit http://archive.ubuntu.com maverick-updates/restricted i386 Packages
Err http://ppa.launchpad.net maverick/main i386 Packages
404 Not Found
Hit http://ppa.launchpad.net maverick/main Sources
Hit http://ppa.launchpad.net maverick/main i386 Packages
Hit http://ppa.launchpad.net maverick/main Sources
Hit http://ppa.launchpad.net maverick/main i386 Packages
Hit http://archive.ubuntu.com maverick-updates/universe i386 Packages
Hit http://archive.ubuntu.com maverick-updates/multiverse i386 Packages
W: Failed to fetch http://ppa.launchpad.net/team-iquik/xbmc-stable/ubuntu/dists/maverick/main/source/Sources.gz 404 Not Found

W: Failed to fetch http://ppa.launchpad.net/team-iquik/xbmc-stable/ubuntu/dists/maverick/main/binary-i386/Packages.gz 404 Not Found

E: Some index files failed to download, they have been ignored, or old ones used instead.
Reading package lists...
Building dependency tree...
Reading state information...
Package libgl-dev is a virtual package provided by:
E: Package 'libgl-dev' has no installation candidate
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Could not open file /var/lib/apt/lists/ppa.launchpad.net_team-iquik_xbmc-stable_ubuntu_dists_maverick_main_source_Sources - open (2: No such file or directory)
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Could not open file /var/lib/apt/lists/ppa.launchpad.net_team-iquik_xbmc-stable_ubuntu_dists_maverick_main_source_Sources - open (2: No such file or directory)
mkdir: cannot create directory `/home/xbmc/setup': File exists
./sxgb.sh: line 48: git: command not found
make: *** lib/libnfs: No such file or directory. Stop.
./sxgb.sh: line 50: cd: /home/xbmc/setup/spotyxbmc2: Not a directory
./sxgb.sh: line 52: ./bootstrap: No such file or directory
./sxgb.sh: line 52: ./configure: No such file or directory
make: *** No targets specified and no makefile found. Stop.
make: *** lib/addons/script.module.pil: No such file or directory. Stop.
make: *** No rule to make target `install'. Stop.
xbmc-live start/running, process 13414
Hmm XBMC-Live is based on Lucid (10.04), not Maverick (10.10). You are running Maverick and that ppa has no sources for Maverick. I can't make the script work for another version of ubuntu right now. I suggest you follow the instructions that akezeke have written.


- alex84 - 2011-09-04 18:52

Flanhare Wrote:Follow the instructions at https://github.com/akezeke/spotyxbmc2 or try my script http://forum.xbmc.org/showpost.php?p=876735&postcount=506.

In any case you need to SSH to your XBMCLive computer (google it).

Thanks for helping.
Im well aware how to ssh to the box. The problem is when running " make install xbmc" command it wont go throw the command. I have tried countless times but cant get past even The bootstrap command. I think that this coul be an issue of the livexbmc not having all the full blown features. I was hoping someone with more knowledge could try the install on a liveinstall of xbmc. I have almost given up since running an full ubuntu / linux install is not anoption for my ion pc. If anyone can confirm your script or other install way that works on the xbmclive version i happily test it.


- Flanhare - 2011-09-06 00:56

alex84 Wrote:Thanks for helping.
Im well aware how to ssh to the box. The problem is when running " make install xbmc" command it wont go throw the command. I have tried countless times but cant get past even The bootstrap command. I think that this coul be an issue of the livexbmc not having all the full blown features. I was hoping someone with more knowledge could try the install on a liveinstall of xbmc. I have almost given up since running an full ubuntu / linux install is not anoption for my ion pc. If anyone can confirm your script or other install way that works on the xbmclive version i happily test it.
Well, I can't say for sure what's going wrong. But it is working for me running XBMC Live on a ION PC. So it is for sure possible.

Please post your full log from the terminal. There is no idea to run make install if the previous step failed and so on.


- Tompen - 2011-09-06 13:48

Any idea why spotyxbmc2 does not work on windows xp?

Win xp sp3 32-bit, xbmc.exe does not start (access violation).
Win 7 sp1 32-bit, works really good. Fantastic.

Same xbmc commit built without spotify integration works ok on win xp 32-bit.
Have not tried 64-bit windows. The branch spotyxbmc1 also behave the same.


- coendeurloo - 2011-09-06 15:51

Flanhare Wrote:As the error message says, a library is missing. It is hard to tell which one, but open README.ubuntu file and check the requirements and manually do a apt.get install as stated in the file.

So there is a library missing in apt-get install line in the script.

EDIT: Yes, you should do everything as root.

Isn't your script meant to install all the required libraries..? I have no idea how to check which ones are installed and which not, I'm just running XBMCLive and access it through putty.

I can't imagine there aren't more people with an XBMCLive install who would like to install Spotify and know what to do? It's the most commonly used version right?


- coendeurloo - 2011-09-06 15:54

Flanhare Wrote:Well, I can't say for sure what's going wrong. But it is working for me running XBMC Live on a ION PC. So it is for sure possible.

Please post your full log from the terminal. There is no idea to run make install if the previous step failed and so on.

I have the same setup as you, could you please describe the steps you did to get this to work?


UberNoob Guide to Building XBMC with Spotify - Gr8rtek - 2011-09-06 17:35

This guide outlines the steps I've taken to properly install Spotify on Windows 7 64-bit. This guide comes with the caveat that I am not a software developer, have never written a line of C++ code and have a very limited understanding of object-oriented development. With all of that said, I do have this working for my system, and I hope this guide will work for someone else out there. Software developers may chime in and say that some steps can be removed or are redundant, and that is fine. Like I said, this is what worked for me. This guide is based on the Windows Install readme originally provided by Akezeke on his GitHub website, expanded for the less-technically inclined. Many thanks also to AbandonNow on the XBMC forums, as some of his findings helped me get this working on my system.

Set Up the Build Environment

Prerequisites
Git for Windows [http://code.google.com/p/msysgit/downloads/list ]
Visual C++ Express [http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-cpp-express ]
DirectX SDK [http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=6812 ]
Nullsoft Scriptable Install System (NSIS) [http://sourceforge.net/projects/nsis/files/NSIS%202/2.46/ ]
Spotify Premium Account [http://www.spotify.com/us/get-spotify/premium/ ]

Install guide for Git for Windows can be found at http://help.github.com/win-set-up-git/
If you read through the XBMC build documentation it says NSIS is optional depending on how you intend to install XBMC. I chose to install it so I could create an installer to deploy XBMC with Spotify to multiple Windows machines.

Once the build environment is successfully set up, we can begin!

Acquire the Necessary Software
[INDENT]1. Launch Git for Windows (Git Bash shortcut on desktop)
2. Determine your current directory location by typing pwd
3. Navigate to the root directory by typing cd /c/
4. Create a Build/Dev directory by typing mkdir dev
5. Change to the new directory by typing cd dev
6. Download the SpotyXBMC source code by typing:
git clone git://github.com/akezeke/spotyxbmc2.git
7. While these files are downloading, go get your Spotify AppKey[/INDENT]
[INDENT][INDENT]1. Open a browser and go to *http://developer.spotify.com/en/libspotify/application-key/
2. Log in with your Spotify credentials
3. Click on the c-code link to be redirected to a different page
4. Highlight all of the text [CTRL-A] and copy [CTRL-C]
5. Open a text editor like Notepad or equivalent
6. Paste the contents from the clipboard [CTRL-V]
7. Save the file as appkey.h in the folder c:\dev\spotyxbmc2
8. In the Save As type drop-down menu, select “All Files”
9. Click Save[/INDENT][/INDENT]
[INDENT]8. Once the files have downloaded from Step 6, you can exit out of Git for Windows by typing exit
9. Open Windows Explorer [WinKey-E] and navigate to c:\dev\spotyxbmc2\project\BuildDependencies
10. Double-click the file DownloadBuildDeps.bat
11. Wait for the script to finish and the command window to close
12. Double-click the file DownloadMingwBuildEnv.bat
13. Wait for the script to finish and the command window to close
14. Navigate to c:\dev\spotyxbmc2\project\Win32BuildSetup
15. Double-click the file named buildmingwlibs.bat
16. Wait for the script to finish
17. Now navigate to c:\dev\spotyxbmc2\project\VS2010Express
18. Right-click the file named XBMC for Windows.sln and select Open With >> Visual C++ Express
19. Wait a few minutes until the status in the lower left corner quits updating or reads “Ready”
20. Locate the three drop-down menus in the main toolbar[/INDENT]
[INDENT][INDENT]1. In the first (left) drop down menu, change Debug to Release (DirectX)
2. The second (middle) drop down menu should read Win32[/INDENT][/INDENT]
[INDENT]21. Press F7 to begin the build process
22. Wait a few minutes for this step to complete[/INDENT]
[INDENT][INDENT]1. Monitor the text in the Output window across the bottom of the app
2. The final line should read something like “Build Successful”[/INDENT][/INDENT]
[INDENT]23. Exit out of Visual C++ Express
24. Go back to Windows Explorer and you should see a new folder named XBMC in c:\dev\spotyxbmc2\project\VS2010Express
25. Navigate to c:\dev\spotyxbmc2\project\Win32BuildSetup\dependencies
26. Copy all of the .dll files from this location to c:\dev\spotyxbmc2\project\VS2010Express\XBMC\Debug (DirectX)
27. Navigate to c:\dev\spotyxbmc2\project\Win32BuildSetup
28. Double-click the file named BuildSetup.bat[/INDENT]
[INDENT][INDENT]1. This is where actual software developers may have a dissenting opinion, saying that it is not necessary to run this after going through the previous steps. Again, I am including this because these are the “exact” steps I followed to successfully get Spotify working with XBMC.[/INDENT][/INDENT]
[INDENT]29. Wait for the script to finish [/INDENT]
[INDENT][INDENT]1. You will know it is complete when it asks if you want to view the Debug log file. Type Y or N (your choice!) and then press the elusive Any Key to exit[/INDENT][/INDENT]
[INDENT]30. You should now have a custom installer named XBMCSetup_[release date]_[build#].exe in c:\dev\spotyxbmc2\project\Win32BuildSetup
31. You can double-click the executable and install XBMC[/INDENT]
[INDENT][INDENT]1. If XBMC is already installed, you can uninstall it but keep your userdata folder[/INDENT][/INDENT]

Configuring XBMC with Spotify
[INDENT]1. Launch XBMC [Start > All Programs > XBMC > XBMC]
2. Navigate to System > Add-Ons > Enabled Add-Ons > Music Add-Ons
3. Select SpotyXBMC
4. Select Configure
5. Select the radio button next to Enable
6. Enter your Spotify username
7. Enter your Spotify password[/INDENT]
[INDENT][INDENT]1. IMPORTANT! Several users have reported issues if their Spotify password starts with an upper-case letter. I got this working after changing my password to one that begins with a lower-case letter.[/INDENT][/INDENT]
[INDENT]8. Select OK
9. Press ESC a few times to return to the Home window
10. Exit XBMC
11. Launch XBMC [Start > All Programs > XBMC > XBMC]
12. Select Music[/INDENT]
[INDENT][INDENT]1. If XBMC was installed previously and you had music in your library, you should now see your Spotify playlists in the Playlist section, as well as being able to use the Search function to search for artists/songs/albums on Spotify
2. If you did not have XBMC installed prior to this, you will need to add some music to XBMC before you can enable the library[/INDENT][/INDENT]
[INDENT][INDENT][INDENT]1. From the Home window go to Music > Add Source
2. You can either point XBMC to your existing music library or simply copy a few MP3 files to your computer and then point XBMC to those files in this step
3. If you choose to do this, it may be helpful to ensure your files are structured as <Artist Name>/<Album Name>/<Track ## - Track Name>
4. Once you add a few tracks/many tracks, highlight an artist, press C on the keyboard and select Scan Item to Library
5. Wait a few minutes for this process to complete
6. Press the left arrow on the keyboard
7. Scroll down and ensure the radio button next to Library is selected/active
8. Press the right arrow to return to the Music section
9. Press ESC to return to the Home window
10. Select Music again and with any luck you should now see your Spotify playlists in the Playlist section, as well as being able to use the Search function to search for artists/songs/albums on Spotify[/INDENT][/INDENT][/INDENT]

Of course, feedback is welcome! Hopefully this guide will prove useful to someone else out there. If it is helpful, perhaps a Moderator would consider moving it to the HOW-TO section of the forums.