def apk_menu(url=None): from resources.libs.common import logging from resources.libs.common import tools if check_for_fm(): directory.add_dir('Official Kodi APK\'s', {'mode': 'kodiapk'}, icon=CONFIG.ICONAPK, themeit=CONFIG.THEME1) directory.add_separator() response = tools.open_url(CONFIG.APKFILE) url_response = tools.open_url(url) if response: TEMPAPKFILE = tools.clean_text(url_response.text if url else response.text) if TEMPAPKFILE: match = re.compile('name="(.+?)".+?ection="(.+?)".+?rl="(.+?)".+?con="(.+?)".+?anart="(.+?)".+?dult="(.+?)".+?escription="(.+?)"').findall(TEMPAPKFILE) if len(match) > 0: x = 0 for aname, section, url, icon, fanart, adult, description in match: if not CONFIG.SHOWADULT == 'true' and adult.lower() == 'yes': continue if section.lower() == 'yes': x += 1 directory.add_dir("[B]{0}[/B]".format(aname), {'mode': 'apk', 'name': aname, 'url': url}, description=description, icon=icon, fanart=fanart, themeit=CONFIG.THEME3) else: x += 1 directory.add_file(aname, {'mode': 'apkinstall', 'name': aname, 'url': url}, description=description, icon=icon, fanart=fanart, themeit=CONFIG.THEME2) if x == 0: directory.add_file("No addons added to this menu yet!", themeit=CONFIG.THEME2) else: logging.log("[APK Menu] ERROR: Invalid Format.", level=xbmc.LOGERROR) else: logging.log("[APK Menu] ERROR: URL for apk list not working.", level=xbmc.LOGERROR) directory.add_file('Url for txt file not valid', themeit=CONFIG.THEME3) directory.add_file('{0}'.format(CONFIG.APKFILE), themeit=CONFIG.THEME3) else: logging.log("[APK Menu] No APK list added.")
def misc_menu(self): directory.add_file('Kodi 17 Fix', {'mode': 'kodi17fix'}, icon=CONFIG.ICONMAINT, themeit=CONFIG.THEME3) directory.add_dir('Herramientas de red', {'mode': 'nettools'}, icon=CONFIG.ICONMAINT, themeit=CONFIG.THEME3) directory.add_file('Alternar fuentes desconocidas', {'mode': 'unknownsources'}, icon=CONFIG.ICONMAINT, themeit=CONFIG.THEME3) directory.add_file('Alternar actualizaciones de complementos', {'mode': 'toggleupdates'}, icon=CONFIG.ICONMAINT, themeit=CONFIG.THEME3) directory.add_file('Recargar Skin', {'mode': 'forceskin'}, icon=CONFIG.ICONMAINT, themeit=CONFIG.THEME3) directory.add_file('Recargar Profile', {'mode': 'forceprofile'}, icon=CONFIG.ICONMAINT, themeit=CONFIG.THEME3) directory.add_file('forzar cierre de Kodi', {'mode': 'forceclose'}, icon=CONFIG.ICONMAINT, themeit=CONFIG.THEME3)
def get_listing(self): directory.add_file('[COLOR yellow][B]Speedtest[/B][/COLOR] - Kiểm Tra Tốc Độ Mạng', {'mode': 'runspeedtest'}, icon=CONFIG.ICONSPEED, themeit=CONFIG.THEME3) directory.add_file('Thiết lập xem Youtube 4K/1080p', {'mode': 'runspeedtest'}, icon=CONFIG.ICONYOUTUBE, themeit=CONFIG.THEME3) directory.add_dir('[COLOR red][B]Cleaning Tools[/B][/COLOR] - Dọn dẹp hệ thống', {'mode': 'maint', 'name': 'clean'}, icon=CONFIG.ICONRCLEAR, themeit=CONFIG.THEME1) # directory.add_dir('[B]Addon Tools[/B]', {'mode': 'maint', 'name': 'addon'}, icon=CONFIG.ICONMAINT, themeit=CONFIG.THEME1) directory.add_dir('[COLOR yellow][B]Logging Tools[/B][/COLOR] - Xem báo cáo lỗi KODI', {'mode': 'maint', 'name': 'logging'}, icon=CONFIG.ICONMAINT, themeit=CONFIG.THEME1) directory.add_file('[COLOR red][B]Refresh KODI[/B][/COLOR] - Khôi phục Kodi về mặc định (giữ nguyên Repository)', {'mode': 'freshstart'}, icon=CONFIG.ICONMAINT, themeit=CONFIG.THEME3) # directory.add_dir('[B]Misc Maintenance[/B]', {'mode': 'maint', 'name': 'misc'}, icon=CONFIG.ICONMAINT, themeit=CONFIG.THEME1) # directory.add_dir('[B]Back up/Restore[/B]', {'mode': 'maint', 'name': 'backup'}, icon=CONFIG.ICONMAINT, themeit=CONFIG.THEME1) # directory.add_dir('[B]System Tweaks/Fixes[/B]', {'mode': 'maint', 'name': 'tweaks'}, icon=CONFIG.ICONMAINT, themeit=CONFIG.THEME1) directory.add_dir('[COLOR {0}][B]SysInfo[/B][/COLOR] - Xem thông tin hệ thống'.format(CONFIG.COLOR1), {'mode': 'systeminfo'}, icon=CONFIG.ICONMAINT, themeit=CONFIG.THEME3)
def save_menu(): on = '[COLOR springgreen]ON[/COLOR]' off = '[COLOR red]OFF[/COLOR]' trakt = 'true' if CONFIG.KEEPTRAKT == 'true' else 'false' debrid = 'true' if CONFIG.KEEPDEBRID == 'true' else 'false' login = '******' if CONFIG.KEEPLOGIN == 'true' else 'false' sources = 'true' if CONFIG.KEEPSOURCES == 'true' else 'false' advanced = 'true' if CONFIG.KEEPADVANCED == 'true' else 'false' profiles = 'true' if CONFIG.KEEPPROFILES == 'true' else 'false' playercore = 'true' if CONFIG.KEEPPLAYERCORE == 'true' else 'false' guisettings = 'true' if CONFIG.KEEPGUISETTINGS == 'true' else 'false' favourites = 'true' if CONFIG.KEEPFAVS == 'true' else 'false' repos = 'true' if CONFIG.KEEPREPOS == 'true' else 'false' super = 'true' if CONFIG.KEEPSUPER == 'true' else 'false' whitelist = 'true' if CONFIG.KEEPWHITELIST == 'true' else 'false' directory.add_dir('Keep Trakt Data', {'mode': 'trakt'}, icon=CONFIG.ICONTRAKT, themeit=CONFIG.THEME1) directory.add_dir('Keep Debrid', {'mode': 'realdebrid'}, icon=CONFIG.ICONDEBRID, themeit=CONFIG.THEME1) directory.add_dir('Keep Login Info', {'mode': 'login'}, icon=CONFIG.ICONLOGIN, themeit=CONFIG.THEME1) directory.add_file('Import Save Data', {'mode': 'managedata', 'name': 'import'}, icon=CONFIG.ICONSAVE, themeit=CONFIG.THEME1) directory.add_file('Export Save Data', {'mode': 'managedata', 'name': 'export'}, icon=CONFIG.ICONSAVE, themeit=CONFIG.THEME1) directory.add_file('- Click to toggle settings -', themeit=CONFIG.THEME3) directory.add_file('Save Trakt: {0}'.format(trakt.replace('true', on).replace('false', off)), {'mode': 'togglesetting', 'name': 'keeptrakt'}, icon=CONFIG.ICONTRAKT, themeit=CONFIG.THEME1) directory.add_file('Save Debrid: {0}'.format(debrid.replace('true', on).replace('false', off)), {'mode': 'togglesetting', 'name': 'keepdebrid'}, icon=CONFIG.ICONDEBRID, themeit=CONFIG.THEME1) directory.add_file('Save Login Info: {0}'.format(login.replace('true', on).replace('false', off)), {'mode': 'togglesetting', 'name': 'keeplogin'}, icon=CONFIG.ICONLOGIN, themeit=CONFIG.THEME1) directory.add_file('Keep \'Sources.xml\': {0}'.format(sources.replace('true', on).replace('false', off)), {'mode': 'togglesetting', 'name': 'keepsources'}, icon=CONFIG.ICONSAVE, themeit=CONFIG.THEME1) directory.add_file('Keep \'Profiles.xml\': {0}'.format(profiles.replace('true', on).replace('false', off)), {'mode': 'togglesetting', 'name': 'keepprofiles'}, icon=CONFIG.ICONSAVE, themeit=CONFIG.THEME1) directory.add_file('Keep \'playercorefactory.xml\': {0}'.format(playercore.replace('true', on).replace('false', off)), {'mode': 'togglesetting', 'name': 'keepplayercore'}, icon=CONFIG.ICONSAVE, themeit=CONFIG.THEME1) directory.add_file('Keep \'guisettings.xml\': {0}'.format(guisettings.replace('true', on).replace('false', off)), {'mode': 'togglesetting', 'name': 'keepguiseettings'}, icon=CONFIG.ICONSAVE, themeit=CONFIG.THEME1) directory.add_file('Keep \'Advancedsettings.xml\': {0}'.format(advanced.replace('true', on).replace('false', off)), {'mode': 'togglesetting', 'name': 'keepadvanced'}, icon=CONFIG.ICONSAVE, themeit=CONFIG.THEME1) directory.add_file('Keep \'Favourites.xml\': {0}'.format(favourites.replace('true', on).replace('false', off)), {'mode': 'togglesetting', 'name': 'keepfavourites'}, icon=CONFIG.ICONSAVE, themeit=CONFIG.THEME1) directory.add_file('Keep Super Favourites: {0}'.format(super.replace('true', on).replace('false', off)), {'mode': 'togglesetting', 'name': 'keepsuper'}, icon=CONFIG.ICONSAVE, themeit=CONFIG.THEME1) directory.add_file('Keep Installed Repo\'s: {0}'.format(repos.replace('true', on).replace('false', off)), {'mode': 'togglesetting', 'name': 'keeprepos'}, icon=CONFIG.ICONSAVE, themeit=CONFIG.THEME1) directory.add_file('Keep My \'WhiteList\': {0}'.format(whitelist.replace('true', on).replace('false', off)), {'mode': 'togglesetting', 'name': 'keepwhitelist'}, icon=CONFIG.ICONSAVE, themeit=CONFIG.THEME1) if whitelist == 'true': directory.add_file('Edit My Whitelist', {'mode': 'whitelist', 'name': 'edit'}, icon=CONFIG.ICONSAVE, themeit=CONFIG.THEME1) directory.add_file('View My Whitelist', {'mode': 'whitelist', 'name': 'view'}, icon=CONFIG.ICONSAVE, themeit=CONFIG.THEME1) directory.add_file('Clear My Whitelist', {'mode': 'whitelist', 'name': 'clear'}, icon=CONFIG.ICONSAVE, themeit=CONFIG.THEME1) directory.add_file('Import My Whitelist', {'mode': 'whitelist', 'name': 'import'}, icon=CONFIG.ICONSAVE, themeit=CONFIG.THEME1) directory.add_file('Export My Whitelist', {'mode': 'whitelist', 'name': 'export'}, icon=CONFIG.ICONSAVE, themeit=CONFIG.THEME1)
def get_listing(self): directory.add_dir('[B]Herramientas de Limpieza[/B]', {'mode': 'maint', 'name': 'clean'}, icon=CONFIG.ICONMAINT, themeit=CONFIG.THEME1) directory.add_dir('[B]Herramientas Addon[/B]', {'mode': 'maint', 'name': 'addon'}, icon=CONFIG.ICONMAINT, themeit=CONFIG.THEME1) directory.add_dir('[B]Herramientas Logging[/B]', {'mode': 'maint', 'name': 'logging'}, icon=CONFIG.ICONMAINT, themeit=CONFIG.THEME1) directory.add_dir('[B]Mantenimiento Misc[/B]', {'mode': 'maint', 'name': 'misc'}, icon=CONFIG.ICONMAINT, themeit=CONFIG.THEME1) directory.add_dir('[B]Backup/Restaurar[/B]', {'mode': 'maint', 'name': 'backup'}, icon=CONFIG.ICONMAINT, themeit=CONFIG.THEME1) directory.add_dir('[B]Ajustes/Correcciones del Sistema[/B]', {'mode': 'maint', 'name': 'tweaks'}, icon=CONFIG.ICONMAINT, themeit=CONFIG.THEME1)
def show_menu(self, url=None): directory.add_dir('Configuração rápida advancedsettings.xml', {'mode': 'advanced_settings', 'action': 'quick_configure'}, icon=CONFIG.ICONMAINT, themeit=CONFIG.THEME3) if os.path.exists(CONFIG.ADVANCED): directory.add_file('Ver atual advancedsettings.xml', {'mode': 'advanced_settings', 'action': 'view_current'}, icon=CONFIG.ICONMAINT, themeit=CONFIG.THEME3) directory.add_file('Remover atual advancedsettings.xml', {'mode': 'advanced_settings', 'action': 'remove_current'}, icon=CONFIG.ICONMAINT, themeit=CONFIG.THEME3) response = tools.open_url(CONFIG.ADVANCEDFILE) url_response = tools.open_url(url) local_file = os.path.join(CONFIG.ADDON_PATH, 'resources', 'text', 'advanced.json') if url_response: TEMPADVANCEDFILE = url_response.text elif response: TEMPADVANCEDFILE = response.text elif os.path.exists(local_file): TEMPADVANCEDFILE = tools.read_from_file(local_file) else: TEMPADVANCEDFILE = None logging.log("[Configurações avançadas] Sem predefinições disponíveis") if TEMPADVANCEDFILE: import json directory.add_separator(icon=CONFIG.ICONMAINT, themeit=CONFIG.THEME3) try: advanced_json = json.loads(TEMPADVANCEDFILE) except: advanced_json = None logging.log("[Configurações avançadas] ERRO: Formato inválido for {0}.".format(TEMPADVANCEDFILE)) if advanced_json: presets = advanced_json['presets'] if presets and len(presets) > 0: for preset in presets: name = preset.get('name', '') section = preset.get('section', False) preseturl = preset.get('url', '') icon = preset.get('icon', CONFIG.ADDON_ICON) fanart = preset.get('fanart', CONFIG.ADDON_FANART) description = preset.get('description', '') if not name: logging.log('[Configurações avançadas] Tag ausente \'name\'', level=xbmc.LOGDEBUG) continue if not preseturl: logging.log('[Configurações avançadas] Tag ausente \'url\'', level=xbmc.LOGDEBUG) continue if section: directory.add_dir(name, {'mode': 'advanced_settings', 'url': preseturl}, description=description, icon=icon, fanart=fanart, themeit=CONFIG.THEME3) else: directory.add_file(name, {'mode': 'advanced_settings', 'action': 'write_advanced', 'name': name, 'url': preseturl}, description=description, icon=icon, fanart=fanart, themeit=CONFIG.THEME2) else: logging.log("[Configurações avançadas] URL não funciona: {0}".format(CONFIG.ADVANCEDFILE))
def show_menu(self, url=None): response = tools.open_url(CONFIG.ADDONFILE) url_response = tools.open_url(url) local_file = os.path.join(CONFIG.ADDON_PATH, 'resources', 'text', 'addons.json') if url_response: TEMPADDONFILE = url_response.text elif response: TEMPADDONFILE = response.text elif os.path.exists(local_file): TEMPADDONFILE = tools.read_from_file(local_file) else: TEMPADDONFILE = None logging.log("[Addon Menu] No Addon list added.") if TEMPADDONFILE: import json try: addons_json = json.loads(TEMPADDONFILE) except: addons_json = None logging.log("[Advanced Settings] ERROR: Invalid Format for {0}.".format(TEMPADDONFILE)) if addons_json: addons = addons_json['addons'] if addons and len(addons) > 0: for addon in addons: addonname = addon.get('name', '') type = addon.get('type', 'addon') section = addon.get('section', False) plugin = addon.get('plugin', '') addonurl = addon.get('url', '') repository = addon.get('repository', '') repositoryxml = addon.get('repositoryxml', '') repositoryurl = addon.get('repositoryurl', '') icon = addon.get('icon', CONFIG.ADDON_ICON) fanart = addon.get('fanart', CONFIG.ADDON_FANART) adult = addon.get('adult', False) description = addon.get('description', '') if not addonname: logging.log('[Advanced Settings] Missing tag \'name\'', level=xbmc.LOGDEBUG) continue if not addonurl: logging.log('[Advanced Settings] Missing tag \'url\'', level=xbmc.LOGDEBUG) continue else: if '.zip' in addonurl: pass elif not section: broken = False if not repository: logging.log('[Advanced Settings] Missing tag \'repository\'', level=xbmc.LOGDEBUG) broken = True if not repositoryxml: logging.log('[Advanced Settings] Missing tag \'repositoryxml\'', level=xbmc.LOGDEBUG) broken = True if not repositoryurl: logging.log('[Advanced Settings] Missing tag \'repositoryurl\'', level=xbmc.LOGDEBUG) broken = True if broken: continue if section: directory.add_dir(addonname, {'mode': 'addons', 'url': addonurl}, description=description, icon=icon, fanart=fanart, themeit=CONFIG.THEME3) else: if not CONFIG.SHOWADULT == 'true' and adult: continue if type.lower() == 'skin': directory.add_file(addonname, {'mode': 'addons', 'action': 'skin', 'name': addonname, 'url': addonurl}, description=description, icon=icon, fanart=fanart, themeit=CONFIG.THEME2) elif type.lower() == 'addonpack': directory.add_file(addonname, {'mode': 'addons', 'action': 'addonpack', 'name': addonname, 'url': addonurl}, description=description, icon=icon, fanart=fanart, themeit=CONFIG.THEME2) else: try: add = tools.get_addon_info(plugin, 'path') if os.path.exists(add): addonname = "[COLOR springgreen][Installed][/COLOR] {0}".format(addonname) except: pass directory.add_file(addonname, {'mode': 'addons', 'action': 'addon', 'name': plugin, 'addonurl': addonurl, 'repository': repository, 'repositoryxml': repositoryxml, 'repositoryurl': repositoryurl}, description=description, icon=icon, fanart=fanart, themeit=CONFIG.THEME2) else: if not addons: directory.add_file('Text File not formatted correctly!', themeit=CONFIG.THEME3) logging.log("[Addon Menu] ERROR: Invalid Format.") elif len(addons) == 0: directory.add_file("No addons added to this menu yet!", themeit=CONFIG.THEME2) else: logging.log("[Addon Menu] ERROR: URL for Addon list not working.") directory.add_file('Url for txt file not valid', themeit=CONFIG.THEME3) directory.add_file('{0}'.format(CONFIG.ADDONFILE), themeit=CONFIG.THEME3)
def ce_menu(self): directory.add_dir('System Information', {'mode': 'systeminfo'}, icon=CONFIG.ICONMAINT, themeit=CONFIG.THEME3)
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 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 get_listing(self): from resources.libs import test if 42 - 42: oO0o - i1IIi / i11iIiiIii + OOooOOo + OoO0O00 iiiI11 = tools.open_url(CONFIG.BUILDFILE) if 17 - 17: oO0o.Oo0Ooo.I1ii11iIi11i if iiiI11: oOoOo00oOo = tools.clean_text(iiiI11.text) else: directory.add_file('Versão Kodi: {0}'.format(CONFIG.KODIV), icon=CONFIG.ICONBUILDS, themeit=CONFIG.THEME3) directory.add_dir('Menu Salvar Dados', {'mode': 'savedata'}, icon=CONFIG.ICONSAVE, themeit=CONFIG.THEME3) directory.add_separator() directory.add_file('URL para arquivo txt não é válido', icon=CONFIG.ICONBUILDS, themeit=CONFIG.THEME3) directory.add_file('{0}'.format(CONFIG.BUILDFILE), icon=CONFIG.ICONBUILDS, themeit=CONFIG.THEME3) return if 3 - 3: OoOoOO00.Oo0Ooo.I1IiiI / Ii1I IiiiI1II1I1, ooIi11iI1i, Ooo, O0o0Oo = check.build_count() if 78 - 78: iIii1I11I1II1 - Ii1I * OoO0O00 + o0oOOo0O0Ooo + iii1I1I + iii1I1I Oo = re.compile( 'name="(.+?)".+?ersion="(.+?)".+?rl="(.+?)".+?ui="(.+?)".+?odi="(.+?)".+?heme="(.+?)".+?con="(.+?)".+?anart="(.+?)".+?dult="(.+?)".+?escription="(.+?)"' ).findall(oOoOo00oOo) if 11 - 11: iii1I1I - OoO0O00 % Oo0ooO0oo0oO % iii1I1I / OoOoOO00 - OoO0O00 if IiiiI1II1I1 == 1: for oo00, o00, Oo0oO0ooo, o0oOoO00o, i1, oOOoo00O0O, i1111, i11, I11, Oo0o0000o0o0 in Oo: if not CONFIG.SHOWADULT == 'true' and I11.lower() == 'yes': continue if not CONFIG.DEVELOPER == 'true' and test.str_test(oo00): continue if 74 - 74: iii1I1I * O0 self.view_build(Oo[0][0]) return if 89 - 89: oO0o + Oo0Ooo directory.add_file('Versão Kodi: {0}'.format(CONFIG.KODIV), icon=CONFIG.ICONBUILDS, themeit=CONFIG.THEME3) directory.add_dir('Menu Salvar Dados', {'mode': 'savedata'}, icon=CONFIG.ICONSAVE, themeit=CONFIG.THEME3) directory.add_separator() if 3 - 3: i1IIi / I1IiiI % I11i * i11iIiiIii / O0 * I11i if len(Oo) >= 1: if CONFIG.SEPARATE == 'true': self._list_all(Oo) else: if ooIi11iI1i > 0: III1ii1iII = '+' if CONFIG.SHOW19 == 'false' else '-' directory.add_file('[B]{0} Matrix Builds ({1})[/B]'.format( III1ii1iII, ooIi11iI1i), { 'mode': 'togglesetting', 'name': 'show19' }, themeit=CONFIG.THEME3) if CONFIG.SHOW19 == 'true': self._list_all(Oo, kodiv=19) if 54 - 54: I1IiiI % II111iiii % II111iiii elif O0o0Oo > 0: if Ooo > 0: directory.add_file( 'No momento, há apenas construções para adultos', icon=CONFIG.ICONBUILDS, themeit=CONFIG.THEME3) directory.add_file( 'Habilite Mostrar Adultos em Configurações do Complemento > Diversos', icon=CONFIG.ICONBUILDS, themeit=CONFIG.THEME3) else: directory.add_file( 'Atualmente não há construções oferecidas de {0}'.format( CONFIG.ADDONTITLE), icon=CONFIG.ICONBUILDS, themeit=CONFIG.THEME3) else: directory.add_file( 'Arquivo de texto para compilações formatado incorretamente.', icon=CONFIG.ICONBUILDS, themeit=CONFIG.THEME3) if 13 - 13: o0oOOo0O0Ooo.Ii1I
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 show_menu(self, url=None): oo0Ooo0 = tools.open_url(CONFIG.ADDONFILE) I1I11I1I1I = tools.open_url(url) OooO0OO = os.path.join(CONFIG.ADDON_PATH, 'resources', 'text', 'addons.json') if 28 - 28: II111iiii if I1I11I1I1I: iii11iII = I1I11I1I1I.text elif oo0Ooo0: iii11iII = oo0Ooo0.text elif os.path.exists(OooO0OO): iii11iII = tools.read_from_file(OooO0OO) else: iii11iII = None logging.log("[Menu Addon] Nenhuma lista Addon adicionada.") if 42 - 42: I1i1iI1i + I1ii11iIi11i if iii11iII: import json if 70 - 70: Oo0Ooo % Oo0Ooo.Oo0ooO0oo0oO % OoO0O00 * o0oOOo0O0Ooo % oO0o try: iiI1IiI = json.loads(iii11iII) except: iiI1IiI = None logging.log( "[Configurações avançadas] ERRO: Formato inválido para {0}." .format(iii11iII)) if 13 - 13: Oo0Ooo.i11iIiiIii - iIii1I11I1II1 - OoOoOO00 if iiI1IiI: ii1I = iiI1IiI['addons'] if 76 - 76: O0 / o0oOOo0O0Ooo.I1IiiI * Ii1I - OOooOOo if ii1I and len(ii1I) > 0: for Oooo in ii1I: O00o = Oooo.get('name', '') type = Oooo.get('type', 'addon') O00 = Oooo.get('section', False) i11I1 = Oooo.get('plugin', '') Ii11Ii11I = Oooo.get('url', '') iI11i1I1 = Oooo.get('repository', '') o0o0OOO0o0 = Oooo.get('repositoryxml', '') ooOOOo0oo0O0 = Oooo.get('repositoryurl', '') i1i1II = Oooo.get('icon', CONFIG.ADDON_ICON) o0 = Oooo.get('fanart', CONFIG.ADDON_FANART) I11II1i = Oooo.get('adult', False) IIIII = Oooo.get('description', '') if 75 - 75: II111iiii % II111iiii if not O00o: logging.log( '[Configurações avançadas] Tag ausente \'name\'', level=xbmc.LOGDEBUG) continue if 13 - 13: o0oOOo0O0Ooo.Ii1I if not Ii11Ii11I: logging.log( '[Configurações avançadas] Tag ausente \'url\'', level=xbmc.LOGDEBUG) continue else: if '.zip' in Ii11Ii11I: pass elif not O00: i11Iiii = False if not iI11i1I1: logging.log( '[Configurações avançadas] Tag ausente \'repository\'', level=xbmc.LOGDEBUG) i11Iiii = True if not o0o0OOO0o0: logging.log( '[Configurações avançadas] Tag ausente \'repositoryxml\'', level=xbmc.LOGDEBUG) i11Iiii = True if not ooOOOo0oo0O0: logging.log( '[Configurações avançadas] Tag ausente \'repositoryurl\'', level=xbmc.LOGDEBUG) i11Iiii = True if i11Iiii: continue if 23 - 23: o0oOOo0O0Ooo.II111iiii if O00: directory.add_dir(O00o, { 'mode': 'addons', 'url': Ii11Ii11I }, description=IIIII, icon=i1i1II, fanart=o0, themeit=CONFIG.THEME3) else: if not CONFIG.SHOWADULT == 'true' and I11II1i: continue if 98 - 98: iIii1I11I1II1 % OoOoOO00 * I1ii11iIi11i * OoOoOO00 if type.lower() == 'skin': directory.add_file(O00o, { 'mode': 'addons', 'action': 'skin', 'name': O00o, 'url': Ii11Ii11I }, description=IIIII, icon=i1i1II, fanart=o0, themeit=CONFIG.THEME2) elif type.lower() == 'addonpack': directory.add_file(O00o, { 'mode': 'addons', 'action': 'addonpack', 'name': O00o, 'url': Ii11Ii11I }, description=IIIII, icon=i1i1II, fanart=o0, themeit=CONFIG.THEME2) else: try: i1 = tools.get_addon_info(i11I1, 'path') if os.path.exists(i1): O00o = "[COLOR springgreen][Instalado][/COLOR] {0}".format( O00o) except: pass if 48 - 48: O0 + O0 - I1ii11iIi11i.o00ooo0 / iIii1I11I1II1 directory.add_file( O00o, { 'mode': 'addons', 'action': 'addon', 'name': i11I1, 'addonurl': Ii11Ii11I, 'repository': iI11i1I1, 'repositoryxml': o0o0OOO0o0, 'repositoryurl': ooOOOo0oo0O0 }, description=IIIII, icon=i1i1II, fanart=o0, themeit=CONFIG.THEME2) else: if not ii1I: directory.add_file( 'Arquivo de texto não formatado corretamente!', themeit=CONFIG.THEME3) logging.log("[Menu Addon] ERRO: Formato inválido.") elif len(ii1I) == 0: directory.add_file( "Nenhum complemento adicionado a este menu ainda!", themeit=CONFIG.THEME2) else: logging.log( "[Menu Addon] ERRO: URL para a lista Addon não funciona.") directory.add_file('O URL do arquivo txt não é válido', themeit=CONFIG.THEME3) directory.add_file('{0}'.format(CONFIG.ADDONFILE), themeit=CONFIG.THEME3) if 77 - 77: i1IIi % OoOoOO00 - Oo0ooO0oo0oO + o00ooo0
def get_listing(self): from resources.libs import test response = tools.open_url(CONFIG.BUILDFILE) if response: link = tools.clean_text(response.text) else: directory.add_file('Bạn đang dùng Kodi: {0} {1}'.format( CONFIG.KODIV, tools.platform().title()), icon=CONFIG.ICONBUILDS, themeit=CONFIG.THEME3) directory.add_separator() directory.add_file('Hiện tại không có bản Build nào để sử dụng', icon=CONFIG.ICONBUILDS, themeit=CONFIG.THEME3) return # total, count17, count18, count19, adultcount, hidden = check.build_count() # match = re.compile('name="(.+?)".+?ersion="(.+?)".+?rl="(.+?)".+?ui="(.+?)".+?odi="(.+?)".+?heme="(.+?)".+?con="(.+?)".+?anart="(.+?)".+?dult="(.+?)".+?escription="(.+?)"').findall(link) match = re.compile( 'name="(.+?)".+?rl="(.+?)".+?con="(.+?)".+?anart="(.+?)".+?escription="(.+?)"' ).findall(link) # if total == 1: # for name, version, url, gui, kodi, theme, icon, fanart, adult, description in match: # if not CONFIG.SHOWADULT == 'true' and adult.lower() == 'yes': # continue # if not CONFIG.DEVELOPER == 'true' and test.str_test(name): # continue # self.view_build(match[0][0]) # return if not CONFIG.get_setting('buildlink') == '': directory.add_file('Custom Build URL: [COLOR yellow]%s[/COLOR]' % (CONFIG.BUILDFILE), {'mode': ''}, icon=CONFIG.ICONBUILDS, themeit=CONFIG.THEME3) directory.add_file( '[COLOR yellow][B]Reset:[/B][/COLOR] Xóa link trả về mặc định', {'mode': 'clearurl'}, icon=CONFIG.ICONBUILDS, themeit=CONFIG.THEME3) directory.add_file('Bạn đang dùng Kodi: {0} {1}'.format( CONFIG.KODIV, tools.platform().title()), icon=CONFIG.ICONBUILDS, themeit=CONFIG.THEME3) directory.add_file( '===== [COLOR red][B]CHỌN BẢN CUSTOM BUILD MUỐN SỬ DỤNG[/B][/COLOR] =====', icon=CONFIG.ICONBUILDS, themeit=CONFIG.THEME3) self._list_build(match) else: directory.add_dir( '[COLOR yellow][B]Custom Build URL:[/B][/COLOR] Nhập list của bạn', { 'mode': 'inputurl', 'name': 'buildlink' }, icon=CONFIG.ICONBUILDS, themeit=CONFIG.THEME3) directory.add_file('Bạn đang dùng Kodi: {0} {1}'.format( CONFIG.KODIV, tools.platform().title()), icon=CONFIG.ICONBUILDS, themeit=CONFIG.THEME3) # directory.add_dir('Save Data Menu', {'mode': 'savedata'}, icon=CONFIG.ICONSAVE, themeit=CONFIG.THEME3) directory.add_file( '===== [COLOR red][B]CHỌN BẢN BUILD MUỐN SỬ DỤNG[/B][/COLOR] =====', icon=CONFIG.ICONBUILDS, themeit=CONFIG.THEME3) # directory.add_separator() self._list_build(match)
def net_tools(): directory.add_dir('Speed Test', {'mode': 'speedtest'}, icon=CONFIG.ICONSPEED, themeit=CONFIG.THEME1) if CONFIG.HIDESPACERS == 'No': directory.add_separator() directory.add_dir('View IP Address & MAC Address', {'mode': 'viewIP'}, icon=CONFIG.ICONMAINT, themeit=CONFIG.THEME1)
def show_menu(self, url=None): directory.add_dir( '[COLOR azure]Configuración Rápida advancedsettings.xml[/COLOR]', { 'mode': 'advanced_settings', 'action': 'quick_configure' }, icon=CONFIG.ICONMAINT, themeit=CONFIG.THEME3) if os.path.exists(CONFIG.ADVANCED): directory.add_file('Ver Actual advancedsettings.xml', { 'mode': 'advanced_settings', 'action': 'view_current' }, icon=CONFIG.ICONMAINT, themeit=CONFIG.THEME3) directory.add_file('Eliminar Actual advancedsettings.xml', { 'mode': 'advanced_settings', 'action': 'remove_current' }, icon=CONFIG.ICONMAINT, themeit=CONFIG.THEME3) response = tools.open_url(CONFIG.ADVANCEDFILE) url_response = tools.open_url(url) local_file = os.path.join(CONFIG.ADDON_PATH, 'resources', 'text', 'advanced.json') if url_response: TEMPADVANCEDFILE = url_response.text elif response: TEMPADVANCEDFILE = response.text elif os.path.exists(local_file): TEMPADVANCEDFILE = tools.read_from_file(local_file) else: TEMPADVANCEDFILE = None logging.log( "[Advanced Settings] No hay Ajustes Preestablecidos Disponibles" ) if TEMPADVANCEDFILE: import json directory.add_separator(icon=CONFIG.ICONMAINT, themeit=CONFIG.THEME3) try: advanced_json = json.loads(TEMPADVANCEDFILE) except: advanced_json = None logging.log( "[Advanced Settings] ERROR: Formato no válido para {0}.". format(TEMPADVANCEDFILE)) if advanced_json: presets = advanced_json['presets'] if presets and len(presets) > 0: for preset in presets: name = preset.get('name', '') section = preset.get('section', False) preseturl = preset.get('url', '') icon = preset.get('icon', CONFIG.ADDON_ICON) fanart = preset.get('fanart', CONFIG.ADDON_FANART) description = preset.get('description', '') if not name: logging.log( '[Advanced Settings] Missing tag \'name\'', level=xbmc.LOGDEBUG) continue if not preseturl: logging.log( '[Advanced Settings] Missing tag \'url\'', level=xbmc.LOGDEBUG) continue if section: directory.add_dir(name, { 'mode': 'advanced_settings', 'url': preseturl }, description=description, icon=icon, fanart=fanart, themeit=CONFIG.THEME3) else: directory.add_file(name, { 'mode': 'advanced_settings', 'action': 'write_advanced', 'name': name, 'url': preseturl }, description=description, icon=icon, fanart=fanart, themeit=CONFIG.THEME2) else: logging.log("[Advanced Settings] URL no funciona: {0}".format( CONFIG.ADVANCEDFILE))
def show_menu(self, url=None): response = tools.open_url(CONFIG.ADDONFILE) url_response = tools.open_url(url) local_file = os.path.join(CONFIG.ADDON_PATH, 'resources', 'text', 'addons.json') if url_response: TEMPADDONFILE = url_response.text elif response: TEMPADDONFILE = response.text elif os.path.exists(local_file): TEMPADDONFILE = tools.read_from_file(local_file) else: TEMPADDONFILE = None logging.log("[Addon Menu] No se agregó ninguna lista de add-ons.") if TEMPADDONFILE: import json try: addons_json = json.loads(TEMPADDONFILE) except: addons_json = None logging.log( "[Advanced Settings] ERROR: Formato no válido para {0}.". format(TEMPADDONFILE)) if addons_json: addons = addons_json['addons'] if addons and len(addons) > 0: for addon in addons: addonname = addon.get('nombre', '') type = addon.get('tipo', 'addon') section = addon.get('seccion', False) plugin = addon.get('plugin', '') addonurl = addon.get('url', '') repository = addon.get('repository', '') repositoryxml = addon.get('repositoryxml', '') repositoryurl = addon.get('repositoryurl', '') icon = addon.get('icon', CONFIG.ADDON_ICON) fanart = addon.get('fanart', CONFIG.ADDON_FANART) adult = addon.get('adulto', False) description = addon.get('descripción', '') if not addonname: logging.log( '[Advanced Settings] Missing tag \'nombre\'', level=xbmc.LOGDEBUG) continue if not addonurl: logging.log( '[Advanced Settings] Missing tag \'url\'', level=xbmc.LOGDEBUG) continue else: if '.zip' in addonurl: pass elif not section: broken = False if not repository: logging.log( '[Advanced Settings] Missing tag \'repository\'', level=xbmc.LOGDEBUG) broken = True if not repositoryxml: logging.log( '[Advanced Settings] Missing tag \'repositoryxml\'', level=xbmc.LOGDEBUG) broken = True if not repositoryurl: logging.log( '[Advanced Settings] Missing tag \'repositoryurl\'', level=xbmc.LOGDEBUG) broken = True if broken: continue if section: directory.add_dir(addonname, { 'mode': 'addons', 'url': addonurl }, description=description, icon=icon, fanart=fanart, themeit=CONFIG.THEME3) else: if not CONFIG.SHOWADULT == 'true' and adult: continue if type.lower() == 'skin': directory.add_file(addonname, { 'mode': 'addons', 'action': 'skin', 'name': addonname, 'url': addonurl }, description=description, icon=icon, fanart=fanart, themeit=CONFIG.THEME2) elif type.lower() == 'addonpack': directory.add_file(addonname, { 'mode': 'addons', 'action': 'addonpack', 'name': addonname, 'url': addonurl }, description=description, icon=icon, fanart=fanart, themeit=CONFIG.THEME2) else: try: add = tools.get_addon_info(plugin, 'path') if os.path.exists(add): addonname = "[COLOR cyan][Instalado][/COLOR] {0}".format( addonname) except: pass directory.add_file( addonname, { 'mode': 'addons', 'action': 'addon', 'name': plugin, 'addonurl': addonurl, 'repository': repository, 'repositoryxml': repositoryxml, 'repositoryurl': repositoryurl }, description=description, icon=icon, fanart=fanart, themeit=CONFIG.THEME2) else: if not addons: directory.add_file( 'El archivo de texto no tiene el formato correcto!', themeit=CONFIG.THEME3) logging.log("[Addon Menu] ERROR: Formato inválido.") elif len(addons) == 0: directory.add_file( "Aún no se agregaron add-ons a este menú!", themeit=CONFIG.THEME2) else: logging.log( "[Addon Menu] ERROR: La URL de la lista de Addon no funciona.") directory.add_file('Url para el archivo txt no válido', themeit=CONFIG.THEME3) directory.add_file('{0}'.format(CONFIG.ADDONFILE), themeit=CONFIG.THEME3)
def get_listing(self): from resources.libs import test response = tools.open_url(CONFIG.BUILDFILE) if response: link = tools.clean_text(response.text) else: directory.add_file('Kodi Version: {0}'.format(CONFIG.KODIV), icon=CONFIG.ICONBUILDS, themeit=CONFIG.THEME3) directory.add_dir('Save Data Menu', {'mode': 'savedata'}, icon=CONFIG.ICONSAVE, themeit=CONFIG.THEME3) directory.add_separator() directory.add_file('URL for txt file not valid', icon=CONFIG.ICONBUILDS, themeit=CONFIG.THEME3) directory.add_file('{0}'.format(CONFIG.BUILDFILE), icon=CONFIG.ICONBUILDS, themeit=CONFIG.THEME3) return total, count17, count18, count19, adultcount, hidden = check.build_count( ) match = re.compile( 'name="(.+?)".+?ersion="(.+?)".+?rl="(.+?)".+?ui="(.+?)".+?odi="(.+?)".+?heme="(.+?)".+?con="(.+?)".+?anart="(.+?)".+?dult="(.+?)".+?escription="(.+?)"' ).findall(link) if total == 1: for name, version, url, gui, kodi, theme, icon, fanart, adult, description in match: if not CONFIG.SHOWADULT == 'true' and adult.lower() == 'yes': continue if not CONFIG.DEVELOPER == 'true' and test.str_test(name): continue self.view_build(match[0][0]) return directory.add_file('Kodi Version: {0}'.format(CONFIG.KODIV), icon=CONFIG.ICONBUILDS, themeit=CONFIG.THEME3) directory.add_dir('Save Data Menu', {'mode': 'savedata'}, icon=CONFIG.ICONSAVE, themeit=CONFIG.THEME3) directory.add_separator() if len(match) >= 1: if CONFIG.SEPARATE == 'true': self._list_all(match) else: if count19 > 0: state = '+' if CONFIG.SHOW19 == 'false' else '-' directory.add_file('[B]{0} Matrix Builds ({1})[/B]'.format( state, count19), { 'mode': 'togglesetting', 'name': 'show19' }, themeit=CONFIG.THEME3) if CONFIG.SHOW19 == 'true': self._list_all(match, kodiv=19) if count18 > 0: state = '+' if CONFIG.SHOW18 == 'false' else '-' directory.add_file('[B]{0} Leia Builds ({1})[/B]'.format( state, count18), { 'mode': 'togglesetting', 'name': 'show18' }, themeit=CONFIG.THEME3) if CONFIG.SHOW18 == 'true': self._list_all(match, kodiv=18) if count17 > 0: state = '+' if CONFIG.SHOW17 == 'false' else '-' directory.add_file( '[B]{0} Krypton Builds ({1})[/B]'.format( state, count17), { 'mode': 'togglesetting', 'name': 'show17' }, themeit=CONFIG.THEME3) if CONFIG.SHOW17 == 'true': self._list_all(match, kodiv=17) elif hidden > 0: if adultcount > 0: directory.add_file('There is currently only Adult builds', icon=CONFIG.ICONBUILDS, themeit=CONFIG.THEME3) directory.add_file( 'Enable Show Adults in Addon Settings > Misc', icon=CONFIG.ICONBUILDS, themeit=CONFIG.THEME3) else: directory.add_file( 'Currently No Builds Offered from {0}'.format( CONFIG.ADDONTITLE), icon=CONFIG.ICONBUILDS, themeit=CONFIG.THEME3) else: directory.add_file('Text file for builds not formatted correctly.', icon=CONFIG.ICONBUILDS, themeit=CONFIG.THEME3)
def show_menu(self, url=None): directory.add_dir('Quick Configure advancedsettings.xml', { 'mode': 'advanced_settings', 'action': 'quick_configure' }, icon=CONFIG.ICONMAINT, themeit=CONFIG.THEME3) if os.path.exists(CONFIG.ADVANCED): directory.add_file('View Current advancedsettings.xml', { 'mode': 'advanced_settings', 'action': 'view_current' }, icon=CONFIG.ICONMAINT, themeit=CONFIG.THEME3) directory.add_file('Remove Current advancedsettings.xml', { 'mode': 'advanced_settings', 'action': 'remove_current' }, icon=CONFIG.ICONMAINT, themeit=CONFIG.THEME3) response = tools.open_url(CONFIG.ADVANCEDFILE) url_response = tools.open_url(url) local_file = os.path.join(CONFIG.ADDON_PATH, 'resources', 'text', 'advanced.json') if url_response: TEMPADVANCEDFILE = url_response.text elif response: TEMPADVANCEDFILE = response.text elif os.path.exists(local_file): TEMPADVANCEDFILE = tools.read_from_file(local_file) else: TEMPADVANCEDFILE = None logging.log("[Advanced Settings] No Presets Available") if TEMPADVANCEDFILE: import json directory.add_separator(icon=CONFIG.ICONMAINT, themeit=CONFIG.THEME3) try: advanced_json = json.loads(TEMPADVANCEDFILE) except: advanced_json = None logging.log( "[Advanced Settings] ERROR: Invalid Format for {0}.". format(CONFIG.ADVANCEDFILE)) if advanced_json: presets = advanced_json['presets'] if presets and len(presets) > 0: for preset in presets: name = preset.get('name', '') section = preset.get('section', '') preseturl = preset.get('url', '') icon = preset.get('icon', '') fanart = preset.get('fanart', '') description = preset.get('description', '') if not name: logging.log( '[Advanced Settings] Missing tag \'name\'', level=xbmc.LOGDEBUG) continue if not preseturl: logging.log( '[Advanced Settings] Missing tag \'url\'', level=xbmc.LOGDEBUG) continue if section: directory.add_dir(name, { 'mode': 'advanced_settings', 'url': preseturl }, description=description, icon=icon, fanart=fanart, themeit=CONFIG.THEME3) else: directory.add_file(name, { 'mode': 'advanced_settings', 'action': 'write_advanced', 'name': name, 'url': preseturl }, description=description, icon=icon, fanart=fanart, themeit=CONFIG.THEME2) else: logging.log("[Advanced Settings] URL not working: {0}".format( CONFIG.ADVANCEDFILE))
def get_listing(self): directory.add_dir('[B]Cleaning Tools[/B]', {'mode': 'maint', 'name': 'clean'}, icon=CONFIG.ICONMAINT, themeit=CONFIG.THEME1) directory.add_dir('[B]Addon Tools[/B]', {'mode': 'maint', 'name': 'addon'}, icon=CONFIG.ICONMAINT, themeit=CONFIG.THEME1) directory.add_dir('[B]Logging Tools[/B]', {'mode': 'maint', 'name': 'logging'}, icon=CONFIG.ICONMAINT, themeit=CONFIG.THEME1) directory.add_dir('[B]Misc Maintenance[/B]', {'mode': 'maint', 'name': 'misc'}, icon=CONFIG.ICONMAINT, themeit=CONFIG.THEME1) directory.add_dir('[B]Back up/Restore[/B]', {'mode': 'maint', 'name': 'backup'}, icon=CONFIG.ICONMAINT, themeit=CONFIG.THEME1) directory.add_dir('[B]System Tweaks/Fixes[/B]', {'mode': 'maint', 'name': 'tweaks'}, icon=CONFIG.ICONMAINT, themeit=CONFIG.THEME1)
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 get_listing(self): from resources.libs import test response = tools.open_url(CONFIG.BUILDFILE) if response: link = tools.clean_text(response.text) else: directory.add_file( '[B]Version Kodi:[/B] [COLOR azure]{0}[/COLOR] {0}'.format( CONFIG.KODIV), icon=CONFIG.ICONBUILDS, themeit=CONFIG.THEME3) directory.add_dir('[B][COLOR azure]MENU GUARDAR DATOS[/COLOR][/B]', {'mode': 'savedata'}, icon=CONFIG.ICONSAVE, themeit=CONFIG.THEME3) directory.add_separator() directory.add_file('URL para archivo txt no valido', icon=CONFIG.ICONBUILDS, themeit=CONFIG.THEME3) directory.add_file('{0}'.format(CONFIG.BUILDFILE), icon=CONFIG.ICONBUILDS, themeit=CONFIG.THEME3) return total, count19, adultcount, hidden = check.build_count() match = re.compile( 'name="(.+?)".+?ersion="(.+?)".+?rl="(.+?)".+?ui="(.+?)".+?odi="(.+?)".+?heme="(.+?)".+?con="(.+?)".+?anart="(.+?)".+?dult="(.+?)".+?escription="(.+?)"' ).findall(link) if total == 1: for name, version, url, gui, kodi, theme, icon, fanart, adult, description in match: if not CONFIG.SHOWADULT == 'true' and adult.lower() == 'yes': continue if not CONFIG.DEVELOPER == 'true' and test.str_test(name): continue self.view_build(match[0][0]) return directory.add_file( '[B]Version Kodi:[/B] [COLOR azure]{0}[/COLOR]'.format( CONFIG.KODIV), icon=CONFIG.ICONBUILDS, themeit=CONFIG.THEME3) directory.add_dir('[B][COLOR azure]MENU GUARDAR DATOS[/COLOR][/B]', {'mode': 'savedata'}, icon=CONFIG.ICONSAVE, themeit=CONFIG.THEME3) directory.add_separator() if len(match) >= 1: if CONFIG.SEPARATE == 'true': self._list_all(match) else: if count19 > 0: state = '[COLOR azure]+[/COLOR]' if CONFIG.SHOW19 == 'false' else '[COLOR azure]-[/COLOR]' directory.add_file( '[B][COLOR dodgerblue]{0} BUILDS:[/COLOR][/B][COLOR azure][B] GTKING[/COLOR] [COLOR lime]MATRIX[/B][/COLOR]' .format(state, count19), { 'mode': 'togglesetting', 'name': 'show19' }, themeit=CONFIG.THEME3) if CONFIG.SHOW19 == 'true': self._list_all(match, kodiv=19) elif hidden > 0: if adultcount > 0: directory.add_file( '[COLOR azure]Actualmente Solo hay Builds para Adultos[COLOR]', icon=CONFIG.ICONBUILDS, themeit=CONFIG.THEME3) directory.add_file( '[COLOR azure]Habilitar Mostrar Adultos en los Ajustes de Addon[COLOR] > Misc', icon=CONFIG.ICONBUILDS, themeit=CONFIG.THEME3) else: directory.add_file( '[COLOR azure]Actualmente No Se Ofrecen Builds de[COLOR] {0}' .format(CONFIG.ADDONTITLE), icon=CONFIG.ICONBUILDS, themeit=CONFIG.THEME3) else: directory.add_file( '[COLOR azure]El archivo de texto para la Build no tiene el formato correcto.[COLOR]', icon=CONFIG.ICONBUILDS, themeit=CONFIG.THEME3)
def get_listing(self): directory.add_dir('[B]Herramientas de limpieza[/B]', { 'mode': 'maint', 'name': 'clean' }, icon=CONFIG.ICONMAINT, themeit=CONFIG.THEME1) directory.add_dir('[B]Addon Herramientas[/B]', { 'mode': 'maint', 'name': 'addon' }, icon=CONFIG.ICONMAINT, themeit=CONFIG.THEME1) directory.add_dir('[B]Loging Herramientas[/B]', { 'mode': 'maint', 'name': 'logging' }, icon=CONFIG.ICONMAINT, themeit=CONFIG.THEME1) directory.add_dir('[B]Mantenimiento misceláneo[/B]', { 'mode': 'maint', 'name': 'misc' }, icon=CONFIG.ICONMAINT, themeit=CONFIG.THEME1) directory.add_dir('[B]Copia de seguridad de restauracion[/B]', { 'mode': 'maint', 'name': 'backup' }, icon=CONFIG.ICONMAINT, themeit=CONFIG.THEME1) directory.add_dir('[B]Ajustes / correcciones del sistema[/B]', { 'mode': 'maint', 'name': 'tweaks' }, icon=CONFIG.ICONMAINT, themeit=CONFIG.THEME1)