开发者

How to install xbmc module for Python

开发者 https://www.devze.com 2023-03-05 07:10 出处:网络
I tried to find the setup script from xbmcscripts.com but apparently that site is down. Neither \'easy_install\' gives a desirable result.开发者_StackOverflow I\'m running Ubuntu 11.04 and xbmc (Media

I tried to find the setup script from xbmcscripts.com but apparently that site is down. Neither 'easy_install' gives a desirable result.开发者_StackOverflow 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!


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:

  • http://wiki.xbmc.org/index.php?title=Python_Development
  • http://wiki.xbmc.org/index.php?title=HOW-TO_debug_Python_Scripts
  • http://wiki.xbmc.org/index.php?title=HOW-TO:_Automatically_start_addons_using_services
  • http://wiki.xbmc.org/index.php?title=Log_File

External links:

  • XBMC's Python Script and Plugin Addon Development Forum
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号