def CheckUpdates(): isListsChanged = common.UpdateLists() if isListsChanged: print "------------> IsraeLive service: Channel-list updated. <---------------" myIPTVSimple.UpdateLogos() isIPTVChanged = False isEPGChanged = False if Addon.getSetting("useLiveTV") == "true": isIPChanged = myIPTVSimple.isIPChange() m3uFileLastUpdate = myIPTVSimple.getM3uFileLastUpdate() now = int(time.time()) isM3uFileNotUpdate = True if ( now - m3uFileLastUpdate) > 82800 else False # 23 hours if isListsChanged or isIPChanged or myIPTVSimple.isMarkedListsChange( ) or isM3uFileNotUpdate: isIPTVChanged = myIPTVSimple.RefreshIPTVlinks() if isIPTVChanged: print "-------------> IsraeLive service: IPTV-links updated. <----------------" else: print "----------> IsraeLive service: error updating IPTV-links. <------------" isEPGChanged = myIPTVSimple.RefreshEPG() if isEPGChanged: print "-------------> IsraeLive service: TV-Guide updated. <-----------------" if isIPTVChanged or isEPGChanged: xbmc.executebuiltin('StartPVRManager') elif isListsChanged: pass else: # if nothing changed print "--------> IsraeLive service: Everything is up to date. :-) <-----------"
def CheckUpdates(): isListsChanged = common.UpdateLists() if isListsChanged: print "------------> IsraeLive service: Channel-list updated. <---------------" myIPTVSimple.UpdateLogos() isIPTVChanged = False isEPGChanged = False if Addon.getSetting("useLiveTV") == "true": isIPChanged = myIPTVSimple.isIPChange() if isListsChanged or isIPChanged or myIPTVSimple.isMarkedListsChange(): isIPTVChanged = myIPTVSimple.RefreshIPTVlinks() if isIPTVChanged: print "-------------> IsraeLive service: IPTV-links updated. <----------------" else: print "----------> IsraeLive service: error updating IPTV-links. <------------" isEPGChanged = myIPTVSimple.RefreshEPG() if isEPGChanged: print "-------------> IsraeLive service: TV-Guide updated. <-----------------" if isIPTVChanged or isEPGChanged: dlg = xbmcgui.Dialog() dlg.ok('ISRAELIVE', 'Links updated.', "Please restart XBMC or PVR db.") elif isListsChanged: pass else: # if nothing changed print "--------> IsraeLive service: Everything is up to date. :-) <-----------"
def UpdateEPG(): global epgCounter global epgThread result = False try: old_epg = annatel.IsOldEPG() epg = annatel.GetEPG() if (epg is not None): myIPTVSimple.RefreshEPG([epg], is_very_new=old_epg) result = (epg is not None) except: result = False if (result): epgCounter = __UpdateInterval__ else: epgCounter = __RetryInterval__ epgThread = None
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)")