def isMarkedListsChange(): markedListsFilename = os.path.join(addon_data_dir, "lists", "markedLists.txt") oldList = common.ReadList(markedListsFilename) newList = common.GetMarkedLists() #oldList = [x.encode('UTF8') for x in oldList] return cmp(oldList, newList) != 0
def RefreshIPTVlinks(): iptvAddon = GetIptvAddon() if iptvAddon == None: return False xbmc.executebuiltin("XBMC.Notification(ISRALIVE, Updating links..., {0}, {1})".format(300000 ,icon)) markedLists = common.GetMarkedLists() markedListsFilename = os.path.join(addon_data_dir, "lists", "markedLists.txt") with open(markedListsFilename, 'w') as outfile: json.dump(markedLists, outfile) outfile.close() isIptvAddonGotham = iptvAddon.getAddonInfo('version') >= "1.9.3" finalList = MakeFinalList(markedLists) finalM3Ulist = MakeM3U(finalList, isIptvAddonGotham) finalM3Ufilename = os.path.join(addon_data_dir, 'iptv.m3u') # The final m3u file. (static + filmon links) f = open(finalM3Ufilename, 'w') # make the finnal m3u list (this file will used in IPTVSimple) f.write(finalM3Ulist) f.close() if os.path.exists(xbmc.translatePath( "special://userdata/addon_data/pvr.iptvsimple")): DeleteCache() UpdateIPTVSimpleSettings(iptvAddon) xbmc.executebuiltin("XBMC.Notification(ISRALIVE, Update links is done., {0}, {1})".format(2000 ,icon)) return True
def Categories(): addDir( "[COLOR yellow][{0}][/COLOR]".format( localizedString(20101).encode('utf-8')), "settings", 10, os.path.join(AddonLogosDir, "settings.jpg")) lists = ['radio', 'uk', 'france', 'russia'] markedLists = common.GetMarkedLists() for listName in markedLists: if listName == "Main": Category(listName) else: addDir( "[COLOR blue][{0}][/COLOR]".format( localizedString(30102 + lists.index(listName)).encode('utf-8')), listName, 1, os.path.join(AddonLogosDir, "{0}.png".format(listName)))
def Categories(): addDir( "[COLOR yellow][{0}][/COLOR]".format( localizedString(20101).encode('utf-8')), "settings", 10, os.path.join(AddonLogosDir, "settings.jpg")) lists = [ "israel", "news", "music", "radio", "localRadio", "france", "russia", "others" ] markedLists = common.GetMarkedLists() for listName in markedLists: if listName == "israel": Category(listName) else: addDir( "[COLOR blue][{0}][/COLOR]".format( localizedString(30101 + lists.index(listName)).encode('utf-8')), listName, 1, os.path.join(AddonLogosDir, "{0}.png".format(listName)))
def RefreshIPTVlinks(): iptvAddon = GetIptvAddon() if iptvAddon == None: return False xbmc.executebuiltin( "XBMC.Notification(ISRALIVE, Updating links..., {0}, {1})".format( 300000, icon)) markedLists = common.GetMarkedLists() markedListsFilename = os.path.join(addon_data_dir, "lists", "markedLists.txt") with open(markedListsFilename, 'w') as outfile: json.dump(markedLists, outfile) outfile.close() isIptvAddonGotham = iptvAddon.getAddonInfo('version') >= "1.9.3" finalList = MakeFinalList(markedLists) finalM3Ulist = MakeM3U(finalList, isIptvAddonGotham) if Addon.getSetting("useM3uPath") == "true": try: f = open(Addon.getSetting("m3uPath"), 'r') lines = f.readlines() f.close() if len(lines) > 0: finalM3Ulist += '\n#EXTINF:-1 tvg-id="Local list" tvg-name="Local list" group-title="{0}" tvg-logo="",[COLOR white][B]--- {1} ---[/B][/COLOR]\nhttp://127.0.0.1\n\n'.format( "ישראלי".decode("windows-1255").encode("utf-8"), localizedString(30207).encode('utf-8')) for line in lines: if line.upper().find('#EXTM3U') == -1: finalM3Ulist += "{0}".format(line) else: finalM3Ulist += "\n" except: pass if Addon.getSetting("useM3uUrl") == "true": try: lines = common.OpenURL(Addon.getSetting("m3uUrl")).replace( '\r', '').split('\n') if len(lines) > 0: finalM3Ulist += '\n#EXTINF:-1 tvg-id="Remote list" tvg-name="Remote list" group-title="{0}" tvg-logo="",[COLOR white][B]--- {1} ---[/B][/COLOR]\nhttp://127.0.0.1\n\n'.format( "ישראלי".decode("windows-1255").encode("utf-8"), localizedString(30208).encode('utf-8')) for line in lines: if line.upper().find('#EXTM3U') == -1: finalM3Ulist += "{0}\n".format(line) except: pass finalM3Ufilename = os.path.join( addon_data_dir, 'iptv.m3u') # The final m3u file. (static + filmon links) f = open( finalM3Ufilename, 'w') # make the finnal m3u list (this file will used in IPTVSimple) f.write(finalM3Ulist) f.close() if os.path.exists( os.path.join( xbmc.translatePath("special://userdata/addon_data").decode( "utf-8"), "pvr.iptvsimple")): DeleteCache() UpdateIPTVSimpleSettings(iptvAddon) xbmc.executebuiltin( "XBMC.Notification(ISRALIVE, Update links is done., {0}, {1})".format( 2000, icon)) return True
def UpdateLogos(): markedLists = common.GetMarkedLists() finalList = MakeFinalList(markedLists) common.updateLogos(finalList)