Question about pvr API - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26) +---- Forum: PVR (https://forum.kodi.tv/forumdisplay.php?fid=136) +---- Thread: Question about pvr API (/showthread.php?tid=310153) |
Question about pvr API - ykamchi - 2017-03-21 Hi all, I wonder if it is possible to query the pvr information, like channels and peg from my addon? If it is, can you please share a code example of how to get a list of channels with information like: channel name, URL, icon etc. ... after searching, I managed to find the channels, but how do I get the URL that it runs, can someone someone assist? Here is my code: ret = json.loads(xbmc.executeJSONRPC('{"jsonrpc": "2.0", "id": 1, "method": "PVR.GetChannelGroups", "params":{"channeltype":"tv"} }')) channelgroups = ret['result']['channelgroups'] for channelgroup in channelgroups: #Get Channels ret = json.loads(xbmc.executeJSONRPC('{"jsonrpc": "2.0", "id": 1, "method": "PVR.GetChannels", "params":{"channelgroupid" : ' + str(channelgroup['channelgroupid']) + '} }')) channels = ret['result']['channels'] for channel in channels: #Get Channel Details ret = json.loads(xbmc.executeJSONRPC('{"jsonrpc": "2.0", "id": 1, "method": "PVR.GetChannelDetails", "params":{"channelid" : ' + str(channel['channelid']) + '} }')) utils.write_log('service', str(ret))Confused |