def wizard(name, url, description): path = xbmc.translatePath(os.path.join('special://home', 'media')) dp = xbmcgui.DialogProgress() dp.create("Addon Selecionado", "Baixando ", '', 'Por Favor Espere') lib = os.path.join(path, name + '.zip') try: os.remove(lib) except: pass downloader.download(url, lib, dp) addonfolder = xbmc.translatePath( os.path.join('special://', 'home/', 'addons')) time.sleep(2) dp.update(0, "", "Instalando Por Favor Espere") print('=======================================') print(addonfolder) print('=======================================') extract.all(lib, addonfolder, dp) #dialog = xbmcgui.Dialog() #dialog.ok("Baixado com Sucesso:)", 'Para continuar a Instalacao irar ser solicitado que desligue o Kodi', 'Se for uma Box precione [COLOR yellow]NAO[/COLOR] depois sai do kodi para terminar a instalacao.','[COLOR yellow][B][Kodi 17][/B][/COLOR]Ao Voltar vai Addons em Meus Addons ativa o addons instalado') time.sleep(2) xbmc.executebuiltin("XBMC.UpdateLocalAddons()") addon_able.set_enabled("") addon_able.setall_enable()
def HELPWIZARD(name,url,description,filetype): path=xbmc.translatePath(os.path.join('special://home','addons','packages')); confirm=xbmcgui.Dialog().yesno("Please Confirm"," Please confirm that you wish to automatically "," configure Kodi with all the best addons and tweaks!"," ","Cancel","Install") filetype=filetype.lower() if confirm: path=xbmc.translatePath(os.path.join('special://home','addons','packages')) dp=xbmcgui.DialogProgress() dp.create(AddonTitle," ",'Downloading and Configuring ','Please Wait') lib=os.path.join(path,name+'.zip') try: os.remove(lib) except: pass ### ## ... ## #kodi.log(url) if str(url).endswith('[error]'): print url; dialog=xbmcgui.Dialog(); dialog.ok("Error!",url); return if '[error]' in url: print url; dialog=xbmcgui.Dialog(); dialog.ok("Error!",url); return downloader.download(url,lib,dp) if filetype=='main': addonfolder=xbmc.translatePath('special://home') elif filetype=='addon': addonfolder=xbmc.translatePath(os.path.join('special://home','addons')) else: print {'filetype':filetype}; dialog=xbmcgui.Dialog(); dialog.ok("Error!",'filetype: "%s"'%str(filetype)); return xbmc.sleep(4000) extract.all(lib,addonfolder,dp) xbmc.executebuiltin("XBMC.UpdateLocalAddons()") addon_able.setall_enable() try: os.remove(lib) except: pass if filetype=='main': link=OPEN_URL(cutslink) shorts=re.compile('shortcut="(.+?)"').findall(link) for shortname in shorts: xEB('Skin.SetString(%s)'%shortname) enableBG16 = "UseCustomBackground,true" enableBG17 = "use_custom_bg,true" xEB('Skin.SetBool(%s)'%enableBG16) xEB('Skin.SetBool(%s)'%enableBG17) xbmc.sleep(4000); xbmc.executebuiltin('XBMC_UpdateLocalAddons()') addon_able.setall_enable() kodi.set_setting("wizardran",'true') dialog=xbmcgui.Dialog() dialog.ok(TeamName,"Installation Complete!","","Click OK to exit Kodi and then restart to complete .") xbmc.executebuiltin('ShutDown')
elif mode == 'InstallQuas': installer.INSTALLQUASAR(url) elif mode == 'addoninstall': #kodi.log("TRYING MODES") installer.ADDONINSTALL(name, url, description, filetype, repourl) elif mode == 'adultlist': items = installer.List_steman_Adult(url) elif mode == 'BrowseUrl': xbmc.executebuiltin("XBMC.System.Exec(%s)" % url) ################################### elif mode == 'enableall': addon_able.setall_enable() elif mode == 'teststuff': freshstart.remove_db() ####################################### elif mode == 'backup_restore': backup.BACKUPMENU() elif mode == 'full_backup': backup.FullBackup() elif mode == 'small_backup': backup.Backup() elif mode == 'do_backup_restore': backup.Restore()
def JUVWIZARD(filetype='main'): if xbmcgui.Dialog().yesno( "Please Confirm", " Please confirm that you wish to automatically", " configure Kodi with all the best addons and tweaks!", " ", "Cancel", "Install"): filetype = filetype.lower() if filetype == 'main': addonfolder = kodi.translate_path('special://home') elif filetype == 'addon': addonfolder = kodi.translate_path( os.path.join('special://home', 'addons')) else: print({'filetype': filetype}) dialog.ok("Error!", 'filetype: "%s"' % str(filetype)) return link = kodi.read_file(wizlink).replace('\n', '').replace('\r', '').replace( '\a', '').strip() # kodi.log(link) if '[error]' in link: print(link) dialog.ok("Error!", link) return path = kodi.translate_path( os.path.join('special://home', 'addons', 'packages')) lib = os.path.join(path, 'rejuv.zip') try: os.remove(lib) except: pass # ## ## ... ## dp = xbmcgui.DialogProgress() dp.create(AddonTitle, " ", 'Downloading and Configuring ', 'Please Wait') downloader.download(link, lib, dp) xbmc.sleep(4000) extract.extract_all(lib, addonfolder, dp) xbmc.executebuiltin("XBMC.UpdateLocalAddons()") addon_able.setall_enable() try: addon_able.set_enabled("inputstream.adaptive") except: pass xbmc.sleep(4000) try: addon_able.set_enabled("inputstream.rtmp") except: pass xbmc.executebuiltin("XBMC.UpdateLocalAddons()") try: os.remove(lib) except: pass if filetype == 'main': link = kodi.read_file(cutslink) shorts = re.compile('shortcut="(.+?)"').findall(link) for shortname in shorts: xEB('Skin.SetString(%s)' % shortname) enableBG16 = "UseCustomBackground,true" enableBG17 = "use_custom_bg,true" xEB('Skin.SetBool(%s)' % enableBG16) xEB('Skin.SetBool(%s)' % enableBG17) kodi.set_setting("wizardran", 'true') dialog.ok(AddonTitle, "Installation Complete.", "", "Click OK to exit Kodi and then restart to complete .") xbmc.executebuiltin('ShutDown')
def HELPWIZARD(name, url, description, filetype): # path = xbmc.translatePath(os.path.join('special://home', 'addons', 'packages')) filetype = filetype.lower() if xbmcgui.Dialog().yesno("Please Confirm", " Please confirm that you wish to automatically", " configure Kodi with all the best addons and tweaks!", " ", "Cancel", "Install"): path = xbmc.translatePath(os.path.join('special://home', 'addons', 'packages')) dp = xbmcgui.DialogProgress() dp.create(AddonTitle, " ", 'Downloading and Configuring ', 'Please Wait') lib = os.path.join(path, name + '.zip') try: os.remove(lib) except: pass # ## ## ... ## # kodi.log(url) # if str(url).endswith('[error]'): # print(url) # dialog = xbmcgui.Dialog() # dialog.ok("Error!", url) # return if '[error]' in url: print(url) dialog = xbmcgui.Dialog() dialog.ok("Error!", url) return downloader.download(url, lib, dp) if not os.path.exists(lib): return if filetype == 'main': addonfolder = xbmc.translatePath('special://home') elif filetype == 'addon': addonfolder = xbmc.translatePath(os.path.join('special://home', 'addons')) else: print({'filetype': filetype}) dialog = xbmcgui.Dialog() dialog.ok("Error!", 'filetype: "%s"' % str(filetype)) return xbmc.sleep(4000) extract.all(lib, addonfolder, dp) xbmc.executebuiltin("XBMC.UpdateLocalAddons()") addon_able.setall_enable() try: addon_able.set_enabled("inputstream.adaptive") except: pass xbmc.sleep(4000) try: addon_able.set_enabled("inputstream.rtmp") except: pass xbmc.executebuiltin("XBMC.UpdateLocalAddons()") try: os.remove(lib) except: pass if filetype == 'main': link = kodi.read_file(cutslink) shorts = re.compile('shortcut="(.+?)"').findall(link) for shortname in shorts: xEB('Skin.SetString(%s)' % shortname) enableBG16 = "UseCustomBackground,true" enableBG17 = "use_custom_bg,true" xEB('Skin.SetBool(%s)' % enableBG16) xEB('Skin.SetBool(%s)' % enableBG17) xbmc.sleep(4000) xbmc.executebuiltin('XBMC_UpdateLocalAddons()') addon_able.setall_enable() # try: # addon_able.set_enabled("inputstream.adaptive") # except: # pass # xbmc.sleep(4000) # try: # addon_able.set_enabled("inputstream.rtmp") # except: # pass kodi.set_setting("wizardran", 'true') dialog = xbmcgui.Dialog() dialog.ok(AddonTitle, "Installation Complete!", "", "Click OK to exit Kodi and then restart to complete .") xbmc.executebuiltin('ShutDown')
installer.EnableRTMP() # ###### REJUVINATE ########### elif mode=='call_rejuv': import rejuv rejuv.startup_rejuv() elif mode=='juvwizard': import rejuv_run rejuv_run.JUVWIZARD() elif mode == 'BrowseUrl': xbmc.executebuiltin("XBMC.System.Exec(%s)" % url) elif mode == 'enableall': addon_able.setall_enable() elif mode == 'teststuff': freshstart.remove_db() ####################################### elif mode == 'backup_restore': backup.backup_menu() elif mode == 'full_backup': backup.full_backup() elif mode == 'small_backup': backup.no_data_backup() elif mode == 'do_backup_restore':