def DownloadLogos(): if myIPTV.GetIptvType() > 1: return xbmc.executebuiltin("XBMC.Notification({0}, Downloading channels logos..., {1}, {2})".format(AddonName, 300000 ,icon)) if not os.path.isfile(listsFile): common.UpdateChList() myIPTV.SaveChannelsLogos(iptvLogosDir) xbmc.executebuiltin("XBMC.Notification({0}, Channels logos saved., {1}, {2})".format(AddonName, 5000 ,icon))
def Update(): if common.getUseIPTV(): myIPTV.makeIPTVlist(iptvChannelsFile) myIPTV.RefreshPVR(iptvChannelsFile, iptvGuideFile, iptvLogosDir) if myIPTV.GetIptvType() < 2: myIPTV.SaveChannelsLogos(iptvLogosDir) xbmc.executebuiltin( "XBMC.AlarmClock({0},XBMC.RunPlugin(plugin://plugin.video.israelive/default.py?mode=101&url=checkUpdates),{1},silent)" .format("IsraeLiveM3U", 720))
def Update(): # Update channels-lists files common.UpdateChList(forceUpdate=False) # Update EPG files for selected LiveTV channels first isGuideUpdated = False if Addon.getSetting("useEPG") == "true": epg = common.ReadList(fullGuideFile) if len(epg) > 0: isGuideUpdated = True fullCategoriesList = [] selectedCategoriesList = [] categoriesList = [] iptvList = Addon.getSetting("iptvList") if iptvList == "0": # Favourites categoriesList = [{"id": "Favourites"}] elif iptvList == "1": # No filter categoriesList = fullCategoriesList = common.ReadList( os.path.join(user_dataDir, "lists", "categories.list")) elif iptvList == "2": # Selected categories categoriesList = selectedCategoriesList = common.ReadList( os.path.join(user_dataDir, "lists", "selectedCategories.list")) common.MakeCatGuides(categoriesList, epg) useIPTV = common.getUseIPTV() # Update LiveTV channels and EPG if useIPTV: import myIPTV myIPTV.makeIPTVlist(iptvChannelsFile) myIPTV.MakeChannelsGuide(fullGuideFile, iptvGuideFile) myIPTV.RefreshPVR(iptvChannelsFile, iptvGuideFile, iptvLogosDir) # Update EPG files for non-selected LiveTV channels if isGuideUpdated: if fullCategoriesList == []: fullCategoriesList = common.ReadList( os.path.join(user_dataDir, "lists", "categories.list")) if iptvList == "0": # Favourites categoriesList = fullCategoriesList elif iptvList == "1": # No filter categoriesList = [{"id": "Favourites"}] elif iptvList == "2": # Selected categories categoriesList = common.GetUnSelectedList(fullCategoriesList, selectedCategoriesList) categoriesList.append({"id": "Favourites"}) common.MakeCatGuides(categoriesList, epg) # Update channels-logos files if useIPTV and myIPTV.GetIptvType() < 2: myIPTV.SaveChannelsLogos(iptvLogosDir) checkInterval = 720 # 12 hours = 720 minutes xbmc.executebuiltin( "XBMC.AlarmClock({0},XBMC.RunPlugin(plugin://plugin.video.israelive/default.py?mode=100&url=checkUpdates),{1},silent)" .format("IsraeLiveUpdates", checkInterval))
def DownloadLogos(): xbmc.executebuiltin( "XBMC.Notification({0}, Downloading channels logos..., {1}, {2})". format(AddonName, 300000, icon)) if not os.path.isfile(plxFile): common.UpdatePlx(plxFile, "plx", forceUpdate=True) myIPTV.SaveChannelsLogos(iptvLogosDir) xbmc.executebuiltin( "XBMC.Notification({0}, Channels logos saved., {1}, {2})".format( AddonName, 5000, icon))
def DownloadLogos(): if myIPTV.GetIptvType() > 1: return xbmc.executebuiltin( "XBMC.Notification({0}, Downloading channels logos..., {1}, {2})". format(AddonName, 300000, icon)) myIPTV.SaveChannelsLogos(iptvLogosDir) xbmc.executebuiltin( "XBMC.Notification({0}, Channels logos saved., {1}, {2})".format( AddonName, 5000, icon))
def DownloadLogos(): xbmc.executebuiltin( "XBMC.Notification({0}, Downloading channels logos..., {1}, {2})". format(AddonName, 300000, icon)) import myIPTV if not os.path.isfile(plxFile): common.UpdatePlx(remoteSettings["plxUrl"], plxFile) myIPTV.SaveChannelsLogos(iptvLogosDir) xbmc.executebuiltin( "XBMC.Notification({0}, Channels logos saved., {1}, {2})".format( AddonName, 5000, icon))
def DownloadLogos(): xbmc.executebuiltin( "XBMC.Notification({0}, Downloading channels logos..., {1}, {2})". format(AddonName, 300000, icon)) import myIPTV if not os.path.isfile(plxFile): common.UpdatePlx(package["url"], plxFile) myIPTV.SaveChannelsLogos(user_dataDir, "israelive.plx", "Main", os.path.join(user_dataDir, "logos")) xbmc.executebuiltin( "XBMC.Notification({0}, Chhannels logos saved., {1}, {2})".format( AddonName, 5000, icon))
def CheckUpdates(): common.CheckNewVersion() remoteSettings = common.GetUpdatedList(remoteSettingsFile, remoteSettingsUrl) if remoteSettings == []: return global checkInterval try: checkInterval = remoteSettings["checkInterval"] * 3600 # in hours except: pass isPlxUpdated = False #if common.UpdatePlx(remoteSettings["plxUrl"], plxFile, refreshInterval=remoteSettings["plxRefresh"] * 3600): # isPlxUpdated = True common.UpdatePlx(remoteSettings["plxUrl"], plxFile, refreshInterval=remoteSettings["plxRefresh"] * 3600) if Addon.getSetting("useEPG") == "true": ''' #isGuideUpdated = False #if common.isFileOld(globalGuideFile, remoteSettings["globalGuideRefresh"] * 3600) and common.UpdateZipedFile(globalGuideFile, remoteSettings["globalGuideUrl"]): # isGuideUpdated = True #if common.isFileOld(filmonGuideFile, remoteSettings["filmonGuideRefresh"] * 3600) and common.UpdateZipedFile(filmonGuideFile, remoteSettings["filmonGuideUrl"]): # isGuideUpdated = True #if isGuideUpdated: # common.MergeGuides(globalGuideFile, filmonGuideFile, fullGuideFile) ''' common.isFileOld(globalGuideFile, remoteSettings["globalGuideRefresh"] * 3600) and common.UpdateZipedFile( globalGuideFile, remoteSettings["globalGuideUrl"]) common.isFileOld(filmonGuideFile, remoteSettings["filmonGuideRefresh"] * 3600) and common.UpdateZipedFile( filmonGuideFile, remoteSettings["filmonGuideUrl"]) common.MergeGuides(globalGuideFile, filmonGuideFile, fullGuideFile) if Addon.getSetting("useIPTV") == "true": ''' if isPlxUpdated: myIPTV.makeIPTVlist(iptvChannelsFile, portNum) if isGuideUpdated: myIPTV.MakeChannelsGuide(fullGuideFile, iptvGuideFile) if isPlxUpdated or isGuideUpdated: myIPTV.RefreshPVR(iptvChannelsFile, iptvGuideFile, iptvLogosDir) ''' myIPTV.makeIPTVlist(iptvChannelsFile, portNum) myIPTV.MakeChannelsGuide(fullGuideFile, iptvGuideFile) myIPTV.RefreshPVR(iptvChannelsFile, iptvGuideFile, iptvLogosDir) myIPTV.SaveChannelsLogos(iptvLogosDir)
def CheckUpdates(): common.CheckNewVersion() global remoteSettings remoteSettings = common.GetUpdatedList(remoteSettingsFile, "remoteSettings", remoteSettings, forceUpdate=True) if remoteSettings == []: global pvrStoped if pvrStoped: xbmc.executebuiltin('StartPVRManager') return global checkInterval try: checkInterval = remoteSettings["remoteSettings"][ "refresh"] * 3600 # in hours except: pass refresh = common.GetSubKeyValue(remoteSettings, "plx", "refresh") if not refresh is None: common.UpdatePlx(plxFile, "plx", remoteSettings, refreshInterval=refresh * 3600) if Addon.getSetting("useEPG") == "true": refresh = common.GetSubKeyValue(remoteSettings, "globalGuide", "refresh") if not refresh is None: common.isFileOld( globalGuideFile, refresh * 3600) and common.UpdateZipedFile( globalGuideFile, "globalGuide", remoteSettings) refresh = common.GetSubKeyValue(remoteSettings, "filmonGuide", "refresh") if not refresh is None: common.isFileOld( filmonGuideFile, refresh * 3600) and common.UpdateZipedFile( filmonGuideFile, "filmonGuide", remoteSettings) common.MergeGuides(globalGuideFile, filmonGuideFile, fullGuideFile) if Addon.getSetting("useIPTV") == "true": myIPTV.makeIPTVlist(iptvChannelsFile, portNum) myIPTV.MakeChannelsGuide(fullGuideFile, iptvGuideFile) myIPTV.RefreshPVR(iptvChannelsFile, iptvGuideFile, iptvLogosDir) myIPTV.SaveChannelsLogos(iptvLogosDir)
def Update(): remoteSettings = common.GetRemoteSettings() refresh = common.GetSubKeyValue(remoteSettings, "remoteSettingsZip", "refresh") forceUpdate = True if refresh is None or common.isFileOld(remoteSettingsFile, refresh * 3600) else False common.UpdateFile(remoteSettingsFile, "remoteSettingsZip", remoteSettings, zip=True, forceUpdate=forceUpdate) remoteSettings = common.ReadList(remoteSettingsFile) if remoteSettings == []: xbmc.executebuiltin('StartPVRManager') else: common.CheckNewVersion(remoteSettings) # Update channels-lists files refresh = common.GetSubKeyValue(remoteSettings, "lists", "refresh") if not refresh is None: common.UpdateChList(remoteSettings, refreshInterval = refresh * 3600, forceUpdate = False) # Update EPG files for selected LiveTV channels first isGuideUpdated = False if Addon.getSetting("useEPG") == "true": refresh = common.GetSubKeyValue(remoteSettings, "fullGuide", "refresh") if refresh is not None and common.isFileOld(fullGuideFile, refresh * 3600) and common.UpdateFile(fullGuideFile, "fullGuide", remoteSettings, zip=True): isGuideUpdated = True epg = common.ReadList(fullGuideFile) fullCategoriesList = [] selectedCategoriesList = [] categoriesList = [] iptvList = Addon.getSetting("iptvList") if iptvList == "0": # Favourites categoriesList = [{"id": "Favourites"}] elif iptvList == "1": # No filter categoriesList = fullCategoriesList = common.ReadList(os.path.join(user_dataDir, "lists", "categories.list")) elif iptvList == "2": # Selected categories categoriesList = selectedCategoriesList = common.ReadList(os.path.join(user_dataDir, "lists", "selectedCategories.list")) common.MakeCatGuides(categoriesList, epg) useIPTV = common.getUseIPTV() # Update LiveTV channels and EPG if useIPTV: import myIPTV myIPTV.makeIPTVlist(iptvChannelsFile) myIPTV.MakeChannelsGuide(fullGuideFile, iptvGuideFile) myIPTV.RefreshPVR(iptvChannelsFile, iptvGuideFile, iptvLogosDir) # Update EPG files for non-selected LiveTV channels if isGuideUpdated: if fullCategoriesList == []: fullCategoriesList = common.ReadList(os.path.join(user_dataDir, "lists", "categories.list")) if iptvList == "0": # Favourites categoriesList = fullCategoriesList elif iptvList == "1": # No filter categoriesList = [{"id": "Favourites"}] elif iptvList == "2": # Selected categories categoriesList = common.GetUnSelectedList(fullCategoriesList, selectedCategoriesList) categoriesList.append({"id": "Favourites"}) common.MakeCatGuides(categoriesList, epg) # Update channels-logos files if useIPTV and myIPTV.GetIptvType() < 2: myIPTV.SaveChannelsLogos(iptvLogosDir) checkInterval = 720 # 12 hours = 720 minutes try: checkInterval = remoteSettings["checkInterval"] * 60 # hours to minutes except: pass xbmc.executebuiltin("XBMC.AlarmClock({0},XBMC.RunPlugin(plugin://plugin.video.israelive/default.py?mode=100&url=checkUpdates),{1},silent)".format("IsraeLiveUpdates", checkInterval))
if fullCategoriesList == []: fullCategoriesList = common.ReadList( os.path.join(user_dataDir, "lists", "categories.list")) if iptvList == "0": # Favourites categoriesList = fullCategoriesList elif iptvList == "1": # No filter categoriesList = [{"id": "Favourites"}] elif iptvList == "2": # Selected categories categoriesList = common.GetUnSelectedList( fullCategoriesList, selectedCategoriesList) categoriesList.append({"id": "Favourites"}) common.MakeCatGuides(categoriesList, epg) if Addon.getSetting("useIPTV") == "true": myIPTV.SaveChannelsLogos(iptvLogosDir) checkInterval = 720 # 12 hours = 720 minutes try: checkInterval = remoteSettings["remoteSettings"][ "refresh"] * 60 # hours to minutes except: pass xbmc.executebuiltin( "XBMC.AlarmClock({0},XBMC.RunScript({1}),{2},silent)".format( "IsraeLiveUpdates", os.path.join(libDir, "checkUpdates.py"), checkInterval)) xbmc.executebuiltin( "XBMC.AlarmClock({0},XBMC.RunScript({1}),{2},silent)".format( "IsraeLiveM3U", os.path.join(libDir, "updateM3U.py"), 360))