def show_tv_channels(): xbmc.log("Raiplay: get Rai channels: ") raiplay = RaiPlay(Addon) onAirJson = raiplay.getOnAir() for station in tv_stations: chName = station["channel"] current = "" for d in onAirJson: if chName == d["channel"]: current = d["currentItem"].get("name","") thumb = d["currentItem"].get("image","") chName = "[COLOR yellow]" + chName + "[/COLOR]: " + current break liStyle = xbmcgui.ListItem(chName) if thumb: liStyle.setThumbnailImage(raiplay.getUrl(thumb)) else: liStyle.setThumbnailImage(raiplay.getThumbnailUrl(station["transparent-icon"])) addLinkItem({"mode": "play", "url": station["video"]["contentUrl"]}, liStyle) #rai sport web streams xbmc.log("Raiplay: get Rai sport web channels: ") chList = raiplay.getRaiSportLivePage() xbmc.log(str(chList)) for ch in chList: liStyle = xbmcgui.ListItem("[COLOR green]" + ch['title'] + "[/COLOR]") liStyle.setThumbnailImage(ch['icon']) liStyle.setInfo("video", {}) addLinkItem({"mode": "play", "url": ch["url"]}, liStyle) xbmcplugin.endOfDirectory(handle=handle, succeeded=True)