3

I am trying to make controlling kodi easier with keyboard shortcuts or from the terminal. Something like how I can control spotify with DBUS or with keyboard shortcuts. I came across this link but I have no idea how to use JSON.
I am using Kodi 17.6 krypton and Ubuntu 18.04.

1 Answer 1

2

You can use the built-in RPC api

See the Official documentation : https://kodi.wiki/view/JSON-RPC_API

  1. Enable http remote control (kodi system settings)
  2. Write some script for your need
  3. An exemple : clean video database

    #!/bin/bash
    ## Configure your XBMC RPC details here
    XBMC_HOST=192.168.0.200
    XBMC_PORT=80
    XBMC_USER=osmc
    XBMC_PASS=osmc
    
    function xbmc_req {
    curl -s -i -X POST --header "Content-Type: application/json" -d "$1" http://$XBMC_USER:$XBMC_PASS@$XBMC_HOST:$XBMC_PORT/jsonrpc 
    }
    
    # Clean
    xbmc_req '{ "jsonrpc": "2.0", "method": "VideoLibrary.Clean", "id": "mybash"}';
    
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .