예제 #1
0
파일: updateM3U.py 프로젝트: bialagary/mw
def Update():
    if Addon.getSetting("useIPTV") == "true":
        myIPTV.makeIPTVlist(iptvChannelsFile)
        myIPTV.RefreshPVR(iptvChannelsFile, iptvGuideFile, iptvLogosDir)
    xbmc.executebuiltin(
        "XBMC.AlarmClock({0},XBMC.RunPlugin(plugin://plugin.video.israelive/default.py?mode=101&url=checkUpdates),{1},silent)"
        .format("IsraeLiveM3U", 720))
예제 #2
0
def MakeIPTVlists():
    xbmc.executebuiltin(
        "XBMC.Notification({0}, Making IPTV channels list..., {1}, {2})".
        format(AddonName, 300000, icon))
    portNum = 65007
    try:
        portNum = int(Addon.getSetting("LiveStreamerPort"))
    except:
        pass
    import myIPTV
    if not os.path.isfile(plxFile):
        common.UpdatePlx(package["url"], plxFile)
    myIPTV.makeIPTVlist(user_dataDir, "israelive.plx", "Main",
                        os.path.join(user_dataDir, "iptv.m3u"), portNum)
    xbmc.executebuiltin(
        "XBMC.Notification({0}, Making IPTV TV-guide..., {1}, {2})".format(
            AddonName, 300000, icon))
    myIPTV.MakeChannelsGuide(globalGuideFile,
                             remoteSettings["globalGuide"]["url"],
                             filmonGuideFile, package["guide"],
                             os.path.join(user_dataDir, "guide.xml"))
    myIPTV.RefreshPVR(os.path.join(user_dataDir, "iptv.m3u"),
                      os.path.join(user_dataDir, "guide.xml"),
                      os.path.join(user_dataDir, "logos"))
    xbmc.executebuiltin(
        "XBMC.Notification({0}, IPTV channels list and TV-guide created., {1}, {2})"
        .format(AddonName, 5000, icon))
예제 #3
0
파일: default.py 프로젝트: bialagary/mw
def UpdateIPTVSimple():
    xbmc.executebuiltin(
        "XBMC.Notification({0}, Updating IPTVSimple settings..., {1}, {2})".
        format(AddonName, 300000, icon))
    myIPTV.RefreshPVR(iptvChannelsFile, iptvGuideFile, iptvLogosDir, 0)
    xbmc.executebuiltin(
        "XBMC.Notification({0}, IPTVSimple settings updated., {1}, {2})".
        format(AddonName, 5000, icon))
예제 #4
0
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))
예제 #5
0
def MakeIPTVlists():
	xbmc.executebuiltin("XBMC.Notification({0}, Making IPTV channels list..., {1}, {2})".format(AddonName, 300000 ,icon))
	if not os.path.isfile(listsFile):
		common.UpdateChList()
	myIPTV.makeIPTVlist(iptvChannelsFile)
	xbmc.executebuiltin("XBMC.Notification({0}, Making IPTV TV-guide..., {1}, {2})".format(AddonName, 300000 ,icon))
	myIPTV.MakeChannelsGuide(fullGuideFile, iptvGuideFile)
	myIPTV.RefreshPVR(iptvChannelsFile, iptvGuideFile, iptvLogosDir, forceUpdate=True)
	xbmc.executebuiltin("XBMC.Notification({0}, IPTV channels list and TV-guide created., {1}, {2})".format(AddonName, 5000 ,icon))
예제 #6
0
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))
예제 #7
0
def UpdateIPTVSimple():
    xbmc.executebuiltin(
        "XBMC.Notification({0}, Updating IPTVSimple settings..., {1}, {2})".
        format(AddonName, 300000, icon))
    import myIPTV
    myIPTV.RefreshPVR(os.path.join(user_dataDir, "iptv.m3u"),
                      os.path.join(user_dataDir, "guide.xml"),
                      os.path.join(user_dataDir, "logos"), 0)
    xbmc.executebuiltin(
        "XBMC.Notification({0}, IPTVSimple settings Updated., {1}, {2})".
        format(AddonName, 5000, icon))
예제 #8
0
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)
예제 #9
0
def CheckUpdates():
    remoteSettings = common.GetUpdatedList(remoteSettingsFile,
                                           remoteSettingsUrl)
    if remoteSettings == []:
        return

    global checkInterval
    try:
        checkInterval = remoteSettings["checkInterval"] * 3600  # in hours
    except:
        pass

    useIPTV = True if Addon.getSetting("useIPTV") == "true" else False

    package = remoteSettings["packages"]["full"]

    isM3uUpdated = False
    if common.UpdatePlx(
            package["url"], plxFile,
            refreshInterval=package["plxRefresh"] * 3600) and useIPTV:
        myIPTV.makeIPTVlist(os.path.join(user_dataDir, 'lists'),
                            "israelive.plx", "Main",
                            os.path.join(user_dataDir, "iptv.m3u"), portNum)
        isM3uUpdated = True

    if Addon.getSetting("useEPG") == "false":
        return

    isGuideUpdated = False
    if common.isFileOld(
            globalGuideFile, remoteSettings["globalGuide"]["refresh"] *
            3600) and common.UpdateZipedFile(
                globalGuideFile, remoteSettings["globalGuide"]["url"]):
        isGuideUpdated = True

    if common.isFileOld(filmonGuideFile,
                        package["refresh"] * 3600) and common.UpdateZipedFile(
                            filmonGuideFile, package["guide"]):
        isGuideUpdated = True

    if isGuideUpdated and useIPTV:
        myIPTV.MakeChannelsGuide(globalGuideFile,
                                 remoteSettings["globalGuide"]["url"],
                                 filmonGuideFile, package["guide"],
                                 os.path.join(user_dataDir, "guide.xml"))

    if isM3uUpdated or isGuideUpdated:
        myIPTV.RefreshPVR(os.path.join(user_dataDir, "iptv.m3u"),
                          os.path.join(user_dataDir, "guide.xml"),
                          os.path.join(user_dataDir, "logos"))
예제 #10
0
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)
예제 #11
0
def MakeIPTVlists():
    xbmc.executebuiltin(
        "XBMC.Notification({0}, Making IPTV channels list..., {1}, {2})".
        format(AddonName, 300000, icon))
    portNum = 65007
    try:
        portNum = int(Addon.getSetting("LiveStreamerPort"))
    except:
        pass
    if not os.path.isfile(plxFile):
        common.UpdatePlx(plxFile, "plx", forceUpdate=True)
    myIPTV.makeIPTVlist(iptvChannelsFile, portNum)
    xbmc.executebuiltin(
        "XBMC.Notification({0}, Making IPTV TV-guide..., {1}, {2})".format(
            AddonName, 300000, icon))
    myIPTV.MakeChannelsGuide(fullGuideFile, iptvGuideFile)
    myIPTV.RefreshPVR(iptvChannelsFile, iptvGuideFile, iptvLogosDir)
    xbmc.executebuiltin(
        "XBMC.Notification({0}, IPTV channels list and TV-guide created., {1}, {2})"
        .format(AddonName, 5000, icon))
예제 #12
0
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))
예제 #13
0
            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)

        if Addon.getSetting("useIPTV") == "true":
            import myIPTV
            myIPTV.makeIPTVlist(iptvChannelsFile)
            if isGuideUpdated:
                myIPTV.MakeChannelsGuide(fullGuideFile, iptvGuideFile)
            myIPTV.RefreshPVR(iptvChannelsFile, iptvGuideFile, iptvLogosDir)

        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)