Exemple #1
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)
Exemple #2
0
def CATEGORIES():
    common.CheckNewVersion(remoteSettings)

    addDir(
        "[COLOR yellow][B][{0}][/B][/COLOR]".format(
            localizedString(30239).encode('utf-8')),
        50,
        'https://www.ostraining.com/cdn/images/coding/setting.png',
        background=
        "http://3.bp.blogspot.com/-vVfHI8TbKA4/UBAbrrZay0I/AAAAAAAABRM/dPFgXAnF8Sg/s1600/retro-tv-icon.jpg"
    )
    addDir(
        "[COLOR {0}][B][{1}][/B][/COLOR]".format(
            Addon.getSetting("favColor"),
            localizedString(30000).encode('utf-8')),
        16,
        'http://cdn3.tnwcdn.com/files/2010/07/bright_yellow_star.png',
        background=
        "http://3.bp.blogspot.com/-vVfHI8TbKA4/UBAbrrZay0I/AAAAAAAABRM/dPFgXAnF8Sg/s1600/retro-tv-icon.jpg"
    )

    if useCategories:
        categories = common.ReadList(selectedCategoriesFile)
        ind = -1
        for category in categories:
            ind += 1
            try:
                if category.has_key("type") and category["type"] == "ignore":
                    continue
                addDir(
                    "[COLOR {0}][B][{1}][/B][/COLOR]".format(
                        Addon.getSetting("catColor"),
                        category["name"].encode("utf-8")),
                    2,
                    category["image"],
                    background=
                    "http://3.bp.blogspot.com/-vVfHI8TbKA4/UBAbrrZay0I/AAAAAAAABRM/dPFgXAnF8Sg/s1600/retro-tv-icon.jpg",
                    channelID=category["id"],
                    categoryID=category["group"],
                    index=ind)
            except Exception as ex:
                xbmc.log("{0}".format(ex), 3)
    else:
        ListLive(
            categoryID="9999",
            iconimage=
            "http://3.bp.blogspot.com/-vVfHI8TbKA4/UBAbrrZay0I/AAAAAAAABRM/dPFgXAnF8Sg/s1600/retro-tv-icon.jpg",
            showSearch=True)

    SetViewMode()
Exemple #3
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)
Exemple #4
0
def CATEGORIES():
    xbmc.executebuiltin(
        "XBMC.RunScript({0})".format(os.path.join(libDir, "repoCheck.py")),
        True)
    common.CheckNewVersion()

    addDir(
        "[COLOR {0}][B][{1}][/B][/COLOR]".format(
            Addon.getSetting("favColor"),
            localizedString(30000).encode('utf-8')),
        'favorites',
        16,
        'http://cdn3.tnwcdn.com/files/2010/07/bright_yellow_star.png',
        '',
        channelName=localizedString(30000).encode('utf-8'),
        background=
        "http://3.bp.blogspot.com/-vVfHI8TbKA4/UBAbrrZay0I/AAAAAAAABRM/dPFgXAnF8Sg/s1600/retro-tv-icon.jpg"
    )

    if useCategories:
        categories = common.ReadList(selectedCategoriesFile)
        ind = -1
        for category in categories:
            ind += 1
            try:
                if category.has_key("type") and category["type"] == "ignore":
                    continue
                addDir(
                    "[COLOR {0}][B][{1}][/B][/COLOR]".format(
                        Addon.getSetting("catColor"),
                        category["name"].encode("utf-8")),
                    'cat',
                    2,
                    category["image"],
                    '',
                    channelName=category["id"],
                    background=
                    "http://3.bp.blogspot.com/-vVfHI8TbKA4/UBAbrrZay0I/AAAAAAAABRM/dPFgXAnF8Sg/s1600/retro-tv-icon.jpg",
                    channelID=ind)
            except Exception as ex:
                print ex
    else:
        ListLive(
            "9999",
            "http://3.bp.blogspot.com/-vVfHI8TbKA4/UBAbrrZay0I/AAAAAAAABRM/dPFgXAnF8Sg/s1600/retro-tv-icon.jpg"
        )

    SetViewMode()
Exemple #5
0
def CATEGORIES():
    repoCheck.UpdateRepo()
    common.CheckNewVersion()
    addDir("[COLOR {0}][B][{1}][/B][/COLOR]".format(
        Addon.getSetting("favColor"),
        localizedString(30000).encode('utf-8')),
           'favorits',
           16,
           'http://cdn3.tnwcdn.com/files/2010/07/bright_yellow_star.png',
           '',
           channelName=localizedString(30000).encode('utf-8'))
    ListLive(
        "pallive",
        "http://3.bp.blogspot.com/-vVfHI8TbKA4/UBAbrrZay0I/AAAAAAAABRM/dPFgXAnF8Sg/s1600/retro-tv-icon.jpg"
    )
    SetViewMode()
Exemple #6
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))
Exemple #7
0
import xbmc, xbmcaddon, os, sys

AddonID = "plugin.video.israelive"
Addon = xbmcaddon.Addon(AddonID)
AddonName = Addon.getAddonInfo("name")
icon = Addon.getAddonInfo('icon')
addonPath = xbmc.translatePath(Addon.getAddonInfo("path")).decode("utf-8")
libDir = os.path.join(addonPath, 'resources', 'lib')
sys.path.insert(0, libDir)
import common
common.CheckNewVersion()

user_dataDir = xbmc.translatePath(
    Addon.getAddonInfo("profile")).decode("utf-8")
if not os.path.exists(user_dataDir):
    os.makedirs(user_dataDir)

remoteSettingsFile = os.path.join(user_dataDir, "remoteSettings.txt")
plxFile = os.path.join(user_dataDir, "israelive.plx")
fullGuideFile = os.path.join(user_dataDir, 'fullGuide.txt')
iptvChannelsFile = os.path.join(user_dataDir, "iptv.m3u")
iptvGuideFile = os.path.join(user_dataDir, "guide.xml")
iptvLogosDir = os.path.join(user_dataDir, "logos")
remoteSettings = common.GetRemoteSettings()
remoteSettings = common.GetUpdatedList(remoteSettingsFile,
                                       "remoteSettings",
                                       remoteSettings,
                                       forceUpdate=True)
if remoteSettings == []:
    xbmc.executebuiltin('StartPVRManager')
else: