Kore/tools/json/README.md

1.1 KiB

JSON Tools

Here you will find perl scripts that can be used to retrieve JSON responses from a Kodi instance. The scripts are primarily used to create the JSON source files needed by the instrumentation tests.

Getting json responses

Currently there are two scripts available to get media details from a Kodi instance.

  • getmovies.pl: retrieves movie details
  • getmusic.pl: retrieves music details

By default the scripts connect to Kodi running on the same machine (127.0.0.1) on port 8080. If you need to contact a Kodi instance on a different port and/or IP-address change the following line in each script:

my $url = "http://127.0.0.1:8080/jsonrpc";

Generating test values

The instrumentation tests require some values such as "total number of songs", "list of artistids", "genre ids", etc. etc. To generate these values from the JSON files, you can run gentestnumbers.pl. This script expects the JSON files to be located in the same directory you execute the script. It also assumes the names of the JSON files are the same as generated by getmovies.pl and getmusic.pl.