def enable_iptv(): xbmc_path = control.join('special://xbmc', 'addons', 'pvr.iptvsimple') home_path = control.join('special://home', 'addons', 'pvr.iptvsimple') if control.condVisibility('Pvr.HasTVChannels') and ( path.exists(control.transPath(xbmc_path)) or path.exists(control.transPath(home_path)) ) and control.addon_details('pvr.iptvsimple').get('enabled'): control.infoDialog(message=control.lang(30407), time=4000) elif not path.exists(control.join(iptv_folder, 'settings.xml')): control.infoDialog(message=control.lang(30409), time=4000) else: if control.yesnoDialog(line1=control.lang(30406)): control.enable_addon('pvr.iptvsimple') if control.infoLabel( 'System.AddonVersion(xbmc.python)') == '2.24.0': control.execute('StartPVRManager')
def check_inputstream_addon(): try: addon_enabled = control.addon_details('inputstream.adaptive').get('enabled') except KeyError: addon_enabled = False leia_plus = control.kodi_version() >= 18.0 first_time_file = control.join(control.dataPath, 'first_time') if not addon_enabled and not file_exists(first_time_file) and leia_plus: try: yes = control.yesnoDialog(control.lang(30014)) if yes: control.enable_addon('inputstream.adaptive') control.infoDialog(control.lang(30402)) with open(first_time_file, 'a'): pass except Exception: pass
def rtmp_enable(): if control.kodi_version() < 17.0: control.infoDialog(control.lang(30322)) return try: enabled = control.addon_details('inputstream.rtmp').get('enabled') except Exception: enabled = False try: if enabled: control.infoDialog(control.lang(30276)) return else: xbmc_path = control.join('special://xbmc', 'addons', 'inputstream.rtmp') home_path = control.join('special://home', 'addons', 'inputstream.rtmp') if path.exists(control.transPath(xbmc_path)) or path.exists( control.transPath(home_path)): yes = control.yesnoDialog(control.lang(30277)) if yes: control.enable_addon('inputstream.rtmp') control.infoDialog(control.lang(30402)) else: try: control.execute('InstallAddon(inputstream.rtmp)') except Exception: control.okDialog(heading='AliveGR', line1=control.lang(30323)) except Exception: control.infoDialog(control.lang(30279))
def isa_enable(): if addon_version('xbmc.python') < 2250: control.infoDialog(control.lang(30322)) return try: enabled = control.addon_details('inputstream.adaptive').get('enabled') except Exception: enabled = False try: if enabled: control.infoDialog(control.lang(30254)) return else: xbmc_path = control.join('special://xbmc', 'addons', 'inputstream.adaptive') home_path = control.join('special://home', 'addons', 'inputstream.adaptive') if path.exists(control.transPath(xbmc_path)) or path.exists(control.transPath(home_path)): yes = control.yesnoDialog(control.lang(30252)) if yes: control.enable_addon('inputstream.adaptive') control.infoDialog(control.lang(30402)) else: try: control.execute('InstallAddon(inputstream.adaptive)') except Exception: control.okDialog(heading='AliveGR', line1=control.lang(30323)) except Exception: control.infoDialog(control.lang(30278))
def log_upload(): exists = control.condVisibility('System.HasAddon(script.kodi.loguploader)') addon_path = control.transPath(control.join('special://', 'home', 'addons', 'script.kodi.loguploader')) if not exists: if path.exists(addon_path): control.enable_addon('script.kodi.loguploader') else: control.execute('InstallAddon(script.kodi.loguploader)') while not path.exists(addon_path): control.sleep(1000) else: control.execute('RunScript(script.kodi.loguploader)') else: control.execute('RunScript(script.kodi.loguploader)')