def XvbmcPiReset(url): if dialog.yesno(resetos +' [B]- Pi[/B] image', resetosdl +'; reset to Jarvis v[B]16.1[/B]?','','(...enig [B]geduld[/B] is vereist, please be patient...)',nolabel='Nee, No',yeslabel='Ja, Yes'): url=base64.b64decode(locate)+'s/GRc7wabLgVRdMDF/download' #MdZoWzbgwXQfwIB=XvBMC31final // #GRc7wabLgVRdMDF =LibreELEC702 path = xbmc.translatePath(os.path.join('/storage/.restore/','')) if not os.path.exists(path): os.makedirs(path) lib=os.path.join(path, bestand+'.tar') try: os.remove(lib) except: pass downloader.download(url, lib) time.sleep(2) dialog.ok(MainTitle +'[B]- Pi[/B]', resetos +' done.', herstart, forceersluiten) Common.killKodi()
def XvbmcPi31(url): #upgrade31 if dialog.yesno(upgrade31 +' [B]- Pi[/B] image', upgrade31dl +' [COLOR=white]image?[/COLOR]',nolabel='Nee, No',yeslabel='Ja, Yes'): url=base64.b64decode(locate)+'s/MdZoWzbgwXQfwIB/download' # MdZoWzbgwXQfwIB=XvBMC31final // GRc7wabLgVRdMDF =LibreELEC702 path = xbmc.translatePath(os.path.join('/storage/.restore/','')) if not os.path.exists(path): os.makedirs(path) lib=os.path.join(path, bestand+'.tar') try: os.remove(lib) except: pass downloader.download(url, lib) time.sleep(2) dialog.ok(MainTitle +'[B]- Pi[/B]', upgrade31 +' done.', herstart, forceersluiten) Common.killKodi()
def Fix_Special(url): HOME = xbmc.translatePath('special://home') dp.create(MainTitle, "Renaming paths...", '', 'Please Wait') for root, dirs, files in os.walk(HOME): for file in files: if file.endswith(".xml"): dp.update(0, "Fixing", "[COLOR green]" + file + "[/COLOR]", "Please wait.....") a = open((os.path.join(root, file))).read() b = a.replace(HOME, 'special://home/') f = open((os.path.join(root, file)), mode='w') f.write(str(b)) f.close() dialog.ok(MainTitle, 'All physical (home) paths have been converted to special', 'To complete this process Kodi will force close now!') Common.killKodi()
def XvbmcPcReset(url): if dialog.yesno(resetos +' - Portable', resetosdl +'; reset to default[B]?[/B]','','(...enig [B]geduld[/B] is vereist, please be patient...)',nolabel='Nee, No',yeslabel='Ja, Yes'): url=base64.b64decode(locate)+'s/KhEZaBn8fLbDo5Q/download' #KhEZaBn8fLbDo5Q =xvbmcresettest path = xbmc.translatePath(os.path.join('special://home/','temp')) addonpath = xbmc.translatePath(os.path.join('special://home/','addons')) userpath = xbmc.translatePath(os.path.join('special://home/','userdata')) mediapath = xbmc.translatePath(os.path.join('special://home/','media')) if not os.path.exists(path): os.makedirs(path) lib=os.path.join(path, bestand+'.zip') try: os.remove(lib) except: pass downloader.download(url, lib) if os.path.exists(lib): dp = xbmcgui.DialogProgress() dp.create("XvBMC Nederland (dutch)","XvBMC-NL: doing some crazy ass VOODOO...",'', '[COLOR dimgray](format C:[B] ;-p [/B]*please wait*)[/COLOR]') Common.removefolder(addonpath, 'script.xvbmc.update') Common.removefolder(userpath, 'script.xvbmc.update') Common.removefolder(mediapath, 'script.xvbmc.update') dp.update(0,"", "now really going medieval on your ass") addonfolder = xbmc.translatePath(os.path.join('special://','home')) time.sleep(2) dp = xbmcgui.DialogProgress() dp.create("XvBMC Nederland - UGRADER","XvBMC-NL: doing some upgrading VOODOO...",'', 'Please Wait') dp.update(0,"", "*Extracting ZiP Please Wait*") extract.all(lib,addonfolder,dp) dp.close() try: os.remove(lib) except: pass for root, dirs, files in os.walk(xbmc.translatePath('special://thumbnails')): file_count = 0 file_count += len(files) if file_count > 0: for f in files: try: os.unlink(os.path.join(root, f)) except: pass dialog.ok(MainTitle +' - Portable', resetos +' done.', herstart, forceersluiten) Common.killKodi()
def autocleannow(): log("AutoCleanNOW") AutoClean = True if os.path.exists(cachePath) == True: for root, dirs, files in os.walk(cachePath): file_count = 0 file_count += len(files) if file_count > 0: for f in files: try: if (f.endswith(".log")): continue os.unlink(os.path.join(root, f)) except: pass for d in dirs: try: checker = (os.path.join(root, d)) if not "archive_cache" in str(checker): shutil.rmtree(os.path.join(root, d)) except: pass else: pass if os.path.exists(tempPath) == True: for root, dirs, files in os.walk(tempPath): file_count = 0 file_count += len(files) if file_count > 0: for f in files: try: if (f.endswith(".log")): continue os.unlink(os.path.join(root, f)) except: pass for d in dirs: try: checker = (os.path.join(root, d)) if not "archive_cache" in str(checker): shutil.rmtree(os.path.join(root, d)) except: pass else: pass if xbmc.getCondVisibility('system.platform.ATV2'): atv2_cache_a = os.path.join( '/private/var/mobile/Library/Caches/AppleTV/Video/', 'Other') for root, dirs, files in os.walk(atv2_cache_a): file_count = 0 file_count += len(files) if file_count > 0: for f in files: try: if (f.endswith(".log")): continue os.unlink(os.path.join(root, f)) except: pass for d in dirs: try: checker = (os.path.join(root, d)) if not "archive_cache" in str(checker): shutil.rmtree(os.path.join(root, d)) except: pass else: pass atv2_cache_b = os.path.join( '/private/var/mobile/Library/Caches/AppleTV/Video/', 'LocalAndRental') for root, dirs, files in os.walk(atv2_cache_b): file_count = 0 file_count += len(files) if file_count > 0: for f in files: try: if (f.endswith(".log")): continue os.unlink(os.path.join(root, f)) except: pass for d in dirs: try: checker = (os.path.join(root, d)) if not "archive_cache" in str(checker): shutil.rmtree(os.path.join(root, d)) except: pass else: pass cacheEntries = setupCacheEntries() for entry in cacheEntries: clear_cache_path = xbmc.translatePath(entry.path) if os.path.exists(clear_cache_path) == True: for root, dirs, files in os.walk(clear_cache_path): file_count = 0 file_count += len(files) if file_count > 0: for f in files: try: if (f.endswith(".log")): continue os.unlink(os.path.join(root, f)) except: pass for d in dirs: try: checker = (os.path.join(root, d)) if not "archive_cache" in str(checker): shutil.rmtree(os.path.join(root, d)) except: pass else: pass if dialog.yesno( MainTitle, '[COLOR red]This option also deletes all your thumbnails...[/COLOR]', '[COLOR green]Are you sure you want to do this[B]?[/B][/COLOR]'): log("removeThumbs") removeThumbs = True if os.path.exists(thumbnailPath) == True: for root, dirs, files in os.walk(thumbnailPath): file_count = 0 file_count += len(files) if file_count > 0: for f in files: try: os.unlink(os.path.join(root, f)) except: pass else: pass else: removeThumbs = False if removeThumbs: text13 = os.path.join(databasePath, "Textures13.db") try: os.unlink(text13) except OSError: myplatform = platform() if myplatform == 'android': Common.log("XvBMC *check* -4- Android") else: Common.log("XvBMC Platform: " + str(myplatform)) try: dbcon = sqlite3.connect(text13) dbcur = dbcon.cursor() dbcur.execute('DROP TABLE IF EXISTS path') dbcur.execute('VACUUM') dbcon.commit() dbcur.execute('DROP TABLE IF EXISTS sizes') dbcur.execute('VACUUM') dbcon.commit() dbcur.execute('DROP TABLE IF EXISTS texture') dbcur.execute('VACUUM') dbcon.commit() dbcur.execute( """CREATE TABLE path (id integer, url text, type text, texture text, primary key(id))""" ) dbcon.commit() dbcur.execute( """CREATE TABLE sizes (idtexture integer,size integer, width integer, height integer, usecount integer, lastusetime text)""" ) dbcon.commit() dbcur.execute( """CREATE TABLE texture (id integer, url text, cachedurl text, imagehash text, lasthashcheck text, PRIMARY KEY(id))""" ) dbcon.commit() except: pass else: Common.log("XvBMC skipped remove thumbnails.") purgePath = xbmc.translatePath('special://home/addons/packages') for root, dirs, files in os.walk(purgePath): file_count = 0 file_count += len(files) for root, dirs, files in os.walk(purgePath): file_count = 0 file_count += len(files) if file_count > 0: try: for f in files: os.unlink(os.path.join(root, f)) for d in dirs: shutil.rmtree(os.path.join(root, d)) except: pass if AutoClean == True: log("AutoCrash") AutoCrash() else: xbmc.log(str(AutoClean)) choice = xbmcgui.Dialog().yesno( MainTitle, '[COLOR white][B]A[/B]uto [B]C[/B]lean finished:[/COLOR]', '[I]cache, crashlogs, packages & thumbnails are removed.[/I]', 'Reboot your device now to finish the process?', yeslabel='[B][COLOR green]YES[/COLOR][/B]', nolabel='[B][COLOR red]NO[/COLOR][/B]') if choice == 1: Common.killKodi()
def autocleannow(): AutoClean = True if os.path.exists(cachePath)==True: for root, dirs, files in os.walk(cachePath): file_count = 0 file_count += len(files) if file_count > 0: for f in files: try: if (f.endswith(".log")): continue os.unlink(os.path.join(root, f)) except: pass for d in dirs: try: shutil.rmtree(os.path.join(root, d)) except: pass else: pass if os.path.exists(tempPath)==True: for root, dirs, files in os.walk(tempPath): file_count = 0 file_count += len(files) if file_count > 0: for f in files: try: if (f.endswith(".log")): continue os.unlink(os.path.join(root, f)) except: pass for d in dirs: try: shutil.rmtree(os.path.join(root, d)) except: pass else: pass if xbmc.getCondVisibility('system.platform.ATV2'): atv2_cache_a = os.path.join('/private/var/mobile/Library/Caches/AppleTV/Video/', 'Other') for root, dirs, files in os.walk(atv2_cache_a): file_count = 0 file_count += len(files) if file_count > 0: for f in files: os.unlink(os.path.join(root, f)) for d in dirs: shutil.rmtree(os.path.join(root, d)) else: pass atv2_cache_b = os.path.join('/private/var/mobile/Library/Caches/AppleTV/Video/', 'LocalAndRental') for root, dirs, files in os.walk(atv2_cache_b): file_count = 0 file_count += len(files) if file_count > 0: for f in files: os.unlink(os.path.join(root, f)) for d in dirs: shutil.rmtree(os.path.join(root, d)) else: pass cacheEntries = setupCacheEntries() for entry in cacheEntries: clear_cache_path = xbmc.translatePath(entry.path) if os.path.exists(clear_cache_path)==True: for root, dirs, files in os.walk(clear_cache_path): file_count = 0 file_count += len(files) if file_count > 0: for f in files: os.unlink(os.path.join(root, f)) for d in dirs: shutil.rmtree(os.path.join(root, d)) else: pass if os.path.exists(thumbnailPath)==True: for root, dirs, files in os.walk(thumbnailPath): file_count = 0 file_count += len(files) if file_count > 0: for f in files: try: os.unlink(os.path.join(root, f)) except: pass else: pass text13 = os.path.join(databasePath,"Textures13.db") try: os.unlink(text13) except OSError: pass purgePath = xbmc.translatePath('special://home/addons/packages') dialog = xbmcgui.Dialog() for root, dirs, files in os.walk(purgePath): file_count = 0 file_count += len(files) for root, dirs, files in os.walk(purgePath): file_count = 0 file_count += len(files) if file_count > 0: for f in files: os.unlink(os.path.join(root, f)) for d in dirs: shutil.rmtree(os.path.join(root, d)) if AutoClean==True: #dialog.ok(MainTitle, "Auto Remove Crash Log Files...") AutoCrash() else: #dialog.ok(MainTitle, "Skip auto remove crash log files...") xbmc.log(str(AutoClean)) choice = xbmcgui.Dialog().yesno(MainTitle,"[COLOR white][B]A[/B]uto [B]C[/B]lean finished:[/COLOR]","[I]cache, crashlogs, packages & thumbnails are removed.[/I]","Reboot your device now to finish the process?", yeslabel='[B][COLOR green]YES[/COLOR][/B]',nolabel='[B][COLOR red]NO[/COLOR][/B]') if choice == 1: Common.killKodi()
elif mode==6: PiCCleaner() elif mode==7: forceRefresh() elif mode==8: AddonsDatabaseRemoval() elif mode==9: AboutXvBMC() elif mode==10: xbmc.executebuiltin('XBMC.RunScript(special://home/addons/script.schoonmaak/purge.py)') elif mode==11: xvbmcupdater(url) elif mode==12: Common.killKodi() elif mode==13: KODIVERSION(url) elif mode==14: closeandexit() xbmcplugin.endOfDirectory(int(sys.argv[1]))