本文介绍如何开发
XBMC插件。
Python库手册:http://mirrors.xbmc.org/docs/python-docs/stable/。
这里有一篇来自wiki的英文介绍:http://kodi.wiki/view/HOW-TO_write_Python_Scripts_for_XBMC#XBMC_Python_Scripting_Tutorial
~/.xbmc/addons/ 在这个目录下通常会有三个文件:addon.xml、hello.py、icon.png 分别是插件描述文件、主程序、图标文件(256x256) 下面是addon.xml一个示例: [codesyntax lang="xml"]
<?xml version="1.0" encoding="UTF-8"?>
<addon id="plugin.suren.system.fan"
name="AutoFan"
version="0.0.1"
provider-name="http://surenpi.com">
<extension point="xbmc.python.pluginsource" library="suren.py">
<provides>Video</provides>
</extension>
<extension point="xbmc.addon.metadata">
<platform>all</platform>
<summary>suren hello world plugin</summary>
<summary lang="zh">suren hello world plugin</summary>
<description>plugin desc information</description>
<description lang="zh">plugin desc information</description>
<disclaimer>disclaimer</disclaimer>
</extension>
</addon>
[/codesyntax] 从上面的例子可以看到,对于插件的多语言是直接支持的。按照上面的目录结构打包成zip文件后即可发行。
先从一个例子说起: [codesyntax lang="python"]
# -*- coding: utf-8 -*-
# suren.py
import xbmcplugin, xbmcgui
url='http://surenpi.com'
handle=int(sys.argv[1])
listitem=xbmcgui.ListItem('Hello, World!')
xbmcplugin.addDirectoryItem(handle, url, listitem)
xbmcplugin.endOfDirectory(handle)
[/codesyntax]
http://bbs.htpc1.com/thread-198731-1-1.html
http://blog.csdn.net/jerry_zhanghui/article/details/7335132