trying to get a bash script to use jsonrpc
#1
I am trying to find the correct way to create a bash script that will play a video on kodi. I have tried multiple things browsing these forums and the documentation and I think the best way I ended up with is this.

json:
curl -s --data-binary '{"jsonrpc":"2.0","id":"1","method":"Player.Open","params":{"item":{"file":"file:///mnt/media/videos/video1/video1.mkv"}}}' -H 'content-type: application/json;' http://192.168.1.243:8080/jsonrpc

When I run it in a bash script I get this result.

bash:
​​​​​​​{"id":"1","jsonrpc":"2.0","result":"OK"}

But the video doesn't start to play on kodi.

Obviously I enabled System/Settings/Network/Services "Allow programs on this system to control Kodi" and "Allow programs on other systems to control Kodi".

Can anyone see what I'm doing wrong here?
Thanks
Reply
#2
found it

bash:
curl -X POST -H "content-type:application/json" http://kodi:[email protected]:8080/jsonrpc -d '{"jsonrpc":"2.0","id":"1","method":"Player.Open","params":{"item":{"file":"file:////mnt/media/videos/video1/video1.mkv"}}}'
Reply

Logout Mark Read Team Forum Stats Members Help
trying to get a bash script to use jsonrpc0