Beispiel #1
0
def ImportFavourites():
    selectedDir = Addon.getSetting("imExFolder")
    if selectedDir is None or selectedDir == "":
        return
    files = [f for f in os.listdir(selectedDir) if f.endswith(".txt")]
    fileInd = common.GetMenuSelected(
        localizedString(30025).encode('utf-8'), files)
    if fileInd == -1:
        return
    fullPath = os.path.join(selectedDir.decode("utf-8"), files[fileInd])
    favsList = common.ReadList(fullPath)
    if not common.YesNoDialog(
            localizedString(30215).encode('utf-8'),
            localizedString(30216).encode('utf-8'),
            line2=localizedString(30217).encode('utf-8').format(len(favsList)),
            line3=localizedString(30218).encode('utf-8'),
            nolabel=localizedString(30002).encode('utf-8'),
            yeslabel=localizedString(30001).encode('utf-8')):
        return
    common.WriteList(FAV, favsList)
    common.MakeFavouritesGuide(fullGuideFile)
    xbmc.executebuiltin(
        'Notification({0}, Favourites list is saved., {2}, {3})'.format(
            AddonName, fullPath, 5000, __icon__))
    if common.getUseIPTV() and int(Addon.getSetting("iptvList")) == 0:
        MakeIPTVlists()
        DownloadLogos()
Beispiel #2
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))
Beispiel #3
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))
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))
Beispiel #5
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))
Beispiel #6
0
def ImportFavourites():
	selectedDir = Addon.getSetting("imExFolder")
	if selectedDir is None or selectedDir == "":
		return
	files = [f for f in os.listdir(selectedDir) if f.endswith(".txt")]
	fileInd = common.GetMenuSelected(localizedString(30025).encode('utf-8'), files)
	if fileInd == -1:
		return
	fullPath = os.path.join(selectedDir.decode("utf-8"), files[fileInd])
	favsList = common.ReadList(fullPath)
	if not common.YesNoDialog(localizedString(30215).encode('utf-8'), localizedString(30216).encode('utf-8'), line2=localizedString(30217).encode('utf-8').format(len(favsList)), line3=localizedString(30218).encode('utf-8'), nolabel=localizedString(30002).encode('utf-8'), yeslabel=localizedString(30001).encode('utf-8')):
		return
	common.WriteList(FAV, favsList)
	common.MakeFavouritesGuide(fullGuideFile)
	xbmc.executebuiltin('Notification({0}, Favourites list is saved., {2}, {3})'.format(AddonName, fullPath, 5000, __icon__))
	if common.getUseIPTV() and int(Addon.getSetting("iptvList")) == 0:
		MakeIPTVlists()
		DownloadLogos()
Beispiel #7
0
import xbmc, xbmcaddon, os

Addon = xbmcaddon.Addon()
libDir = os.path.join(xbmc.translatePath(Addon.getAddonInfo("path")).decode("utf-8"), 'resources', 'lib')
sys.path.insert(0, libDir)
import common

if common.getUseIPTV():
	autoIPTV = common.getAutoIPTV()
	autoPVR = Addon.getSetting("autoPVR") == "true"
	autoStopPVR = Addon.getSetting("autoStopPVR") == "true"
	if autoIPTV and autoPVR and autoStopPVR:
		xbmc.executebuiltin('StopPVRManager')
	portNum = common.GetLivestreamerPort()
	try:
		import livestreamersrv
		livestreamersrv.start(portNum)
	except Exception as ex:
		xbmc.log("{0}".format(ex), 3)

xbmc.executebuiltin("XBMC.RunPlugin(plugin://plugin.video.israelive/default.py?mode=100&url=checkUpdates)")
xbmc.executebuiltin("XBMC.AlarmClock({0},XBMC.RunPlugin(plugin://plugin.video.israelive/default.py?mode=101&url=checkUpdates),{1},silent)".format("IsraeLiveM3U", 360))
Beispiel #8
0
import xbmc, xbmcaddon, os

Addon = xbmcaddon.Addon()
libDir = os.path.join(
    xbmc.translatePath(Addon.getAddonInfo("path")).decode("utf-8"),
    'resources', 'lib')
sys.path.insert(0, libDir)
import common

if common.getUseIPTV():
    autoIPTV = common.getAutoIPTV()
    autoPVR = Addon.getSetting("autoPVR") == "true"
    autoStopPVR = Addon.getSetting("autoStopPVR") == "true"
    if autoIPTV and autoPVR and autoStopPVR:
        xbmc.executebuiltin('StopPVRManager')
    portNum = common.GetLivestreamerPort()
    try:
        import livestreamersrv
        livestreamersrv.start(portNum)
    except Exception as ex:
        xbmc.log("{0}".format(ex), 3)

xbmc.executebuiltin(
    "XBMC.RunPlugin(plugin://plugin.video.israelive/default.py?mode=100&url=checkUpdates)"
)
xbmc.executebuiltin(
    "XBMC.AlarmClock({0},XBMC.RunPlugin(plugin://plugin.video.israelive/default.py?mode=101&url=checkUpdates),{1},silent)"
    .format("IsraeLiveM3U", 360))
