def Category(categoryName): list = common.ReadChannelsList(categoryName) common.updateLogos(list) logosDir = os.path.join(addon_data_dir, 'logos') epgFileLastUpdate = common.getFileLastUpdate(epgFile) now = int(time.time()) isEpgUpdate = True if (now - epgFileLastUpdate) < 86400 else False # 24 hours if not isEpgUpdate: myIPTVSimple.RefreshEPG(updateIPTVSimple=False) epg = ET.parse(epgFile) for channel in list: description = "" logoFile = os.path.join(logosDir, "{0}.png".format(channel["logo"])) tvg_id = channel["tvg_id"].encode("utf-8") channelName = "[COLOR yellow]{0}[/COLOR]".format(channel["display_name"].encode("utf-8")) programme = GetProgrammes(epg, tvg_id) if programme is not None: programmeDetails = GetGetProgrammeDetails(programme) programmeName = "[COLOR orange]{0}[/COLOR] [COLOR grey][{1}-{2}][/COLOR]".format(programmeDetails["title"], programmeDetails["start"].strftime('%H:%M'), programmeDetails["stop"].strftime('%H:%M')) channelName = "{0} - {1}".format(channelName, programmeName) description = programmeDetails["desc"] else: tvg_id = None mode = 3 if channel["type"]== "filmon" else 2 addDir(channelName, channel["url"], mode, logoFile, description, tvg_id=tvg_id, display_name=channel["display_name"].encode("utf-8"), isFolder=False) xbmcplugin.setContent(int(sys.argv[1]), 'movies') xbmc.executebuiltin("Container.SetViewMode(515)")
def Category(categoryName): logosDir = os.path.join(xbmc.translatePath("special://userdata/addon_data").decode("utf-8"), AddonID, 'logos') list = common.ReadChannelsList(categoryName) common.updateLogos(list) for channel in list: logoFile = os.path.join(logosDir, "{0}.png".format(channel["logo"])) mode = 3 if channel["type"]== "filmon" else 2 addDir(channel["display_name"].encode("utf-8"), channel["url"], mode, logoFile, isFolder=False)
def Category(categoryName): logosDir = os.path.join( xbmc.translatePath("special://userdata/addon_data").decode("utf-8"), AddonID, 'logos') list = common.ReadChannelsList(categoryName) common.updateLogos(list) for channel in list: logoFile = os.path.join(logosDir, "{0}.png".format(channel["logo"])) mode = 3 if channel["type"] == "filmon" else 2 addDir(channel["display_name"].encode("utf-8"), channel["url"], mode, logoFile, isFolder=False)
def Category(categoryName): list = common.ReadChannelsList(categoryName) common.updateLogos(list) logosDir = os.path.join(addon_data_dir, 'logos') epgFileLastUpdate = common.getFileLastUpdate(epgFile) now = int(time.time()) isEpgUpdate = True if (now - epgFileLastUpdate) < 86400 else False # 24 hours if not isEpgUpdate: myIPTVSimple.RefreshEPG(updateIPTVSimple=False) epg = ET.parse(epgFile) for channel in list: description = "" logoFile = os.path.join(logosDir, "{0}.png".format(channel["logo"])) tvg_id = channel["tvg_id"].encode("utf-8") channelName = "[COLOR yellow]{0}[/COLOR]".format( channel["display_name"].encode("utf-8")) programme = GetProgrammes(epg, tvg_id) if programme is not None: programmeDetails = GetGetProgrammeDetails(programme) programmeName = "[COLOR orange]{0}[/COLOR] [COLOR grey][{1}-{2}][/COLOR]".format( programmeDetails["title"], programmeDetails["start"].strftime('%H:%M'), programmeDetails["stop"].strftime('%H:%M')) channelName = "{0} - {1}".format(channelName, programmeName) description = programmeDetails["desc"] else: tvg_id = None mode = 3 if channel["type"] == "filmon" else 2 addDir(channelName, channel["url"], mode, logoFile, description, tvg_id=tvg_id, display_name=channel["display_name"].encode("utf-8"), isFolder=False) xbmcplugin.setContent(int(sys.argv[1]), 'movies') xbmc.executebuiltin("Container.SetViewMode(515)")
def UpdateLogos(): markedLists = common.GetMarkedLists() finalList = MakeFinalList(markedLists) common.updateLogos(finalList)