rmrector / script.playrandomvideos

An add-on for Kodi to play random videos from a variety of lists.
Other
10 stars 6 forks source link

Example JSON-RPC #12

Open mrchainman opened 1 year ago

mrchainman commented 1 year ago

Hi, awesome plugin! Could you provide an example of how to use it with the jsonrpc? for instance, the call to play a random episode from a specific tvshow.

Many thanks in advance

rmrector commented 1 year ago

Call JSON-RPC with a payload like {"jsonrpc":"2.0","id":4,"method":"Addons.ExecuteAddon","params":{"addonid":"script.playrandomvideos","params":["videodb://movies/genres/xx/", "label=Documentary"]}}. Over HTTP the ExecuteAddon method is restricted to the POST verb, so can't be tested with just a browser URL.

Here is a complete example with curl.

curl --location --request POST 'http://bmo/jsonrpc' \
--header 'Content-Type: application/json' \
--data-raw '{"jsonrpc":"2.0","id":4,"method":"Addons.ExecuteAddon","params":{"addonid":"script.playrandomvideos","params":["videodb://movies/genres/xx/", "label=Documentary"]}}'