def GetIptvAddon(): iptvAddon = None if xbmc.getCondVisibility("System.HasAddon(pvr.iptvsimple)"): try: iptvAddon = xbmcaddon.Addon("pvr.iptvsimple") except: pass if iptvAddon is None: import platform osType = platform.system() osVer = platform.release() xbmcVer = xbmc.getInfoLabel( "System.BuildVersion" )[:2] xbmc.log("---- {0} ----\nIPTVSimple addon is disable.".format(AddonName), 2) xbmc.log("---- {0} ----\nosType: {1}\nosVer: {2}\nxbmcVer: {3}".format(AddonName, osType, osVer, xbmcVer), 2) msg1 = "PVR IPTV Simple Client is Disable." msg2 = "Please enable PVR IPTV Simple Client addon." common.OKmsg(AddonName, msg1, msg2) return iptvAddon
def GetIptvAddon(show_message=False): iptvAddon = None if os.path.exists( xbmcvfs.translatePath("special://home/addons/").encode().decode( "utf-8") + 'pvr.iptvsimple') or os.path.exists( xbmcvfs.translatePath("special://xbmc/addons/").encode(). decode("utf-8") + 'pvr.iptvsimple'): try: iptvAddon = xbmcaddon.Addon("pvr.iptvsimple") except: print("---- Annatel ----\nIPTVSimple addon is disable.") msg1 = "PVR IPTVSimple is Disable." msg2 = "Please enable IPTVSimple addon." else: msg1 = "PVR IPTVSimple is NOT installed on your machine." msg2 = "Please install XBMC version that include IPTVSimple in it." if ((iptvAddon is None) and (show_message)): common.OKmsg(msg1, msg2) return iptvAddon
AddNewDirectory() elif mode == 44: ShowDirectoryContents(uuid) elif mode == 45: AddToDirectory(uuid) elif mode == 46: DeleteDirectory(uuid, with_contents=True) elif mode == 47: DeleteDirectory(uuid) elif mode == 40: common.OKmsg("Playlist Loader", "Comming soon !!") """ xbmc.log("The movie db scan request", xbmc.LOGERROR) # First make sure no the tv db data was here. if common.isScannedByTheTvDB(index): common.removeTheTvDBData(index) """ elif mode == 41: if makeGroups: # First make sur no scan from the movie db was here. if common.isScannedByTheMovieDB(index): common.removeTheMovieDBData(index) token = common.getTheTvDbToken() if token is False: common.OKmsg("The TV Db 1", getLocaleString(30042))
import sys, xbmc from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler #from SocketServer import ThreadingMixIn import socket #import thread import threading try: from livestreamer import Livestreamer #import livestreamer except: import common, xbmcaddon, sys localizedString = xbmcaddon.Addon("plugin.video.israelive").getLocalizedString if common.InstallAddon('script.module.israeliveresolver'): common.OKmsg(localizedString(30236).encode('utf-8'), localizedString(30201).encode('utf-8')) else: common.OKmsg(localizedString(30237).encode('utf-8'), localizedString(30238).encode('utf-8')) sys.exit() from urllib import unquote import player LIVESTREAMER = None httpd = None def Streamer(wfile, url, quality): global LIVESTREAMER channel = LIVESTREAMER.resolve_url(url) streams = channel.get_streams() #streams = livestreamer.streams(url)
def UpdateIPTVSimpleSettings(m3uPath, epgPath, logoPath): iptvSettingsFile = os.path.join( xbmc.translatePath("special://profile").decode("utf-8"), "addon_data", "pvr.iptvsimple", "settings.xml") if not os.path.isfile(iptvSettingsFile): iptvAddon = GetIptvAddon() if iptvAddon is None: return False iptvAddon.setSetting( "epgPathType", "0" ) # make 'settings.xml' in 'userdata/addon_data/pvr.iptvsimple' folder oldIptv = GetIptvType() < 2 # get settings.xml into dictionary dict = ReadSettings(iptvSettingsFile, fromFile=True) if dict is None: msg1 = "Oops." msg2 = "Can't update IPTVSimple settings." common.OKmsg(AddonName, msg1, msg2) return False isSettingsChanged = False # make changes if dict.has_key("m3uPathType") and dict["m3uPathType"] != "0": dict["m3uPathType"] = "0" isSettingsChanged = True if dict.has_key("m3uPath") and dict["m3uPath"] != m3uPath: dict["m3uPath"] = m3uPath isSettingsChanged = True if dict.has_key("epgPathType") and dict["epgPathType"] != "0": dict["epgPathType"] = "0" isSettingsChanged = True if dict.has_key("epgPath") and dict["epgPath"] != epgPath: dict["epgPath"] = epgPath isSettingsChanged = True if oldIptv: if dict.has_key("logoPathType") and dict["logoPathType"] != "0": dict["logoPathType"] = "0" isSettingsChanged = True if dict.has_key("logoPath") and dict["logoPath"] != logoPath: dict["logoPath"] = logoPath isSettingsChanged = True else: if dict.has_key("logoPathType") and dict["logoPathType"] != "1": dict["logoPathType"] = "1" isSettingsChanged = True if dict.has_key("logoBaseUrl") and dict["logoBaseUrl"] != "": dict["logoBaseUrl"] = "" isSettingsChanged = True if not isSettingsChanged: return True #make new settings.xml (string) xml = "<settings>\n" for k, v in dict.iteritems(): xml += '\t<setting id="{0}" value="{1}" />\n'.format(k, v) xml += "</settings>\n" # write updates back to settings.xml with open(iptvSettingsFile, 'w') as f: f.write(xml) return True