def test_update(): from resources.libs import check from resources.libs.gui import window if CONFIG.BUILDNAME == "": window.show_update_window() else: window.show_update_window( CONFIG.BUILDNAME, CONFIG.BUILDVERSION, CONFIG.BUILDLATEST, check.check_build(CONFIG.BUILDNAME, 'icon'), check.check_build(CONFIG.BUILDNAME, 'fanart'))
def theme_count(self, name, count=True): from resources.libs import check from resources.libs.common import tools if 27 - 27: OoO0O00 oOOOo0o0O = check.check_build(name, 'theme') if 72 - 72: Oo0Ooo % OOooOOo.I1IiiI / I11i * I1IiiI iiiI11 = tools.open_url(oOOOo0o0O) if 91 - 91: o0oOOo0O0Ooo / II111iiii.I1ii11iIi11i + OOooOOo if not iiiI11: return False if 47 - 47: OoOoOO00 / Ii1I * OoooooooOO II111iiiiII = iiiI11.text oOoOo00oOo = tools.clean_text(II111iiiiII) Oo = re.compile('name="(.+?)"').findall(oOoOo00oOo) if 85 - 85: OOooOOo % I1ii11iIi11i * Oo0ooO0oo0oO if len(Oo) == 0: return False if 90 - 90: o0oOOo0O0Ooo % o0oOOo0O0Ooo % I11i * OoOoOO00 i1IIiiiii = [] for o00o in Oo: i1IIiiiii.append(o00o) if 41 - 41: i1IIi + O0oo0OO0 + OOooOOo - O00oOoOoO0o0O if len(i1IIiiiii) > 0: if count: return len(i1IIiiiii) else: return i1IIiiiii else: return False if 77 - 77: Oo0Ooo.O00oOoOoO0o0O % Oo0ooO0oo0oO
def theme_count(self, name, count=True): from resources.libs import check from resources.libs.common import tools themefile = check.check_build(name, 'theme') response = tools.open_url(themefile) if not response: return False themetext = response.text link = tools.clean_text(themetext) match = re.compile('name="(.+?)"').findall(link) if len(match) == 0: return False themes = [] for item in match: themes.append(item) if len(themes) > 0: if count: return len(themes) else: return themes else: return False
def gui(self, name, over=False): if name == CONFIG.get_setting('buildname'): if over: yes_pressed = 1 else: yes_pressed = self.dialog.yesno(CONFIG.ADDONTITLE, '[COLOR {0}]Would you like to apply the guifix for:'.format(CONFIG.COLOR2) + '\n' + '[COLOR {0}]{1}[/COLOR]?[/COLOR]'.format(CONFIG.COLOR1, name), nolabel='[B][COLOR red]No, Cancel[/COLOR][/B]', yeslabel='[B][COLOR springgreen]Apply Fix[/COLOR][/B]') else: yes_pressed = self.dialog.yesno("{0} - [COLOR red]WARNING!![/COLOR]".format(CONFIG.ADDONTITLE), "[COLOR {0}][COLOR {1}]{2}[/COLOR] community build is not currently installed.".format(CONFIG.COLOR2, CONFIG.COLOR1, name) + '\n' + "Would you like to apply the guiFix anyways?.[/COLOR]", nolabel='[B][COLOR red]No, Cancel[/COLOR][/B]', yeslabel='[B][COLOR springgreen]Apply Fix[/COLOR][/B]') if yes_pressed: guizip = check.check_build(name, 'gui') zipname = name.replace('\\', '').replace('/', '').replace(':', '').replace('*', '').replace('?', '').replace('"', '').replace('<', '').replace('>', '').replace('|', '') response = tools.open_url(guizip, check=True) if not response: logging.log_notify(CONFIG.ADDONTITLE, '[COLOR {0}]GuiFix: Invalid Zip Url![/COLOR]'.format(CONFIG.COLOR2)) return self.dialogProgress.create(CONFIG.ADDONTITLE, '[COLOR {0}][B]Downloading GuiFix:[/B][/COLOR] [COLOR {1}]{2}[/COLOR]'.format(CONFIG.COLOR2, CONFIG.COLOR1, name), '', 'Please Wait') lib = os.path.join(CONFIG.PACKAGES, '{0}_guisettings.zip'.format(zipname)) try: os.remove(lib) except: pass Downloader().download(guizip, lib) xbmc.sleep(500) if os.path.getsize(lib) == 0: try: os.remove(lib) except: pass return title = '[COLOR {0}][B]Installing:[/B][/COLOR] [COLOR {1}]{2}[/COLOR]'.format(CONFIG.COLOR2, CONFIG.COLOR1, name) self.dialogProgress.update(0, title + '\n' + 'Please Wait') extract.all(lib, CONFIG.USERDATA, title=title) self.dialogProgress.close() skin.skin_to_default('Build Install') skin.look_and_feel_data('save') installed = db.grab_addons(lib) db.addon_database(installed, 1, True) self.dialog.ok(CONFIG.ADDONTITLE, "[COLOR {0}]To save changes you now need to force close Kodi, Press OK to force close Kodi[/COLOR]".format(CONFIG.COLOR2)) tools.kill_kodi(over=True) else: logging.log_notify(CONFIG.ADDONTITLE, '[COLOR {0}]GuiFix: Cancelled![/COLOR]'.format(CONFIG.COLOR2))
def build_info(self, name): from resources.libs import check from resources.libs.common import logging from resources.libs.common import tools from resources.libs.gui import window response = tools.open_url(CONFIG.BUILDFILE, check=True) if response: if check.check_build(name, 'url'): name, version, url, minor, gui_ignore, kodi, theme, icon, fanart, preview, adult, info, description = check.check_build(name, 'all') adult = 'Yes' if adult.lower() == 'yes' else 'No' info_response = tools.open_url(info) if info_response: try: tname, extracted, zipsize, skin, created, programs, video, music, picture, repos, scripts, binaries = check.check_info(info_response.text) extend = True except: extend = False else: extend = False themes = self.theme_count(name, count=False) msg = "[COLOR {0}]Build Name:[/COLOR] [COLOR {1}]{2}[/COLOR][CR]".format(CONFIG.COLOR2, CONFIG.COLOR1, name) msg += "[COLOR {0}]Build Version:[/COLOR] [COLOR {1}]{2}[/COLOR][CR]".format(CONFIG.COLOR2, CONFIG.COLOR1, version) if themes: msg += "[COLOR {0}]Build Theme(s):[/COLOR] [COLOR {1}]{2}[/COLOR][CR]".format(CONFIG.COLOR2, CONFIG.COLOR1, ', '.join(themes)) msg += "[COLOR {0}]Kodi Version:[/COLOR] [COLOR {1}]{2}[/COLOR][CR]".format(CONFIG.COLOR2, CONFIG.COLOR1, kodi) msg += "[COLOR {0}]Adult Content:[/COLOR] [COLOR {1}]{2}[/COLOR][CR]".format(CONFIG.COLOR2, CONFIG.COLOR1, adult) msg += "[COLOR {0}]Description:[/COLOR] [COLOR {1}]{2}[/COLOR][CR]".format(CONFIG.COLOR2, CONFIG.COLOR1, description) if extend: msg += "[COLOR {0}]Latest Update:[/COLOR] [COLOR {1}]{2}[/COLOR][CR][CR]".format(CONFIG.COLOR2, CONFIG.COLOR1, created) msg += "[COLOR {0}]Extracted Size:[/COLOR] [COLOR {1}]{2}[/COLOR][CR][CR]".format(CONFIG.COLOR2, CONFIG.COLOR1, tools.convert_size(int(float(extracted)))) msg += "[COLOR {0}]Zip Size:[/COLOR] [COLOR {1}]{2}[/COLOR][CR][CR]".format(CONFIG.COLOR2, CONFIG.COLOR1, tools.convert_size(int(float(zipsize)))) msg += "[COLOR {0}]Skin Name:[/COLOR] [COLOR {1}]{2}[/COLOR][CR][CR]".format(CONFIG.COLOR2, CONFIG.COLOR1, skin) msg += "[COLOR {0}]Programs:[/COLOR] [COLOR {1}]{2}[/COLOR][CR][CR]".format(CONFIG.COLOR2, CONFIG.COLOR1, programs) msg += "[COLOR {0}]Video:[/COLOR] [COLOR {1}]{2}[/COLOR][CR][CR]".format(CONFIG.COLOR2, CONFIG.COLOR1, video) msg += "[COLOR {0}]Music:[/COLOR] [COLOR {1}]{2}[/COLOR][CR][CR]".format(CONFIG.COLOR2, CONFIG.COLOR1, music) msg += "[COLOR {0}]Pictures:[/COLOR] [COLOR {1}]{2}[/COLOR][CR][CR]".format(CONFIG.COLOR2, CONFIG.COLOR1, picture) msg += "[COLOR {0}]Repositories:[/COLOR] [COLOR {1}]{2}[/COLOR][CR][CR]".format(CONFIG.COLOR2, CONFIG.COLOR1, repos) msg += "[COLOR {0}]Scripts:[/COLOR] [COLOR {1}]{2}[/COLOR][CR][CR]".format(CONFIG.COLOR2, CONFIG.COLOR1, scripts) msg += "[COLOR {0}]Binaries:[/COLOR] [COLOR {1}]{2}[/COLOR]".format(CONFIG.COLOR2, CONFIG.COLOR1, binaries) window.show_text_box("Viewing Build Info: {0}".format(name), msg) else: logging.log("Invalid Build Name!") else: logging.log("Build text file not working: {0}".format(CONFIG.BUILDFILE))
def build_video(self, name): from resources.libs import check from resources.libs import yt from resources.libs.common import logging from resources.libs.common import tools response = tools.open_url(CONFIG.BUILDFILE, check=True) if response: videofile = check.check_build(name, 'preview') if tools.open_url(videofile, check=True): yt.play_video(videofile) else: logging.log("[{0}]Unable to find url for video preview".format(name)) else: logging.log("Build text file not working: {0}".format(CONFIG.BUILDFILE))
def build_video(self, name): from resources.libs import check from resources.libs import yt from resources.libs.common import logging from resources.libs.common import tools response = tools.open_url(CONFIG.BUILDFILE, check=True) if response: videofile = check.check_build(name, 'preview') if tools.open_url(videofile, check=True): yt.play_video(videofile) else: logging.log( "[{0}]No se puede encontrar la URL para la vista previa del vídeo" .format(name)) else: logging.log( "[B][COLOR azure]La Build del archivo de texto no funciona:[/COLOR][/B] [COLOR blue]{0}[/COLOR]" .format(CONFIG.BUILDFILE))
def build_video(self, name): from resources.libs import check from resources.libs import yt from resources.libs.common import logging from resources.libs.common import tools if 1 - 1: Oo0Ooo / o0oOOo0O0Ooo % iii1I1I * O00oOoOoO0o0O.i11iIiiIii iiiI11 = tools.open_url(CONFIG.BUILDFILE, check=True) if 2 - 2: I1ii11iIi11i * I11i - iIii1I11I1II1 + I1IiiI.oO0o % iii1I1I if iiiI11: ooOOOoOooOoO = check.check_build(name, 'preview') if tools.open_url(ooOOOoOooOoO, check=True): yt.play_video(ooOOOoOooOoO) else: logging.log( "[{0}]Não foi possível encontrar url para a visualização do vídeo" .format(name)) else: logging.log( "O arquivo de texto de compilação não está funcionando: {0}". format(CONFIG.BUILDFILE)) if 91 - 91: iii1I1I % i1IIi % iIii1I11I1II1
def build(self, name, over=False): # if action == 'normal': # if CONFIG.KEEPTRAKT == 'true': # from resources.libs import traktit # traktit.auto_update('all') # CONFIG.set_setting('traktnextsave', tools.get_date(days=3, formatted=True)) # if CONFIG.KEEPDEBRID == 'true': # from resources.libs import debridit # debridit.auto_update('all') # CONFIG.set_setting('debridnextsave', tools.get_date(days=3, formatted=True)) # if CONFIG.KEEPLOGIN == 'true': # from resources.libs import loginit # loginit.auto_update('all') # CONFIG.set_setting('loginnextsave', tools.get_date(days=3, formatted=True)) temp_kodiv = int(CONFIG.KODIV) buildv = int(float(check.check_build(name, 'kodi'))) if not temp_kodiv == buildv: warning = True else: warning = False if warning: yes_pressed = self.dialog.yesno( "{0} - [COLOR red]ADVERTENCIA!![/COLOR]".format( CONFIG.ADDONTITLE), '[COLOR {0}]Existe la posibilidad de que el Skin no se vea correctamente' .format(CONFIG.COLOR2) + '\n' + 'Al instalar una {0} build en un Kodi {1} instalado'.format( check.check_build(name, 'kodi'), CONFIG.KODIV) + '\n' + 'Todavia te gustaria instalar: [COLOR {0}]{1} v{2}[/COLOR]?[/COLOR]' .format(CONFIG.COLOR1, name, check.check_build( name, 'version')), nolabel='[B][COLOR red]No, Cancel[/COLOR][/B]', yeslabel='[B][COLOR springgreen]Yes, Install[/COLOR][/B]') else: if over: yes_pressed = 1 else: yes_pressed = self.dialog.yesno( CONFIG.ADDONTITLE, '[COLOR {0}][B]La Instalación Sobreescribirá los datos de su Kodi Actual ![/B] ' .format(CONFIG.COLOR2) + '\n' + '[COLOR {0}]Le gustaria Descargar e Instalar: '.format( CONFIG.COLOR2) + '[COLOR {0}]{1} v{2} [/COLOR]?[/COLOR]'.format( CONFIG.COLOR1, name, check.check_build( name, 'version')), nolabel='[B][COLOR red]No, Cancelar[/COLOR][/B]', yeslabel='[B][COLOR springgreen]Si, Instalar[/COLOR][/B]') if yes_pressed: CONFIG.clear_setting('build') buildzip = check.check_build(name, 'url') zipname = name.replace('\\', '').replace('/', '').replace( ':', '').replace('*', '').replace('?', '').replace('"', '').replace( '<', '').replace('>', '').replace('|', '') self.dialogProgress.create( CONFIG.ADDONTITLE, '[COLOR {0}][B]Descargando:[/B][/COLOR] [COLOR {1}]{2} v{3}[/COLOR]' .format(CONFIG.COLOR2, CONFIG.COLOR1, name, check.check_build(name, 'version')) + '\n' + 'Espere por Favor') lib = os.path.join(CONFIG.MYBUILDS, '{0}.zip'.format(zipname)) try: os.remove(lib) except: pass Downloader().download(buildzip, lib) xbmc.sleep(500) if os.path.getsize(lib) == 0: try: os.remove(lib) except: pass return install.wipe() skin.look_and_feel_data('save') title = '[COLOR {0}][B]Instalando:[/B][/COLOR] [COLOR {1}]{2} v{3}[/COLOR]'.format( CONFIG.COLOR2, CONFIG.COLOR1, name, check.check_build(name, 'version')) self.dialogProgress.update(0, title + '\n' + 'Espere por Favor') percent, errors, error = extract.all(lib, CONFIG.HOME, title=title) skin.skin_to_default('Instalar Build') if int(float(percent)) > 0: db.fix_metas() CONFIG.set_setting('buildname', name) CONFIG.set_setting('buildversion', check.check_build(name, 'version')) CONFIG.set_setting('buildtheme', '') CONFIG.set_setting('latestversion', check.check_build(name, 'version')) CONFIG.set_setting( 'nextbuildcheck', tools.get_date(days=CONFIG.UPDATECHECK, formatted=True)) CONFIG.set_setting('installed', 'true') CONFIG.set_setting('extract', percent) CONFIG.set_setting('errors', errors) logging.log('INSTALADO {0}: [ERRORES:{1}]'.format( percent, errors)) try: os.remove(lib) except: pass if int(float(errors)) > 0: yes_pressed = self.dialog.yesno( CONFIG.ADDONTITLE, '[COLOR {0}][COLOR {1}]{2} v{3}[/COLOR]'.format( CONFIG.COLOR2, CONFIG.COLOR1, name, check.check_build(name, 'version')) + '\n' + 'Completado: [COLOR {0}]{1}{2}[/COLOR] [Errores:[COLOR {3}]{4}[/COLOR]]' .format(CONFIG.COLOR1, percent, '%', CONFIG.COLOR1, errors) + '\n' + 'Le gustaria ver los errores?[/COLOR]', nolabel='[B][COLOR red]No, Gracias[/COLOR][/B]', yeslabel='[B][COLOR springgreen]Ver Errores[/COLOR][/B]' ) if yes_pressed: from resources.libs.gui import window window.show_text_box( "Visualizacion de Errores de Instalacion de la Build", error) self.dialogProgress.close() from resources.libs.gui.build_menu import BuildMenu themecount = BuildMenu().theme_count(name) if themecount > 0: self.theme(name) db.addon_database(CONFIG.ADDON_ID, 1) db.force_check_updates(over=True) if os.path.exists(os.path.join(CONFIG.USERDATA, '.enableall')): CONFIG.set_setting('enable_all', 'true') self.dialog.ok( CONFIG.ADDONTITLE, "[COLOR {0}]Para guardar los cambios, ahora necesita Forzar el Cierre de Kodi. \nPresione [B]OK[/B] para Forzar el Cierre de Kodi.[/COLOR]" .format(CONFIG.COLOR2)) tools.kill_kodi(over=True) else: from resources.libs.gui import window window.show_text_box( "Visualizacion de Errores de Instalacion de la Build", error) else: logging.log_notify( CONFIG.ADDONTITLE, '[COLOR {0}]Instalacion Build:[/COLOR] [COLOR gold]Cancelado![/COLOR]' .format(CONFIG.COLOR2))
def theme(self, name, theme='', over=False): installtheme = False if not theme: themefile = check.check_build(name, 'theme') response = tools.open_url(themefile, check=True) if response: from resources.libs.gui.build_menu import BuildMenu themes = BuildMenu().theme_count(name, False) if len(themes) > 0: if self.dialog.yesno( CONFIG.ADDONTITLE, "[COLOR {0}][B]La Build [COLOR {1}]{2}[/COLOR] viene con [COLOR {3}]{4}[/COLOR] Parches diferentes[/B]" .format(CONFIG.COLOR2, CONFIG.COLOR1, name, CONFIG.COLOR1, len(themes)) + '\n\n' + "Le gustaria instalar uno ahora?[/COLOR]", yeslabel= "[B][COLOR cyan]Instalar Parche[/COLOR][/B]", nolabel="[B][COLOR red]Cancelar Parche[/COLOR][/B]" ): logging.log("Lista de Parches: {0}".format( str(themes))) ret = self.dialog.select(CONFIG.ADDONTITLE, themes) logging.log( "[B]Selecciona un Parche para Instalar:[/B] {0}". format(ret)) if not ret == -1: theme = themes[ret] installtheme = True else: logging.log_notify( CONFIG.ADDONTITLE, '[COLOR {0}]Instalación:[/COLOR] [COLOR gold]Cancelado![/COLOR]' .format(CONFIG.COLOR2)) return else: logging.log_notify( CONFIG.ADDONTITLE, '[COLOR {0}]Instalación Parche:[/COLOR] [COLOR gold]Cancelado![/COLOR]' .format(CONFIG.COLOR2)) return else: logging.log_notify( CONFIG.ADDONTITLE, '[COLOR {0}]Instalación Parche:[/COLOR] [COLOR gold]Nada Encontrado![/COLOR]' .format(CONFIG.COLOR2)) else: installtheme = self.dialog.yesno( CONFIG.ADDONTITLE, '[COLOR {0}][B]Te gustaría instalar uno de los Parches que hay en:[/B]' .format(CONFIG.COLOR2) + ' \n' + '[COLOR dodgerblue][B]PARCHES MATRIX[/B][/COLOR]'.format( CONFIG.COLOR1, theme) + '\n' + '[B]para [COLOR {0}]{1} v{2}[/COLOR]?[/B][/COLOR]'.format( CONFIG.COLOR1, name, check.check_build(name, 'version')), yeslabel="[B][COLOR cyan]Instalar Parche[/COLOR][/B]", nolabel="[B][COLOR red]Cancelar Parche[/COLOR][/B]") if installtheme: themezip = check.check_theme(name, theme, 'url') zipname = name.replace('\\', '').replace('/', '').replace( ':', '').replace('*', '').replace('?', '').replace('"', '').replace( '<', '').replace('>', '').replace('|', '') response = tools.open_url(themezip, check=True) if not response: logging.log_notify( CONFIG.ADDONTITLE, '[COLOR {0}]Instalación Parche:[/COLOR] [COLOR gold]Url Zip Inválido![/COLOR]' .format(CONFIG.COLOR2)) return False self.dialogProgress.create( CONFIG.ADDONTITLE, '[COLOR {0}][B]Descargando:[/B][/COLOR] [COLOR {1}]{2}[/COLOR]' .format(CONFIG.COLOR2, CONFIG.COLOR1, zipname) + ' \n' + 'Espere por Favor') lib = os.path.join(CONFIG.PACKAGES, '{0}.zip'.format(zipname)) try: os.remove(lib) except: pass Downloader().download(themezip, lib) xbmc.sleep(500) if os.path.getsize(lib) == 0: try: os.remove(lib) except: pass return self.dialogProgress.update(0, '\n' + "Instalando {0}".format(name)) from resources.libs import skin from resources.libs import test title = '[COLOR {0}][B]Instalando Parche:[/B][/COLOR] [COLOR {1}]{2}[/COLOR]'.format( CONFIG.COLOR2, CONFIG.COLOR1, theme) self.dialogProgress.update(0, title + '\n' + 'Espere por Favor') percent, errors, error = extract.all(lib, CONFIG.HOME, title=title) CONFIG.set_setting('buildtheme', theme) logging.log('INSTALADO {0}: [ERRORES:{1}]'.format(percent, errors)) self.dialogProgress.close() installed = db.grab_addons(lib) db.addon_database(installed, 1, True) xbmc.executebuiltin("ReloadSkin()") xbmc.sleep(1000) xbmc.executebuiltin("Container.Refresh()") else: logging.log_notify( CONFIG.ADDONTITLE, '[COLOR {0}]Instalación Parche:[/COLOR] [COLOR gold]Cancelado![/COLOR]' .format(CONFIG.COLOR2))
def gui(self, name, over=False): if name == CONFIG.get_setting('buildname'): if over: yes_pressed = 1 else: yes_pressed = self.dialog.yesno( CONFIG.ADDONTITLE, '[COLOR {0}]Le gustaria aplicar la correccion de interfaz gráfica de usuario para:' .format(CONFIG.COLOR2) + '\n' + '[COLOR {0}]{1}[/COLOR]?[/COLOR]'.format( CONFIG.COLOR1, name), nolabel='[B][COLOR red]No, Cancelar[/COLOR][/B]', yeslabel= '[B][COLOR springgreen]Aplicar Correccion[/COLOR][/B]') else: yes_pressed = self.dialog.yesno( "[B]{0} - [COLOR red]ADVERTENCIA!![/COLOR][/B]".format( CONFIG.ADDONTITLE), "[COLOR {0}][COLOR {1}]{2}[/COLOR] [B]La Build de la comunidad no está instalada actualmente." .format(CONFIG.COLOR2, CONFIG.COLOR1, name) + '\n' + "Le gustaría aplicar la Corrección Gui ([COLOR azure]de la interfaz gráfica de usuario[/COLOR]) de todos modos?[/B][/COLOR]", nolabel='[B][COLOR red]No, Cancelar[/COLOR][/B]', yeslabel='[B][COLOR springgreen]Aplicar Correccion[/COLOR][/B]' ) if yes_pressed: guizip = check.check_build(name, 'gui') zipname = name.replace('\\', '').replace('/', '').replace( ':', '').replace('*', '').replace('?', '').replace('"', '').replace( '<', '').replace('>', '').replace('|', '') response = tools.open_url(guizip, check=True) if not response: logging.log_notify( CONFIG.ADDONTITLE, '[COLOR {0}]Corrección Gui: Url Zip Inválido![/COLOR]'. format(CONFIG.COLOR2)) return self.dialogProgress.create( CONFIG.ADDONTITLE, '[COLOR {0}][B]Descargando Correccion Gui:[/B][/COLOR] [COLOR {1}]{2}[/COLOR]' .format(CONFIG.COLOR2, CONFIG.COLOR1, name), '', 'Espere por Favor') lib = os.path.join(CONFIG.PACKAGES, '{0}_guisettings.zip'.format(zipname)) try: os.remove(lib) except: pass Downloader().download(guizip, lib) xbmc.sleep(500) if os.path.getsize(lib) == 0: try: os.remove(lib) except: pass return title = '[COLOR {0}][B]Instalando:[/B][/COLOR] [COLOR {1}]{2}[/COLOR]'.format( CONFIG.COLOR2, CONFIG.COLOR1, name) self.dialogProgress.update(0, title + '\n' + 'Espere por Favor') extract.all(lib, CONFIG.USERDATA, title=title) self.dialogProgress.close() skin.skin_to_default('Build Install') skin.look_and_feel_data('save') installed = db.grab_addons(lib) db.addon_database(installed, 1, True) self.dialog.ok( CONFIG.ADDONTITLE, "[COLOR {0}][B]Para guardar los cambios, ahora necesita Forzar el Cierre de Kodi.[/B] \n\nPresione [B]OK[/B] para Forzar el Cierre de Kodi.[/COLOR]" .format(CONFIG.COLOR2)) tools.kill_kodi(over=True) else: logging.log_notify( CONFIG.ADDONTITLE, '[COLOR {0}]Corrección Gui:[/COLOR] [COLOR gold]Cancelado![/COLOR]' .format(CONFIG.COLOR2))
def build(self, name, over=False): # if action == 'normal': # if CONFIG.KEEPTRAKT == 'true': # from resources.libs import traktit # traktit.auto_update('all') # CONFIG.set_setting('traktnextsave', tools.get_date(days=3, formatted=True)) # if CONFIG.KEEPDEBRID == 'true': # from resources.libs import debridit # debridit.auto_update('all') # CONFIG.set_setting('debridnextsave', tools.get_date(days=3, formatted=True)) # if CONFIG.KEEPLOGIN == 'true': # from resources.libs import loginit # loginit.auto_update('all') # CONFIG.set_setting('loginnextsave', tools.get_date(days=3, formatted=True)) temp_kodiv = int(CONFIG.KODIV) buildv = int(float(check.check_build(name, 'kodi'))) if not temp_kodiv == buildv: warning = True else: warning = False if warning: yes_pressed = self.dialog.yesno( "{0} - [COLOR red]WARNING!![/COLOR]".format(CONFIG.ADDONTITLE), '[COLOR {0}]Existe la posibilidad de que la piel no se vea correctamente' .format(CONFIG.COLOR2) + '\n' + 'Al instalar un {0} build sobre un Kodi {1} Instalar'.format( check.check_build(name, 'kodi'), CONFIG.KODIV) + '\n' + '¿Todavía te gustaría instalar: [COLOR {0}]{1} v{2}[/COLOR]?[/COLOR]' .format(CONFIG.COLOR1, name, check.check_build( name, 'version')), nolabel='[B][COLOR red]No, Cancel[/COLOR][/B]', yeslabel='[B][COLOR springgreen]SI, INSTALAR[/COLOR][/B]') else: if over: yes_pressed = 1 else: yes_pressed = self.dialog.yesno( CONFIG.ADDONTITLE, '[COLOR {0}]¿Le gustaría descargar e instalar: '.format( CONFIG.COLOR2) + '[COLOR {0}]{1} v{2}[/COLOR]?[/COLOR]'.format( CONFIG.COLOR1, name, check.check_build( name, 'version')), nolabel='[B][COLOR red]No, Cancelar[/COLOR][/B]', yeslabel='[B][COLOR springgreen]si, instalar[/COLOR][/B]') if yes_pressed: CONFIG.clear_setting('build') buildzip = check.check_build(name, 'url') zipname = name.replace('\\', '').replace('/', '').replace( ':', '').replace('*', '').replace('?', '').replace('"', '').replace( '<', '').replace('>', '').replace('|', '') self.dialogProgress.create( CONFIG.ADDONTITLE, '[COLOR {0}][B]descargando:[/B][/COLOR] [COLOR {1}]{2} v{3}[/COLOR]' .format(CONFIG.COLOR2, CONFIG.COLOR1, name, check.check_build(name, 'version')) + '\n' + 'espere por favor') lib = os.path.join(CONFIG.MYBUILDS, '{0}.zip'.format(zipname)) try: os.remove(lib) except: pass Downloader().download(buildzip, lib) xbmc.sleep(500) if os.path.getsize(lib) == 0: try: os.remove(lib) except: pass return yes_fresh = self.dialog.yesno( CONFIG.ADDONTITLE, '[COLOR {0}][COLOR {1}]¿Desea borrar todos los datos antes de instalar?[/COLOR]' .format(CONFIG.COLOR2, CONFIG.COLOR1), nolabel='[B][COLOR red]No gracias[/COLOR][/B]', yeslabel='[B][COLOR springgreen]si[/COLOR][/B]') if yes_fresh: install.wipe() skin.look_and_feel_data('save') title = '[COLOR {0}][B]instalando:[/B][/COLOR] [COLOR {1}]{2} v{3}[/COLOR]'.format( CONFIG.COLOR2, CONFIG.COLOR1, name, check.check_build(name, 'version')) self.dialogProgress.update(0, title + '\n' + 'espere por favor') percent, errors, error = extract.all(lib, CONFIG.HOME, title=title) skin.skin_to_default('Build Install') if int(float(percent)) > 0: db.fix_metas() CONFIG.set_setting('buildname', name) CONFIG.set_setting('buildversion', check.check_build(name, 'version')) CONFIG.set_setting('buildtheme', '') CONFIG.set_setting('latestversion', check.check_build(name, 'version')) CONFIG.set_setting( 'nextbuildcheck', tools.get_date(days=CONFIG.UPDATECHECK, formatted=True)) CONFIG.set_setting('installed', 'true') CONFIG.set_setting('extract', percent) CONFIG.set_setting('errors', errors) logging.log('INSTALLED {0}: [ERRORS:{1}]'.format( percent, errors)) try: os.remove(lib) except: pass if int(float(errors)) > 0: yes_pressed = self.dialog.yesno( CONFIG.ADDONTITLE, '[COLOR {0}][COLOR {1}]{2} v{3}[/COLOR]'.format( CONFIG.COLOR2, CONFIG.COLOR1, name, check.check_build(name, 'version')) + '\n' + 'Completado: [COLOR {0}]{1}{2}[/COLOR] [Errors:[COLOR {3}]{4}[/COLOR]]' .format(CONFIG.COLOR1, percent, '%', CONFIG.COLOR1, errors) + '\n' + '¿Le gustaría ver los errores?[/COLOR]', nolabel='[B][COLOR red]No [/COLOR][/B]', yeslabel='[B][COLOR springgreen]si[/COLOR][/B]') if yes_pressed: from resources.libs.gui import window window.show_text_box("Viewing Build Install Errors", error) self.dialogProgress.close() from resources.libs.gui.build_menu import BuildMenu #themecount = BuildMenu().theme_count(name) #if themecount > 0: #self.theme(name, 'theme') db.addon_database(CONFIG.ADDON_ID, 1) #db.force_check_updates(over=True) self.dialog.ok( CONFIG.ADDONTITLE, "[COLOR {0}]Para guardar los cambios, ahora necesita forzar el cierre de Kodi, presione OK para forzar el cierre de Kodi[/COLOR]" .format(CONFIG.COLOR2)) tools.kill_kodi(over=True) else: from resources.libs.gui import window window.show_text_box("Viewing Build Install Errors", error) else: logging.log_notify( CONFIG.ADDONTITLE, '[COLOR {0}]Instalación de compilación: cancelada.[/COLOR]'. format(CONFIG.COLOR2))
def theme(self, name, theme, over=False): installtheme = False if not theme: themefile = check.check_build(name, 'theme') response = tools.open_url(themefile, check=True) if response: from resources.libs.gui.build_menu import BuildMenu themes = BuildMenu().theme_count(name, False) if len(themes) > 0: if self.dialog.yesno( CONFIG.ADDONTITLE, "[COLOR {0}]The Build [COLOR {1}]{2}[/COLOR] comes with [COLOR {3}]{4}[/COLOR] different themes" .format(CONFIG.COLOR2, CONFIG.COLOR1, name, CONFIG.COLOR1, len(themes)) + '\n' + "Would you like to install one now?[/COLOR]", yeslabel= "[B][COLOR springgreen]Install Theme[/COLOR][/B]", nolabel="[B][COLOR red]Cancel Themes[/COLOR][/B]"): logging.log("Theme List: {0}".format(str(themes))) ret = self.dialog.select(CONFIG.ADDONTITLE, themes) logging.log("Theme install selected: {0}".format(ret)) if not ret == -1: theme = themes[ret] installtheme = True else: logging.log_notify( CONFIG.ADDONTITLE, '[COLOR {0}]Theme Install: Cancelled![/COLOR]'. format(CONFIG.COLOR2)) return else: logging.log_notify( CONFIG.ADDONTITLE, '[COLOR {0}]Theme Install: Cancelled![/COLOR]'. format(CONFIG.COLOR2)) return else: logging.log_notify( CONFIG.ADDONTITLE, '[COLOR {0}]Theme Install: None Found![/COLOR]'.format( CONFIG.COLOR2)) else: installtheme = self.dialog.yesno( CONFIG.ADDONTITLE, '[COLOR {0}]Would you like to install the theme:'.format( CONFIG.COLOR2) + ' \n' + '[COLOR {0}]{1}[/COLOR]'.format(CONFIG.COLOR1, theme) + '\n' + 'for [COLOR {0}]{1} v{2}[/COLOR]?[/COLOR]'.format( CONFIG.COLOR1, name, check.check_build(name, 'version')), yeslabel="[B][COLOR springgreen]Install Theme[/COLOR][/B]", nolabel="[B][COLOR red]Cancel Themes[/COLOR][/B]") if installtheme: themezip = check.check_theme(name, theme, 'url') zipname = name.replace('\\', '').replace('/', '').replace( ':', '').replace('*', '').replace('?', '').replace('"', '').replace( '<', '').replace('>', '').replace('|', '') response = tools.open_url(themezip, check=True) if not response: logging.log_notify( CONFIG.ADDONTITLE, '[COLOR {0}]Theme Install: Invalid Zip Url![/COLOR]'. format(CONFIG.COLOR2)) return False self.dialogProgress.create( CONFIG.ADDONTITLE, '[COLOR {0}][B]Downloading:[/B][/COLOR] [COLOR {1}]{2}[/COLOR]' .format(CONFIG.COLOR2, CONFIG.COLOR1, zipname) + ' \n' + 'Please Wait') lib = os.path.join(CONFIG.PACKAGES, '{0}.zip'.format(zipname)) try: os.remove(lib) except: pass Downloader().download(themezip, lib) xbmc.sleep(500) if os.path.getsize(lib) == 0: try: os.remove(lib) except: pass return self.dialogProgress.update(0, '\n' + "Installing {0}".format(name)) title = '[COLOR {0}][B]Installing Theme:[/B][/COLOR] [COLOR {1}]{2}[/COLOR]'.format( CONFIG.COLOR2, CONFIG.COLOR1, theme) self.dialogProgress.update(0, title + '\n' + 'Please Wait') percent, errors, error = extract.all(lib, CONFIG.HOME, title=title) CONFIG.set_setting('buildtheme', theme) logging.log('INSTALLED {0}: [ERRORS:{1}]'.format(percent, errors)) self.dialogProgress.close() #db.force_check_updates(over=True) installed = db.grab_addons(lib) db.addon_database(installed, 1, True) xbmc.executebuiltin("ReloadSkin()") xbmc.sleep(1000) xbmc.executebuiltin("Container.Refresh()") else: logging.log_notify( CONFIG.ADDONTITLE, '[COLOR {0}]Theme Install: Cancelled![/COLOR]'.format( CONFIG.COLOR2))
def get_listing(self): from resources.libs import check from resources.libs.common import logging from resources.libs.common import tools errors = int(logging.error_checking(count=True)) errorsfound = str(errors) + ' Error(es) Encontrado' if errors > 0 else 'Nada Encontrado' if CONFIG.AUTOUPDATE == 'Yes': response = tools.open_url(CONFIG.BUILDFILE, check=True) if response: ver = check.check_wizard('version') if ver: if ver > CONFIG.ADDON_VERSION: directory.add_file( '{0} [v{1}] [COLOR red][B][ACTUALIZACIÓN v{2}][/B][/COLOR]'.format(CONFIG.ADDONTITLE, CONFIG.ADDON_VERSION, ver), {'mode': 'wizardupdate'}, themeit=CONFIG.THEME2) else: directory.add_file('{0} [v{1}]'.format(CONFIG.ADDONTITLE, CONFIG.ADDON_VERSION), themeit=CONFIG.THEME2) else: directory.add_file('{0} [v{1}]'.format(CONFIG.ADDONTITLE, CONFIG.ADDON_VERSION), themeit=CONFIG.THEME2) else: directory.add_file('{0} [v{1}]'.format(CONFIG.ADDONTITLE, CONFIG.ADDON_VERSION), themeit=CONFIG.THEME2) if len(CONFIG.BUILDNAME) > 0: version = check.check_build(CONFIG.BUILDNAME, 'version') build = '[B]{0} - v{1}[/B]'.format(CONFIG.BUILDNAME, CONFIG.BUILDVERSION) if version > CONFIG.BUILDVERSION: build = '{0} [COLOR red][B][ACTUALIZACIÓN v{1}][/B][/COLOR]'.format(build, version) directory.add_dir(build, {'mode': 'viewbuild', 'name': CONFIG.BUILDNAME}, themeit=CONFIG.THEME4) from resources.libs.gui.build_menu import BuildMenu themefile = BuildMenu().theme_count(CONFIG.BUILDNAME) if themefile: directory.add_file('Nada' if CONFIG.BUILDTHEME == "" else CONFIG.BUILDTHEME, {'mode': 'theme', 'name': CONFIG.BUILDNAME}, themeit=CONFIG.THEME5) else: directory.add_dir('Nada', {'mode': 'builds'}, themeit=CONFIG.THEME4) directory.add_separator() directory.add_dir('[B][COLOR dodgerblue]BUILDS[/COLOR] - [COLOR dodgerblue]PARCHES[/COLOR][/B]', {'mode': 'builds'}, icon=CONFIG.ICONBUILDS, themeit=CONFIG.THEME1) directory.add_dir('[B]Mantenimiento[/B]', {'mode': 'maint'}, icon=CONFIG.ICONMAINT, themeit=CONFIG.THEME1) if (tools.platform() == 'android' or CONFIG.DEVELOPER == 'true'): directory.add_dir('Instalador de APK', {'mode': 'apk'}, icon=CONFIG.ICONAPK, themeit=CONFIG.THEME1) if tools.open_url(CONFIG.ADDONFILE, check=True) or os.path.exists(os.path.join(CONFIG.ADDON_PATH, 'resources', 'text', 'addons.json')): directory.add_dir('Instalador de Addon', {'mode': 'addons'}, icon=CONFIG.ICONADDONS, themeit=CONFIG.THEME1) if tools.open_url(CONFIG.YOUTUBEFILE, check=True) and not CONFIG.YOUTUBETITLE == '': directory.add_dir(CONFIG.YOUTUBETITLE, {'mode': 'youtube'}, icon=CONFIG.ICONYOUTUBE, themeit=CONFIG.THEME1) directory.add_dir('[B]Guardar Datos[/B]', {'mode': 'savedata'}, icon=CONFIG.ICONSAVE, themeit=CONFIG.THEME1) if CONFIG.HIDECONTACT == 'No': directory.add_file('Contacto', {'mode': 'contact'}, icon=CONFIG.ICONCONTACT, themeit=CONFIG.THEME1) directory.add_separator() directory.add_file('Cargar Archivo de Registro', {'mode': 'uploadlog'}, icon=CONFIG.ICONMAINT, themeit=CONFIG.THEME1) directory.add_file('[B]Ver Errores en el Registro:[/B] [COLOR teal]{0}[/COLOR]'.format(errorsfound), {'mode': 'viewerrorlog'}, icon=CONFIG.ICONMAINT, themeit=CONFIG.THEME1) if errors > 0: directory.add_file('Ver el Ultimo Error en el Registro', {'mode': 'viewerrorlast'}, icon=CONFIG.ICONMAINT, themeit=CONFIG.THEME1) directory.add_separator() directory.add_file('[B]Ajustes[/B]', {'mode': 'settings', 'name': CONFIG.ADDON_ID}, icon=CONFIG.ICONSETTINGS, themeit=CONFIG.THEME1) if CONFIG.DEVELOPER == 'true': directory.add_dir('Menú de Desarrollador', {'mode': 'developer'}, icon=CONFIG.ADDON_ICON, themeit=CONFIG.THEME1)
def build_info(self, name): from resources.libs import check from resources.libs.common import logging from resources.libs.common import tools from resources.libs.gui import window if 75 - 75: o0oOOo0O0Ooo.Oo0ooO0oo0oO iiiI11 = tools.open_url(CONFIG.BUILDFILE, check=True) if 54 - 54: II111iiii % OoOoOO00 % I11i % iIii1I11I1II1 + iIii1I11I1II1 * Oo0ooO0oo0oO if iiiI11: if check.check_build(name, 'url'): name, o00, Oo0oO0ooo, O00O0oOO00O00, i1Oo00, i1, oOOoo00O0O, i1111, i11, I1i1I, I11, oOO00oOO, Oo0o0000o0o0 = check.check_build( name, 'all') I11 = 'Yes' if I11.lower() == 'yes' else 'No' if 31 - 31: O0oo0OO0.OoOoOO00 / O0 o000O0o = tools.open_url(oOO00oOO) if 42 - 42: OoOoOO00 if o000O0o: try: II, Ii1I1IIii1II, O0ii1ii1ii, oooooOoo0ooo, I1I1IiI1, III1iII1I1ii, oOOo0, oo00O00oO, iIiIIIi, ooo00OOOooO, O00OOOoOoo0O, O000OOo00oo = check.check_info( o000O0o.text) oo0OOo = True except: oo0OOo = False else: oo0OOo = False if 64 - 64: I11i i1IIiiiii = self.theme_count(name, count=False) if 22 - 22: Oo0Ooo + Ii1I % I1ii11iIi11i iI1 = "[COLOR {0}]Nome da construção:[/COLOR] [COLOR {1}]{2}[/COLOR][CR]".format( CONFIG.COLOR2, CONFIG.COLOR1, name) iI1 += "[COLOR {0}]Build Version:[/COLOR] [COLOR {1}]{2}[/COLOR][CR]".format( CONFIG.COLOR2, CONFIG.COLOR1, o00) if i1IIiiiii: iI1 += "[COLOR {0}]Build Tema(s):[/COLOR] [COLOR {1}]{2}[/COLOR][CR]".format( CONFIG.COLOR2, CONFIG.COLOR1, ', '.join(i1IIiiiii)) iI1 += "[COLOR {0}]Versão Kodi:[/COLOR] [COLOR {1}]{2}[/COLOR][CR]".format( CONFIG.COLOR2, CONFIG.COLOR1, i1) iI1 += "[COLOR {0}]Conteúdo adulto:[/COLOR] [COLOR {1}]{2}[/COLOR][CR]".format( CONFIG.COLOR2, CONFIG.COLOR1, I11) iI1 += "[COLOR {0}]Descrição:[/COLOR] [COLOR {1}]{2}[/COLOR][CR]".format( CONFIG.COLOR2, CONFIG.COLOR1, Oo0o0000o0o0) if 28 - 28: OoO0O00 + Ii1I / OoO0O00.II111iiii if oo0OOo: iI1 += "[COLOR {0}]Última atualização:[/COLOR] [COLOR {1}]{2}[/COLOR][CR][CR]".format( CONFIG.COLOR2, CONFIG.COLOR1, I1I1IiI1) iI1 += "[COLOR {0}]Tamanho Extraído:[/COLOR] [COLOR {1}]{2}[/COLOR][CR][CR]".format( CONFIG.COLOR2, CONFIG.COLOR1, tools.convert_size(int(float(Ii1I1IIii1II)))) iI1 += "[COLOR {0}]Tamanho Zip:[/COLOR] [COLOR {1}]{2}[/COLOR][CR][CR]".format( CONFIG.COLOR2, CONFIG.COLOR1, tools.convert_size(int(float(O0ii1ii1ii)))) iI1 += "[COLOR {0}]Nome da Skin:[/COLOR] [COLOR {1}]{2}[/COLOR][CR][CR]".format( CONFIG.COLOR2, CONFIG.COLOR1, oooooOoo0ooo) iI1 += "[COLOR {0}]Programa:[/COLOR] [COLOR {1}]{2}[/COLOR][CR][CR]".format( CONFIG.COLOR2, CONFIG.COLOR1, III1iII1I1ii) iI1 += "[COLOR {0}]Video:[/COLOR] [COLOR {1}]{2}[/COLOR][CR][CR]".format( CONFIG.COLOR2, CONFIG.COLOR1, oOOo0) iI1 += "[COLOR {0}]Música:[/COLOR] [COLOR {1}]{2}[/COLOR][CR][CR]".format( CONFIG.COLOR2, CONFIG.COLOR1, oo00O00oO) iI1 += "[COLOR {0}]Fotos:[/COLOR] [COLOR {1}]{2}[/COLOR][CR][CR]".format( CONFIG.COLOR2, CONFIG.COLOR1, iIiIIIi) iI1 += "[COLOR {0}]Repositórios:[/COLOR] [COLOR {1}]{2}[/COLOR][CR][CR]".format( CONFIG.COLOR2, CONFIG.COLOR1, ooo00OOOooO) iI1 += "[COLOR {0}]Scripts:[/COLOR] [COLOR {1}]{2}[/COLOR][CR][CR]".format( CONFIG.COLOR2, CONFIG.COLOR1, O00OOOoOoo0O) iI1 += "[COLOR {0}]Binários:[/COLOR] [COLOR {1}]{2}[/COLOR]".format( CONFIG.COLOR2, CONFIG.COLOR1, O000OOo00oo) if 68 - 68: i11iIiiIii % I1ii11iIi11i + i11iIiiIii window.show_text_box( "Visualizando informações de compilação: {0}".format(name), iI1) else: logging.log("Nome de compilação inválido!") else: logging.log( "O arquivo de texto de compilação não está funcionando: {0}". format(CONFIG.BUILDFILE)) if 31 - 31: II111iiii.I1IiiI
def view_build(self, name): if 19 - 19: I11i + Oo0ooO0oo0oO iiiI11 = tools.open_url(CONFIG.BUILDFILE) if 53 - 53: OoooooooOO.i1IIi if iiiI11: oOoOo00oOo = tools.clean_text(iiiI11.text) else: directory.add_file('URL para arquivo txt não é válido', themeit=CONFIG.THEME3) directory.add_file('{0}'.format(CONFIG.BUILDFILE), themeit=CONFIG.THEME3) return if 18 - 18: o0oOOo0O0Ooo if not check.check_build(name, 'version'): directory.add_file('Erro ao ler o arquivo txt.', themeit=CONFIG.THEME3) directory.add_file( '{0} não foi encontrado na lista de builds.'.format(name), themeit=CONFIG.THEME3) return if 28 - 28: OOooOOo - O00oOoOoO0o0O.O00oOoOoO0o0O + OoOoOO00 - OoooooooOO + O0 Oo = re.compile( 'name="%s".+?ersion="(.+?)".+?rl="(.+?)".+?ui="(.+?)".+?odi="(.+?)".+?heme="(.+?)".+?con="(.+?)".+?anart="(.+?)".+?review="(.+?)".+?dult="(.+?)".+?nfo="(.+?)".+?escription="(.+?)"' % name).findall(oOoOo00oOo) if 95 - 95: OoO0O00 % oO0o.O0 for o00, Oo0oO0ooo, o0oOoO00o, i1, oOOOo0o0O, i1111, i11, I1i1I, I11, oOO00oOO, Oo0o0000o0o0 in Oo: OoOo = '{0} (v{1})'.format(name, o00) if 18 - 18: i11iIiiIii Ii11I = CONFIG.BUILDNAME == name and o00 > CONFIG.BUILDVERSION OOO0OOO00oo = True if float(CONFIG.KODIV) == float(i1) else False Iii111II = tools.open_url(I1i1I, check=True) iiii11I = tools.open_url(o0oOoO00o, check=True) Ooo0OO0oOO = tools.open_url(oOOOo0o0O, check=True) if 50 - 50: I1IiiI if Ii11I: OoOo = '{0} [COLOR red][CURRENT v{1}][/COLOR]'.format( OoOo, CONFIG.BUILDVERSION) if 34 - 34: I1IiiI * II111iiii % iii1I1I * OoOoOO00 - I1IiiI directory.add_file(OoOo, description=Oo0o0000o0o0, fanart=i11, icon=i1111, themeit=CONFIG.THEME4) directory.add_separator() directory.add_dir('Menu Salvar Dados', {'mode': 'savedata'}, icon=CONFIG.ICONSAVE, themeit=CONFIG.THEME3) directory.add_file('Informações de construção', { 'mode': 'buildinfo', 'name': name }, description=Oo0o0000o0o0, fanart=i11, icon=i1111, themeit=CONFIG.THEME3) if 33 - 33: o0oOOo0O0Ooo + OOooOOo * OoO0O00 - Oo0Ooo / oO0o % Ii1I if Iii111II: directory.add_file('Ver visualização do vídeo', { 'mode': 'buildpreview', 'name': name }, description=Oo0o0000o0o0, fanart=i11, icon=i1111, themeit=CONFIG.THEME3) if 21 - 21: OoO0O00 * iIii1I11I1II1 % oO0o * i1IIi if OOO0OOO00oo: directory.add_file( '[I]Construir projetado para Kodi v{0} (instalado: v{1})[/I]' .format(str(i1), str(CONFIG.KODIV)), fanart=i11, icon=i1111, themeit=CONFIG.THEME3) if 16 - 16: O0 - O0oo0OO0 * iIii1I11I1II1 + iii1I1I directory.add_separator('INSTALAR') directory.add_file('INSTALAR', { 'mode': 'install', 'action': 'build', 'name': name }, description=Oo0o0000o0o0, fanart=i11, icon=i1111, themeit=CONFIG.THEME1) if 50 - 50: II111iiii - Oo0ooO0oo0oO * I1ii11iIi11i / O0oo0OO0 + o0oOOo0O0Ooo if iiii11I: directory.add_file('Aplicar guiFix', { 'mode': 'install', 'action': 'gui', 'name': name }, description=Oo0o0000o0o0, fanart=i11, icon=i1111, themeit=CONFIG.THEME1) if 88 - 88: Ii1I / O0oo0OO0 + iii1I1I - II111iiii / Oo0ooO0oo0oO - OoOoOO00 if Ooo0OO0oOO: directory.add_separator('TEMAS', fanart=i11, icon=i1111) if 15 - 15: I1ii11iIi11i + OoOoOO00 - OoooooooOO / OOooOOo iiiI11 = tools.open_url(oOOOo0o0O) oOOoo00O0O = iiiI11.text oo000OO00Oo = tools.clean_text(oOOoo00O0O) Oo = re.compile( 'name="(.+?)".+?rl="(.+?)".+?con="(.+?)".+?anart="(.+?)".+?dult="(.+?)".+?escription="(.+?)"' ).findall(oo000OO00Oo) for O0OOO0OOoO0O, O00Oo000ooO0, OoO0O00IIiII, o0, ooOooo000oOO, Oo0o0000o0o0 in Oo: Oo0oOOo = CONFIG.SHOWADULT != 'true' and ooOooo000oOO.lower( ) == 'yes' if 58 - 58: II111iiii * OOooOOo * I1ii11iIi11i / OOooOOo if Oo0oOOo: continue if 75 - 75: oO0o I1III = O0OOO0OOoO0O if not O0OOO0OOoO0O == CONFIG.BUILDTHEME else "[B]{0} (Installed)[/B]".format( O0OOO0OOoO0O) OoO0O00IIiII = OoO0O00IIiII if tools.open_url( OoO0O00IIiII, check=True) else i1111 o0 = o0 if tools.open_url(o0, check=True) else i11 if 63 - 63: OOooOOo % oO0o * oO0o * OoO0O00 / I1ii11iIi11i directory.add_file(I1III, { 'mode': 'install', 'action': 'theme', 'name': name, 'url': O0OOO0OOoO0O }, description=Oo0o0000o0o0, fanart=o0, icon=OoO0O00IIiII, themeit=CONFIG.THEME3) if 74 - 74: II111iiii
def get_listing(self): from resources.libs import check from resources.libs.common import logging from resources.libs.common import tools errors = int(logging.error_checking(count=True)) errorsfound = str(errors) + ' Error(s) Found' if errors > 0 else 'None Found' if CONFIG.AUTOUPDATE == 'Yes': response = tools.open_url(CONFIG.BUILDFILE, check=True) if response: ver = check.check_wizard('version') if ver: if ver > CONFIG.ADDON_VERSION: directory.add_file( '{0} [v{1}] [COLOR red][B][UPDATE v{2}][/B][/COLOR]'.format(CONFIG.ADDONTITLE, CONFIG.ADDON_VERSION, ver), {'mode': 'wizardupdate'}, themeit=CONFIG.THEME2) else: directory.add_file('{0} [v{1}]'.format(CONFIG.ADDONTITLE, CONFIG.ADDON_VERSION), themeit=CONFIG.THEME2) else: directory.add_file('{0} [v{1}]'.format(CONFIG.ADDONTITLE, CONFIG.ADDON_VERSION), themeit=CONFIG.THEME2) else: directory.add_file('{0} [v{1}]'.format(CONFIG.ADDONTITLE, CONFIG.ADDON_VERSION), themeit=CONFIG.THEME2) if len(CONFIG.BUILDNAME) > 0: version = check.check_build(CONFIG.BUILDNAME, 'version') build = '{0} (v{1})'.format(CONFIG.BUILDNAME, CONFIG.BUILDVERSION) if version > CONFIG.BUILDVERSION: build = '{0} [COLOR red][B][UPDATE v{1}][/B][/COLOR]'.format(build, version) directory.add_dir(build, {'mode': 'viewbuild', 'name': CONFIG.BUILDNAME}, themeit=CONFIG.THEME4) from resources.libs.gui.build_menu import BuildMenu themefile = BuildMenu().theme_count(CONFIG.BUILDNAME) if themefile: directory.add_file('None' if CONFIG.BUILDTHEME == "" else CONFIG.BUILDTHEME, {'mode': 'theme', 'name': CONFIG.BUILDNAME}, themeit=CONFIG.THEME5) else: directory.add_dir('None', {'mode': 'builds'}, themeit=CONFIG.THEME4) directory.add_separator() directory.add_dir('Builds', {'mode': 'builds'}, icon=CONFIG.ICONBUILDS, themeit=CONFIG.THEME1) directory.add_dir('Maintenance', {'mode': 'maint'}, icon=CONFIG.ICONMAINT, themeit=CONFIG.THEME1) if (tools.platform() == 'android' or CONFIG.DEVELOPER == 'true') and CONFIG.KODIV < 18: directory.add_dir('APK Installer', {'mode': 'apk'}, icon=CONFIG.ICONAPK, themeit=CONFIG.THEME1) if tools.open_url(CONFIG.ADDONFILE, check=True) or os.path.exists(os.path.join(CONFIG.ADDON_PATH, 'resources', 'text', 'addons.json')): directory.add_dir('Addon Installer', {'mode': 'addons'}, icon=CONFIG.ICONADDONS, themeit=CONFIG.THEME1) if tools.open_url(CONFIG.YOUTUBEFILE, check=True) and not CONFIG.YOUTUBETITLE == '': directory.add_dir(CONFIG.YOUTUBETITLE, {'mode': 'youtube'}, icon=CONFIG.ICONYOUTUBE, themeit=CONFIG.THEME1) directory.add_dir('Save Data', {'mode': 'savedata'}, icon=CONFIG.ICONSAVE, themeit=CONFIG.THEME1) if CONFIG.HIDECONTACT == 'No': directory.add_file('Contact', {'mode': 'contact'}, icon=CONFIG.ICONCONTACT, themeit=CONFIG.THEME1) directory.add_separator() directory.add_file('Upload Log File', {'mode': 'uploadlog'}, icon=CONFIG.ICONMAINT, themeit=CONFIG.THEME1) directory.add_file('View Errors in Log: {0}'.format(errorsfound), {'mode': 'viewerrorlog'}, icon=CONFIG.ICONMAINT, themeit=CONFIG.THEME1) if errors > 0: directory.add_file('View Last Error In Log', {'mode': 'viewerrorlast'}, icon=CONFIG.ICONMAINT, themeit=CONFIG.THEME1) directory.add_separator() directory.add_file('Settings', {'mode': 'settings', 'name': CONFIG.ADDON_ID}, icon=CONFIG.ICONSETTINGS, themeit=CONFIG.THEME1) if CONFIG.DEVELOPER == 'true': directory.add_dir('Developer Menu', {'mode': 'developer'}, icon=CONFIG.ADDON_ICON, themeit=CONFIG.THEME1)
def installed_build_check(): dialog = xbmcgui.Dialog() if not CONFIG.EXTRACT == '100' and CONFIG.EXTERROR > 0: logging.log("[Build Installed Check] Build fue extraído {0}/100 con [ERRORS: {1}]".format(CONFIG.EXTRACT, CONFIG.EXTERROR), level=xbmc.LOGINFO) yes = dialog.yesno(CONFIG.ADDONTITLE, '[COLOR {0}]{2}[/COLOR] [COLOR {1}]no se instaló correctamente![/COLOR]'.format(CONFIG.COLOR1, CONFIG.COLOR2, CONFIG.BUILDNAME) +'\n'+('Instalado: [COLOR {0}]{1}[/COLOR] / ' 'Errores Encontrados: [COLOR {2}]{3}[/COLOR]').format(CONFIG.COLOR1, CONFIG.EXTRACT, CONFIG.COLOR1, CONFIG.EXTERROR) +'\n'+'¿Le gustaría volver a intentarlo?[/COLOR]', nolabel='[B]No, ¡Gracias![/B]', yeslabel='[B]Reintentar la Instalación[/B]') CONFIG.clear_setting('build') if yes: xbmc.executebuiltin("PlayMedia(plugin://{0}/?mode=install&name={1}&url=fresh)".format(CONFIG.ADDON_ID, quote_plus(CONFIG.BUILDNAME))) logging.log("[Build Installed Check] Instalación Nueva Re-activada", level=xbmc.LOGINFO) else: logging.log("[Build Installed Check] Reinstalar Ignorado") elif CONFIG.SKIN in ['skin.confluence', 'skin.estuary', 'skin.estouchy']: logging.log("[Build Installed Check] Skin Incorrecto: {0}".format(CONFIG.SKIN), level=xbmc.LOGINFO) defaults = CONFIG.get_setting('defaultskin') if not defaults == '': if os.path.exists(os.path.join(CONFIG.ADDONS, defaults)): if skin.skin_to_default(defaults): skin.look_and_feel_data('restore') if not CONFIG.SKIN == defaults and not CONFIG.BUILDNAME == "": gui_xml = check.check_build(CONFIG.BUILDNAME, 'gui') response = tools.open_url(gui_xml, check=True) if not response: logging.log("[Build Installed Check] Guifix estaba configurado para http://", level=xbmc.LOGINFO) dialog.ok(CONFIG.ADDONTITLE, "[COLOR {0}]Parece que la configuración de la máscara no se aplicó a la build.".format(CONFIG.COLOR2) +'\n'+"Lamentablemente, no se adjuntó ninguna corrección de interfaz gráfica de usuario a la build" +'\n'+"Deberá reinstalar la build y asegurarse de hacer un cierre forzado[/COLOR]") else: yes = dialog.yesno(CONFIG.ADDONTITLE, '{0} No se instaló correctamente!'.format(CONFIG.BUILDNAME) +'\n'+'Parece que la configuración de la máscara no se aplicó a la build.' +'\n'+'Le gustaría aplicar el GuiFix?', nolabel='[B]No, Cancelar[/B]', yeslabel='[B]Aplicar Fix[/B]') if yes: xbmc.executebuiltin("PlayMedia(plugin://{0}/?mode=install&name={1}&url=gui)".format(CONFIG.ADDON_ID, quote_plus(CONFIG.BUILDNAME))) logging.log("[Build Installed Check] Intentando instalar Guifix") else: logging.log('[Build Installed Check] URL de Guifix funcionando, pero cancelada: {0}'.format(gui_xml), level=xbmc.LOGINFO) else: logging.log('[Build Installed Check] La instalación parece haberse completado correctamente', level=xbmc.LOGINFO) if CONFIG.get_setting('installed') == 'true': if CONFIG.get_setting('keeptrakt') == 'true': from resources.libs import traktit logging.log('[Build Installed Check] Restaurando Trakt Data', level=xbmc.LOGINFO) traktit.trakt_it('restore', 'all') if CONFIG.get_setting('keepdebrid') == 'true': from resources.libs import debridit logging.log('[Build Installed Check] Restaurando Real Debrid Data', level=xbmc.LOGINFO) debridit.debrid_it('restore', 'all') if CONFIG.get_setting('keeplogin') == 'true': from resources.libs import loginit logging.log('[Build Installed Check] Restaurando Login Data', level=xbmc.LOGINFO) loginit.login_it('restore', 'all') CONFIG.clear_setting('install')
def view_build(self, name): response = tools.open_url(CONFIG.BUILDFILE) if response: link = tools.clean_text(response.text) else: directory.add_file('URL for txt file not valid', themeit=CONFIG.THEME3) directory.add_file('{0}'.format(CONFIG.BUILDFILE), themeit=CONFIG.THEME3) return if not check.check_build(name, 'version'): directory.add_file('Error reading the txt file.', themeit=CONFIG.THEME3) directory.add_file( '{0} was not found in the builds list.'.format(name), themeit=CONFIG.THEME3) return match = re.compile( 'name="%s".+?ersion="(.+?)".+?rl="(.+?)".+?ui="(.+?)".+?odi="(.+?)".+?heme="(.+?)".+?con="(.+?)".+?anart="(.+?)".+?review="(.+?)".+?dult="(.+?)".+?nfo="(.+?)".+?escription="(.+?)"' % name).findall(link) for version, url, gui, kodi, themefile, icon, fanart, preview, adult, info, description in match: build = '{0} (v{1})'.format(name, version) updatecheck = CONFIG.BUILDNAME == name and version > CONFIG.BUILDVERSION versioncheck = True if float( CONFIG.KODIV) == float(kodi) else False previewcheck = tools.open_url(preview, check=True) guicheck = tools.open_url(gui, check=True) themecheck = tools.open_url(themefile, check=True) if updatecheck: build = '{0} [COLOR red][CURRENT v{1}][/COLOR]'.format( build, CONFIG.BUILDVERSION) directory.add_file(build, description=description, fanart=fanart, icon=icon, themeit=CONFIG.THEME4) directory.add_separator() directory.add_dir('Save Data Menu', {'mode': 'savedata'}, icon=CONFIG.ICONSAVE, themeit=CONFIG.THEME3) directory.add_file('Build Information', { 'mode': 'buildinfo', 'name': name }, description=description, fanart=fanart, icon=icon, themeit=CONFIG.THEME3) if previewcheck: directory.add_file('View Video Preview', { 'mode': 'buildpreview', 'name': name }, description=description, fanart=fanart, icon=icon, themeit=CONFIG.THEME3) if versioncheck: directory.add_file( '[I]Build designed for Kodi v{0} (installed: v{1})[/I]'. format(str(kodi), str(CONFIG.KODIV)), fanart=fanart, icon=icon, themeit=CONFIG.THEME3) directory.add_separator('INSTALL') directory.add_file('Fresh Install', { 'mode': 'install', 'action': 'fresh', 'name': name }, description=description, fanart=fanart, icon=icon, themeit=CONFIG.THEME1) directory.add_file('Standard Install', { 'mode': 'install', 'action': 'normal', 'name': name }, description=description, fanart=fanart, icon=icon, themeit=CONFIG.THEME1) if guicheck: directory.add_file('Apply guiFix', { 'mode': 'install', 'action': 'gui', 'name': name }, description=description, fanart=fanart, icon=icon, themeit=CONFIG.THEME1) if themecheck: directory.add_separator('THEMES', fanart=fanart, icon=icon) response = tools.open_url(themefile) theme = response.text themelink = tools.clean_text(theme) match = re.compile( 'name="(.+?)".+?rl="(.+?)".+?con="(.+?)".+?anart="(.+?)".+?dult="(.+?)".+?escription="(.+?)"' ).findall(themelink) for themename, themeurl, themeicon, themefanart, themeadult, description in match: adultcheck = CONFIG.SHOWADULT != 'true' and themeadult.lower( ) == 'yes' if adultcheck: continue themetitle = themename if not themename == CONFIG.BUILDTHEME else "[B]{0} (Installed)[/B]".format( themename) themeicon = themeicon if tools.open_url( themeicon, check=True) else icon themefanart = themefanart if tools.open_url( themefanart, check=True) else fanart directory.add_file(themetitle, { 'mode': 'install', 'action': 'theme', 'name': name, 'url': themename }, description=description, fanart=themefanart, icon=themeicon, themeit=CONFIG.THEME3)
def view_build(self, name): response = tools.open_url(CONFIG.BUILDFILE) if response: link = tools.clean_text(response.text) else: directory.add_file('[COLOR azure]URL para archivo txt no válido', themeit=CONFIG.THEME3) directory.add_file('{0}'.format(CONFIG.BUILDFILE), themeit=CONFIG.THEME3) return if not check.check_build(name, 'version'): directory.add_file( '[COLOR azure]Error al leer el archivo txt.[COLOR]', themeit=CONFIG.THEME3) directory.add_file( '{0} [COLOR azure]no se encontró en la lista de builds.[COLOR]' .format(name), themeit=CONFIG.THEME3) return match = re.compile( 'name="%s".+?ersion="(.+?)".+?rl="(.+?)".+?ui="(.+?)".+?odi="(.+?)".+?heme="(.+?)".+?con="(.+?)".+?anart="(.+?)".+?review="(.+?)".+?dult="(.+?)".+?nfo="(.+?)".+?escription="(.+?)"' % name).findall(link) for version, url, gui, kodi, themefile, icon, fanart, preview, adult, info, description in match: build = '[COLOR azure]{0}[/COLOR] [COLOR white]- v{1}[/COLOR]'.format( name, version) updatecheck = CONFIG.BUILDNAME == name and version > CONFIG.BUILDVERSION versioncheck = True if float( CONFIG.KODIV) == float(kodi) else False previewcheck = tools.open_url(preview, check=True) guicheck = tools.open_url(gui, check=True) themecheck = tools.open_url(themefile, check=True) if updatecheck: build = '{0} [COLOR red][ACTUAL v{1}][/COLOR]'.format( build, CONFIG.BUILDVERSION) directory.add_file(build, description=description, fanart=fanart, icon=icon, themeit=CONFIG.THEME4) directory.add_separator() directory.add_dir('[B][COLOR azure]MENU GUARDAR DATOS[/COLOR][/B]', {'mode': 'savedata'}, icon=CONFIG.ICONSAVE, themeit=CONFIG.THEME3) directory.add_file('[B][COLOR azure]BUILD INFORMACION[/COLOR][/B]', { 'mode': 'buildinfo', 'name': name }, description=description, fanart=fanart, icon=icon, themeit=CONFIG.THEME3) if previewcheck: directory.add_file('Ver Vista Previa de Video', { 'mode': 'buildpreview', 'name': name }, description=description, fanart=fanart, icon=icon, themeit=CONFIG.THEME3) if versioncheck: directory.add_file( '[I][COLOR powderblue]Build diseñado para Kodi v{0}[/COLOR] [COLOR azure]( instalado: [COLOR gold]v{1}[/COLOR] )[/COLOR][/I]' .format(str(kodi), str(CONFIG.KODIV)), fanart=fanart, icon=icon, themeit=CONFIG.THEME3) directory.add_file( '[I][COLOR azure]Soporte[/COLOR] [COLOR dodgerblue]TELEGRAM:[/COLOR] [I][COLOR azure]https://t.me/beelinkking[/COLOR][/I]' .format(str(kodi), str(CONFIG.KODIV)), fanart=fanart, icon=icon, themeit=CONFIG.THEME3) directory.add_separator('[B]INSTALACION BUILD[/B]', fanart=fanart, icon=icon, themeit=CONFIG.THEME3) directory.add_file('[B][COLOR azure]- Instalar Build[/COLOR][/B]', { 'mode': 'install', 'action': 'build', 'name': name }, description=description, fanart=fanart, icon=icon, themeit=CONFIG.THEME3) if guicheck: directory.add_file('Aplicar Corrección gui', { 'mode': 'install', 'action': 'gui', 'name': name }, description=description, fanart=fanart, icon=icon, themeit=CONFIG.THEME1) if themecheck: directory.add_separator('[B]PARCHES MATRIX[/B]', fanart=fanart, icon=icon, themeit=CONFIG.THEME2) response = tools.open_url(themefile) theme = response.text themelink = tools.clean_text(theme) match = re.compile( 'name="(.+?)".+?rl="(.+?)".+?con="(.+?)".+?anart="(.+?)".+?dult="(.+?)".+?escription="(.+?)"' ).findall(themelink) for themename, themeurl, themeicon, themefanart, themeadult, description in match: adultcheck = CONFIG.SHOWADULT != 'true' and themeadult.lower( ) == 'yes' if adultcheck: continue themetitle = themename if not themename == CONFIG.BUILDTHEME else "{0} - Instalado".format( themename) themeicon = themeicon if tools.open_url( themeicon, check=True) else icon themefanart = themefanart if tools.open_url( themefanart, check=True) else fanart directory.add_file(themetitle, { 'mode': 'install', 'action': 'theme', 'name': name, 'url': themename }, description=description, fanart=themefanart, icon=themeicon, themeit=CONFIG.THEME6)
def installed_build_check(): dialog = xbmcgui.Dialog() if not CONFIG.EXTRACT == '100' and CONFIG.EXTERROR > 0: logging.log( "[Build Installed Check] Build foi extraído {0}/100 with [ERROS: {1}]" .format(CONFIG.EXTRACT, CONFIG.EXTERROR), level=xbmc.LOGINFO) yes = dialog.yesno( CONFIG.ADDONTITLE, '[COLOR {0}]{2}[/COLOR] [COLOR {1}]não foi instalado corretamente![/COLOR]' .format(CONFIG.COLOR1, CONFIG.COLOR2, CONFIG.BUILDNAME) + '\n' + ('Instalado: [COLOR {0}]{1}[/COLOR] / ' 'Error Count: [COLOR {2}]{3}[/COLOR]').format( CONFIG.COLOR1, CONFIG.EXTRACT, CONFIG.COLOR1, CONFIG.EXTERROR) + '\n' + 'Você gostaria de tentar de novo?[/COLOR]', nolabel='[B]Não, obrigado![/B]', yeslabel='[B]Tentar novamente[/B]') CONFIG.clear_setting('build') if yes: xbmc.executebuiltin( "PlayMedia(plugin://{0}/?mode=install&name={1}&url=fresh)". format(CONFIG.ADDON_ID, quote_plus(CONFIG.BUILDNAME))) logging.log("[Build Installed Check] Nova instalação reset", level=xbmc.LOGINFO) else: logging.log("[Build Installed Check] Reinstall Ignored") elif CONFIG.SKIN in ['skin.confluence', 'skin.estuary', 'skin.estouchy']: logging.log("[Build Installed Check] Incorrect skin: {0}".format( CONFIG.SKIN), level=xbmc.LOGINFO) defaults = CONFIG.get_setting('defaultskin') if not defaults == '': if os.path.exists(os.path.join(CONFIG.ADDONS, defaults)): if skin.skin_to_default(defaults): skin.look_and_feel_data('restore') if not CONFIG.SKIN == defaults and not CONFIG.BUILDNAME == "": gui_xml = check.check_build(CONFIG.BUILDNAME, 'gui') response = tools.open_url(gui_xml, check=True) if not response: logging.log( "[Build Installed Check] Guifix was set to http://", level=xbmc.LOGINFO) dialog.ok( CONFIG.ADDONTITLE, "[COLOR {0}]Parece que as configurações de skin não foram aplicadas à build." .format(CONFIG.COLOR2) + '\n' + "Infelizmente, nenhuma correção de interface foi anexada a build" + '\n' + "Você precisará reinstalar a compilação e certificar-se de fazer um fechamento forçado[/COLOR]" ) else: yes = dialog.yesno( CONFIG.ADDONTITLE, '{0} não foi instalado corretamente!'.format( CONFIG.BUILDNAME) + '\n' + 'Parece que as configurações de skin não foram aplicadas à build.' + '\n' + 'Você gostaria de aplicar o GuiFix?', nolabel='[B]Não, Cancelar[/B]', yeslabel='[B]Aplicar Fix[/B]') if yes: xbmc.executebuiltin( "PlayMedia(plugin://{0}/?mode=install&name={1}&url=gui)" .format(CONFIG.ADDON_ID, quote_plus(CONFIG.BUILDNAME))) logging.log( "[Build Installed Check] Guifix tentando instalar") else: logging.log( '[Build Installed Check] Guifix url funcionando, mas cancelado: {0}' .format(gui_xml), level=xbmc.LOGINFO) else: logging.log( '[Build Installed Check] A instalação parece ter sido concluída corretamente', level=xbmc.LOGINFO) if CONFIG.get_setting('installed') == 'true': if CONFIG.get_setting('keeptrakt') == 'true': from resources.libs import traktit logging.log('[Build Installed Check] Restoring Trakt Data', level=xbmc.LOGINFO) traktit.trakt_it('restore', 'all') if CONFIG.get_setting('keepdebrid') == 'true': from resources.libs import debridit logging.log('[Build Installed Check] Restoring Real Debrid Data', level=xbmc.LOGINFO) debridit.debrid_it('restore', 'all') if CONFIG.get_setting('keeplogin') == 'true': from resources.libs import loginit logging.log('[Build Installed Check] Restoring Login Data', level=xbmc.LOGINFO) loginit.login_it('restore', 'all') CONFIG.clear_setting('install')
def installed_build_check(): dialog = xbmcgui.Dialog() if not CONFIG.EXTRACT == '100' and CONFIG.EXTERROR > 0: logging.log("[Build Installed Check] Build was extracted {0}/100 with [ERRORS: {1}]".format(CONFIG.EXTRACT, CONFIG.EXTERROR), level=xbmc.LOGINFO) yes = dialog.yesno(CONFIG.ADDONTITLE, '[COLOR {0}]{2}[/COLOR] [COLOR {1}]was not installed correctly![/COLOR]'.format(CONFIG.COLOR1, CONFIG.COLOR2, CONFIG.BUILDNAME) +'\n'+('Installed: [COLOR {0}]{1}[/COLOR] / ' 'Error Count: [COLOR {2}]{3}[/COLOR]').format(CONFIG.COLOR1, CONFIG.EXTRACT, CONFIG.COLOR1, CONFIG.EXTERROR) +'\n'+'Would you like to try again?[/COLOR]', nolabel='[B]No Thanks![/B]', yeslabel='[B]Retry Install[/B]') CONFIG.clear_setting('build') if yes: xbmc.executebuiltin("PlayMedia(plugin://{0}/?mode=install&name={1}&url=fresh)".format(CONFIG.ADDON_ID, quote_plus(CONFIG.BUILDNAME))) logging.log("[Build Installed Check] Fresh Install Re-activated", level=xbmc.LOGINFO) else: logging.log("[Build Installed Check] Reinstall Ignored") elif CONFIG.SKIN in ['skin.confluence', 'skin.estuary', 'skin.estouchy']: logging.log("[Build Installed Check] Incorrect skin: {0}".format(CONFIG.SKIN), level=xbmc.LOGINFO) defaults = CONFIG.get_setting('defaultskin') if not defaults == '': if os.path.exists(os.path.join(CONFIG.ADDONS, defaults)): if skin.skin_to_default(defaults): skin.look_and_feel_data('restore') if not CONFIG.SKIN == defaults and not CONFIG.BUILDNAME == "": gui_xml = check.check_build(CONFIG.BUILDNAME, 'gui') response = tools.open_url(gui_xml, check=True) if not response: logging.log("[Build Installed Check] Guifix was set to http://", level=xbmc.LOGINFO) dialog.ok(CONFIG.ADDONTITLE, "[COLOR {0}]It looks like the skin settings was not applied to the build.".format(CONFIG.COLOR2) +'\n'+"Sadly no gui fix was attached to the build" +'\n'+"You will need to reinstall the build and make sure to do a force close[/COLOR]") else: yes = dialog.yesno(CONFIG.ADDONTITLE, '{0} was not installed correctly!'.format(CONFIG.BUILDNAME) +'\n'+'It looks like the skin settings was not applied to the build.' +'\n'+'Would you like to apply the GuiFix?', nolabel='[B]No, Cancel[/B]', yeslabel='[B]Apply Fix[/B]') if yes: xbmc.executebuiltin("PlayMedia(plugin://{0}/?mode=install&name={1}&url=gui)".format(CONFIG.ADDON_ID, quote_plus(CONFIG.BUILDNAME))) logging.log("[Build Installed Check] Guifix attempting to install") else: logging.log('[Build Installed Check] Guifix url working but cancelled: {0}'.format(gui_xml), level=xbmc.LOGINFO) else: logging.log('[Build Installed Check] Install seems to be completed correctly', level=xbmc.LOGINFO) if CONFIG.get_setting('installed') == 'true': if CONFIG.get_setting('keeptrakt') == 'true': from resources.libs import traktit logging.log('[Build Installed Check] Restoring Trakt Data', level=xbmc.LOGINFO) traktit.trakt_it('restore', 'all') if CONFIG.get_setting('keepdebrid') == 'true': from resources.libs import debridit logging.log('[Build Installed Check] Restoring Real Debrid Data', level=xbmc.LOGINFO) debridit.debrid_it('restore', 'all') if CONFIG.get_setting('keeplogin') == 'true': from resources.libs import loginit logging.log('[Build Installed Check] Restoring Login Data', level=xbmc.LOGINFO) loginit.login_it('restore', 'all') CONFIG.clear_setting('install')
def build_info(self, name): from resources.libs import check from resources.libs.common import logging from resources.libs.common import tools from resources.libs.gui import window response = tools.open_url(CONFIG.BUILDFILE, check=True) if response: if check.check_build(name, 'url'): name, version, url, minor, gui_ignore, kodi, theme, icon, fanart, preview, adult, info, description = check.check_build( name, 'all') adult = 'Yes' if adult.lower() == 'yes' else 'No' info_response = tools.open_url(info) if info_response: try: tname, extracted, zipsize, skin, created, programs, video, music, picture, repos, scripts, binaries = check.check_info( info_response.text) extend = True except: extend = False else: extend = False themes = self.theme_count(name, count=False) msg = "[COLOR {0}]Nombre Build:[/COLOR] [COLOR {1}]{2}[/COLOR][CR]".format( CONFIG.COLOR2, CONFIG.COLOR1, name) msg += "[COLOR {0}]Version Build:[/COLOR] [COLOR {1}]{2}[/COLOR][CR]".format( CONFIG.COLOR2, CONFIG.COLOR1, version) if themes: msg += "[COLOR {0}]Build Parche(s):[/COLOR] [COLOR {1}]{2}[/COLOR][CR]".format( CONFIG.COLOR2, CONFIG.COLOR1, ', '.join(themes)) msg += "[COLOR {0}]Version Kodi:[/COLOR] [COLOR {1}]{2}[/COLOR][CR]".format( CONFIG.COLOR2, CONFIG.COLOR1, kodi) msg += "[COLOR {0}]Contenido Adulto:[/COLOR] [COLOR {1}]{2}[/COLOR][CR]".format( CONFIG.COLOR2, CONFIG.COLOR1, adult) msg += "[COLOR {0}]Descripción:[/COLOR] [COLOR {1}]{2}[/COLOR][CR]".format( CONFIG.COLOR2, CONFIG.COLOR1, description) if extend: msg += "[COLOR {0}]Ultima Actualización:[/COLOR] [COLOR {1}]{2}[/COLOR][CR][CR]".format( CONFIG.COLOR2, CONFIG.COLOR1, created) msg += "[COLOR {0}]Tamaño Extraido:[/COLOR] [COLOR {1}]{2}[/COLOR][CR][CR]".format( CONFIG.COLOR2, CONFIG.COLOR1, tools.convert_size(int(float(extracted)))) msg += "[COLOR {0}]Tamaño Zip:[/COLOR] [COLOR {1}]{2}[/COLOR][CR][CR]".format( CONFIG.COLOR2, CONFIG.COLOR1, tools.convert_size(int(float(zipsize)))) msg += "[COLOR {0}]Nombre Skin:[/COLOR] [COLOR {1}]{2}[/COLOR][CR][CR]".format( CONFIG.COLOR2, CONFIG.COLOR1, skin) msg += "[COLOR {0}]Programas:[/COLOR] [COLOR {1}]{2}[/COLOR][CR][CR]".format( CONFIG.COLOR2, CONFIG.COLOR1, programs) msg += "[COLOR {0}]Video:[/COLOR] [COLOR {1}]{2}[/COLOR][CR][CR]".format( CONFIG.COLOR2, CONFIG.COLOR1, video) msg += "[COLOR {0}]Música:[/COLOR] [COLOR {1}]{2}[/COLOR][CR][CR]".format( CONFIG.COLOR2, CONFIG.COLOR1, music) msg += "[COLOR {0}]Imágenes:[/COLOR] [COLOR {1}]{2}[/COLOR][CR][CR]".format( CONFIG.COLOR2, CONFIG.COLOR1, picture) msg += "[COLOR {0}]Repositorios:[/COLOR] [COLOR {1}]{2}[/COLOR][CR][CR]".format( CONFIG.COLOR2, CONFIG.COLOR1, repos) msg += "[COLOR {0}]Scripts:[/COLOR] [COLOR {1}]{2}[/COLOR][CR][CR]".format( CONFIG.COLOR2, CONFIG.COLOR1, scripts) msg += "[COLOR {0}]Binarios:[/COLOR] [COLOR {1}]{2}[/COLOR]".format( CONFIG.COLOR2, CONFIG.COLOR1, binaries) window.show_text_box( "[B][COLOR azure]Visualización de Información de la Build:[/COLOR][/B] [COLOR blue]{0}[/COLOR]" .format(name), msg) else: logging.log("Nombre Inválido de la Build!") else: logging.log( "[B][COLOR azure]La Build del archivo de texto no funciona:[/COLOR][/B] [COLOR blue]{0}[/COLOR]" .format(CONFIG.BUILDFILE))
def build(self, name, over=False): # if action == 'normal': # if CONFIG.KEEPTRAKT == 'true': # from resources.libs import traktit # traktit.auto_update('all') # CONFIG.set_setting('traktnextsave', tools.get_date(days=3, formatted=True)) # if CONFIG.KEEPDEBRID == 'true': # from resources.libs import debridit # debridit.auto_update('all') # CONFIG.set_setting('debridnextsave', tools.get_date(days=3, formatted=True)) # if CONFIG.KEEPLOGIN == 'true': # from resources.libs import loginit # loginit.auto_update('all') # CONFIG.set_setting('loginnextsave', tools.get_date(days=3, formatted=True)) temp_kodiv = int(CONFIG.KODIV) buildv = int(float(check.check_build(name, 'kodi'))) if not temp_kodiv == buildv: warning = True else: warning = False if warning: yes_pressed = self.dialog.yesno( "{0} - [COLOR red]WARNING!![/COLOR]".format(CONFIG.ADDONTITLE), '[COLOR {0}]There is a chance that the skin will not appear correctly' .format(CONFIG.COLOR2) + '\n' + 'When installing a {0} build on a Kodi {1} install'.format( check.check_build(name, 'kodi'), CONFIG.KODIV) + '\n' + 'Would you still like to install: [COLOR {0}]{1} v{2}[/COLOR]?[/COLOR]' .format(CONFIG.COLOR1, name, check.check_build( name, 'version')), nolabel='[B][COLOR red]No, Cancel[/COLOR][/B]', yeslabel='[B][COLOR springgreen]Yes, Install[/COLOR][/B]') else: if over: yes_pressed = 1 else: yes_pressed = self.dialog.yesno( CONFIG.ADDONTITLE, '[COLOR {0}]Would you like to Download and Install: '. format(CONFIG.COLOR2) + '[COLOR {0}]{1} v{2}[/COLOR]?[/COLOR]'.format( CONFIG.COLOR1, name, check.check_build( name, 'version')), nolabel='[B][COLOR red]No, Cancel[/COLOR][/B]', yeslabel='[B][COLOR springgreen]Yes, Install[/COLOR][/B]') if yes_pressed: CONFIG.clear_setting('build') buildzip = check.check_build(name, 'url') zipname = name.replace('\\', '').replace('/', '').replace( ':', '').replace('*', '').replace('?', '').replace('"', '').replace( '<', '').replace('>', '').replace('|', '') self.dialogProgress.create( CONFIG.ADDONTITLE, '[COLOR {0}][B]Downloading:[/B][/COLOR] [COLOR {1}]{2} v{3}[/COLOR]' .format(CONFIG.COLOR2, CONFIG.COLOR1, name, check.check_build(name, 'version')) + '\n' + 'Please Wait') lib = os.path.join(CONFIG.MYBUILDS, '{0}.zip'.format(zipname)) try: os.remove(lib) except: pass Downloader().download(buildzip, lib) xbmc.sleep(500) if os.path.getsize(lib) == 0: try: os.remove(lib) except: pass return yes_fresh = self.dialog.yesno( CONFIG.ADDONTITLE, '[COLOR {0}][COLOR {1}]Do you wish to erase all data before installing?[/COLOR]' .format(CONFIG.COLOR2, CONFIG.COLOR1), nolabel='[B][COLOR red]No Thanks[/COLOR][/B]', yeslabel='[B][COLOR springgreen]Fresh Install[/COLOR][/B]') if yes_fresh: install.wipe() skin.look_and_feel_data('save') title = '[COLOR {0}][B]Installing:[/B][/COLOR] [COLOR {1}]{2} v{3}[/COLOR]'.format( CONFIG.COLOR2, CONFIG.COLOR1, name, check.check_build(name, 'version')) self.dialogProgress.update(0, title + '\n' + 'Please Wait') percent, errors, error = extract.all(lib, CONFIG.HOME, title=title) skin.skin_to_default('Build Install') if int(float(percent)) > 0: db.fix_metas() CONFIG.set_setting('buildname', name) CONFIG.set_setting('buildversion', check.check_build(name, 'version')) CONFIG.set_setting('buildtheme', '') CONFIG.set_setting('latestversion', check.check_build(name, 'version')) CONFIG.set_setting( 'nextbuildcheck', tools.get_date(days=CONFIG.UPDATECHECK, formatted=True)) CONFIG.set_setting('installed', 'true') CONFIG.set_setting('extract', percent) CONFIG.set_setting('errors', errors) logging.log('INSTALLED {0}: [ERRORS:{1}]'.format( percent, errors)) try: os.remove(lib) except: pass if int(float(errors)) > 0: yes_pressed = self.dialog.yesno( CONFIG.ADDONTITLE, '[COLOR {0}][COLOR {1}]{2} v{3}[/COLOR]'.format( CONFIG.COLOR2, CONFIG.COLOR1, name, check.check_build(name, 'version')) + '\n' + 'Completed: [COLOR {0}]{1}{2}[/COLOR] [Errors:[COLOR {3}]{4}[/COLOR]]' .format(CONFIG.COLOR1, percent, '%', CONFIG.COLOR1, errors) + '\n' + 'Would you like to view the errors?[/COLOR]', nolabel='[B][COLOR red]No Thanks[/COLOR][/B]', yeslabel='[B][COLOR springgreen]View Errors[/COLOR][/B]' ) if yes_pressed: from resources.libs.gui import window window.show_text_box("Viewing Build Install Errors", error) self.dialogProgress.close() from resources.libs.gui.build_menu import BuildMenu #themecount = BuildMenu().theme_count(name) #if themecount > 0: #self.theme(name, 'theme') db.addon_database(CONFIG.ADDON_ID, 1) #db.force_check_updates(over=True) self.dialog.ok( CONFIG.ADDONTITLE, "[COLOR {0}]To save changes you now need to force close Kodi, Press OK to force close Kodi[/COLOR]" .format(CONFIG.COLOR2)) tools.kill_kodi(over=True) else: from resources.libs.gui import window window.show_text_box("Viewing Build Install Errors", error) else: logging.log_notify( CONFIG.ADDONTITLE, '[COLOR {0}]Build Install: Cancelled![/COLOR]'.format( CONFIG.COLOR2))
def install(self, name): CONFIG.clear_setting('build') if CONFIG.get_setting('choicelink') == 'true': buildzip = check.check_data(name,'url') elif CONFIG.get_setting('choicelink') == 'false': buildzip = check.check_data(name,'url') zipname = name.replace('\\', '').replace('/', '').replace(':', '').replace('*', '').replace('?', '').replace('"', '').replace('<', '').replace('>', '').replace('|', '') self.dialogProgress.create(CONFIG.ADDONTITLE, '[COLOR {0}][B]Downloading:[/B][/COLOR] [COLOR {1}]{2}[/COLOR]'.format(CONFIG.COLOR2, CONFIG.COLOR1, name) + '\n' + 'Please Wait') lib = os.path.join(CONFIG.MYBUILDS, '{0}.zip'.format(zipname)) try: os.remove(lib) except: pass Downloader().download(buildzip, lib) xbmc.sleep(500) if os.path.getsize(lib) == 0: try: os.remove(lib) except: pass return # install.wipe() # skin.look_and_feel_data('save') title = '[COLOR {0}][B]Installing:[/B][/COLOR] [COLOR {1}]{2} v{3}[/COLOR]'.format(CONFIG.COLOR2, CONFIG.COLOR1, name, check.check_build(name, 'version')) self.dialogProgress.update(0, title + '\n' + 'Please Wait') percent, errors, error = extract.all(lib, CONFIG.HOME, title=title) # skin.skin_to_default('Build Install') if int(float(percent)) > 0: # db.fix_metas() # CONFIG.set_setting('buildname', name) # CONFIG.set_setting('buildversion', check.check_build(name, 'version')) # CONFIG.set_setting('buildtheme', '') # CONFIG.set_setting('latestversion', check.check_build(name, 'version')) # CONFIG.set_setting('nextbuildcheck', tools.get_date(days=CONFIG.UPDATECHECK, formatted=True)) # CONFIG.set_setting('installed', 'true') # CONFIG.set_setting('extract', percent) # CONFIG.set_setting('errors', errors) logging.log('INSTALLED {0}: [ERRORS:{1}]'.format(percent, errors)) try: os.remove(lib) except: pass if int(float(errors)) > 0: yes_pressed = self.dialog.yesno(CONFIG.ADDONTITLE, '[COLOR {0}][COLOR {1}]{2} v{3}[/COLOR]'.format(CONFIG.COLOR2, CONFIG.COLOR1, name, check.check_build(name, 'version')), 'Completed: [COLOR {0}]{1}{2}[/COLOR] [Errors:[COLOR {3}]{4}[/COLOR]]'.format( CONFIG.COLOR1, percent, '%', CONFIG.COLOR1, errors), 'Would you like to view the errors?[/COLOR]', nolabel='[B][COLOR red]No Thanks[/COLOR][/B]', yeslabel='[B][COLOR springgreen]View Errors[/COLOR][/B]') if yes_pressed: from resources.libs.gui import window window.show_text_box("Viewing Build Install Errors", error) self.dialogProgress.close() # from resources.libs.gui.build_menu import BuildMenu # themecount = BuildMenu().theme_count(name) # if themecount > 0: # self.theme(name, 'theme') # db.addon_database(CONFIG.ADDON_ID, 1) # #db.force_check_updates(over=True) self.dialog.ok(CONFIG.ADDONTITLE, "[COLOR {0}]Khôi phục xong, nhấn OK và thưởng thức ^^[/COLOR]".format(CONFIG.COLOR2)) # tools.kill_kodi(over=True) else: from resources.libs.gui import window window.show_text_box("Viewing Build Install Errors", error)