Run python script through json-rpc api
#1
hey everyone,

Just wondering if there is any option available to run a python script throught the API as it exists for the builtin functions (RunScript(script[,args]*)). I tried to execute the script with the "Addons.ExecuteAddon" method but it seems there are some issues with the parameters being passed to the addon.
In fact, I couldn't even run the example presented in the xbmc wiki (http://wiki.xbmc.org/index.php?title=HOW...ON-RPC_API).

Is there any way I can do this, or perhaps suggest a feature implementation (if it doesn't exist yet) ?

Thanks in advance

keep it up
Reply
#2
Addons.ExecuteAddon would be the proper method but I haven't gotten around to fixing the parameter problem (and it looks like there's no real "standard" for how to pass parameters to a plugin).
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#3
(2013-09-13, 07:49)Montellese Wrote: Addons.ExecuteAddon would be the proper method but I haven't gotten around to fixing the parameter problem (and it looks like there's no real "standard" for how to pass parameters to a plugin).

Thanks for the reply Montelesse. The "standard" wouldn't be really a problem for me as I can change the addon code if I had a "template" that works with the json rpc api. However, nor even the example in the wiki is working, for me to modify my addon accordingly.
Please let me know when there are any changes to the api addons.executeAddon method.

Take care and thanks again
Reply
#4
it's all standardized.

plugin://<id>?<params>

you just pass on the part behind the ? as a string to python, everything else is handled inside.
Reply
#5
(2013-09-13, 12:33)spiff Wrote: it's all standardized.

plugin://<id>?<params>

you just pass on the part behind the ? as a string to python, everything else is handled inside.

I was told that this assumption is not correct. There also seem to be plugins that work with a hierarchy approach i.e.
Code:
plugin://<id>/<some>/<path>

EDIT: See PR2072.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#6
Sorry for Hiajacking here ...but what if I want to pass variables from json to python script in addon.

Like I want to put (I=1196) in json-rpc and use it as variable in python file like:

import xbmc
import xbmcgui
import xbmcplugin
import xbmcaddon
import json
import requests
 

if I == "1199":
xbmc.executebuiltin('ActivateWindow(9000)')
else:
xbmc.executebuiltin('ActivateWindow(1199)')

How can this run?
Reply
#7
(2018-09-10, 15:16)networkmad Wrote: Sorry for Hiajacking here ...but what if I want to pass variables from json to python script in addon.

Like I want to put (I=1196) in json-rpc and use it as variable in python file like:

import xbmc
import xbmcgui
import xbmcplugin
import xbmcaddon
import json
import requests
 

if I == "1199":
xbmc.executebuiltin('ActivateWindow(9000)')
else:
xbmc.executebuiltin('ActivateWindow(1199)')

How can this run?
Kodi's Json-rpc is a interface with Kodi and its API/Database; not a substitute for python... You should use python and pass arguments via a custom event process.
Image Lunatixz - Kodi / Beta repository
Image PseudoTV - Forum | Website | Youtube | Help?
Reply

Logout Mark Read Team Forum Stats Members Help
Run python script through json-rpc api0