2015-05-15, 23:16
Can anybody give me an example of how to get for instance a list of all the TV shows in a python script or a simple addon that I can look at to learn?
(2015-05-16, 01:04)Tricky Wrote: I'm probably a complete idiot but I'm not really understanding it. Executejsonrpc is a method of xbmc, but how do I use it?
import json
import xbmc
request = {"jsonrpc": "2.0", "method": "VideoLibrary.GetEpisodes", "params": { "filter": {"field": "playcount", "operator": "greaterthan", "value": "0"}, "limits": { "start" : 0 }, "properties": ["playcount"], "sort": { "order": "ascending", "method": "label" } }, "id": "libTvShows"}
results = json.loads(xbmc.executeJSONRPC(json.dumps(request)))
(2015-05-16, 01:34)curti Wrote:(2015-05-16, 01:04)Tricky Wrote: I'm probably a complete idiot but I'm not really understanding it. Executejsonrpc is a method of xbmc, but how do I use it?
The sample below is from a previous post of mine to get a list of watched episodes. More examples are available at: http://kodi.wiki/view/JSON-RPC_API/Examples
Code:import json
import xbmc
request = {"jsonrpc": "2.0", "method": "VideoLibrary.GetEpisodes", "params": { "filter": {"field": "playcount", "operator": "greaterthan", "value": "0"}, "limits": { "start" : 0 }, "properties": ["playcount"], "sort": { "order": "ascending", "method": "label" } }, "id": "libTvShows"}
results = json.loads(xbmc.executeJSONRPC(json.dumps(request)))