Hi Guys,
I want to be able to pass a variable like i=1199 by json-rpc to python script in another user.
I have this json-rpc and can activate an the python script in another user:
import requests
import xbmc
import xbmcgui
import xbmcplugin
import xbmcaddon
headers = {
'Content-Type': 'application/json',
}
data = '''{
"jsonrpc":"2.0",
"method":"Addons.ExecuteAddon",
"params": {
"addonid":"script.activatewindowid",
"params": {
"i":"1199"
}
},
"id":1
}'''
response = requests.post('http://192.168.1.200:8080/jsonrpc',
headers=headers,
data=data,
auth=('kodi', '1234'))
but I need to pass variable or arguments like i=“1199” to work in python script like this:
import xbmc
import xbmcgui
import xbmcplugin
import xbmcaddon
i = "i"
if i == "1199":
xbmc.executebuiltin('ActivateWindow(9000)')
else:
xbmc.executebuiltin('ActivateWindow(1199)')
Sorry but I am still beginner in json-rpc and python
Thanks for all