def clearSaved(who, over=False): if who == 'all': for login in LOGINID: clearSaved(login, True) elif LOGINID[who]: file = LOGINID[who]['file'] if os.path.exists(file): os.remove(file) wiz.LogNotify('[COLOR %s]%s[/COLOR]' % (COLOR1, LOGINID[who]['name']), '[COLOR %s]API Key: Removed![/COLOR]' % COLOR2, 2000, LOGINID[who]['icon']) wiz.setS(LOGINID[who]['saved'], '') if over == False: wiz.refresh()
def clearSaved(who, over=False): if who == 'all': for login in LOGINID: clearSaved(login, True) elif LOGINID[who]: file = LOGINID[who]['file'] if os.path.exists(file): os.remove(file) wiz.LogNotify('[COLOR %s]%s[/COLOR]' % (COLOR1, LOGINID[who]['name']), '[COLOR %s]Login Info: Removed![/COLOR]' % COLOR2, 2000, LOGINID[who]['icon']) wiz.setS(LOGINID[who]['saved'], '') if over == False: wiz.refresh()
def clearSaved(who, over=False): if who == 'all': for debrid in DEBRIDID: clearSaved(debrid, True) elif DEBRIDID[who]: file = DEBRIDID[who]['file'] if os.path.exists(file): os.remove(file) wiz.LogNotify('[COLOR %s]%s[/COLOR]' % (COLOR1, DEBRIDID[who]['name']),'[COLOR %s]Datos de Real Debrid: Eliminados![/COLOR]' % COLOR2, 2000, DEBRIDID[who]['icon']) wiz.setS(DEBRIDID[who]['saved'], '') if over == False: wiz.refresh()
def clearSaved(who): if who == 'all': for trakt in TRAKTID: file = TRAKTID[trakt]['file'] if os.path.exists(file): os.remove(file) wiz.LogNotify("[COLOR %s]%s[/COLOR]" % (COLOR1, TRAKTID[trakt]['name']),'[COLOR %s]Trakt Data: Removed![/COLOR]' % COLOR2, 2000, TRAKTID[trakt]['icon']) elif TRAKTID[who]: file = TRAKTID[who]['file'] if os.path.exists(file): os.remove(file) wiz.LogNotify("[COLOR %s]%s[/COLOR]" % (COLOR1, TRAKTID[who]['name']),'[COLOR %s]Trakt Data: Removed![/COLOR]' % COLOR2, 2000, TRAKTID[who]['icon']) wiz.refresh()
def clearSaved(who): if who == 'all': for debrid in DEBRIDID: file = DEBRIDID[debrid]['file'] if os.path.exists(file): os.remove(file) wiz.LogNotify('[COLOR %s]%s[/COLOR]' % (COLOR1, DEBRIDID[debrid]['name']),'[COLOR %s]Real Debrid Data: Removed![/COLOR]' % COLOR2, 2000, DEBRIDID[debrid]['icon']) elif DEBRIDID[who]: file = DEBRIDID[who]['file'] if os.path.exists(file): os.remove(file) wiz.LogNotify('[COLOR %s]%s[/COLOR]' % (COLOR1, DEBRIDID[who]['name']),'[COLOR %s]Real Debrid Data: Removed![/COLOR]' % COLOR2, 2000, DEBRIDID[who]['icon']) wiz.refresh()
def clearSaved(who, over=False): if who == 'all': for alluc in ALLUCID: clearSaved(alluc, True) elif ALLUCID[who]: file = ALLUCID[who]['file'] if os.path.exists(file): os.remove(file) wiz.LogNotify('[COLOR %s]%s[/COLOR]' % (COLOR1, ALLUCID[who]['name']),'[COLOR %s]Alluc Data: Removed![/COLOR]' % COLOR2, 2000, ALLUCID[who]['icon']) wiz.setS(ALLUCID[who]['saved'], '') if over == False: wiz.refresh()
def clearSaved(who, over=False): if who == 'all': for debrid in DEBRIDID: clearSaved(debrid, True) elif DEBRIDID[who]: file = DEBRIDID[who]['file'] if os.path.exists(file): os.remove(file) wiz.LogNotify('[COLOR %s]%s[/COLOR]' % (COLOR1, DEBRIDID[who]['name']),'[COLOR %s]Real Debrid Data: Removed![/COLOR]' % COLOR2, 2000, DEBRIDID[who]['icon']) wiz.setS(DEBRIDID[who]['saved'], '') if over == False: wiz.refresh()
def clearSaved(who, over=False): if who == 'all': for trakt in TRAKTID: clearSaved(trakt, True) elif TRAKTID[who]: file = TRAKTID[who]['file'] if os.path.exists(file): os.remove(file) wiz.LogNotify("[COLOR %s]%s[/COLOR]" % (COLOR1, TRAKTID[who]['name']),'[COLOR %s]Trakt Data: Removed![/COLOR]' % COLOR2, 2000, TRAKTID[who]['icon']) wiz.setS(TRAKTID[who]['saved'], '') if over == False: wiz.refresh()
def clearSaved(who, over=False): if who == 'all': for trakt in TRAKTID: clearSaved(trakt, True) elif TRAKTID[who]: file = TRAKTID[who]['file'] if os.path.exists(file): os.remove(file) wiz.LogNotify("[COLOR %s]%s[/COLOR]" % (COLOR1, TRAKTID[who]['name']),'[COLOR %s]Trakt Data: Removed![/COLOR]' % COLOR2, 2000, TRAKTID[who]['icon']) wiz.setS(TRAKTID[who]['saved'], '') if over == False: wiz.refresh()
def clearSaved(who): if who == 'all': for login in LOGINID: file = LOGINID[login]['file'] if os.path.exists(file): os.remove(file) wiz.LogNotify( '[COLOR %s]%s[/COLOR]' % (COLOR1, LOGINID[login]['name']), '[COLOR %s]Login Data: Removed![/COLOR]' % COLOR2, 2000, LOGINID[login]['icon']) elif LOGINID[who]: file = LOGINID[who]['file'] if os.path.exists(file): os.remove(file) wiz.LogNotify('[COLOR %s]%s[/COLOR]' % (COLOR1, LOGINID[who]['name']), '[COLOR %s]Login Data: Removed![/COLOR]' % COLOR2, 2000, LOGINID[who]['icon']) wiz.refresh()
def activateDebrid(who): if DEBRIDID[who]: if os.path.exists(DEBRIDID[who]['path']): act = DEBRIDID[who]['activate'] addonid = wiz.addonId(DEBRIDID[who]['plugin']) if act == '': addonid.openSettings() else: url = xbmc.executebuiltin(DEBRIDID[who]['activate']) else: DIALOG.ok(ADDONTITLE, '%s is not currently installed.' % DEBRIDID[who]['name']) else: wiz.refresh() return check = 0 while debridUser(who) == None: if check == 30: break check += 1 time.sleep(10) wiz.refresh()
def activateTrakt(who): if TRAKTID[who]: if os.path.exists(TRAKTID[who]['path']): act = TRAKTID[who]['activate'] addonid = wiz.addonId(TRAKTID[who]['plugin']) if act == '': addonid.openSettings() else: url = xbmc.executebuiltin(TRAKTID[who]['activate']) else: DIALOG.ok(ADDONTITLE, '%s no esta actualmente instalado.' % TRAKTID[who]['name']) else: wiz.refresh() return check = 0 while traktUser(who) == None: if check == 30: break check += 1 time.sleep(10) wiz.refresh()
def activateTrakt(who): if TRAKTID[who]: if os.path.exists(TRAKTID[who]['path']): act = TRAKTID[who]['activate'] addonid = wiz.addonId(TRAKTID[who]['plugin']) if act == '': addonid.openSettings() else: url = xbmc.executebuiltin(TRAKTID[who]['activate']) else: DIALOG.ok(ADDONTITLE, '%s is not currently installed.' % TRAKTID[who]['name']) else: wiz.refresh() return check = 0 while traktUser(who) == None: if check == 30: break check += 1 time.sleep(10) wiz.refresh()
def activateLogin(who): if LOGINID[who]: if os.path.exists(LOGINID[who]['path']): act = LOGINID[who]['activate'] addonid = wiz.addonId(LOGINID[who]['plugin']) if act == '': addonid.openSettings() else: url = xbmc.executebuiltin(LOGINID[who]['activate']) else: DIALOG.ok(ADDONTITLE, '%s no esta instalado.' % LOGINID[who]['name']) else: wiz.refresh() return check = 0 while loginUser(who) == None or loginUser(who) == "": if check == 30: break check += 1 time.sleep(10) wiz.refresh()
def activateTrakt(who): if TRAKTID[who]: if os.path.exists(TRAKTID[who]['path']): act = TRAKTID[who]['activate'] addonid = wiz.addonId(TRAKTID[who]['plugin']) if act == '': addonid.openSettings() else: url = xbmc.executebuiltin(TRAKTID[who]['activate']) else: DIALOG.ok("[COLOR %s]%s[/COLOR]" % (COLOR1, ADDONTITLE), '%s is not currently installed.' % TRAKTID[who]['name']) else: wiz.refresh() return check = 0 while traktUser(who) == None: if check == 30: break check += 1 time.sleep(10) wiz.refresh()
def updateDebrid(do, who): file = DEBRIDID[who]['file'] settings = DEBRIDID[who]['settings'] data = DEBRIDID[who]['data'] addonid = wiz.addonId(DEBRIDID[who]['plugin']) saved = DEBRIDID[who]['saved'] default = DEBRIDID[who]['default'] user = addonid.getSetting(default) suser = wiz.getS(saved) name = DEBRIDID[who]['name'] icon = DEBRIDID[who]['icon'] if do == 'update': if not user == '': with open(file, 'w') as f: for debrid in data: f.write('<debrid>\n\t<id>%s</id>\n\t<value>%s</value>\n</debrid>\n' % (debrid, addonid.getSetting(debrid))) f.close() user = addonid.getSetting(default) wiz.setS(saved, user) wiz.LogNotify("[COLOR %s]%s[/COLOR]" % (COLOR1, name), '[COLOR %s]Real Debrid Data: Saved![/COLOR]' % COLOR2, 2000, icon) else: wiz.LogNotify("[COLOR %s]%s[/COLOR]" % (COLOR1, name), '[COLOR %s]Real Debrid Data: Not Registered![/COLOR]' % COLOR2, 2000, icon) elif do == 'restore': if os.path.exists(file): f = open(file,mode='r'); g = f.read().replace('\n','').replace('\r','').replace('\t',''); f.close(); match = re.compile('<debrid><id>(.+?)</id><value>(.+?)</value></debrid>').findall(g) if len(match) > 0: for debrid, value in match: addonid.setSetting(debrid, value) user = addonid.getSetting(default) wiz.setS(saved, user) wiz.LogNotify("[COLOR %s]%s[/COLOR]" % (COLOR1, name), '[COLOR %s]Real Debrid: Restored![/COLOR]' % COLOR2, 2000, icon) #else: wiz.LogNotify(name,'Real Debrid Data: [COLOR red]Not Found![/COLOR]', 2000, icon) elif do == 'clearaddon': wiz.log('%s SETTINGS: %s' % (name, settings), xbmc.LOGDEBUG) if os.path.exists(settings): f = open(settings,"r"); lines = f.readlines(); f.close() f = open(settings,"w") for line in lines: match = re.compile('<setting.+?id="(.+?)".+?/>').findall(line) if len(match) == 0: f.write(line) elif match[0] not in data: f.write(line) else: wiz.log('[Debrid Clear Addon] Removing Line: %s' % line, xbmc.LOGNOTICE) f.close() wiz.LogNotify("[COLOR %s]%s[/COLOR]" % (COLOR1, name), '[COLOR %s]Addon Data: Cleared![/COLOR]' % COLOR2, 2000, icon) else: wiz.LogNotify("[COLOR %s]%s[/COLOR]" % (COLOR1, name), '[COLOR %s]Addon Data: Clear Failed![/COLOR]' % COLOR2, 2000, icon) wiz.refresh()
def activateDebrid(who): if DEBRIDID[who]: if os.path.exists(DEBRIDID[who]['path']): act = DEBRIDID[who]['activate'] addonid = wiz.addonId(DEBRIDID[who]['plugin']) if act == '': addonid.openSettings() else: url = xbmc.executebuiltin(DEBRIDID[who]['activate']) else: DIALOG.ok(ADDONTITLE, '%s no esta actualmente instalado.' % DEBRIDID[who]['name']) else: wiz.refresh() return check = 0 while debridUser(who) == None: if check == 30: break check += 1 time.sleep(10) wiz.refresh()
def activateLogin(who): if LOGINID[who]: if os.path.exists(LOGINID[who]['path']): act = LOGINID[who]['activate'] addonid = wiz.addonId(LOGINID[who]['plugin']) if act == '': addonid.openSettings() else: url = xbmc.executebuiltin(LOGINID[who]['activate']) else: DIALOG.ok(ADDONTITLE, '%s no esta instalado.' % LOGINID[who]['name']) else: wiz.refresh() return check = 0 while loginUser(who) == None or loginUser(who) == "": if check == 30: break check += 1 time.sleep(10) wiz.refresh()
match = wiz.parseDOM(line, 'setting', ret='id') if len(match) == 0: f.write(line) else: if match[0] not in data: f.write(line) else: wiz.log('Removing Line: %s' % line, xbmc.LOGNOTICE) f.close() wiz.LogNotify( "[COLOR %s]%s[/COLOR]" % (COLOR1, name), '[COLOR %s]Addon Data: Cleared![/COLOR]' % COLOR2, 2000, icon) except Exception, e: wiz.log( "[Debrid Info] Unable to Clear Addon %s (%s)" % (who, str(e)), xbmc.LOGERROR) wiz.refresh() def autoUpdate(who): if who == 'all': for log in DEBRIDID: if os.path.exists(DEBRIDID[log]['path']): autoUpdate(log) elif DEBRIDID[who]: if os.path.exists(DEBRIDID[who]['path']): u = debridUser(who) su = wiz.getS(DEBRIDID[who]['saved']) n = DEBRIDID[who]['name'] if u == None or u == '': return elif su == '': debridIt('update', who) elif not u == su:
wiz.log('%s SETTINGS: %s' % (name, settings), xbmc.LOGDEBUG) if os.path.exists(settings): try: f = open(settings, "r"); lines = f.readlines(); f.close() f = open(settings, "w") for line in lines: match = wiz.parseDOM(line, 'setting', ret='id') if len(match) == 0: f.write(line) else: if match[0] not in data: f.write(line) else: wiz.log('Removing Line: %s' % line, xbmc.LOGNOTICE) f.close() wiz.LogNotify("[COLOR %s]%s[/COLOR]" % (COLOR1, name),'[COLOR %s]Addon Data: Cleared![/COLOR]' % COLOR2, 2000, icon) except Exception, e: wiz.log("[Trakt Data] Unable to Clear Addon %s (%s)" % (who, str(e)), xbmc.LOGERROR) wiz.refresh() def autoUpdate(who): if who == 'all': for log in TRAKTID: if os.path.exists(TRAKTID[log]['path']): autoUpdate(log) elif TRAKTID[who]: if os.path.exists(TRAKTID[who]['path']): u = traktUser(who) su = wiz.getS(TRAKTID[who]['saved']) n = TRAKTID[who]['name'] if u == None or u == '': return elif su == '': traktIt('update', who) elif not u == su: if DIALOG.yesno(ADDONTITLE, "[COLOR %s]Would you like to save the [COLOR %s]Trakt Data[/COLOR] for [COLOR %s]%s[/COLOR]?" % (COLOR2, COLOR1, COLOR1, n), "Addon: [COLOR springgreen][B]%s[/B][/COLOR]" % u, "Saved:[/COLOR] [COLOR red][B]%s[/B][/COLOR]" % su if not su == '' else 'Saved:[/COLOR] [COLOR red][B]None[/B][/COLOR]', yeslabel="[B][COLOR springgreen]Save Data[/COLOR][/B]", nolabel="[B][COLOR red]No Cancel[/COLOR][/B]"):