2

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!

Dananjaya
  • 2,135
  • 8
  • 22
  • 27

1 Answers1

4

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:

Bruce van der Kooij
  • 2,192
  • 1
  • 18
  • 29
  • Thank you for your answer. I will take a look at the links you've provided. The code snippet in the question is from Windows platform and I'm looking for a similar way to expose the XBMC API in Linux. – Dananjaya Jun 18 '11 at 09:18
  • I have my doubts that those modules are available to Python scripts running outside of XBMC on Windows. That's what I was saying, the modules are only exposed to scripts running in the context of XBMC. It wouldn't make much sense otherwise. – Bruce van der Kooij Jun 18 '11 at 11:11