我正在尝试开发一个 XBMC/Kodi 插件,我的目标是从 python 脚本运行脚本和插件。当你按下它们时,addon.py 中有按钮,指定的插件将运行。我为图片和游戏插件实现了这一点。像这样:
if control == self.button1:
xbmc.executebuiltin("RunScript(script.game)")
if control == self.button2:
xbmc.executebuiltin("RunScript(script.picture)")
我试过用这种方式调用视频插件,但是给我一些错误信息。当我搜索这个问题时,我发现了这个:
"Do not try to run Plugins files from the scripts window as that will only give you a weird error message"
是否有另一种方法可以从 python 脚本调用视频插件,或者我们可以编写视频脚本而不是插件吗?
请您参考如下方法:
您还可以使用 RunPlugin 和 RunAddon,它们是 Kodi 的内置功能。 (有关详细信息,请参阅此 KODI List of builtin Functions )
这是运行任何插件的示例:
运行插件使用:
xbmc.executebuiltin('RunPlugin("plugin.video.something")')要运行脚本,请使用:
xbmc.executebuiltin('RunAddon("script.something")')
