kodi plus json

Play a Youtube video on Kodi, by sending a JSON-RPC request with Python.

pip install "jsonrpcclient[requests]"
>>> import jsonrpcclient
>>> jsonrpcclient.request("http://kodi:8080/jsonrpc", "Player.Open", item={"file": "plugin://plugin.video.youtube/?action=play_video&videoid=QwSazmPRfaI"})
--> {"jsonrpc": "2.0", "method": "Player.Open", "params": {"item": {"file": "plugin://plugin.video.youtube/?action=play_video&videoid=QwSazmPRfaI"}}, "id": 1}
<-- {"id":1,"jsonrpc":"2.0","result":"OK"} (200 OK)
'OK'

Change the videoid to your video.