Example #1
0
def RefreshPVR(m3uPath, epgPath, logoPath, forceUpdate=False, forceUpdateIPTV=False):
	if forceUpdateIPTV or common.getAutoIPTV():
		UpdateIPTVSimpleSettings(m3uPath, epgPath, logoPath)
	kodi16 = True if common.GetKodiVer() < 17 else False
	if Addon.getSetting("autoPVR") == "true":
		if (not json.loads(xbmc.executeJSONRPC('{"jsonrpc":"2.0","method":"Addons.GetAddonDetails","params":{"addonid":"pvr.iptvsimple", "properties": ["enabled"]},"id":1}'))['result']['addon']['enabled'] or (kodi16 and not json.loads(xbmc.executeJSONRPC('{"jsonrpc":"2.0", "method":"Settings.GetSettingValue", "params":{"setting":"pvrmanager.enabled"},"id":1}'))['result']['value'])):
			tvOption = common.GetMenuSelected(localizedString(30317).encode('utf-8'), [localizedString(30318).encode('utf-8'), localizedString(30319).encode('utf-8')])
			if tvOption != 0:
				if tvOption == 1:
					Addon.setSetting("useIPTV", "False")
				return False
		isIPTVnotRestarted = not EnableIptvClient() and not kodi16
		isPVRnotRestarted = kodi16 and not EnablePVR()
		if isIPTVnotRestarted and forceUpdate:
			xbmc.executeJSONRPC('{"jsonrpc":"2.0","method":"Addons.SetAddonEnabled","params":{"addonid":"pvr.iptvsimple","enabled":false},"id":1}')
			xbmc.executeJSONRPC('{"jsonrpc":"2.0","method":"Addons.SetAddonEnabled","params":{"addonid":"pvr.iptvsimple","enabled":true},"id":1}')
			#iptvAddon = GetIptvAddon()
			#if iptvAddon is None:
			#	return False
			#iptvAddon.setSetting("m3uPathType", iptvAddon.getSetting("m3uPathType"))
		if isPVRnotRestarted:
			xbmc.executebuiltin('StopPVRManager')
			xbmc.executebuiltin('StartPVRManager')
		return True
	else:
		return False
Example #2
0
def RefreshPVR(m3uPath, epgPath, logoPath, forceUpdate=False):
	if common.getAutoIPTV() or forceUpdate:
		UpdateIPTVSimpleSettings(m3uPath, epgPath, logoPath)
		if Addon.getSetting("autoPVR") == "true":
			EnableIptvClient()
			if not EnableIPVR():
				xbmc.executebuiltin('StopPVRManager')
				xbmc.executebuiltin('StartPVRManager')
Example #3
0
def RefreshPVR(m3uPath, epgPath, logoPath, forceUpdate=False):
    if common.getAutoIPTV() or forceUpdate:
        UpdateIPTVSimpleSettings(m3uPath, epgPath, logoPath)
        if Addon.getSetting("autoPVR") == "true":
            EnableIptvClient()
            if not EnableIPVR():
                xbmc.executebuiltin('StopPVRManager')
                xbmc.executebuiltin('StartPVRManager')
Example #4
0
def RefreshPVR(m3uPath, epgPath, logoPath, forceUpdate=False):
    if forceUpdate or common.getAutoIPTV():
        UpdateIPTVSimpleSettings(m3uPath, epgPath, logoPath)
        ver = xbmc.__version__.split('.')
        kodi17 = True if int(ver[0]) > 2 or int(
            ver[0]) == 2 and int(ver[1]) > 24 else False
        if Addon.getSetting("autoPVR") == "true":
            if (not json.loads(
                    xbmc.executeJSONRPC(
                        '{"jsonrpc":"2.0","method":"Addons.GetAddonDetails","params":{"addonid":"pvr.iptvsimple", "properties": ["enabled"]},"id":1}'
                    ))['result']['addon']['enabled'] or
                (not kodi17 and not json.loads(
                    xbmc.executeJSONRPC(
                        '{"jsonrpc":"2.0", "method":"Settings.GetSettingValue", "params":{"setting":"pvrmanager.enabled"},"id":1}'
                    ))['result']['value'])):
                tvOption = common.GetMenuSelected(
                    localizedString(30317).encode('utf-8'), [
                        localizedString(30318).encode('utf-8'),
                        localizedString(30319).encode('utf-8')
                    ])
                if tvOption != 0:
                    if tvOption == 1:
                        Addon.setSetting("useIPTV", "False")
                    return False
            isIPTVnotRestarted = not EnableIptvClient() and kodi17
            isPVRnotRestarted = not kodi17 and not EnablePVR()
            if isIPTVnotRestarted and forceUpdate:
                xbmc.executeJSONRPC(
                    '{"jsonrpc":"2.0","method":"Addons.SetAddonEnabled","params":{"addonid":"pvr.iptvsimple","enabled":false},"id":1}'
                )
                xbmc.executeJSONRPC(
                    '{"jsonrpc":"2.0","method":"Addons.SetAddonEnabled","params":{"addonid":"pvr.iptvsimple","enabled":true},"id":1}'
                )
            if isPVRnotRestarted:
                xbmc.executebuiltin('StopPVRManager')
                xbmc.executebuiltin('StartPVRManager')
        return True
    else:
        return False
Example #5
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))
Example #6
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))
Example #7
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))
Example #8
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))
Example #9
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))