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?

2 Answers 2

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")')

2
  • 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, 2017 at 6: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")') Jul 31, 2017 at 9: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

1
  • 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, 2017 at 5:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.