@
Dumyat, @
Angelinas
I use kodi to watch live tv every day, for epg I use Webgrab+ and I have a complete epg (now and next events)
I use kodi to watch live tv every day.
For the info epg I use Webgrab+ and I have a complete epg (now and next events).
I have modified the plugin SHS for to obtain the ListItem poster-next from epg.
This way in MyPVRChannels I don't use the Local Artwork and the Google Artwork, because in epg I have all the info and posters
Code:
def get_pvr_artwork(self, listitem, prefix):
'''get pvr artwork from artwork module'''
if self.enable_pvrart:
if getCondVisibility("%sListItem.IsFolder" % prefix) and not listitem[
"channelname"] and not listitem["title"]:
listitem["title"] = listitem["label"]
listitem = self.metadatautils.extend_dict(
listitem, self.metadatautils.get_pvr_artwork(
listitem["title"],
listitem["channelname"],
listitem["genre"]), ["title", "genre", "genres", "thumb"])
if listitem["channelname"]:
next_poster = try_decode(xbmc.getInfoLabel("$INFO[%sListItem.ChannelName]" % prefix))
json_query = xbmc.executeJSONRPC('{"id": 1,"jsonrpc": "2.0","method": "PVR.GetChannels","params": {"properties": ["channelnumber"],"channelgroupid": 1}}')
json_response = json.loads(json_query)
for item in json_response['result']['channels']:
if('result' in json_response) and(json_response['result'] != None) and(item['label'] == next_poster):
json_id = item["channelid"]
json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "PVR.GetChannelDetails", "params": {"channelid": %s, "properties": ["broadcastnext"]}, "id": 1}' % json_id)
json_response = json.loads(json_query)
try:
listitem["art"]["NextTitle"] = json_response["result"]["channeldetails"]["broadcastnext"]["thumbnail"]
except:
listitem["art"]["NextTitle"] = try_decode(xbmc.getInfoLabel("$INFO[%sListItem.Icon]" % prefix))
# next_listitem = try_decode(xbmc.getInfoLabel("$INFO[%sListItem.NextTitle]" % prefix))
# listitem["art"]["NextTitle"] = self.metadatautils.google.search_image(next_listitem)
# pvr channellogo
if listitem["channelname"]:
listitem["art"]["ChannelLogo"] = self.metadatautils.get_channellogo(listitem["channelname"])
elif listitem.get("pvrchannel"):
listitem["art"]["ChannelLogo"] = self.metadatautils.get_channellogo(listitem["pvrchannel"])
return listitem
For other menu or skin I have created an script to obtain all info and posters. For me the function "Broadcastnext" in json is very useful
Code:
import xbmc
import xbmcaddon
import xbmcgui
import json
addon = xbmcaddon.Addon()
class NextInfo:
def __init__(self, info):
self.info = info
def broadcast(self):
return self.info
json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "id": "VideoGetItem", "method": "Player.GetItem", "params": {"playerid":1}}')
json_response = json.loads(json_query)
json_id = json_response["result"]["item"]["id"]
json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "PVR.GetChannelDetails", "params": {"channelid": %s, "properties": ["broadcastnext"]}, "id": 1}' % json_id)
json_response = json.loads(json_query)
try:
episode = NextInfo(json_response["result"]["channeldetails"]["broadcastnext"]["episodename"])
poster = NextInfo(json_response["result"]["channeldetails"]["broadcastnext"]["thumbnail"])
except:
episode = NextInfo("")
poster = NextInfo("")
xbmcgui.Window(xbmcgui.getCurrentWindowId()).setProperty("MyLabel", episode.broadcast())
xbmcgui.Window(xbmcgui.getCurrentWindowId()).setProperty("MyPoster", poster.broadcast())