2

I am trying to develop an XBMC/Kodi addon and my goal is run script and plugins from python script. There are buttons in addon.py when you pushed them, the addon that specified will run. I achieved this for picture and game add-on. Like this:

if control == self.button1:
  xbmc.executebuiltin("RunScript(script.game)")
if control == self.button2:
  xbmc.executebuiltin("RunScript(script.picture)")

I tried this way to call video plugin, but give me some error message. When I searched this problem, I found this:

"Do not try to run Plugins files from the scripts window as that will only give you a weird error message"

Is there an another way to call a video plugin from python script or can we a write a video-script instead of plugin?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
LadyLyanna
  • 41
  • 1
  • 6

2 Answers2

1

You can also use RunPlugin and RunAddon which are the builtin Function of Kodi. (for detail refer this KODI List of builtin Functions)

Here is the example to run any plugin :

  1. To run plugin use : xbmc.executebuiltin('RunPlugin("plugin.video.something")')

  2. To run script use : xbmc.executebuiltin('RunAddon("script.something")')

Rachit kapadia
  • 705
  • 7
  • 18
  • I tried your first example for plugin;give me some error and I found this information on Kodi's page you cant run plugin from python script ... – LadyLyanna Jul 31 '17 at 06:45
  • @LadyLyanna I think the method is deprecated though it was given in tutorial but you can also use second method that i had mention earlier .i.e, `xbmc.executebuiltin('RunAddon("plugin.video.something")')` – Rachit kapadia Jul 31 '17 at 09:39
0

You should call video plugin as follow:

xbmc.executebuiltin("ActivateWindow(<window-id>,'plugin://<plugin-id>/<parameter-optional>',return)")
ex.
xbmc.executebuiltin("ActivateWindow(10025,'plugin://plugin.video.example/',return)")

from kodi 17 window ID for video plugin is 10025

Gahan
  • 4,075
  • 4
  • 24
  • 44
  • for me this method works for running script too. just you need to make sure that plugin or script is exist/installed and enabled – Gahan Jul 28 '17 at 05:58