Beispiel #9
0
def Update():
	remoteSettings = common.GetRemoteSettings()
	refresh = common.GetSubKeyValue(remoteSettings, "remoteSettings", "refresh")
	forceUpdate = True if refresh is None or common.isFileOld(remoteSettingsFile, refresh * 3600) else False
	remoteSettings = common.GetUpdatedList(remoteSettingsFile, "remoteSettings", remoteSettings, forceUpdate=forceUpdate)
	if remoteSettings == []:
		xbmc.executebuiltin('StartPVRManager')
	else:
		common.CheckNewVersion(remoteSettings)
		#UA.CheckUA()
		# Update channels-lists files
		refresh = common.GetSubKeyValue(remoteSettings, "plx", "refresh")
		if not refresh is None:
			common.UpdatePlx(plxFile, "plx", remoteSettings, refreshInterval = refresh * 3600)

		# Update EPG files for selected LiveTV channels first
		isGuideUpdated = False
		if Addon.getSetting("useEPG") == "true":
			refresh = common.GetSubKeyValue(remoteSettings, "fullGuide", "refresh")
			if not refresh is None and common.isFileOld(fullGuideFile, refresh * 3600) and common.UpdateZipedFile(fullGuideFile, "fullGuide", remoteSettings):
				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:
			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))
Beispiel #10
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))
Beispiel #11
0
if remoteSettings == []:
	xbmc.executebuiltin('Notification({0}, Cannot load settings, {1}, {2})'.format(AddonName, 5000, icon))
	sys.exit()
plxFile = os.path.join(user_dataDir, "israelive.plx")
if not os.path.isfile(plxFile):
	common.UpdatePlx(plxFile, "plx", remoteSettings, forceUpdate=True)
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")
listsDir = os.path.join(user_dataDir, 'lists')
categoriesFile =  os.path.join(listsDir, 'categories.list')
selectedCategoriesFile =  os.path.join(listsDir, 'selectedCategories.list')
useCategories = Addon.getSetting("useCategories") == "true"
useRtmp = Addon.getSetting("StreramProtocol") == "1"
useIPTV = common.getUseIPTV()
useEPG = Addon.getSetting("useEPG") == "true"
if useEPG and not os.path.isfile(fullGuideFile):
	useEPG = False
epg = None

def CATEGORIES():
	common.CheckNewVersion(remoteSettings)

	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
Beispiel #12
0
        'Notification({0}, Cannot load settings, {1}, {2})'.format(
            AddonName, 5000, icon))
    sys.exit()
plxFile = os.path.join(user_dataDir, "israelive.plx")
if not os.path.isfile(plxFile):
    common.UpdatePlx(plxFile, "plx", remoteSettings, forceUpdate=True)
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")
listsDir = os.path.join(user_dataDir, 'lists')
categoriesFile = os.path.join(listsDir, 'categories.list')
selectedCategoriesFile = os.path.join(listsDir, 'selectedCategories.list')
useCategories = Addon.getSetting("useCategories") == "true"
useRtmp = Addon.getSetting("StreramProtocol") == "1"
useIPTV = common.getUseIPTV()
useEPG = Addon.getSetting("useEPG") == "true"
if useEPG and not os.path.isfile(fullGuideFile):
    useEPG = False
epg = None


def CATEGORIES():
    common.CheckNewVersion(remoteSettings)

    addDir(
        "[COLOR {0}][B][{1}][/B][/COLOR]".format(
            Addon.getSetting("favColor"),
            localizedString(30000).encode('utf-8')),
        'favorites',
        16,
Beispiel #13
0
import xbmc, xbmcaddon, common

Addon = xbmcaddon.Addon()

if common.GetKodiVer() < 17 and common.getUseIPTV() and common.getAutoIPTV() and Addon.getSetting("autoPVR") == "true" and  Addon.getSetting("autoStopPVR") == "true":
	xbmc.executebuiltin('StopPVRManager')

xbmc.executebuiltin("XBMC.RunPlugin(plugin://plugin.video.israelive/default.py?mode=100&url=checkUpdates)")
xbmc.executebuiltin("XBMC.AlarmClock({0},XBMC.RunPlugin(plugin://plugin.video.israelive/default.py?mode=101&url=checkUpdates),{1},silent)".format("IsraeLiveM3U", 360))
Beispiel #14
0
import xbmc, xbmcaddon, common

Addon = xbmcaddon.Addon()

if common.GetKodiVer() < 17 and common.getUseIPTV() and common.getAutoIPTV(
) and Addon.getSetting("autoPVR") == "true" and Addon.getSetting(
        "autoStopPVR") == "true":
    xbmc.executebuiltin('StopPVRManager')

xbmc.executebuiltin(
    "XBMC.RunPlugin(plugin://plugin.video.israelive/default.py?mode=100&url=checkUpdates)"
)
xbmc.executebuiltin(
    "XBMC.AlarmClock({0},XBMC.RunPlugin(plugin://plugin.video.israelive/default.py?mode=101&url=checkUpdates),{1},silent)"
    .format("IsraeLiveM3U", 360))
Beispiel #15
0
import xbmc, xbmcaddon, common

Addon = xbmcaddon.Addon()
ver = xbmc.__version__.split('.')
kodi17 = True if int(ver[0]) > 2 or int(
    ver[0]) == 2 and int(ver[1]) > 24 else False

if not kodi17 and common.getUseIPTV() and common.getAutoIPTV(
) and Addon.getSetting("autoPVR") == "true" and Addon.getSetting(
        "autoStopPVR") == "true":
    xbmc.executebuiltin('StopPVRManager')

xbmc.executebuiltin(
    "XBMC.RunPlugin(plugin://plugin.video.israelive/default.py?mode=100&url=checkUpdates)"
)
xbmc.executebuiltin(
    "XBMC.AlarmClock({0},XBMC.RunPlugin(plugin://plugin.video.israelive/default.py?mode=101&url=checkUpdates),{1},silent)"
    .format("IsraeLiveM3U", 360))