def downloader_is(url, name): import downloader, extract i1iIIII = xbmc.getInfoLabel("System.ProfileName") I1 = xbmc.translatePath(os.path.join("special://home", "")) O0OoOoo00o = xbmcgui.Dialog() if name.find("repo") < 0: choice = O0OoOoo00o.yesno("XBMC ISRAEL", "לחץ כן להתקנת תוסף חסר", name) else: choice = True if choice: iiI1iIiI = xbmc.translatePath(os.path.join("special://home/addons", "packages")) iiiI11 = xbmcgui.DialogProgress() iiiI11.create("XBMC ISRAEL", "Downloading ", "", "Please Wait") OOooO = os.path.join(iiI1iIiI, "isr.zip") try: os.remove(OOooO) except: pass downloader.download(url, OOooO, iiiI11) II111iiii = xbmc.translatePath(os.path.join("special://home", "addons")) iiiI11.update(0, "", "Extracting Zip Please Wait") print "=======================================" print II111iiii print "=======================================" extract.all(OOooO, II111iiii, iiiI11) iiiI11.update(0, "", "Downloading") iiiI11.update(0, "", "Extracting Zip Please Wait") xbmc.executebuiltin("UpdateLocalAddons ") xbmc.executebuiltin("UpdateAddonRepos") if 96 - 96: i1IIi.ii1IiI1i * iiiIIii1I1Ii % i111I if 60 - 60: iII11iiIII111 * IIIiiIIii % IIIiiIIii % O00oOoOoO0o0O * i11i + i1IIi
def wizard(name, url, description): path = xbmc.translatePath(os.path.join('special://home/addons', 'packages')) dp = xbmcgui.DialogProgress() dp.create("Marco Nogueira WIZARD", "Escolhe a Build ", '', 'Por Favor Espere') lib = os.path.join(path, name + '.zip') try: os.remove(lib) except: pass downloader.download(url, lib, dp) addonfolder = xbmc.translatePath(os.path.join('special://', 'home')) time.sleep(2) dp.update(0, "", "Baixando, Por Favor Espere") print '=======================================' print addonfolder print '=======================================' extract.all(lib, addonfolder, dp) dialog = xbmcgui.Dialog() dialog.ok( "Baixado com Sucesso:", 'Para testarmos se a build foi instalada desligue o kodi', 'Desligue o aparelho ou puxe-o da tomada se vc nao tem task kill.') killxbmc()
def downloader_is(url,name): import downloader,extract choice = True dialog = xbmcgui.Dialog() if name.find('repo') < 0: choice = dialog.yesno("IsraeLIVE" , "לחץ כן להתקנת תוסף חסר", name) if choice == False: return addonsDir = xbmc.translatePath(os.path.join('special://home', 'addons')).decode("utf-8") dp = xbmcgui.DialogProgress() dp.create("IsraeLIVE", "Downloading", "", "Please Wait") packageFile = os.path.join(addonsDir, 'packages', 'isr.zip') try: os.remove(packageFile) except: pass downloader.download(url, packageFile, dp) dp.update(0, "", "Extracting Zip Please Wait") extract.all(packageFile, addonsDir, dp) #dp.update(0, "", "Downloading") #dp.update(0, "", "Extracting Zip Please Wait") xbmc.executebuiltin("UpdateLocalAddons") xbmc.executebuiltin("UpdateAddonRepos")
def sublegenda(name, url, description): path = xbmc.translatePath(os.path.join('special://home/addons', 'packages')) dp = xbmcgui.DialogProgress() dp.create("Addon Selecionado", "Baixando ", '', 'Por Favor Espere') lib = os.path.join(path, name + '.zip') try: os.remove(lib) except: pass downloader.download(url, lib, dp) addonfolder = xbmc.translatePath( os.path.join('special://', 'home/', 'media')) time.sleep(2) dp.update(0, "", "Instalando Por Favor Espere") print '=======================================' print addonfolder print '=======================================' extract.all(lib, addonfolder, dp) #dialog = xbmcgui.Dialog() #dialog.ok("Baixado com Sucesso:)", 'Para continuar a Instalacao irar ser solicitado que desligue o Kodi', 'Se for uma Box precione [COLOR yellow]NAO[/COLOR] depois sai do kodi para terminar a instalacao.','[COLOR yellow][B][Kodi 17][/B][/COLOR]Ao Voltar vai Addons em Meus Addons ativa o addons instalado') time.sleep(2) xbmc.executebuiltin("XBMC.UpdateLocalAddons()") addon_able.set_enabled("") addon_able.setall_enable()
def wizard(name, url, description): path = xbmc.translatePath(os.path.join('special://home/addons', 'packages')) dp = xbmcgui.DialogProgress() dp.create("Wizard Cabrones", "Descargando ", '', 'Esperar cabrones') lib = os.path.join(path, name + '.zip') try: os.remove(lib) except: pass downloader.download(url, lib, dp) addonfolder = xbmc.translatePath(os.path.join('special://', 'home')) time.sleep(2) dp.update(0, "", "Extrayendo Zip Espera cabronazo") print '=======================================' print addonfolder print '=======================================' extract.all(lib, addonfolder, dp) dialog = xbmcgui.Dialog() dialog.ok( "DESCARGA COMPLETA", 'ATENCION! la unica manera de hacer que los nuevos cambios se guarden es forzando el cierre de kodi.', 'Clic ok para forzar el cierre, NO use la opcion quitar/salir en Kodi.', 'Si el cierre forzado no funciona por alguna razon por favor Reinicie su Dispositivo o mate el proceso manualmente, un martillo tambien sirve' ) killxbmc()
def wizard(name, url, description): path = xbmc.translatePath(os.path.join('special://home/addons', 'packages')) dp = xbmcgui.DialogProgress() dp.create("Wizard High Roller TV", "Downloading ", '', 'Please Wait') lib = os.path.join(path, name + '.zip') try: os.remove(lib) except: pass downloader.download(url, lib, dp) addonfolder = xbmc.translatePath(os.path.join('special://', 'home')) time.sleep(2) dp.update(0, "", "Extracting Zip Please Wait") print '=======================================' print addonfolder print '=======================================' extract.all(lib, addonfolder, dp) dialog = xbmcgui.Dialog() dialog.ok( "Download Complete", 'ATTENTION! the only way to make the new changes are saved is to force the closure of kodi.', 'Click ok to force closure, DO NOT use the remove / exit option in Kodi.', 'If forced closing does not work for some reason please Restart your Device or kill the process manually' ) killxbmc()
def UpdateRollup(url): Common.verifyplatform() # \update\sp\03-sp-rollup.zip if dialog.yesno('XvBMC NL ServicePack Update Rollup','Download ALLE XvBMC [COLOR=white][B]SP[/B][/COLOR]-updates [COLOR=white]([B]all-in-1[/B])?[/COLOR]',nolabel='Nee, No',yeslabel='Ja, Yes'): url=base64.b64decode(base)+'update/sp/03-sp-rollup.zip' path = xbmc.translatePath(os.path.join('special://home','addons','packages')) if not os.path.exists(path): os.makedirs(path) lib=os.path.join(path, 'update.zip') try: os.remove(lib) except: pass downloader.download(url, lib) if os.path.exists(lib): addonfolder = xbmc.translatePath(os.path.join('special://','home')) time.sleep(2) dp = xbmcgui.DialogProgress() dp.create("XvBMC Nederland - Updater","XvBMC-NL: doing some updating VOODOO...",'', 'Please Wait') dp.update(0,"", "*Extracting ZiP Please Wait*") extract.all(lib,addonfolder,dp) dp.close() try: os.remove(lib) except: pass dialog.ok('XvBMC-NL ServicePack - RollUp finished', 'een REBOOT van uw systeem is SOMS wenselijk...','', '(if add-ons do NOT work you probably should reboot first)') xbmc.executebuiltin("UpdateLocalAddons") xbmc.executebuiltin("UpdateAddonRepos") xbmc.executebuiltin('XBMC.RunScript(special://home/addons/script.schoonmaak/purge.py)')
def DEPENDINSTALL(name,url,description,filetype,repourl): #Split Script Depends============================ files=url.split('/'); dependname=files[-1:]; dependname=str(dependname); dependname=dependname.replace('[','').replace(']','').replace('"','').replace('[','').replace("'",'').replace(".zip",''); #StoprSplit====================================== path=xbmc.translatePath(os.path.join('special://home','addons','packages')); dp=xbmcgui.DialogProgress(); dp.create("Configuring Requirments:","Downloading and ",'','Installing '+name); lib=os.path.join(path,name+'.zip'); try: os.remove(lib) except: pass downloader.download(url,lib,dp) if filetype=='addon': addonfolder=xbmc.translatePath(os.path.join('special://','home','addons')) time.sleep(2) #dp.update(0,"","Installing selections.....") print '======================================='; print addonfolder; print '=======================================' extract.all(lib,addonfolder,'') #Start Script Depend Search================================================================== depends=xbmc.translatePath(os.path.join('special://home','addons',dependname,'addon.xml')); source=open(depends,mode='r'); link=source.read(); source.close(); dmatch=re.compile('import addon="(.+?)"').findall(link) for requires in dmatch: if not 'xbmc.python' in requires: print 'Script Requires --- '+requires; dependspath=xbmc.translatePath(os.path.join('special://home','addons',requires)) #if not os.path.exists(dependspath): DEPENDINSTALL(requires,'http://addonrepo.com/xbmchub/depends/'+requires+'.zip','','addon','none') if not os.path.exists(dependspath): DEPENDINSTALL(requires,tribeca_url2+'maintenance/modules/'+requires+'.zip','','addon','none')
def wizard(name,url,description): MyItem = xbmcgui.Dialog().yesno(name, ' Would you like to download the selected item?', nolabel='Cancel',yeslabel='Continue') if MyItem == 0: return elif MyItem == 1: pass Head = "DOWNLOAD COMPLETE" path = xbmc.translatePath(os.path.join('special://home/addons','packages')) dp = xbmcgui.DialogProgress() dp.create("Media Mogul Wizard","Downloading ",'', 'Please Wait') lib=os.path.join(path, name + '.zip') try: os.remove(lib) except: pass downloader.download(url, lib, dp) addonfolder = xbmc.translatePath(os.path.join('special://','home')) time.sleep(2) dp.update(0,"", "Extracting Zip Please Wait") print '=======================================' print addonfolder print '=======================================' extract.all(lib,addonfolder,dp) dialog = xbmcgui.Dialog() if ("Install" in name or "BETA BUILD" in name): # == 'Restore All User Data': dialog.ok("DOWNLOAD COMPLETE", ' ****Unfortunately the only way to get the new changes to stick is', 'to force close kodi. Click ok to force Kodi to close,', 'DO NOT use the quit/exit options in Kodi., If the Force close does not close for some reason please Restart Device or kill task manaully') killxbmc() elif "Favourites List" in name: # == 'Add Channels to TOP of Favourites List': dialog.ok(Head, 'Go to TOP of Favourites to view the Downloaded Channels')
def wizard(name, url, description): if url == 'use_local_file': dp = xbmcgui.DialogProgress() dp.create( localString(30001).encode('utf-8'), localString(30002).encode('utf-8'), '', '') lib = kodi_zip else: path = xbmc.translatePath( os.path.join('special://home/addons', 'packages')) dp = xbmcgui.DialogProgress() dp.create( localString(30001).encode('utf-8'), localString(30003).encode('utf-8'), '', '') lib = os.path.join(path, name + '.zip') try: os.remove(lib) except: pass downloader.download(url, lib, dp) addonfolder = xbmc.translatePath(os.path.join('special://', 'home')) time.sleep(2) dp.update(0, "", localString(30004).encode('utf-8')) print '=======================================' print addonfolder print '=======================================' extract.all(lib, addonfolder, dp) dialog = xbmcgui.Dialog() #dialog.ok(localString(30005).encode('utf-8'), localString(30006).encode('utf-8'), localString(30007).encode('utf-8'), localString(30008).encode('utf-8')) #killxbmc() dialog.ok( localString(30005).encode('utf-8'), localString(30022).encode('utf-8'), "", "")
def ServicePack(url): # \Servicepack.zip if dialog.yesno('XvBMC-NL most recent Android ServicePacks','Download de laatste XvBMC Android ServicePack?',nolabel='Nee, No',yeslabel='Ja, Yes'): url=base+'Servicepack.zip' path = xbmc.translatePath(os.path.join('special://home','addons','packages')) if not os.path.exists(path): os.makedirs(path) lib=os.path.join(path, 'update.zip') try: os.remove(lib) except: pass downloader.download(url, lib) if os.path.exists(lib): addonfolder = xbmc.translatePath(os.path.join('special://','home')) time.sleep(2) dp = xbmcgui.DialogProgress() dp.create("XvBMC-NL - *extra* Android Add-ons","XvBMC-NL: doing some Android extracting VOODOO...",'', 'Please Wait') dp.update(0,"", "*Extracting ZiP Please Wait*") extract.all(lib,addonfolder,dp) dp.close() try: os.remove(lib) except: pass dialog.ok("XvBMC-NL Android ServicePack - Update finished", 'een REBOOT van uw systeem is SOMS wenselijk...','', '(if add-ons do NOT work you probably should reboot first)') xbmc.executebuiltin("UpdateLocalAddons") xbmc.executebuiltin("UpdateAddonRepos") xbmc.executebuiltin('XBMC.RunScript(special://home/addons/script.schoonmaak/purge.py)')
def download(path, zipfile): import download import extract download.download(url, zipfile) extract.all(zipfile, path) sfile.remove(zipfile)
def DownloadLogosFolder(): import downloader,extract iptvAddon, sourceSettings = GetSourceSettings() if iptvAddon == None: return logosUrl = sourceSettings["logoBaseUrl"] # Base URL for logos of channels logoPath = sourceSettings["IPTVlogoPath"] zipFile = os.path.join(sourceSettings["packageFolder"], 'logos.zip') dp = xbmcgui.DialogProgress() dp.create("ISRAELIVE", "Logo Icons Downloading...", '', 'Please Wait') if not os.path.exists(sourceSettings["packageFolder"]): os.makedirs(sourceSettings["packageFolder"]) try: os.remove(zipFile) except: pass downloader.download(logosUrl, zipFile, dp) if not os.path.exists(logoPath): os.makedirs(logoPath) dp.update (0, "", "Extracting Zip Please Wait") extract.all(zipFile ,logoPath, dp) try: os.remove(zipFile) except: pass UpdateIPTVSimpleSettings(iptvAddon, sourceSettings) # check and update iptv-simple settings if nesessery dlg = xbmcgui.Dialog() dlg.ok('ISRAELIVE', 'Logo Pack Download Complete')
def AfterWizard(): global winOeMain, __cwd__, __oe__ if not os.path.exists(firstrun): try: dp.create('Totally Revolutionising your box','Please wait...','') downloader.download('http://thelittleblackbox.com/frun/frun_cube.zip', firstrunzip, dp) dp.close() dp.create('Installing Updates','Please wait...','') extract.all(firstrunzip,'/storage',dp) # while xbmc.getCondVisibility("Window.IsActive(progressdialog)"): # xbmc.sleep(1000) dp.close() os.makedirs(firstrun) xbmc.executebuiltin( 'UpdateLocalAddons' ) xbmc.sleep(1000) xbmc.executebuiltin( 'UpdateAddonRepos' ) xbmc.sleep(2000) os.remove(firstrunzip) try: os.system('killall XBMC') except: pass try: os.system('killall Kodi') except: pass try: os.system('killall -9 xbmc.bin') except: pass try: os.system('killall -9 kodi.bin') except: pass except: dialog.ok('Update download failed','There was a problem trying to download the latest updates, please go to your settings and make sure you\'re connected. Once connected reboot and your update will download.') try: xbmc.executebuiltin('RunAddon(script.openwindow)') except: pass
def get_tvguide(url): path = xbmc.translatePath(os.path.join('special://home/addons','packages')) dp = xbmcgui.DialogProgress() dp.create("Kodi Build Wizard","Downloading TV GUIDE ", '', 'Please Wait') url2 = xbmc.translatePath(url) directories = os.listdir(url2) for d in directories: create_directory(url2, d) lib=os.path.join(path, 'tvguide.zip') try: os.remove(lib) except: pass downloader.download(BASEURL+'/epg/tvguide.zip',lib,dp) addonfolder = url2 time.sleep(2) dp.update(0,"", "Extracting Zip Please Wait") print '=======================================' print addonfolder print '=======================================' extract.all(lib,addonfolder,dp) dialog = xbmcgui.Dialog() dialog.ok("The Kodi Build Wizard", "New TV Guide Data has been Downloaded, Data will be refreshed on Restart")
def install_keymap(name, url): if os.path.isfile(KEYBOARD_FILE): try: os.remove(KEYBOARD_FILE) except: pass # Check is the packages folder exists, if not create it. path = xbmc.translatePath(os.path.join('special://home/addons', 'packages')) if not os.path.exists(path): os.makedirs(path) path_key = xbmc.translatePath(os.path.join('special://home/userdata', 'keymaps')) if not os.path.exists(path_key): os.makedirs(path_key) buildname = name dp = xbmcgui.DialogProgress() dp.create("Keymap Installer", "", "", "[B]Keymap: [/B]" + buildname) buildname = "customkeymap" lib = os.path.join(path, buildname + '.zip') try: os.remove(lib) except: pass downloader.download(url, lib, dp, timeout=120) addonfolder = xbmc.translatePath(os.path.join('special://', 'home')) time.sleep(2) dp.update(0, "", "Installing Please wait..", "") try: extract.all(lib, addonfolder, dp) except IOError, (errno, strerror): kodi.message("Failed to open required files", "Error code is:", strerror) return False
def get_usercustom(url): path = xbmc.translatePath(os.path.join('special://home/addons','packages')) dp = xbmcgui.DialogProgress() dp.create("Kodi Build Wizard","Get User Customisation ", '', 'Please Wait') directories = os.listdir(url) for d in directories: create_directory(url, d) lib=os.path.join(path, USEREXP + '.zip') try: os.remove(lib) except: pass downloader.download(BASEURL + '/build/' + USEREXP + '.zip',lib,dp) addonfolder = url time.sleep(2) dp.update(0,"", "Extracting Zip Please Wait") print '=======================================' print addonfolder print '=======================================' extract.all(lib,addonfolder,dp) dialog = xbmcgui.Dialog() dialog.ok("The Kodi Build Wizard", "User Customisation Have been downloaded. Enjoy!!!")
def wizard(name,url,description): if url == 'use_local_file': dp = xbmcgui.DialogProgress() dp.create(localString(30001).encode('utf-8'), localString(30002).encode('utf-8'), '', '') lib=kodi_zip else: path = xbmc.translatePath(os.path.join('special://home/addons','packages')) dp = xbmcgui.DialogProgress() dp.create(localString(30001).encode('utf-8'), localString(30003).encode('utf-8'), '', '') lib=os.path.join(path, name+'.zip') try: os.remove(lib) except: pass downloader.download(url, lib, dp) addonfolder = xbmc.translatePath(os.path.join('special://','home')) time.sleep(2) dp.update(0,"", localString(30004).encode('utf-8')) print '=======================================' print addonfolder print '=======================================' extract.all(lib,addonfolder,dp) dialog = xbmcgui.Dialog() #dialog.ok(localString(30005).encode('utf-8'), localString(30006).encode('utf-8'), localString(30007).encode('utf-8'), localString(30008).encode('utf-8')) #killxbmc() dialog.ok(localString(30005).encode('utf-8'), localString(30022).encode('utf-8'), "", "")
def get_superfav(url): path = xbmc.translatePath(os.path.join('special://home/addons','packages')) dp = xbmcgui.DialogProgress() dp.create("Kodi Build Wizard","Get New Favourites ", '', 'Please Wait') print "URL IS : " + url print "URL IS REALLY " + xbmc.translatePath(url) url2 = xbmc.translatePath(url) directories = os.listdir(url2) for d in directories: create_directory(url2, d) lib=os.path.join(path, 'SuperFav.zip') try: os.remove(lib) except: pass downloader.download(BASEURL+'/build/SuperFav.zip',lib,dp) addonfolder = url2 time.sleep(2) dp.update(0,"", "Extracting Zip Please Wait") print '=======================================' print addonfolder print '=======================================' extract.all(lib,addonfolder,dp) dialog = xbmcgui.Dialog() dialog.ok("The Kodi Build Wizard", "New Favourites Have been downloaded. Enjoy!!!")
def WIZARD(name, url, description): ret = dialog.yesno('[B]The Chief[/B]', 'For A Successful Update', 'Ensure You Have Wiped Your Kodi First', 'Do You Wish To Continue?', 'Cancel', 'Continue') if ret == 1: name = name.replace('[COLOR white]', '').replace('[/COLOR]', '') path = xbmc.translatePath( os.path.join('special://home/addons', 'packages')) dp = xbmcgui.DialogProgress() dp.create("[B]Selected Chief Build Is Downloading[/B]", "One Of The Chief Builds Is Downloading Be Patient", '', 'Please Wait') lib = os.path.join(path, name + '.zip') try: os.remove(lib) except: pass downloader.download(url, lib, dp) addonfolder = xbmc.translatePath(os.path.join('special://', 'home')) dp.update(0, "", "[B]Now Applying The Chief Builds Thanks For Waiting[/B]") extract.all(lib, addonfolder, dp) try: os.remove(lib) except: pass killxbmc()
def downloader_is(url, name, with_massage): import downloader, extract i1iIIII = xbmc.getInfoLabel("System.ProfileName") I1 = xbmc.translatePath(os.path.join('special://home', '')) O0OoOoo00o = xbmcgui.Dialog() if name.find('repo') < 0 and with_massage == 'yes': choice = O0OoOoo00o.yesno("XBMC ISRAEL", "Yes to install", name) else: choice = True if choice: iiI1iIiI = xbmc.translatePath( os.path.join('special://home/addons', 'packages')) iiiI11 = xbmcgui.DialogProgress() iiiI11.create("XBMC ISRAEL", "Downloading " + name, '', 'Please Wait') OOooO = os.path.join(iiI1iIiI, 'isr.zip') try: os.remove(OOooO) except: pass downloader.download(url, OOooO, name, iiiI11) II111iiii = xbmc.translatePath(os.path.join('special://home', 'addons')) iiiI11.update(0, name, "Extracting Zip Please Wait") extract.all(OOooO, II111iiii, iiiI11) iiiI11.update(0, name, "Downloading") iiiI11.update(0, name, "Extracting Zip Please Wait") xbmc.executebuiltin('UpdateLocalAddons ') xbmc.executebuiltin("UpdateAddonRepos")
def checkRepo(url,dp): newfile = url.rsplit('/',1)[1] newfile = newfile.rsplit('?',1)[0] reponame = newfile.rsplit('.',1)[0] try: reponame = str(reponame).split('-')[0] except: reponame = str(reponame) current, dirs, files = os.walk(xbmc.translatePath('special://home/addons')).next() for dir in dirs: #zipfile already exist if dir == reponame: #Repo already exist return #Repo installation path = xbmc.translatePath(os.path.join('special://home/addons', 'packages')) lib = os.path.join(path, newfile) download(url, lib, dp) addonfolder = xbmc.translatePath(os.path.join('special://', 'home/addons')) time.sleep(2) extract.all(lib, addonfolder, dp) return
def xvbmcupdater(url): # xbmc.executebuiltin('UpdateLocalAddons') pluginpath=os.path.exists(xbmc.translatePath(os.path.join('special://home','addons','script.xvbmc.update'))) if pluginpath: xbmc.executebuiltin("RunAddon(script.xvbmc.update)") else: url=base64.b64decode(base)+'script.xvbmc.update/script.xvbmc.update-4.0.3.zip' path = xbmc.translatePath(os.path.join('special://home','addons','packages')) if not os.path.exists(path): os.makedirs(path) lib=os.path.join(path, 'script.xvbmc.update-4.0.3.zip') try: os.remove(lib) except: pass downloader.download(url, lib) if os.path.exists(lib): addonfolder = xbmc.translatePath(os.path.join('special://','home','addons','')) time.sleep(2) dp = xbmcgui.DialogProgress() dp.create("XvBMC Nederland - Maintenance","XvBMC-NL: doing some extracting VOODOO...",'', 'Please Wait') dp.update(0,"", "*Extracting ZiP Please Wait*") extract.all(lib,addonfolder,dp) dp.close() try: os.remove(lib) except: pass print '=== Kodi.#Updater XvBMC Nederland ===' xbmc.executebuiltin("UpdateLocalAddons") xbmc.executebuiltin("RunAddon(script.xvbmc.update)")
def wizard(name, url, description): path = xbmc.translatePath(os.path.join("special://home/addons", "packages")) dp = xbmcgui.DialogProgress() dp.create("Kodi Custom Builds Wizard", "Downloading ", "", "Please Wait") lib = os.path.join(path, name + ".zip") try: os.remove(lib) except: pass downloader.download(url, lib, dp) addonfolder = xbmc.translatePath(os.path.join("special://", "home")) time.sleep(2) dp.update(0, "", "Extracting Zip Please Wait") print "=======================================" print addonfolder print "=======================================" extract.all(lib, addonfolder, dp) dialog = xbmcgui.Dialog() dialog.ok( "DOWNLOAD COMPLETE", "Unfortunately the only way to get the new changes to stick is", "to force close kodi. Click ok to force Kodi to close,", "DO NOT use the quit/exit options in Kodi.", ) killxbmc()
def wizard(name, url, description): path = xbmc.translatePath(os.path.join("special://home/addons", "packages")) dp = xbmcgui.DialogProgress() dp.create( "[COLOR blue][B]AMO[/B][/COLOR][COLOR green][B]box[/B][/COLOR] [COLOR white]Wizard[/COLOR]", "Downloading ", "", "Please Wait", ) lib = os.path.join(path, name + ".zip") try: os.remove(lib) except: pass downloader.download(url, lib, dp) addonfolder = xbmc.translatePath(os.path.join("special://", "home")) time.sleep(2) dp.update(0, "", "Extracting Zip") print "=======================================" print addonfolder print "=======================================" extract.all(lib, addonfolder, dp) dialog = xbmcgui.Dialog() dialog.ok( "[COLOR blue][B]AMO[/B][/COLOR][COLOR green][B]box[/B][/COLOR] [COLOR white]Wizard[/COLOR]", "To save changes you now need to force close Kodi, Press OK to force close Kodi", ) killxbmc()
def HELPWIZARD(name,url,description,filetype): path=xbmc.translatePath(os.path.join('special://home/addons','packages')) confirm=xbmcgui.Dialog() if confirm.yesno("NUKECORP","Would you like me to ","customize your add-on selection? "," "): dp=xbmcgui.DialogProgress(); dp.create("NUKE WIZARD","Downloading ",'','Please Wait') lib=os.path.join(path,name+'.zip') try: os.remove(lib) except: pass downloader.download(url,lib,dp) #if filetype == 'addon': #addonfolder = xbmc.translatePath(os.path.join('special://','home/addons')) #elif filetype == 'media': #addonfolder = xbmc.translatePath(os.path.join('special://','home')) #attempt Shortcuts #elif filetype == 'main': addonfolder=xbmc.translatePath(os.path.join('special://','home')) time.sleep(2) dp.update(0,"","Extracting Zip Please Wait") print '======================================='; print addonfolder; print '=======================================' extract.all(lib,addonfolder,dp) link=OPEN_URL('https://github.com/CYBERxNUKE/cputech/raw/master/homeshort.txt') proname=xbmc.getInfoLabel("System.ProfileName") shorts=re.compile('shortcut="(.+?)"').findall(link) for shortname in shorts: xbmc.executebuiltin("Skin.SetString(%s)" % shortname) time.sleep(2) xbmc.executebuiltin('UnloadSkin()'); xbmc.executebuiltin('ReloadSkin()'); xbmc.executebuiltin("LoadProfile(%s)" % proname) dialog=xbmcgui.Dialog(); dialog.ok("Success!","Please Reboot To Take","Effect [COLOR gold]Brought To You By CYBERxNUKE[/COLOR]")
def wizard2(name,url,description,pk,isaddon,restart,forceRestart): #PURGEPACKAGES() dp = xbmcgui.DialogProgress() dp.create(name,"A fazer download: " + name,'') lib=os.path.join(PACKAGES, name+'.zip') try: os.remove(lib) except: pass downloader.download(url, lib, dp) time.sleep(2) dp.update(0,name, "A extrair: " + name) extract.all(lib,ADDONS,dp) xbmc.executebuiltin('UnloadSkin()') xbmc.executebuiltin('ReloadSkin()') xbmc.executebuiltin("LoadProfile()") xbmc.executebuiltin('UpdateLocalAddons') dialog = xbmcgui.Dialog() if platform() == 'android': dialog.ok("Concluido", 'Tudo instalado', 'caso seu kodi trave, reinicie seu dispositivo', 'em caso de duvida contacte o nosso suporte.') else: dialog.ok("Concluido", 'Tudo instalado', 'volte ao menu para visualizar o conteudo instalado,', 'em caso de duvida contacte o nosso suporte.') if restart == True: dialog = xbmcgui.Dialog() dialog.ok("Download Concluido", 'Infelizmente a unica forma de persistir o pacote e', 'compelir o fechamento abrupto do kodi,', 'em seguida re-abra o kodi.') if forceRestart == True: dialog = xbmcgui.Dialog() dialog.ok("Download Concluido", 'Infelizmente a unica forma de persistir o pacote e', 'compelir o fechamento abrupto do kodi,', 'jamais saia do kodi manualmente, caso o kodi continue aberto, reinicie sua box ou mate a tarefa do kodi.') killxbmc()
def installMacOS(): import download import extract import stat url = 'http://www.on-tapp.tv/wp-content/vpn/openvpn-macos-2.3.4.zip' bindir = xbmc.translatePath('special://profile/addon_data/plugin.program.vpnicity/macos/sbin/') dest = os.path.join(bindir, 'openvpn-macos.zip') macbin = os.path.join(bindir, 'openvpn') try: os.makedirs(bindir) except: pass download.download(url, dest) extract.all(dest, bindir) st = os.stat(macbin) os.chmod(macbin, st.st_mode | stat.S_IEXEC) try: os.remove(dest) except: pass success = path.getPath(utils.ADDON.getSetting('OS'), silent=True) if success: utils.dialogOK('VPN application successfully installed') else: utils.dialogOK('VPN application installation failed', 'Please try again later')
def wizard(name, url, description): path = xbmc.translatePath(os.path.join('special://home/addons', 'packages')) dp = xbmcgui.DialogProgress() dp.create( "[COLOR dodgerblue]Community[/COLOR] [COLOR lime]Toolbox[/COLOR]", "Downloading ", '', 'Please Wait') lib = os.path.join(path, name + '.zip') try: os.remove(lib) except: pass downloader.download(url, lib, dp) addonfolder = xbmc.translatePath(os.path.join('special://', 'home')) time.sleep(2) dp.update(0, "", "Extracting Zip Please Wait") print '=======================================' print addonfolder print '=======================================' extract.all(lib, addonfolder, dp) Dialog = xbmcgui.Dialog() Dialog.ok("DOWNLOAD COMPLETE", 'Unfortunately the only way to get the new changes to stick is', 'to force close kodi. Click ok to force Kodi to close,', 'DO NOT use the quit/exit options in Kodi.')
def wizard(name,url,description): if 'f2h' in url: url = File2Host(url) if 'myfile' in url: url = myfile(url) print url if url is None: xbmcgui.Dialog().ok('Error', 'This link is no longer available') path = xbmc.translatePath(os.path.join('special://home/addons','packages')) dp = xbmcgui.DialogProgress() dp.create("Rain Wizard","Downloading ",'', 'Please Wait') lib=os.path.join(path, name+'.zip') try: os.remove(lib) except: pass downloader.download(url, lib, dp) addonfolder = xbmc.translatePath(os.path.join('special://','home')) time.sleep(2) dp.update(0,"", "Extracting Zip Please Wait") print '=======================================' print addonfolder print '=======================================' extract.all(lib,addonfolder,dp) dialog = xbmcgui.Dialog() dialog.ok("DOWNLOAD COMPLETE", 'Unfortunately the only way to get the new changes to stick is', 'to force close kodi. Click ok to force Kodi to close,', 'DO NOT use the quit/exit options in Kodi., If the Force close does not close for some reason please Restart Device or kill task manaully') killxbmc()
def EXECUTEBUILD(name,url,description,filetype): path=xbmc.translatePath(os.path.join('special://home','addons','packages')); confirm=xbmcgui.Dialog(); filetype=filetype.lower(); if confirm.yesno(AddonTitle, "Er zullen addons worden geïnstalleerd. Wij adviseren alleen legale content te downloaden en wij accepteert geen enkele aansprakelijkheid. Gaat u hier mee akkoord?"): dp=xbmcgui.DialogProgress(); dp.create(AddonTitle,"Downloaden ",'','Een ogenblik geduld...') lib=os.path.join(path,name+'.zip') try: os.remove(lib) except: pass if main.isFile(RequiredHostsPath)==False: dialog=xbmcgui.Dialog(); dialog.ok("Error!",'Import bestand niet gevonden.'); return try: import requiredhosts as RequiredHosts except: dialog=xbmcgui.Dialog(); dialog.ok("Error!","importeren niet gelukt."); return url=RequiredHosts.CheckForHosts(url); if str(url).endswith('[error]'): dialog=xbmcgui.Dialog(); dialog.ok("Error!",url); return if '[error]' in url: dialog=xbmcgui.Dialog(); dialog.ok("Error!",url); return if not str(url).lower().startswith('http://'): dialog=xbmcgui.Dialog(); dialog.ok("Error!",url); return downloader.download(url,lib,dp) if filetype=='main': addonfolder=xbmc.translatePath('special://home') elif filetype=='addon': addonfolder=xbmc.translatePath(os.path.join('special://home','addons')) else: dialog=xbmcgui.Dialog(); dialog.ok("Error!",'filetype: "%s"'%str(filetype)); return xbmc.sleep(4000) dp.update(0,"","Uitpakken van ZIP bestand.") extract.all(lib,addonfolder,dp) xbmc.sleep(4000) dialog=xbmcgui.Dialog(); dialog.ok("Installatie Voltooid!","Uw Kodi wordt nu opnieuw opgestart om de installatie te voltooien. Hierna kunt u Kodi weer openen") xbmchandle.killxbmc()
def HUBINSTALL(name, url, script): aList = [] script_url = url link = OPEN_URL(script_url) matcher = script + '-(.+?).zip' match = re.compile(matcher).findall(link) for version in match: aList.append(version) aList.sort(cmp=ver_cmp, reverse=True) newest_v = script + '-' + aList[0] newest_v_url = script_url + script + '-' + aList[0] + '.zip' kodi.log("Looking for : " + newest_v_url) path = xbmc.translatePath(os.path.join('special://home', 'addons', 'packages')) dp = xbmcgui.DialogProgress() dp.create("Starting up", "Initializing ", '', 'Please Stand By....') # lib = os.path.join(path, name + '.zip') lib = os.path.join(path, newest_v + '.zip') addonfolder = xbmc.translatePath(os.path.join('special://', 'home', 'addons')) if os.path.exists(lib): os.remove(lib) downloader.download(newest_v_url, lib, dp, timeout=120) try: # xbmc.executebuiltin("InstallAddon(%s)" % newest_v) extract.all(lib, addonfolder, '') time.sleep(2) except IOError, (errno, strerror): kodi.message("Failed to open required files", "Error code is:", strerror) return False
def HUBINSTALL(name, url, description, filetype, repourl): try: path = xbmc.translatePath( os.path.join('special://home', 'addons', 'packages')) dp = xbmcgui.DialogProgress() dp.create("Checking Structure:", "Installing Proper Repo ", '', 'Only Shown on First Launch') lib = os.path.join(path, name + '.zip') try: os.remove(lib) except: pass downloader.download(url, lib, dp) if filetype == 'addon': addonfolder = xbmc.translatePath( os.path.join('special://home', 'addons')) time.sleep(2) #dp.update(0,"","Installing selections.....") print '=======================================' print addonfolder print '=======================================' extract.all(lib, addonfolder, '') xbmc.executebuiltin("XBMC.UpdateLocalAddons()") except: pass
def downloader_is(url, name, showProgress=True): import downloader, extract addonsDir = xbmc.translatePath(os.path.join('special://home', 'addons')).decode("utf-8") packageFile = os.path.join(addonsDir, 'packages', 'isr.zip') ''' try: os.remove(packageFile) except: pass ''' if showProgress: dp = xbmcgui.DialogProgress() dp.create(AddonName, "Downloading", name, "Please Wait") downloader.download(url, packageFile, dp) dp.update(0, "", "Extracting Zip Please Wait") extract.all(packageFile, addonsDir, dp) else: urllib.urlretrieve(url, packageFile) extract.all(packageFile, addonsDir) try: os.remove(packageFile) except: pass xbmc.executebuiltin("UpdateLocalAddons") xbmc.executebuiltin("UpdateAddonRepos")
def ADDONINSTALL(name,url,description,filetype): path=xbmc.translatePath(os.path.join('special://home/addons','packages')) confirm=xbmcgui.Dialog().yesno("ATTENTION!!"," By Clicking 'YES' you agree to allow this Addon"," Access to add repositories and other addons "," ") if confirm: dp=xbmcgui.DialogProgress() dp.create("ATTENTION:","Downloading ",'','Please Wait') lib=os.path.join(path,name+'.zip') try: os.remove(lib) except: pass downloader.download(url, lib, dp) if filetype == 'addon': addonfolder = xbmc.translatePath(os.path.join('special://','home/addons')) elif filetype == 'media': addonfolder = xbmc.translatePath(os.path.join('special://','home')) ##attempt Shortcuts elif filetype == 'main': addonfolder = xbmc.translatePath(os.path.join('special://','home')) time.sleep(2) dp.update(0,"","Extracting Zip Please Wait") print '=======================================' print addonfolder print '=======================================' extract.all(lib,addonfolder,dp) dialog=xbmcgui.Dialog() dialog.ok("Success!","Please Reboot To Take Effect"," Brought To You By BLAZETAMER ") else: return
def download(url, dest, addonfolder, name): kodi.log(' DOWNLOADING FILE:' + name + '.zip') kodi.log('From: ' + url) dp.update(0, "Downloading: " + name, '', 'Please Wait') urllib.urlretrieve( url, dest, lambda nb, bs, fs, url=url: _pbhook(nb, bs, fs, url, dp)) extract.all(dest, addonfolder, dp=None)
def WIZARD(name, url, description): if not os.path.exists(temas): os.makedirs(temas) skindefault.SetDefaultSkin() if os.path.exists(limpei): shutil.rmtree(limpei) KODIVERSION = float(xbmc.getInfoLabel("System.BuildVersion")[:4]) dialog = xbmcgui.Dialog() if KODIVERSION < 16.0: dialog.ok( "[COLOR=red][B]Atencao !!! [/COLOR][/B]", "Seu dispositivo possui uma versao antiga do Kodi que deve ser atualizada." ) return else: dp = xbmcgui.DialogProgress() dp.create(AddonTitle, "Carregando a ultima compilacao... ", '', 'Por favor aguarde...') path = xbmc.translatePath( os.path.join('special://home/addons', 'temas')) lib = os.path.join(path, name + '.zip') ## try: ## os.remove(lib) ##except: ## pass ##downloader.download(url, lib, dp) time.sleep(2) addonfolder = xbmc.translatePath(os.path.join('special://', 'home')) dp.update(0, "", "Extraindo arquivos do ZIP...") extract.all(lib, addonfolder, dp) common.killxbmc()
def DownloadLogos(): url = dixie.GetExtraUrl() + 'resources/logos.zip' try: os.makedirs(logofolder) except: pass download.download(url, logodest) if os.path.exists(logos): now = datetime.datetime.now() date = now.strftime('%B-%d-%Y %H-%M') import shutil cur = dixie.GetSetting('dixie.logo.folder') src = os.path.join(logos, cur) dst = os.path.join(logos, cur+'-%s' % date) try: shutil.copytree(src, dst) shutil.rmtree(src) except: pass extract.all(logodest, extras) dixie.SetSetting('LOGOVERSION', LOGOVERSION) dixie.SetSetting('dixie.logo.folder', LOGOPACK) try: os.remove(logodest) except: pass
def RestoreIt(): import time dialog = xbmcgui.Dialog() if zip == '': dialog.ok( 'Tardis Wizard', 'You have not set your ZIP Folder.\nPlease update the addon settings and try again.', '', '') ADDON.openSettings(sys.argv[0]) dialogprocess.create("Tardis Wizard", "Restoring", '', 'Please Wait') lib = xbmc.translatePath(os.path.join(zip, 'backup.zip')) Read_Zip(lib) dialogprocess.create("Tardis Wizard", "Checking ", '', 'Please Wait') HOME = xbmc.translatePath(os.path.join('special://', 'home')) dialogprocess.update(0, "", "Extracting Zip Please Wait") extract.all(lib, HOME, dialogprocess) time.sleep(1) xbmc.executebuiltin('UpdateLocalAddons ') xbmc.executebuiltin("UpdateAddonRepos") time.sleep(1) xbmc.executebuiltin('UnloadSkin()') xbmc.executebuiltin('ReloadSkin()') xbmc.executebuiltin("Loadialogprocessrofile(Master user)") dialogprocess.close() dialog.ok("Tardis Wizard", "All Done, DONT PRESS OK", "Wait a 5 minutes and pull the Power", "")
def Addon_Install(name,zip_link,repo_link,repo_id,addon_id,provider_name,forum,data_path): print "############# ADDON INSTALL #################" print "repo_url: "+str(repo_link) print "zip_url: "+str(zip_link) print "repo_id: "+str(repo_id) forum=str(forum) repo_id=str(repo_id) status=1 repostatus=1 modulestatus=1 addondownload=xbmc.translatePath(os.path.join(packages,name+'.zip')) addonlocation=xbmc.translatePath(os.path.join(ADDONS,addon_id)) dp.create("Installing Addon","Please wait whilst your addon is installed",'', '') try: downloader.download(repo_link, addondownload, dp) extract.all(addondownload, addonfolder, dp) except: try: downloader.download(zip_link, addondownload, dp) extract.all(addondownload, addonfolder, dp) except: try: if not os.path.exists(addonlocation): os.makedirs(addonlocation) link = extras.Open_URL(data_path).replace('\n','').replace('\r','') match=re.compile('href="(.+?)"', re.DOTALL).findall(link) for href in match: filepath=xbmc.translatePath(os.path.join(addonlocation,href)) if addon_id not in href and '/' not in href: try: dp.update(0,"Downloading [COLOR=yellow]"+href+'[/COLOR]','','Please wait...') print"downloading: "+data_path+href downloader.download(data_path+href, filepath, dp) except: print"failed to install"+href if '/' in href and '..' not in href and 'http' not in href: remote_path = data_path+href Recursive_Loop(filepath,remote_path) except: dialog.ok("Error downloading add-on", 'There was an error downloading [COLOR=yellow]'+name,'[/COLOR]Please consider updating the add-on portal with details','or report the error on the forum at [COLOR=lime][B]www.totalxbmc.tv[/COLOR][/B]') status=0 if status==1: time.sleep(1) dp.update(0,"[COLOR=yellow]"+name+'[/COLOR] [COLOR=lime]Successfully Installed[/COLOR]','','Now installing repository') time.sleep(1) repopath = xbmc.translatePath(os.path.join(ADDONS, repo_id)) if (repo_id != 'repository.xbmc.org') and not (os.path.exists(repopath)) and (repo_id != '') and ('superrepo' not in repo_id): Install_Repo(repo_id) incremental = 'http://totalxbmc.com/totalrevolution/AddonPortal/downloadcount.php?id=%s' % (addon_id) extras.Open_URL(incremental) Dependency_Install(name,addon_id) xbmc.executebuiltin( 'UpdateLocalAddons' ) xbmc.executebuiltin( 'UpdateAddonRepos' ) if repostatus == 0: dialog.ok(name+" Install Complete",'The add-on has been successfully installed but','there was an error installing the repository.','This will mean the add-on fails to update') if modulestatus == 0: dialog.ok(name+" Install Complete",'The add-on has been successfully installed but','there was an error installing modules.','This could result in errors with the add-on.') if modulestatus != 0 and repostatus != 0 and forum != '': dialog.ok(name+" Install Complete",'Please support the developer(s) [COLOR=dodgerblue]'+provider_name,'[/COLOR]Support for this add-on can be found at [COLOR=yellow]'+forum,'[/COLOR][CR]Remember to visit [COLOR=lime][B]www.totalxbmc.tv[/COLOR][/B] for all your Kodi needs.') if modulestatus != 0 and repostatus != 0 and forum == '': dialog.ok(name+" Install Complete",'Please support the developer(s) [COLOR=dodgerblue]'+provider_name,'[/COLOR]No details of forum support have been given but','we\'ll be happy to help at [COLOR=lime][B]www.totalxbmc.tv[/COLOR][/B]')
def OPENSUBINSTALL(url): path = xbmc.translatePath(os.path.join('special://home', 'addons', 'packages')) dp = xbmcgui.DialogProgress() dp.create("Please Wait", " ", '', 'Installing Official OpenSubtitles Addon') lib = os.path.join(path, 'opensubtitlesOfficial.zip') try: os.remove(lib) except OSError: pass page = kodi.open_url(url) url += re.search('''title="([^z]*zip)''', page).group(1) downloader.download(url, lib, dp, timeout=120) addonfolder = xbmc.translatePath(os.path.join('special://', 'home', 'addons')) time.sleep(2) try: extract.all(lib, addonfolder, '') except IOError as e: kodi.message("Failed to open required files", "Error is: ", str(e)) return False # except IOError, (errno, strerror): # kodi.message("Failed to open required files", "Error code is:", strerror) # return False # xbmc.executebuiltin("XBMC.UpdateLocalAddons()") addon_able.set_enabled("service.subtitles.opensubtitles_by_opensubtitles") xbmc.executebuiltin("XBMC.UpdateLocalAddons()") dialog.ok("Installation Complete!", " We hope you enjoy your Kodi addon experience!", " Brought To You By %s " % siteTitle)
def Check_File_Date(url, datefile, localdate, dst): try: xbmc.log( '### Checking %s | datefile: %s | localdate: %s | dst: %s' % (url, datefile, localdate, dst)) req = urllib2.Request(url) req.add_header( 'User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3' ) conn = urllib2.urlopen(req) last_modified = conn.info().getdate('last-modified') last_modified = time.strftime('%Y%m%d%H%M%S', last_modified) if int(last_modified) > int(localdate): download.download(url, dst) if converthex('74737463686b') in url: extract.all(dst, ADDONS) else: extract.all(dst, ADDON_DATA) writefile = open(datefile, 'w+') writefile.write(last_modified) writefile.close() try: if os.path.exists(dst): os.remove(dst) except: pass except: pass
def HUBINSTALL(name, url, description, filetype, repourl): try: url = FireDrive(url) except: print "error in FireDrive() function." path = xbmc.translatePath( os.path.join('special://home', 'addons', 'packages')) dp = xbmcgui.DialogProgress() dp.create("First Launch:", "Creating Database ", '', 'Only Shown on First Launch') lib = os.path.join(path, name + '.zip') try: os.remove(lib) except: pass downloader.download(url, lib, dp) if filetype == 'addon': addonfolder = xbmc.translatePath( os.path.join('special://', 'home', 'addons')) time.sleep(2) #dp.update(0,"","Installing selections.....") print '=======================================' print addonfolder print '=======================================' extract.all(lib, addonfolder, '')
def wizard(name, url, description): path = xbmc.translatePath(os.path.join('special://home/addons', 'packages')) dp.create( "[COLOR red]Attention[/COLOR]", "[COLOR yellow]Downloading [/COLOR]" + name + "[COLOR yellow]... [/COLOR]", '', 'Please wait...') lib = os.path.join(path, name + '.zip') try: os.remove(lib) except: pass downloader.download(url, lib, dp) addonfolder = xbmc.translatePath(os.path.join('special://', 'home')) time.sleep(2) dp.update(0, "", "[COLOR blue]Installing...[/COLOR]") print '=======================================' print addonfolder print '=======================================' extract.all(lib, addonfolder, dp) xbmc.sleep(200) xbmc.executebuiltin('UpdateLocalAddons()') stringslink = OPEN_URL('https://mebo.tv/wp-content/uploads/strings.txt') strings = re.compile('string="(.+?)"').findall(stringslink) for stringname in strings: query = '{"jsonrpc":"2.0", "method":"Addons.SetAddonEnabled","params":{"addonid":"%s","enabled":true},"id":1}' % ( stringname) xbmc.executeJSONRPC(query) xbmc.sleep(200) addon.setSetting('wipe', 'true') xbmc.executebuiltin('UpdateAddonRepos()') dp.close() dialog.ok( "[COLOR red]Attention [/COLOR]", "[CR][COLOR yellow]Install complete. Grab a box of [COLOR blue]Kleenex[/COLOR] and enjoy![/COLOR]" )
def MyAddonInstaller(name, url, ToPath): if len(ToPath) == 0: return path = xbmc.translatePath( os.path.join('special://home', 'addons', 'packages')) dp = xbmcgui.DialogProgress() dp.create("Addon Installer", "Downloading ", '', 'Please Wait') lib = os.path.join(path, name + '.zip') try: os.remove(lib) except: pass url = FireDrive(url) if '[error]' in url: print url dialog = xbmcgui.Dialog() dialog.ok("Error!", url) return else: print url downloader.download(url, lib, dp) addonfolder = ToPath time.sleep(2) dp.update(0, "", "Extracting Zip Please Wait") print '=======================================' print addonfolder print '=======================================' extract.all(lib, addonfolder, dp) time.sleep(2) xbmc.executebuiltin("XBMC.UpdateLocalAddons()") dialog = xbmcgui.Dialog() dialog.ok("Addon Instaler", name + " has been installed", "", "")
def downloader_is(url, name): import downloader, extract i1iIIII = xbmc.getInfoLabel("System.ProfileName") I1 = xbmc.translatePath(os.path.join('special://home', '')) O0OoOoo00o = xbmcgui.Dialog() if name.find('repo') < 0: choice = O0OoOoo00o.yesno("XBMC ISRAEL", "לחץ כן להתקנת תוסף חסר", name) else: choice = True if choice: iiI1iIiI = xbmc.translatePath( os.path.join('special://home/addons', 'packages')) iiiI11 = xbmcgui.DialogProgress() iiiI11.create("XBMC ISRAEL", "Downloading ", '', 'Please Wait') OOooO = os.path.join(iiI1iIiI, 'isr.zip') try: os.remove(OOooO) except: pass downloader.download(url, OOooO, iiiI11) II111iiii = xbmc.translatePath(os.path.join('special://home', 'addons')) iiiI11.update(0, "", "Extracting Zip Please Wait") print '=======================================' print II111iiii print '=======================================' extract.all(OOooO, II111iiii, iiiI11) iiiI11.update(0, "", "Downloading") iiiI11.update(0, "", "Extracting Zip Please Wait") xbmc.executebuiltin('UpdateLocalAddons ') xbmc.executebuiltin("UpdateAddonRepos") if 96 - 96: i1IIi.ii1IiI1i * iiiIIii1I1Ii % i111I if 60 - 60: iII11iiIII111 * IIIiiIIii % IIIiiIIii % O00oOoOoO0o0O * i11i + i1IIi
def RESTORE_EMAIL_FILE(ZIPFILE): if 'addons.zip' in ZIPFILE: DIR = ADDONS to_backup = ADDONS else: DIR = ADDON_DATA dp.create("USB BACKUP/RESTORE", "Checking ", '', 'Please Wait') import time dp.update(0, "", "Extracting Zip Please Wait") extract.all(ZIPFILE, DIR, dp) time.sleep(1) Fusion_Installer() xbmc.executebuiltin('UpdateLocalAddons ') xbmc.executebuiltin("UpdateAddonRepos") Kodi17() dialog.ok("USB BACKUP/RESTORE", "You Are Now Restored", 'If New Updates Dont Come Through Reboot Kodi', 'A Couple Times & Manually Update Plugins') xbmc.executebuiltin('UpdateLocalAddons ') xbmc.executebuiltin("UpdateAddonRepos")
def RESTORE(): import time dialog = xbmcgui.Dialog() if zip == '' and ADDON.getSetting('email') == '': dialog.ok( 'USB BACKUP/RESTORE', 'You have not set your ZIP Folder.\nPlease update the addon settings and try again.', '', '') ADDON.openSettings(sys.argv[0]) lib = xbmc.translatePath(os.path.join(zip, 'backup.zip')) READ_ZIP(lib) dp.create("USB BACKUP/RESTORE", "Checking ", '', 'Please Wait') HOME = xbmc.translatePath(os.path.join('special://', 'home')) dp.update(0, "", "Extracting Zip Please Wait") extract.all(lib, HOME, dp) time.sleep(1) Fusion_Installer() xbmc.executebuiltin('UpdateLocalAddons ') xbmc.executebuiltin("UpdateAddonRepos") time.sleep(1) xbmc.executebuiltin('UnloadSkin()') xbmc.executebuiltin('ReloadSkin()') Kodi17() dialog.ok("USB BACKUP/RESTORE", "PLEASE REBOOT YOUR BOX IF HOMESCREEN HAS NOT CHANGED", "", "") xbmc.executebuiltin("LoadProfile(Master user)")
def wizard(name, url, description): path = xbmc.translatePath(os.path.join('special://home/addons', 'packages')) dp = xbmcgui.DialogProgress() dp.create("phenon", "Downloading ", '', 'Please Wait') lib = os.path.join(path, name + '.zip') try: os.remove(lib) except: pass downloader.download(url, lib, dp) addonfolder = xbmc.translatePath(os.path.join('special://', 'home')) time.sleep(2) dp.update(0, "", "Extracting Zip") print '=======================================' print addonfolder print '=======================================' extract.all(lib, addonfolder, dp) dialog = xbmcgui.Dialog() dialog.ok( "DOWNLOAD COMPLETE", 'Unfortunately the only way to get the new changes to stick is', 'to force close kodi. Click ok to force Kodi to close,', 'DO NOT use the quit/exit options in Kodi., If the Force close does not close for some reason please Restart Device or kill task manaully' ) killxbmc()
def HUBINSTALL(name, url, script): a_list = [] script_url = url link = kodi.open_url(script_url) matcher = script + '-(.+?).zip' match = re.compile(matcher).findall(link) for version in match: a_list.append(version) a_list.sort(cmp=ver_cmp, reverse=True) newest_v = script + '-' + a_list[0] newest_v_url = script_url + script + '-' + a_list[0] + '.zip' kodi.log("Looking for : " + newest_v_url) path = xbmc.translatePath(os.path.join('special://home', 'addons', 'packages')) dp = xbmcgui.DialogProgress() dp.create("Starting up", "Initializing ", '', 'Please Stand By....') # lib = os.path.join(path, name + '.zip') lib = os.path.join(path, newest_v + '.zip') addonfolder = xbmc.translatePath(os.path.join('special://', 'home', 'addons')) if os.path.exists(lib): os.remove(lib) downloader.download(newest_v_url, lib, dp, timeout=120) try: # xbmc.executebuiltin("InstallAddon(%s)" % newest_v) extract.all(lib, addonfolder, '') time.sleep(2) except IOError as e: kodi.message("Failed to open required files", "Error is: ", str(e)) return False
def extract_file(file): time.sleep(1) if not os.path.exists( xbmc.translatePath(destination) ): os.makedirs( xbmc.translatePath(destination) ) dprogress.create("EXTRACTING","","Initializing") zippath = xbmc.translatePath(destination) dprogress.update(0,filename,"This can take some time, please be patient." ) extract.all(file, zippath, dprogress) time.sleep(1)
def RESTORE_ZIP_FILE(url): if zip == '': dialog.ok('USB BACKUP/RESTORE','You have not set your ZIP Folder.\nPlease update the addon settings and try again.','','') ADDON.openSettings(sys.argv[0]) if 'addons' in url: ZIPFILE = xbmc.translatePath(os.path.join(USB,'addons.zip')) DIR = ADDONS to_backup = ADDONS backup_zip = xbmc.translatePath(os.path.join(USB,'addons.zip')) else: ZIPFILE = xbmc.translatePath(os.path.join(USB,'addon_data.zip')) DIR = ADDON_DATA if 'Backup' in name: DeletePackages() import zipfile import sys dp.create("USB BACKUP/RESTORE","Backing Up",'', 'Please Wait') zipobj = zipfile.ZipFile(ZIPFILE , 'w', zipfile.ZIP_DEFLATED) rootlen = len(DIR) for_progress = [] ITEM =[] for base, dirs, files in os.walk(DIR): for file in files: ITEM.append(file) N_ITEM =len(ITEM) for base, dirs, files in os.walk(DIR): for file in files: for_progress.append(file) progress = len(for_progress) / float(N_ITEM) * 100 dp.update(int(progress),"Backing Up",'[COLOR yellow]%s[/COLOR]'%file, 'Please Wait') fn = os.path.join(base, file) if not 'temp' in dirs: if not 'plugin.video.usbwizard' in dirs: import time C**T= '01/01/1980' FILE_DATE=time.strftime('%d/%m/%Y', time.gmtime(os.path.getmtime(fn))) if FILE_DATE > C**T: zipobj.write(fn, fn[rootlen:]) zipobj.close() dp.close() dialog.ok("USB BACKUP/RESTORE", "You Are Now Backed Up", '','') else: dp.create("USB BACKUP/RESTORE","Checking ",'', 'Please Wait') import time dp.update(0,"", "Extracting Zip Please Wait") extract.all(ZIPFILE,DIR,dp) time.sleep(1) XfinityInstaller() xbmc.executebuiltin('UpdateLocalAddons ') xbmc.executebuiltin("UpdateAddonRepos") dialog.ok("USB BACKUP/RESTORE", "You Are Now Restored", '','')
def downloadLogos(url, path, zipfile): import download import extract DialogOK('Some new logos are available.', 'They will be downloaded and added to your logopack.') download.download(url, zipfile) extract.all(zipfile, path, dp='Installing logo update') sfile.remove(zipfile)
def downloadLogos(url, path, zipfile): import download import extract utils.DialogOK('Algunos de los nuevos logotipos están disponibles.', 'Pueden ser descargados y añadidos a su logopack.') download.download(url, zipfile) extract.all(zipfile, path, dp='Installing logo update') sfile.remove(zipfile)
def unziper(zipfile,last_commit): progresso.create('SportsDevil-Fixes', "Unziping git master" ,'Please wait...') import extract extract.all(lib,path) progresso.update(25,"Unziping git master","Done.") progresso.update(30,"Copying to addons dir","Please wait...") copy(last_commit)
def downloadSkins(url, path, zipfile): import download import extract utils.DialogOK('Una nueva version actualizada está disponible.', 'Se puede descargar e instalar "," en su sistema GVAX.') download.download(url, zipfile) extract.all(zipfile, path, dp='Installing skin update') sfile.remove(zipfile)