KODI RPC : Remotely Clean Video Library


Here is a simple way to remotely start the Kodi's Video clean process
Of course, you can use the web interface to do so
If you don't want to open any program, you can create a script that will call the JSON RPC of Kodi



For Linux and Mac client systems :

#!/bin/bash

## Configure your KODI RPC details here
XBMC_HOST=192.168.1.50
XBMC_PORT=8080
XBMC_USER=osmc
XBMC_PASS=osmc

function kodi_req {
curl -s -i -X POST --header "Content-Type: application/json" -d "$1" http://$XBMC_USER:$XBMC_PASS@$XBMC_HOST:$XBMC_PORT/jsonrpc
}

# Clean
kodi_req '{ "jsonrpc": "2.0", "method": "VideoLibrary.Clean", "id": "mybash"}';

# simply add a CR LF to the concole output
echo "
";






Get even more information about remote library control :
https://kodi.wiki/view/HOW-TO:Remotely_update_library