How to install xbmc module for Python

Dananjaya picture Dananjaya · May 11, 2011 · Viewed 12.9k times · Source

I tried to find the setup script from xbmcscripts.com but apparently that site is down. Neither 'easy_install' gives a desirable result. I'm running Ubuntu 11.04 and xbmc (Media Center) is installed and working alright. What I basically need is the ability to import the xbmc module in Python console/script like this,

import xbmc

url = '<a link to a .flv file goes here'
xbmc.Player(xbmc.PLAYER_CORE_DVDPLAYER).play(url)

Thanks!

Answer

Bruce van der Kooij picture Bruce van der Kooij · Jun 18, 2011

I haven't done any XBMC development myself but I thought I'd take a look at this.

From what I can tell XBMC ships with its own Python interpreter (/usr/lib/xbmc/system/python/python24-i486-linux.so) and the xbmc, xbmcgui and xbmcplugin libraries are not available outside of XBMC itself.

As for the easiest way to develop for XBMC with regards to experimenting, testing and debugging. Here's some tips:

  • Running XBMC in a window and always on top might be handy (use \ in fullscreen mode)
  • Any print statements inside an add-on/script end up as notices in the log (~/.xbmc/temp/xbmc.log)
  • You could create an add-on that exposes a Python shell from within the context of XBMC (that you communicate with over say Telnet)

There are references scattered around to something that used to be on XMBCscripts.com referred to as an "XBMC emulator" which apparently implemented the functionality of those libraries outside of XBMC but I can't find it anywhere.

Relevant documentation:

External links: