def doNormalInstall(self): wiz.log("[Check Updates] [Installed Version: %s] [Current Version: %s] [User Selected: Normal Install build]" % (BUILDVERSION, LATESTVERSION), xbmc.LOGNOTICE) wiz.log("[Check Updates] [Next Check: %s]" % str(NEXTCHECK), xbmc.LOGNOTICE) wiz.setS('lastbuildcheck', str(NEXTCHECK)) self.close() url = 'plugin://%s/?mode=install&name=%s&url=normal' % (ADDON_ID, urllib.quote_plus(BUILDNAME)) xbmc.executebuiltin('RunPlugin(%s)' % url)
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 == '': try: 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]Datos de Real Debrid: Guardados![/COLOR]' % COLOR2, 2000, icon) except Exception, e: wiz.log("[Real Debrid Data] Unable to Update %s (%s)" % (who, str(e)), xbmc.LOGERROR) else: wiz.LogNotify("[COLOR %s]%s[/COLOR]" % (COLOR1, name), '[COLOR %s]Datos de Real Debrid: No registrado![/COLOR]' % COLOR2, 2000, icon)
def updateTrakt(do, who): file = TRAKTID[who]['file'] settings = TRAKTID[who]['settings'] data = TRAKTID[who]['data'] addonid = wiz.addonId(TRAKTID[who]['plugin']) saved = TRAKTID[who]['saved'] default = TRAKTID[who]['default'] user = addonid.getSetting(default) suser = wiz.getS(saved) name = TRAKTID[who]['name'] icon = TRAKTID[who]['icon'] if do == 'update': if not user == '': try: with open(file, 'w') as f: for trakt in data: f.write('<trakt>\n\t<id>%s</id>\n\t<value>%s</value>\n</trakt>\n' % (trakt, addonid.getSetting(trakt))) f.close() user = addonid.getSetting(default) wiz.setS(saved, user) wiz.LogNotify("[COLOR %s]%s[/COLOR]" % (COLOR1, name), '[COLOR %s]Trakt Data: Saved![/COLOR]' % COLOR2, 2000, icon) except Exception, e: wiz.log("[Trakt Data] Unable to Update %s (%s)" % (who, str(e)), xbmc.LOGERROR) else: wiz.LogNotify("[COLOR %s]%s[/COLOR]" % (COLOR1, name), '[COLOR %s]Trakt Data: Not Registered![/COLOR]' % COLOR2, 2000, icon)
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 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 onClick(self, controlId): if controlId == self.okbutton: self.close() for item in self.controllist: at = self.controllist.index(item) if self.getControl(item).isSelected(): wiz.setS(self.controlsettings[at], 'true') else: wiz.setS(self.controlsettings[at], 'false') if self.getControl(self.whitelist).isSelected() and not self.whitelistcurrent == 'true': wiz.whiteList('edit')
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 checkUpdate(): BUILDNAME = wiz.getS('buildname') BUILDVERSION = wiz.getS('buildversion') link = wiz.openURL(BUILDFILE).replace('\n','').replace('\r','').replace('\t','') match = re.compile('name="%s".+?ersion="(.+?)"' % BUILDNAME).findall(link) if len(match) > 0: version = match[0] wiz.setS('latestversion', version) if version > BUILDVERSION: notify.updateWindow() else: wiz.log("[Check Updates] [Installed Version: %s] [Current Version: %s]" % (BUILDVERSION, version)) else: wiz.log("[Check Updates] ERROR: Unable to find build version in build text file")
def debridIt(do, who): if not os.path.exists(ADDONDATA): os.makedirs(ADDONDATA) if not os.path.exists(REALFOLD): os.makedirs(REALFOLD) if who == "all": if os.path.exists(PATHEXODUS): debrid_Exodus(do) if os.path.exists(PATHSPECTO): debrid_Specto(do) if os.path.exists(PATHURL): debrid_Url(do) wiz.setS('debridlastsave', str(THREEDAYS)) else: if who == "exodus" and os.path.exists(PATHEXODUS): debrid_Exodus(do) if who == "specto" and os.path.exists(PATHSPECTO): debrid_Specto(do) if who == "url" and os.path.exists(PATHURL): debrid_Url(do)
def loginIt(do, who): if not os.path.exists(ADDONDATA): os.makedirs(ADDONDATA) if not os.path.exists(LOGINFOLD): os.makedirs(LOGINFOLD) if who == 'all': for log in ORDER: if os.path.exists(LOGINID[log]['path']): updateLogin(do, log) else: wiz.log('[Login Data] %s(%s) is not installed' % (LOGINID[log]['name'],LOGINID[log]['plugin'])) wiz.setS('loginlastsave', str(THREEDAYS)) else: if LOGINID[who]: if os.path.exists(LOGINID[who]['path']): updateLogin(do, who) else: wiz.log('[Login Data] Invalid Entry: %s' % who)
def traktIt(do, who): if not os.path.exists(ADDONDATA): os.makedirs(ADDONDATA) if not os.path.exists(TRAKTFOLD): os.makedirs(TRAKTFOLD) if who == 'all': for log in ORDER: if os.path.exists(TRAKTID[log]['path']): updateTrakt(do, log) else: wiz.log('[Trakt Data] %s(%s) is not installed' % (TRAKTID[log]['name'],TRAKTID[log]['plugin'])) wiz.setS('traktlastsave', str(THREEDAYS)) else: if TRAKTID[who]: if os.path.exists(TRAKTID[who]['path']): updateTrakt(do, who) else: wiz.log('[Trakt Data] Invalid Entry: %s' % who)
def debridIt(do, who): if not os.path.exists(ADDONDATA): os.makedirs(ADDONDATA) if not os.path.exists(REALFOLD): os.makedirs(REALFOLD) if who == 'all': for log in ORDER: if os.path.exists(DEBRIDID[log]['path']): updateDebrid(do, log) else: wiz.log('[Real Debrid Data] %s(%s) is not installed' % (DEBRIDID[log]['name'],DEBRIDID[log]['plugin'])) wiz.setS('debridlastsave', str(THREEDAYS)) else: if DEBRIDID[who]: if os.path.exists(DEBRIDID[who]['path']): updateDebrid(do, who) else: wiz.log('[Real Debrid Data] Invalid Entry: %s' % who)
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): addonlist = {'exodus':'exodus_debrid', 'specto':'specto_debrid', 'url':'url_debrid'} if who == 'all': for debrid in addonlist: file = os.path.join(REALFOLD, addonlist[debrid]) if os.path.exists(file): os.remove(file) wiz.setS('urlresolver' if debrid == 'url' else str('real'+debrid), '') wiz.LogNotify(debrid.upper(),'Real Debrid Data: [COLOR green]Removed![/COLOR]', 2000, os.path.join(eval('PATH'+debrid.replace('real', '').upper()),'icon.png')) else: file = os.path.join(REALFOLD, addonlist[who]) if os.path.exists(file): os.remove(file) wiz.setS('urlresolver' if who == 'url' else str('real'+who), '') wiz.LogNotify(who.upper().replace('real', ''),'Real Debrid Data: [COLOR green]Removed![/COLOR]', 2000, os.path.join(eval('PATH'+who.replace('real', '').upper()),'icon.png')) xbmc.executebuiltin('Container.Refresh')
def onClick(self, controlId): if controlId == self.okbutton: self.close() for item in self.controllist: at = self.controllist.index(item) if self.getControl(item).isSelected(): wiz.setS(self.controlsettings[at], 'true') else: wiz.setS(self.controlsettings[at], 'false') if self.getControl(self.whitelist).isSelected( ) and not self.whitelistcurrent == 'true': wiz.whiteList('edit')
def clearSaved(who): addonlist = {'salts':'salts_trakt', 'saltshd':'saltshd_trakt', 'exodus':'exodus_trakt', 'royalwe':'royalwe_trakt', 'velocity':'velocity_trakt', 'velocitykids':'velocitykids_trakt', 'trakt':'trakt_trakt', 'specto':'specto_trakt'} if who == 'all': for trakt in addonlist: file = os.path.join(TRAKTFOLD, addonlist[trakt]) if os.path.exists(file): os.remove(file) wiz.setS(trakt, '') wiz.LogNotify(trakt.upper(),'Trakt Data: [COLOR green]Removed![/COLOR]', 2000, os.path.join(eval('PATH'+trakt.upper()),'icon.png')) else: file = os.path.join(TRAKTFOLD, addonlist[who]) if os.path.exists(file): os.remove(file) wiz.setS(who, '') wiz.LogNotify(who.upper(),'Trakt Data: [COLOR green]Removed![/COLOR]', 2000, os.path.join(eval('PATH'+who.upper()),'icon.png')) xbmc.executebuiltin('Container.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 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 Data: 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]Debrid Info: Removed![/COLOR]' % COLOR2, 2000, DEBRIDID[who]['icon']) wiz.setS(DEBRIDID[who]['saved'], '') if over == False: wiz.refresh()
def debridIt(do, who): if not os.path.exists(ADDONDATA): os.makedirs(ADDONDATA) if not os.path.exists(REALFOLD): os.makedirs(REALFOLD) if who == 'all': for log in ORDER: if os.path.exists(DEBRIDID[log]['path']): updateDebrid(do, log) else: wiz.log('[Real Debrid Data] %s(%s) is not installed' % (DEBRIDID[log]['name'], DEBRIDID[log]['plugin'])) wiz.setS('debridlastsave', str(THREEDAYS)) else: if DEBRIDID[who]: if os.path.exists(DEBRIDID[who]['path']): updateDebrid(do, who) else: wiz.log('[Real Debrid Data] Invalid Entry: %s' % who)
def loginIt(do, who): if not os.path.exists(ADDONDATA): os.makedirs(ADDONDATA) if not os.path.exists(LOGINFOLD): os.makedirs(LOGINFOLD) if who == 'all': for log in ORDER: if os.path.exists(LOGINID[log]['path']): updateLogin(do, log) else: wiz.log('[Login Data] %s(%s) is not installed' % (LOGINID[log]['name'], LOGINID[log]['plugin'])) wiz.setS('loginlastsave', str(THREEDAYS)) else: if LOGINID[who]: if os.path.exists(LOGINID[who]['path']): updateLogin(do, who) else: wiz.log('[Login Data] Invalid Entry: %s' % who)
def checkUpdate(): BUILDNAME = wiz.getS('buildname') BUILDVERSION = wiz.getS('buildversion') link = wiz.openURL(BUILDFILE).replace('\n','').replace('\r','').replace('\t','') match = re.compile('name="%s".+?ersion="(.+?)".+?con="(.+?)".+?anart="(.+?)"' % BUILDNAME).findall(link) if len(match) > 0: version = match[0][0] icon = match[0][1] fanart = match[0][2] wiz.setS('latestversion', version) if version > BUILDVERSION: if DISABLEUPDATE == 'false': wiz.log("[Check Updates] [Installierte Version: %s] [Aktuelle Version: %s] Offne Update Fenster" % (BUILDVERSION, version), xbmc.LOGNOTICE) notify.updateWindow(BUILDNAME, BUILDVERSION, version, icon, fanart) else: wiz.log("[Check Updates] [Installierte Version: %s] [Aktuelle Version: %s] Offne Update Fenster deaktiviert" % (BUILDVERSION, version), xbmc.LOGNOTICE) else: wiz.log("[Check Updates] [Installierte Version: %s] [Aktuelle Version: %s]" % (BUILDVERSION, version), xbmc.LOGNOTICE) else: wiz.log("[Check Updates] FEHLER: Kann die Build Version nicht in der Build Text Datei finden", xbmc.LOGERROR)
def checkUpdate(): BUILDNAME = wiz.getS('buildname') BUILDVERSION = wiz.getS('buildversion') link = wiz.openURL(BUILDFILE).replace('\n','').replace('\r','').replace('\t','') match = re.compile('name="%s".+?ersion="(.+?)".+?con="(.+?)".+?anart="(.+?)"' % BUILDNAME).findall(link) if len(match) > 0: version = match[0][0] icon = match[0][1] fanart = match[0][2] wiz.setS('latestversion', version) if version > BUILDVERSION: if DISABLEUPDATE == 'false': wiz.log("[Check Updates] [Installed Version: %s] [Current Version: %s] Opening Update Window" % (BUILDVERSION, version), xbmc.LOGNOTICE) notify.updateWindow(BUILDNAME, BUILDVERSION, version, icon, fanart) else: wiz.log("[Check Updates] [Installed Version: %s] [Current Version: %s] Update Window Disabled" % (BUILDVERSION, version), xbmc.LOGNOTICE) else: wiz.log("[Check Updates] [Installed Version: %s] [Current Version: %s]" % (BUILDVERSION, version), xbmc.LOGNOTICE) else: wiz.log("[Check Updates] ERROR: Unable to find build version in build text file", xbmc.LOGERROR)
def onClick(self, controlId): if controlId == self.okbutton: self.close() url = 'plugin://%s/?mode=builds' % ADDON_ID xbmc.executebuiltin('ActivateWindow(10025, "%s", return)' % url) for item in self.controllist: at = self.controllist.index(item) if self.getControl(item).isSelected(): wiz.setS(self.controlsettings[at], 'true') else: wiz.setS(self.controlsettings[at], 'false') if self.getControl(self.whitelist).isSelected( ) and not self.whitelistcurrent == 'true': wiz.whiteList('edit')
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 checkUpdate(): BUILDNAME = wiz.getS('buildname') BUILDVERSION = wiz.getS('buildversion') link = wiz.openURL(BUILDFILE).replace('\n','').replace('\r','').replace('\t','') match = re.compile('name="%s".+?ersion="(.+?)".+?con="(.+?)".+?anart="(.+?)"' % BUILDNAME).findall(link) if len(match) > 0: version = match[0][0] icon = match[0][1] fanart = match[0][2] wiz.setS('latestversion', version) if version > BUILDVERSION: if DISABLEUPDATE == 'false': wiz.log("[Verificar Atualizacoes] [Versao Instalada: %s] [Versao Atual: %s] Abrindo a Janela de Atualizacao" % (BUILDVERSION, version), xbmc.LOGNOTICE) notify.updateWindow(BUILDNAME, BUILDVERSION, version, icon, fanart) else: wiz.log("[Verificar Atualizacoes] [Versao Instalada: %s] [Versao Atual: %s] Abrindo a Janela de Atualizacao" % (BUILDVERSION, version), xbmc.LOGNOTICE) else: wiz.log("[Verificar Atualizacoes] [Versao Instalada: %s] [Versao Atual: %s]" % (BUILDVERSION, version), xbmc.LOGNOTICE) else: wiz.log("[Verificar Atualizacoes] ERRO: Nao e possivel encontrar a versao de compilacao da BUILD no arquivo de texto", xbmc.LOGERROR)
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(name,'Real Debrid Data: [COLOR green]Saved![/COLOR]', 2000, icon) else: wiz.LogNotify(name,'Real Debrid Data: [COLOR red]Not Registered![/COLOR]', 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(name,'Real Debrid: [COLOR green]Restored![/COLOR]', 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)) 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) f.close() wiz.LogNotify(name,'Addon Data: [COLOR green]Cleared![/COLOR]', 2000, icon) else: wiz.LogNotify(name,'Addon Data: [COLOR red]Clear Failed![/COLOR]', 2000, icon) xbmc.executebuiltin('Container.Refresh')
def updateTrakt(do, who): file = TRAKTID[who]['file'] settings = TRAKTID[who]['settings'] data = TRAKTID[who]['data'] addonid = wiz.addonId(TRAKTID[who]['plugin']) saved = TRAKTID[who]['saved'] default = TRAKTID[who]['default'] user = addonid.getSetting(default) suser = wiz.getS(saved) name = TRAKTID[who]['name'] icon = TRAKTID[who]['icon'] if do == 'update': if not user == '': with open(file, 'w') as f: for trakt in data: f.write('<trakt>\n\t<id>%s</id>\n\t<value>%s</value>\n</trakt>\n' % (trakt, addonid.getSetting(trakt))) f.close() user = addonid.getSetting(default) wiz.setS(saved, user) wiz.LogNotify(name,'Trakt Data: [COLOR green]Saved![/COLOR]', 2000, icon) else: wiz.LogNotify(name,'Trakt Data: [COLOR red]Not Registered![/COLOR]', 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('<trakt><id>(.+?)</id><value>(.+?)</value></trakt>').findall(g) if len(match) > 0: for trakt, value in match: addonid.setSetting(trakt, value) user = addonid.getSetting(default) wiz.setS(saved, user) wiz.LogNotify(name,'Trakt: [COLOR green]Restored![/COLOR]', 2000, icon) #else: wiz.LogNotify(name,'Trakt Data: [COLOR red]Not Found![/COLOR]', 2000, icon) elif do == 'clearaddon': wiz.log('%s SETTINGS: %s' % (name, settings)) if os.path.exists(settings): f = open(set,"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('Removing Line: %s' % line) f.close() wiz.LogNotify(name,'Addon Data: [COLOR green]Cleared![/COLOR]', 2000, icon) else: wiz.LogNotify(name,'Addon Data: [COLOR red]Clear Failed![/COLOR]', 2000, icon) xbmc.executebuiltin('Container.Refresh')
def traktIt(do, who): if not os.path.exists(ADDONDATA): os.makedirs(ADDONDATA) if not os.path.exists(TRAKTFOLD): os.makedirs(TRAKTFOLD) if who == 'all': for log in ORDER: if os.path.exists(TRAKTID[log]['path']): updateTrakt(do, log) else: wiz.log( '[Trakt Data] %s(%s) is not installed' % (TRAKTID[log]['name'], TRAKTID[log]['plugin']), xbmc.LOGERROR) wiz.setS('traktlastsave', str(THREEDAYS)) else: if TRAKTID[who]: if os.path.exists(TRAKTID[who]['path']): updateTrakt(do, who) else: wiz.log('[Trakt Data] Invalid Entry: %s' % who, xbmc.LOGERROR)
def importlist(who): if who == 'all': for log in DEBRIDID: if os.path.exists(DEBRIDID[log]['file']): importlist(log) elif DEBRIDID[who]: if os.path.exists(DEBRIDID[who]['file']): d = DEBRIDID[who]['default'] sa = DEBRIDID[who]['saved'] su = wiz.getS(sa) n = DEBRIDID[who]['name'] f = open(DEBRIDID[who]['file'], mode='r') g = f.read().replace('\n', '').replace('\r', '').replace('\t', '') f.close() m = re.compile('<debrid><id>%s</id><value>(.+?)</value></debrid>' % d).findall(g) if len(m) > 0: if not m[0] == su: if DIALOG.yesno( "[COLOR %s]%s[/COLOR]" % (COLOR1, ADDONTITLE), "[COLOR %s]Would you like to import the [COLOR %s]Debrid Info[/COLOR] for [COLOR %s]%s[/COLOR]?" % (COLOR2, COLOR1, COLOR1, n), "File: [COLOR springgreen][B]%s[/B][/COLOR]" % m[0], "Saved:[/COLOR] [COLOR red][B]%s[/B][/COLOR]" % su if not su == '' else 'Saved:[/COLOR] [COLOR red][B]None[/B][/COLOR]', yeslabel="[B][COLOR %s]Import Debrid[/COLOR][/B]" % COLOR2, nolabel="[B][COLOR %s]No, Cancel[/COLOR][/B]" % COLOR1): wiz.setS(sa, m[0]) wiz.log('[Import Data] %s: %s' % (who, str(m)), xbmc.LOGNOTICE) else: wiz.log( '[Import Data] Declined Import(%s): %s' % (who, str(m)), xbmc.LOGNOTICE) else: wiz.log('[Import Data] Duplicate Entry(%s): %s' % (who, str(m))), xbmc.LOGNOTICE else: wiz.log('[Import Data] No Match(%s): %s' % (who, str(m)), xbmc.LOGNOTICE)
def importlist(who): if who == 'all': for log in DEBRIDID: if os.path.exists(DEBRIDID[log]['file']): importlist(log) elif DEBRIDID[who]: if os.path.exists(DEBRIDID[who]['file']): d = DEBRIDID[who]['default'] sa = DEBRIDID[who]['saved'] su = wiz.getS(sa) n = DEBRIDID[who]['name'] f = open(DEBRIDID[who]['file'], mode='r') g = f.read().replace('\n', '').replace('\r', '').replace('\t', '') f.close() m = re.compile('<debrid><id>%s</id><value>(.+?)</value></debrid>' % d).findall(g) if len(m) > 0: if not m[0] == su: if DIALOG.yesno( ADDONTITLE, "[COLOR %s]Willst du die [COLOR %s]Real Debrid[/COLOR] Daten fur [COLOR %s]%s[/COLOR] importieren?" % (COLOR2, COLOR1, COLOR1, n), "Datei: [COLOR lime][B]%s[/B][/COLOR]" % m[0], "Gespeichert:[/COLOR] [COLOR red][B]%s[/B][/COLOR]" % su if not su == '' else 'Gespeichert:[/COLOR] [COLOR red][B]Keine[/B][/COLOR]', yeslabel= "[B][COLOR lime]JA, Daten speichern[/COLOR][/B]", nolabel="[B][COLOR red]NEIN, abbrechen[/COLOR][/B]" ): wiz.setS(sa, m[0]) wiz.log('[Import Data] %s: %s' % (who, str(m)), xbmc.LOGNOTICE) else: wiz.log( '[Import Data] Declined Import(%s): %s' % (who, str(m)), xbmc.LOGNOTICE) else: wiz.log('[Import Data] Duplicate Entry(%s): %s' % (who, str(m))), xbmc.LOGNOTICE else: wiz.log('[Import Data] No Match(%s): %s' % (who, str(m)), xbmc.LOGNOTICE)
def importlist(who): if who == 'all': for log in LOGINID: if os.path.exists(LOGINID[log]['file']): importlist(log) elif LOGINID[who]: if os.path.exists(LOGINID[who]['file']): d = LOGINID[who]['default'] sa = LOGINID[who]['saved'] su = wiz.getS(sa) n = LOGINID[who]['name'] f = open(LOGINID[who]['file'], mode='r') g = f.read().replace('\n', '').replace('\r', '').replace('\t', '') f.close() m = re.compile('<login><id>%s</id><value>(.+?)</value></login>' % d).findall(g) if len(m) > 0: if not m[0] == su: if DIALOG.yesno( ADDONTITLE, "[COLOR %s]Quieres importar los datos de [COLOR %s]Login[/COLOR] para [COLOR %s]%s[/COLOR]?" % (COLOR2, COLOR1, COLOR1, n), "Archivo: [COLOR green][B]%s[/B][/COLOR]" % m[0], "Guardado:[/COLOR] [COLOR red][B]%s[/B][/COLOR]" % su if not su == '' else 'Guardado:[/COLOR] [COLOR red][B]Ninguno[/B][/COLOR]', yeslabel= "[B][COLOR green]Guardar datos[/COLOR][/B]", nolabel="[B][COLOR red]No, Cancelar[/COLOR][/B]"): wiz.setS(sa, m[0]) wiz.log('[Import Data] %s: %s' % (who, str(m)), xbmc.LOGNOTICE) else: wiz.log( '[Import Data] Declined Import(%s): %s' % (who, str(m)), xbmc.LOGNOTICE) else: wiz.log( '[Import Data] Duplicate Entry(%s): %s' % (who, str(m)), xbmc.LOGNOTICE) else: wiz.log('[Import Data] No Match(%s): %s' % (who, str(m)), xbmc.LOGNOTICE)
def importlist(who): if who == 'all': for log in LOGINID: if os.path.exists(LOGINID[log]['file']): importlist(log) elif LOGINID[who]: if os.path.exists(LOGINID[who]['file']): d = LOGINID[who]['default'] sa = LOGINID[who]['saved'] su = wiz.getS(sa) n = LOGINID[who]['name'] f = open(LOGINID[who]['file'], mode='r') g = f.read().replace('\n', '').replace('\r', '').replace('\t', '') f.close() m = re.compile('<login><id>%s</id><value>(.+?)</value></login>' % d).findall(g) if len(m) > 0: if not m[0] == su: if DIALOG.yesno( ADDONTITLE, "[COLOR %s]Would you like to import the [COLOR %s]Login[/COLOR] data for [COLOR %s]%s[/COLOR]?" % (COLOR2, COLOR1, COLOR1, n), "File: [COLOR green][B]%s[/B][/COLOR]" % m[0], "Saved:[/COLOR] [COLOR lime][B]%s[/B][/COLOR]" % su if not su == '' else 'Saved:[/COLOR] [COLOR lime][B]None[/B][/COLOR]', yeslabel="[B][COLOR green]Save Data[/COLOR][/B]", nolabel="[B][COLOR lime]No Cancel[/COLOR][/B]"): wiz.setS(sa, m[0]) wiz.log('[Import Data] %s: %s' % (who, str(m)), xbmc.LOGNOTICE) else: wiz.log( '[Import Data] Declined Import(%s): %s' % (who, str(m)), xbmc.LOGNOTICE) else: wiz.log( '[Import Data] Duplicate Entry(%s): %s' % (who, str(m)), xbmc.LOGNOTICE) else: wiz.log('[Import Data] No Match(%s): %s' % (who, str(m)), xbmc.LOGNOTICE)
def traktIt(do, who): if not os.path.exists(ADDONDATA): os.makedirs(ADDONDATA) if not os.path.exists(TRAKTFOLD): os.makedirs(TRAKTFOLD) if who == 'all': for log in ORDER: if os.path.exists(TRAKTID[log]['path']): try: addonid = wiz.addonId(TRAKTID[log]['plugin']) default = TRAKTID[log]['default'] user = addonid.getSetting(default) if user == '' and do == 'update': continue updateTrakt(do, log) except: pass else: wiz.log('[Trakt Data] %s(%s) is not installed' % (TRAKTID[log]['name'],TRAKTID[log]['plugin']), xbmc.LOGERROR) wiz.setS('traktlastsave', str(THREEDAYS)) else: if TRAKTID[who]: if os.path.exists(TRAKTID[who]['path']): updateTrakt(do, who) else: wiz.log('[Trakt Data] Invalid Entry: %s' % who, xbmc.LOGERROR)
def loginIt(do, who): if not os.path.exists(ADDONDATA): os.makedirs(ADDONDATA) if not os.path.exists(LOGINFOLD): os.makedirs(LOGINFOLD) if who == 'all': for log in ORDER: if os.path.exists(LOGINID[log]['path']): try: addonid = wiz.addonId(LOGINID[log]['plugin']) default = LOGINID[log]['default'] user = addonid.getSetting(default) if user == '' and do == 'update': continue updateLogin(do, log) except: pass else: wiz.log('[Login Info] %s(%s) is not installed' % (LOGINID[log]['name'],LOGINID[log]['plugin']), xbmc.LOGERROR) wiz.setS('loginlastsave', str(THREEDAYS)) else: if LOGINID[who]: if os.path.exists(LOGINID[who]['path']): updateLogin(do, who) else: wiz.log('[Login Info] Invalid Entry: %s' % who, xbmc.LOGERROR)
def debridIt(do, who): if not os.path.exists(ADDONDATA): os.makedirs(ADDONDATA) if not os.path.exists(REALFOLD): os.makedirs(REALFOLD) if who == 'all': for log in ORDER: if os.path.exists(DEBRIDID[log]['path']): try: addonid = wiz.addonId(DEBRIDID[log]['plugin']) default = DEBRIDID[log]['default'] user = addonid.getSetting(default) if user == '' and do == 'update': continue updateDebrid(do, log) except: pass else: wiz.log('[Real Debrid Data] %s(%s) is not installed' % (DEBRIDID[log]['name'],DEBRIDID[log]['plugin']), xbmc.LOGERROR) wiz.setS('debridlastsave', str(THREEDAYS)) else: if DEBRIDID[who]: if os.path.exists(DEBRIDID[who]['path']): updateDebrid(do, who) else: wiz.log('[Real Debrid Data] Invalid Entry: %s' % who, xbmc.LOGERROR)
def checkUpdate(): BUILDNAME = wiz.getS('buildname') BUILDVERSION = wiz.getS('buildversion') link = wiz.openURL(BUILDFILE).replace('\n', '').replace('\r', '').replace('\t', '') match = re.compile('name="%s".+?ersion="(.+?)"' % BUILDNAME).findall(link) if len(match) > 0: version = match[0] wiz.setS('latestversion', version) if version > BUILDVERSION: notify.updateWindow() else: wiz.log( "[Check Updates] [Installed Version: %s] [Current Version: %s]" % (BUILDVERSION, version)) else: wiz.log( "[Check Updates] ERROR: Unable to find build version in build text file" )
def loginIt(do, who): if not os.path.exists(ADDONDATA): os.makedirs(ADDONDATA) if not os.path.exists(LOGINFOLD): os.makedirs(LOGINFOLD) if who == 'all': for log in ORDER: if os.path.exists(LOGINID[log]['path']): try: addonid = wiz.addonId(LOGINID[log]['plugin']) default = LOGINID[log]['default'] user = addonid.getSetting(default) if user == '' and do == 'update': continue updateLogin(do, log) except: pass else: wiz.log('[API Keys] %s(%s) is not installed' % (LOGINID[log]['name'],LOGINID[log]['plugin']), xbmc.LOGERROR) wiz.setS('loginlastsave', str(THREEDAYS)) else: if LOGINID[who]: if os.path.exists(LOGINID[who]['path']): updateLogin(do, who) else: wiz.log('[API Keys] Invalid Entry: %s' % who, xbmc.LOGERROR)
def importlist(who): if who == 'all': for log in DEBRIDID: if os.path.exists(DEBRIDID[log]['file']): importlist(log) elif DEBRIDID[who]: if os.path.exists(DEBRIDID[who]['file']): d = DEBRIDID[who]['default'] sa = DEBRIDID[who]['saved'] su = wiz.getS(sa) n = DEBRIDID[who]['name'] f = open(DEBRIDID[who]['file'],mode='r'); g = f.read().replace('\n','').replace('\r','').replace('\t',''); f.close(); m = re.compile('<debrid><id>%s</id><value>(.+?)</value></debrid>' % d).findall(g) if len(m) > 0: if not m[0] == su: if DIALOG.yesno(ADDONTITLE, "[COLOR %s]Quieres importar los datos de [COLOR %s]Real Debrid[/COLOR] para [COLOR %s]%s[/COLOR]?" % (COLOR2, COLOR1, COLOR1, n), "Archivo: [COLOR green][B]%s[/B][/COLOR]" % m[0], "Guardado:[/COLOR] [COLOR red][B]%s[/B][/COLOR]" % su if not su == '' else 'Guardado:[/COLOR] [COLOR red][B]None[/B][/COLOR]', yeslabel="[B][COLOR green]Guardar datos[/COLOR][/B]", nolabel="[B][COLOR red]No, Cancelar[/COLOR][/B]"): wiz.setS(sa, m[0]) wiz.log('[Import Data] %s: %s' % (who, str(m)), xbmc.LOGNOTICE) else: wiz.log('[Import Data] Declined Import(%s): %s' % (who, str(m)), xbmc.LOGNOTICE) else: wiz.log('[Import Data] Duplicate Entry(%s): %s' % (who, str(m))), xbmc.LOGNOTICE else: wiz.log('[Import Data] No Match(%s): %s' % (who, str(m)), xbmc.LOGNOTICE)
def importlist(who): if who == 'all': for log in DEBRIDID: if os.path.exists(DEBRIDID[log]['file']): importlist(log) elif DEBRIDID[who]: if os.path.exists(DEBRIDID[who]['file']): d = DEBRIDID[who]['default'] sa = DEBRIDID[who]['saved'] su = wiz.getS(sa) n = DEBRIDID[who]['name'] f = open(DEBRIDID[who]['file'],mode='r'); g = f.read().replace('\n','').replace('\r','').replace('\t',''); f.close(); m = re.compile('<debrid><id>%s</id><value>(.+?)</value></debrid>' % d).findall(g) if len(m) > 0: if not m[0] == su: if DIALOG.yesno(ADDONTITLE, "Would you like to import the Real Debrid data for %s?" % n, "File: [COLOR green][B]%s[/B][/COLOR]" % m[0], "Saved: [COLOR red][B]%s[/B][/COLOR]" % su if not su == '' else 'Saved: [COLOR red][B]None[/B][/COLOR]', yeslabel="Yes Save", nolabel="No Cancel"): wiz.setS(sa, m[0]) wiz.log('[Import Data] %s: %s' % (who, str(m))) else: wiz.log('[Import Data] Declined Import(%s): %s' % (who, str(m))) else: wiz.log('[Import Data] Duplicate Entry(%s): %s' % (who, str(m))) else: wiz.log('[Import Data] No Match(%s): %s' % (who, str(m)))
def importlist(who): if who == 'all': for log in TRAKTID: if os.path.exists(TRAKTID[log]['file']): importlist(log) elif TRAKTID[who]: if os.path.exists(TRAKTID[who]['file']): d = TRAKTID[who]['default'] sa = TRAKTID[who]['saved'] su = wiz.getS(sa) n = TRAKTID[who]['name'] f = open(TRAKTID[who]['file'],mode='r'); g = f.read().replace('\n','').replace('\r','').replace('\t',''); f.close(); m = re.compile('<trakt><id>%s</id><value>(.+?)</value></trakt>' % d).findall(g) if len(m) > 0: if not m[0] == su: if DIALOG.yesno(ADDONTITLE, "Would you like to import the Trakt data for %s?" % n, "File: [COLOR green][B]%s[/B][/COLOR]" % m[0], "Saved: [COLOR red][B]%s[/B][/COLOR]" % su if not su == '' else 'Saved: [COLOR red][B]None[/B][/COLOR]', yeslabel="Yes Save", nolabel="No Cancel"): wiz.setS(sa, m[0]) wiz.log('[Import Data] %s: %s' % (who, str(m))) else: wiz.log('[Import Data] Declined Import(%s): %s' % (who, str(m))) else: wiz.log('[Import Data] Duplicate Entry(%s): %s' % (who, str(m))) else: wiz.log('[Import Data] No Match(%s): %s' % (who, str(m)))
def importlist(who): if who == 'all': for log in TRAKTID: if os.path.exists(TRAKTID[log]['file']): importlist(log) elif TRAKTID[who]: if os.path.exists(TRAKTID[who]['file']): d = TRAKTID[who]['default'] sa = TRAKTID[who]['saved'] su = wiz.getS(sa) n = TRAKTID[who]['name'] f = open(TRAKTID[who]['file'],mode='r'); g = f.read().replace('\n','').replace('\r','').replace('\t',''); f.close(); m = re.compile('<trakt><id>%s</id><value>(.+?)</value></trakt>' % d).findall(g) if len(m) > 0: if not m[0] == su: if DIALOG.yesno(ADDONTITLE, "[COLOR %s]Would you like to import the [COLOR %s]Trakt Data[/COLOR] for [COLOR %s]%s[/COLOR]?" % (COLOR2, COLOR1, COLOR1, n), "File: [COLOR springgreen][B]%s[/B][/COLOR]" % m[0], "Saved:[/COLOR] [COLOR red][B]%s[/B][/COLOR]" % su if not su == '' else 'Saved:[/COLOR] [COLOR red][B]None[/B][/COLOR]', yeslabel="[B]Save Data[/B]", nolabel="[B]No Cancel[/B]"): wiz.setS(sa, m[0]) wiz.log('[Import Data] %s: %s' % (who, str(m)), xbmc.LOGNOTICE) else: wiz.log('[Import Data] Declined Import(%s): %s' % (who, str(m)), xbmc.LOGNOTICE) else: wiz.log('[Import Data] Duplicate Entry(%s): %s' % (who, str(m)), xbmc.LOGNOTICE) else: wiz.log('[Import Data] No Match(%s): %s' % (who, str(m)), xbmc.LOGNOTICE)
def traktIt(do, who): if not os.path.exists(ADDONDATA): os.makedirs(ADDONDATA) if not os.path.exists(TRAKTFOLD): os.makedirs(TRAKTFOLD) if who == "all": if os.path.exists(PATHEXODUS): trakt_Exodus(do) if os.path.exists(PATHVELOCITY): trakt_Velocity(do) if os.path.exists(PATHVELOCITYKI): trakt_VelocityKids(do) if os.path.exists(PATHSALTS): trakt_Salts(do) if os.path.exists(PATHSALTSHD): trakt_SaltsHD(do) if os.path.exists(PATHROYALWE): trakt_TheRoyalWe(do) if os.path.exists(PATHSPECTO): trakt_Specto(do) if os.path.exists(PATHTRAKT): trakt_Trakt(do) wiz.setS('traktlastsave', str(THREEDAYS)) else: if who == "exodus" and os.path.exists(PATHEXODUS): trakt_Exodus(do) if who == "velocity" and os.path.exists(PATHVELOCITY): trakt_Velocity(do) if who == "velocitykids" and os.path.exists(PATHVELOCITYKI): trakt_VelocityKids(do) if who == "salts" and os.path.exists(PATHSALTS): trakt_Salts(do) if who == "saltshd" and os.path.exists(PATHSALTSHD): trakt_SaltsHD(do) if who == "royalwe" and os.path.exists(PATHROYALWE): trakt_TheRoyalWe(do) if who == "specto" and os.path.exists(PATHSPECTO): trakt_Specto(do) if who == "trakt" and os.path.exists(PATHTRAKT): trakt_Trakt(do)
def trakt_Trakt(do): TRAKTFILE = os.path.join(TRAKTFOLD, 'trakt_trakt') TRAKTSETTINGS = os.path.join(USERDATA, 'addon_data', TRAKT,'settings.xml') TRAKT_TRAKT = ['user', 'Auth_Info', 'authorization'] ADD_TRAKT = wiz.addonId(TRAKT) TRAKTTRAKT = ADD_TRAKT.getSetting('user') if do == 'update': if not ADD_TRAKT.getSetting('user') == '': with open(TRAKTFILE, 'w') as f: for trakt in TRAKT_TRAKT: f.write('<trakt>\n\t<id>%s</id>\n\t<value>%s</value>\n</trakt>\n' % (trakt, ADD_TRAKT.getSetting(trakt))) f.closed wiz.setS('trakt', ADD_TRAKT.getSetting('user')) wiz.LogNotify('Trakt','Trakt Data: [COLOR green]Saved![/COLOR]', 2000, os.path.join(PATHTRAKT,'icon.png')) else: wiz.LogNotify('Trakt','Trakt Data: [COLOR red]Not Registered![/COLOR]', 2000, os.path.join(PATHTRAKT,'icon.png')) elif do == 'restore': if os.path.exists(TRAKTFILE): f = open(TRAKTFILE,mode='r'); g = f.read().replace('\n','').replace('\r','').replace('\t',''); f.close(); match = re.compile('<trakt><id>(.+?)</id><value>(.+?)</value></trakt>').findall(g) if len(match) > 0: for trakt, value in match: ADD_TRAKT.setSetting(trakt, value) wiz.setS('trakt', ADD_TRAKT.getSetting('user')) wiz.LogNotify('Trakt','Trakt Data: [COLOR green]Restored![/COLOR]', 2000, os.path.join(PATHTRAKT,'icon.png')) else: wiz.LogNotify('Trakt','Trakt Data: [COLOR red]Not Found![/COLOR]', 2000, os.path.join(PATHTRAKT,'icon.png')) elif do == 'clearaddon': wiz.log('Trakt SETTINGS: %s' % TRAKTSETTINGS) if os.path.exists(TRAKTSETTINGS): f = open(TRAKTSETTINGS,"r"); lines = f.readlines(); f.close() f = open(TRAKTSETTINGS,"w") for line in lines: match = re.compile('<setting.+?id="(.+?)".+?/>').findall(line) if len(match) == 0: f.write(line) elif match[0] not in TRAKT_TRAKT: f.write(line) else: wiz.log('Removing Line: %s' % line) f.close() wiz.LogNotify('Specto','Addon Data: [COLOR green]Cleared![/COLOR]', 2000, os.path.join(PATHTRAKT,'icon.png')) else: wiz.LogNotify('Specto','Addon Data: [COLOR red]Clear Failed![/COLOR]', 2000, os.path.join(PATHTRAKT,'icon.png')) xbmc.executebuiltin('Container.Refresh')
def trakt_TheRoyalWe(do): ROYALWEFILE = os.path.join(TRAKTFOLD, 'royalwe_trakt') ROYALWESETTINGS = os.path.join(USERDATA, 'addon_data', ROYALWE,'settings.xml') ROYAL_TRAKT = ['trakt_authorized', 'trakt_account', 'trakt_client_id', 'trakt_oauth_token', 'trakt_refresh_token', 'trakt_secret'] ADD_ROYALWE = wiz.addonId(ROYALWE) TRAKTROYAL = ADD_ROYALWE.getSetting('trakt_account') if do == 'update': if ADD_ROYALWE.getSetting('trakt_authorized') == 'true': with open(ROYALWEFILE, 'w') as f: for trakt in ROYAL_TRAKT: f.write('<trakt>\n\t<id>%s</id>\n\t<value>%s</value>\n</trakt>\n' % (trakt, ADD_ROYALWE.getSetting(trakt))) f.closed wiz.setS('royalwe', ADD_ROYALWE.getSetting('trakt_account')) wiz.LogNotify('The Royal We','Trakt Data: [COLOR green]Saved![/COLOR]', 2000, os.path.join(PATHROYALWE,'icon.png')) else: wiz.LogNotify('The Royal We','Trakt Data: [COLOR red]Not Registered![/COLOR]', 2000, os.path.join(PATHROYALWE,'icon.png')) elif do == 'restore': if os.path.exists(ROYALWEFILE): f = open(ROYALWEFILE,mode='r'); g = f.read().replace('\n','').replace('\r','').replace('\t',''); f.close(); match = re.compile('<trakt><id>(.+?)</id><value>(.+?)</value></trakt>').findall(g) if len(match) > 0: for trakt, value in match: ADD_ROYALWE.setSetting(trakt, value) wiz.setS('royalwe', ADD_ROYALWE.getSetting('trakt_account')) wiz.LogNotify('The Royal We','Trakt Data: [COLOR green]Restored![/COLOR]', 2000, os.path.join(PATHROYALWE,'icon.png')) else: wiz.LogNotify('The Royal We','Trakt Data: [COLOR red]Not Found![/COLOR]', 2000, os.path.join(PATHROYALWE,'icon.png')) elif do == 'clearaddon': wiz.log('The Royal We SETTINGS: %s' % ROYALWESETTINGS) if os.path.exists(ROYALWESETTINGS): f = open(ROYALWESETTINGS,"r"); lines = f.readlines(); f.close() f = open(ROYALWESETTINGS,"w") for line in lines: match = re.compile('<setting.+?id="(.+?)".+?/>').findall(line) if len(match) == 0: f.write(line) elif match[0] not in ROYAL_TRAKT: f.write(line) else: wiz.log('Removing Line: %s' % line) f.close() wiz.LogNotify('The Royal We','Addon Data: [COLOR green]Cleared![/COLOR]', 2000, os.path.join(PATHROYALWE,'icon.png')) else: wiz.LogNotify('The Royal We','Addon Data: [COLOR red]Clear Failed![/COLOR]', 2000, os.path.join(PATHROYALWE,'icon.png')) xbmc.executebuiltin('Container.Refresh')
def trakt_VelocityKids(do): VELOCITYKIDSFILE = os.path.join(TRAKTFOLD, 'velocitykids_trakt') VELOCITYKSETTINGS = os.path.join(USERDATA, 'addon_data', VELOCITYKIDS,'settings.xml') VELOKIDS_TRAKT = ['trakt_authorized', 'trakt_username', 'trakt_oauth_token', 'trakt_refresh_token'] ADD_VELOCITYKIDS = wiz.addonId(VELOCITYKIDS) TRAKTVELOCITYKIDS = ADD_VELOCITYKIDS.getSetting('trakt_username') if do == 'update': if ADD_VELOCITYKIDS.getSetting('trakt_authorized') == 'true': with open(VELOCITYKIDSFILE, 'w') as f: for trakt in VELOKIDS_TRAKT: f.write('<trakt>\n\t<id>%s</id>\n\t<value>%s</value>\n</trakt>\n' % (trakt, ADD_VELOCITYKIDS.getSetting(trakt))) f.closed wiz.setS('velocitykids', ADD_VELOCITYKIDS.getSetting('trakt_username')) wiz.LogNotify('Velocity Kids','Trakt Data: [COLOR green]Saved![/COLOR]', 2000, os.path.join(PATHVELOCITYKI,'icon.png')) else: wiz.LogNotify('Velocity Kids','Trakt Data: [COLOR red]Not Registered![/COLOR]', 2000, os.path.join(PATHVELOCITYKI,'icon.png')) elif do == 'restore': if os.path.exists(VELOCITYKIDSFILE): f = open(VELOCITYKIDSFILE,mode='r'); g = f.read().replace('\n','').replace('\r','').replace('\t',''); f.close(); match = re.compile('<trakt><id>(.+?)</id><value>(.+?)</value></trakt>').findall(g) if len(match) > 0: for trakt, value in match: ADD_VELOCITYKIDS.setSetting(trakt, value) wiz.setS('velocitykids', ADD_VELOCITYKIDS.getSetting('trakt_username')) wiz.LogNotify('Velocity Kids','Trakt Data: [COLOR green]Restored![/COLOR]', 2000, os.path.join(PATHVELOCITYKI,'icon.png')) else: wiz.LogNotify('Velocity Kids','Trakt Data: [COLOR red]Not Found![/COLOR]', 2000, os.path.join(PATHVELOCITYKI,'icon.png')) elif do == 'clearaddon': wiz.log('Velocity Kids SETTINGS: %s' % VELOCITYKSETTINGS) if os.path.exists(VELOCITYKSETTINGS): f = open(VELOCITYKSETTINGS,"r"); lines = f.readlines(); f.close() f = open(VELOCITYKSETTINGS,"w") for line in lines: match = re.compile('<setting.+?id="(.+?)".+?/>').findall(line) if len(match) == 0: f.write(line) elif match[0] not in VELOKIDS_TRAKT: f.write(line) else: wiz.log('Removing Line: %s' % line) f.close() wiz.LogNotify('Velocity Kids','Addon Data: [COLOR green]Cleared![/COLOR]', 2000, os.path.join(PATHVELOCITYKI,'icon.png')) else: wiz.LogNotify('Velocity Kids','Addon Data: [COLOR red]Clear Failed![/COLOR]', 2000, os.path.join(PATHVELOCITYKI,'icon.png')) xbmc.executebuiltin('Container.Refresh')
def debrid_Url(do): URLFILE = os.path.join(REALFOLD, 'url_debrid') URLSETTINGS = os.path.join(USERDATA, 'addon_data', URLRESOLVER,'settings.xml') URL_DEBRID = ['RealDebridResolver_enabled', 'RealDebridResolver_autopick', 'RealDebridResolver_token', 'RealDebridResolver_refresh', 'RealDebridResolver_client_id', 'RealDebridResolver_client_secret'] ADD_URL = wiz.addonId(URLRESOLVER) DEBRIDURL = ADD_URL.getSetting('RealDebridResolver_client_id') if do == 'update': if not ADD_URL.getSetting('RealDebridResolver_client_id') == '': with open(URLFILE, 'w') as f: for debrid in URL_DEBRID: f.write('<debrid>\n\t<id>%s</id>\n\t<value>%s</value>\n</debrid>\n' % (debrid, ADD_URL.getSetting(debrid))) f.closed wiz.setS('urlresolver', ADD_URL.getSetting('RealDebridResolver_client_id')) wiz.LogNotify('Url Resolver','Real Debrid Data: [COLOR green]Saved![/COLOR]', 2000, os.path.join(PATHURL,'icon.png')) else: wiz.LogNotify('Url Resolver','Real Debrid Data: [COLOR red]Not Registered![/COLOR]', 2000, os.path.join(PATHURL,'icon.png')) elif do == 'restore': if os.path.exists(URLFILE): f = open(URLFILE,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: ADD_URL.setSetting(debrid, value) wiz.setS('urlresolver', ADD_URL.getSetting('RealDebridResolver_client_id')) wiz.LogNotify('Url Resolver','Real Debrid Data: [COLOR green]Restored![/COLOR]', 2000, os.path.join(PATHURL,'icon.png')) else: wiz.LogNotify('Url Resolver','Real Debrid Data: [COLOR red]Not Found![/COLOR]', 2000, os.path.join(PATHURL,'icon.png')) elif do == 'clearaddon': wiz.log('Url Resolver SETTINGS: %s' % URLSETTINGS) if os.path.exists(URLSETTINGS): f = open(URLSETTINGS,"r"); lines = f.readlines(); f.close() f = open(URLSETTINGS,"w") for line in lines: match = re.compile('<setting.+?id="(.+?)".+?/>').findall(line) if len(match) == 0: f.write(line) elif match[0] not in URL_DEBRID: f.write(line) else: wiz.log('Removing Line: %s' % line) f.close() wiz.LogNotify('Url Resolver','Addon Data: [COLOR green]Cleared![/COLOR]', 2000, os.path.join(PATHURL,'icon.png')) else: wiz.LogNotify('Url Resolver','Addon Data: [COLOR red]Clear Failed![/COLOR]', 2000, os.path.join(PATHURL,'icon.png')) xbmc.executebuiltin('Container.Refresh')
def debrid_Exodus(do): EXODUSFILE = os.path.join(REALFOLD, 'exodus_debrid') EXODUSSETTINGS = os.path.join(USERDATA, 'addon_data', EXODUS,'settings.xml') EXODUS_DEBRID = ['realdebrid.auth', 'realdebrid.id', 'realdebrid.secret', 'realdebrid.token', 'realdebrid.refresh'] ADD_EXODUS = wiz.addonId(EXODUS) TRAKTEXODUS = ADD_EXODUS.getSetting('realdebrid.id') if do == 'update': if not TRAKTEXODUS == '': with open(EXODUSFILE, 'w') as f: for debrid in EXODUS_DEBRID: f.write('<debrid>\n\t<id>%s</id>\n\t<value>%s</value>\n</debrid>\n' % (debrid, ADD_EXODUS.getSetting(debrid))) f.closed wiz.setS('realexodus', ADD_EXODUS.getSetting('realdebrid.id')) wiz.LogNotify('Exodus','Real Debrid Data: [COLOR green]Saved![/COLOR]', 2000, os.path.join(PATHEXODUS,'icon.png')) else: wiz.LogNotify('Exodus','Real Debrid Data: [COLOR red]Not Registered![/COLOR]', 2000, os.path.join(PATHEXODUS,'icon.png')) elif do == 'restore': if os.path.exists(EXODUSFILE): f = open(EXODUSFILE,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: ADD_EXODUS.setSetting(debrid, value) wiz.setS('realexodus', ADD_EXODUS.getSetting('realdebrid.id')) wiz.LogNotify('Exodus','Real Debrid: [COLOR green]Restored![/COLOR]', 2000, os.path.join(PATHEXODUS,'icon.png')) else: wiz.LogNotify('Exodus','Real Debrid Data: [COLOR red]Not Found![/COLOR]', 2000, os.path.join(PATHEXODUS,'icon.png')) elif do == 'clearaddon': wiz.log('Exodus SETTINGS: %s' % EXODUSSETTINGS) if os.path.exists(EXODUSSETTINGS): f = open(EXODUSSETTINGS,"r"); lines = f.readlines(); f.close() f = open(EXODUSSETTINGS,"w") for line in lines: match = re.compile('<setting.+?id="(.+?)".+?/>').findall(line) if len(match) == 0: f.write(line) elif match[0] not in EXODUS_DEBRID: f.write(line) else: wiz.log('Removing Line: %s' % line) f.close() wiz.LogNotify('Exodus','Addon Data: [COLOR green]Cleared![/COLOR]', 2000, os.path.join(PATHEXODUS,'icon.png')) else: wiz.LogNotify('Exodus','Addon Data: [COLOR red]Clear Failed![/COLOR]', 2000, os.path.join(PATHEXODUS,'icon.png')) xbmc.executebuiltin('Container.Refresh')
def debrid_Specto(do): SPECTOFILE = os.path.join(REALFOLD, 'specto_debrid') SPECTOSETTINGS = os.path.join(USERDATA, 'addon_data', SPECTO,'settings.xml') SPECTO_DEBRID = ['realdebrid_auth', 'realdebrid_token', 'realdebrid_refresh', 'realdebrid_client_id', 'realdebrid_client_secret'] ADD_SPECTO = wiz.addonId(SPECTO) DEBRIDSPECTO = ADD_SPECTO.getSetting('realdebrid_client_id') if do == 'update': if not ADD_SPECTO.getSetting('realdebrid_client_id') == '': with open(SPECTOFILE, 'w') as f: for debrid in SPECTO_DEBRID: f.write('<debrid>\n\t<id>%s</id>\n\t<value>%s</value>\n</debrid>\n' % (debrid, ADD_SPECTO.getSetting(debrid))) f.closed wiz.setS('realspecto', ADD_SPECTO.getSetting('realdebrid_client_id')) wiz.LogNotify('Specto','Real Debrid Data: [COLOR green]Saved![/COLOR]', 2000, os.path.join(PATHSPECTO,'icon.png')) else: wiz.LogNotify('Specto','Real Debrid Data: [COLOR red]Not Registered![/COLOR]', 2000, os.path.join(PATHSPECTO,'icon.png')) elif do == 'restore': if os.path.exists(SPECTOFILE): f = open(SPECTOFILE,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: ADD_SPECTO.setSetting(debrid, value) wiz.setS('realspecto', ADD_SPECTO.getSetting('realdebrid_client_id')) wiz.LogNotify('Specto','Real Debrid Data: [COLOR green]Restored![/COLOR]', 2000, os.path.join(PATHSPECTO,'icon.png')) else: wiz.LogNotify('Specto','Real Debrid Data: [COLOR red]Not Found![/COLOR]', 2000, os.path.join(PATHSPECTO,'icon.png')) elif do == 'clearaddon': wiz.log('Specto SETTINGS: %s' % SPECTOSETTINGS) if os.path.exists(SPECTOSETTINGS): f = open(SPECTOSETTINGS,"r"); lines = f.readlines(); f.close() f = open(SPECTOSETTINGS,"w") for line in lines: match = re.compile('<setting.+?id="(.+?)".+?/>').findall(line) if len(match) == 0: f.write(line) elif match[0] not in SPECTO_DEBRID: f.write(line) else: wiz.log('Removing Line: %s' % line) f.close() wiz.LogNotify('Specto','Addon Data: [COLOR green]Cleared![/COLOR]', 2000, os.path.join(PATHSPECTO,'icon.png')) else: wiz.LogNotify('Specto','Addon Data: [COLOR red]Clear Failed![/COLOR]', 2000, os.path.join(PATHSPECTO,'icon.png')) xbmc.executebuiltin('Container.Refresh')
def updateTrakt(do, who): file = TRAKTID[who]['file'] settings = TRAKTID[who]['settings'] data = TRAKTID[who]['data'] addonid = wiz.addonId(TRAKTID[who]['plugin']) saved = TRAKTID[who]['saved'] default = TRAKTID[who]['default'] user = addonid.getSetting(default) suser = wiz.getS(saved) name = TRAKTID[who]['name'] icon = TRAKTID[who]['icon'] if do == 'update': if not user == '': try: with open(file, 'w') as f: for trakt in data: f.write( '<trakt>\n\t<id>%s</id>\n\t<value>%s</value>\n</trakt>\n' % (trakt, addonid.getSetting(trakt))) f.close() user = addonid.getSetting(default) wiz.setS(saved, user) wiz.LogNotify( "[COLOR %s]%s[/COLOR]" % (COLOR1, name), '[COLOR %s]Trakt Daten: Gespeichert![/COLOR]' % COLOR2, 2000, icon) except Exception, e: wiz.log( "[Trakt Data] Unable to Update %s (%s)" % (who, str(e)), xbmc.LOGERROR) else: wiz.LogNotify( "[COLOR %s]%s[/COLOR]" % (COLOR1, name), '[COLOR %s]Trakt Daten: Nicht registriert![/COLOR]' % COLOR2, 2000, icon)
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 == '': try: 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) except Exception, e: wiz.log( "[Real Debrid Data] Unable to Update %s (%s)" % (who, str(e)), xbmc.LOGERROR) else: wiz.LogNotify( "[COLOR %s]%s[/COLOR]" % (COLOR1, name), '[COLOR %s]Real Debrid Data: Not Registered![/COLOR]' % COLOR2, 2000, icon)
def checkUpdate(): BUILDNAME = wiz.getS('buildname') BUILDVERSION = wiz.getS('buildversion') link = wiz.openURL(BUILDFILE).replace('\n','').replace('\r','').replace('\t','') match = re.compile('name="%s".+?ersion="(.+?)"' % BUILDNAME).findall(link) if len(match) > 0: version = match[0] wiz.setS('latestversion', version) if version > BUILDVERSION: yes_pressed = DIALOG.yesno(ADDONTITLE,"New version of your current build avaliable: %s v%s" % (BUILDNAME, version), "Click Go to Build Page to install update.", yeslabel="Go to Build Page", nolabel="Ignore for 3 days") if yes_pressed: wiz.log("[Check Updates] [Installed Version: %s] [Current Version: %s] [User Selected: Install build]" % (BUILDVERSION, version)) url = 'plugin://%s/?mode=viewbuild&name=%s' % (ADDON_ID, urllib.quote_plus(BUILDNAME)) xbmc.executebuiltin('ActivateWindow(10025 ,%s, return)' % url) wiz.setS('lastbuildcheck', str(NEXTCHECK)) else: wiz.log("[Check Updates] [Installed Version: %s] [Current Version: %s] [User Selected: Wait 3 days]" % (BUILDVERSION, version)) DIALOG.ok(ADDONTITLE, 'You can still update %s to %s from the %s.' % (BUILDNAME, version, ADDONTITLE)) wiz.setS('lastbuildcheck', str(THREEDAYS)) else: wiz.log("[Check Updates] [Installed Version: %s] [Current Version: %s]" % (BUILDVERSION, version)) else: wiz.log("[Check Updates] ERROR: Unable to find build version in build text file")
def checkInstalled(): current = '' for skin in SKINCHECK: skinpath = os.path.join(ADDONS,skin) if os.path.exists(skinpath): current = skin if current == SKINCHECK[0]: yes_pressed = DIALOG.yesno(ADDONTITLE,"[COLOR dodgerblue]Aftermath[/COLOR] Zephyr is currently outdated and is no longer being updated.", "Please download one of the newer community builds.", yeslabel="Build Menu", nolabel="Ignore") if yes_pressed: xbmc.executebuiltin('ActivateWindow(10025 , "plugin://%s/?mode=builds", return)' % ADDON_ID) else: DIALOG.ok(ADDONTITLE, 'You can still install a community build from the [COLOR dodgerblue]Aftermath[/COLOR] Wizard.') elif current == SKINCHECK[1]: yes_pressed = DIALOG.yesno(ADDONTITLE,"[COLOR dodgerblue]Aftermath[/COLOR] Silvo is currently outdated and is no longer being updated.", "Please download one of the newer community builds.", yeslabel="Build Menu", nolabel="Ignore") if yes_pressed: xbmc.executebuiltin('ActivateWindow(10025 , "plugin://%s/?mode=builds", return)' % ADDON_ID) else: DIALOG.ok(ADDONTITLE, 'You can still install a community build from the [COLOR dodgerblue]Aftermath[/COLOR] Wizard.') elif current == SKINCHECK[2]: if KODIV >= 16: gui = os.path.join(ADDOND, SKINCHECK[2], 'settings.xml') f = open(gui,mode='r'); g = f.read(); f.close() match = re.compile('<setting id=\"SubSettings.3.Label\" type=\"string\">(.+?)<\/setting>').findall(g) if len(match): name, build, ver = match[0].replace('[COLOR dodgerblue]','').replace('[/COLOR]','').split(' ') else: build = "Simple" ver = "v0.1" else: gui = os.path.join(USERDATA,'guisettings.xml') f = open(gui,mode='r'); g = f.read(); f.close() match = re.compile('<setting type=\"string\" name=\"skin.aftermath.simple.SubSettings.3.Label\">(.+?)<\/setting>').findall(g) name, build, ver = match[0].replace('[COLOR dodgerblue]','').replace('[/COLOR]','').split(' ') wiz.setS('buildname', 'Aftermath %s' % build) wiz.setS('buildversion', ver[1:]) wiz.setS('lastbuildcheck', str(NEXTCHECK)) checkUpdate() elif current == SKINCHECK[3]: yes_pressed = DIALOG.yesno(ADDONTITLE,"[COLOR dodgerblue]Aftermath[/COLOR] CCM is currently outdated and is no longer being updated.", "Please download one of the newer community builds.", yeslabel="Build Menu", nolabel="Ignore") if yes_pressed: xbmc.executebuiltin('ActivateWindow(10025 , "plugin://%s/?mode=builds", return)' % ADDON_ID) else: DIALOG.ok(ADDONTITLE, 'You can still install a community build from the [COLOR dodgerblue]Aftermath[/COLOR] Wizard.') else: notify.firstRunSettings() notify.firstRun()
def checkSkin(): wiz.log("[Build Check] Invalid Skin Check Start") DEFAULTSKIN = wiz.getS('defaultskin') DEFAULTNAME = wiz.getS('defaultskinname') DEFAULTIGNORE = wiz.getS('defaultskinignore') gotoskin = False if not DEFAULTSKIN == '': if os.path.exists(os.path.join(ADDONS, DEFAULTSKIN)): if DIALOG.yesno( ADDONTITLE, "[COLOR %s]It seems that the skin has been set back to [COLOR %s]%s[/COLOR]" % (COLOR2, COLOR1, SKIN[5:].title()), "Would you like to set the skin back to:[/COLOR]", '[COLOR %s]%s[/COLOR]' % (COLOR1, DEFAULTNAME)): gotoskin = DEFAULTSKIN gotoname = DEFAULTNAME else: wiz.log("Skin was not reset", xbmc.LOGNOTICE) wiz.setS('defaultskinignore', 'true') gotoskin = False else: wiz.setS('defaultskin', '') wiz.setS('defaultskinname', '') DEFAULTSKIN = '' DEFAULTNAME = '' if DEFAULTSKIN == '': skinname = [] skinlist = [] for folder in glob.glob(os.path.join(ADDONS, 'skin.*/')): xml = "%s/addon.xml" % folder if os.path.exists(xml): f = open(xml, mode='r') g = f.read().replace('\n', '').replace('\r', '').replace('\t', '') f.close() match = re.compile('<addon.+?id="(.+?)".+?>').findall(g) match2 = re.compile('<addon.+?name="(.+?)".+?>').findall(g) wiz.log("%s: %s" % (folder, str(match[0])), xbmc.LOGNOTICE) if len(match) > 0: skinlist.append(str(match[0])) skinname.append(str(match2[0])) else: wiz.log("ID not found for %s" % folder, xbmc.LOGNOTICE) else: wiz.log("ID not found for %s" % folder, xbmc.LOGNOTICE) if len(skinlist) > 0: if len(skinlist) > 1: if DIALOG.yesno( ADDONTITLE, "[COLOR %s]It seems that the skin has been set back to [COLOR %s]%s[/COLOR]" % (COLOR2, COLOR1, SKIN[5:].title()), "Would you like to view a list of avaliable skins?[/COLOR]" ): choice = DIALOG.select("Select skin to switch to!", skinname) if choice == -1: wiz.log("Skin was not reset", xbmc.LOGNOTICE) wiz.setS('defaultskinignore', 'true') else: gotoskin = skinlist[choice] gotoname = skinname[choice] else: wiz.log("Skin was not reset", xbmc.LOGNOTICE) wiz.setS('defaultskinignore', 'true') else: if DIALOG.yesno( ADDONTITLE, "[COLOR %s]It seems that the skin has been set back to [COLOR %s]%s[/COLOR]" % (COLOR2, COLOR1, SKIN[5:].title()), "Would you like to set the skin back to:[/COLOR]", '[COLOR %s]%s[/COLOR]' % (COLOR1, skinname[0])): gotoskin = skinlist[0] gotoname = skinname[0] else: wiz.log("Skin was not reset", xbmc.LOGNOTICE) wiz.setS('defaultskinignore', 'true') else: wiz.log("No skins found in addons folder.", xbmc.LOGNOTICE) wiz.setS('defaultskinignore', 'true') gotoskin = False if gotoskin: skinSwitch.swapSkins(gotoskin) x = 0 xbmc.sleep(1000) while not xbmc.getCondVisibility( "Window.isVisible(yesnodialog)") and x < 150: x += 1 xbmc.sleep(200) if xbmc.getCondVisibility("Window.isVisible(yesnodialog)"): wiz.ebi('SendClick(11)') wiz.lookandFeelData('restore') else: wiz.LogNotify("[COLOR %s]%s[/COLOR]" (COLOR1, ADDONTITLE), '[COLOR %s]Skin Swap Timed Out![/COLOR]' % COLOR2) wiz.log("[Build Check] Invalid Skin Check End", xbmc.LOGNOTICE)
if not NOTIFY == 'true': url = wiz.workingURL(NOTIFICATION) if url == True: link = wiz.openURL(NOTIFICATION).replace('\r', '').replace('\t', '') id, msg = link.split('|||') if int(id) == int(NOTEID): if NOTEDISMISS == 'false': notify.notification(msg=msg) else: wiz.log("[Notifications] id[%s] Dismissed" % int(id), xbmc.LOGNOTICE) elif int(id) > int(NOTEID): wiz.log("[Notifications] id: %s" % str(int(id)), xbmc.LOGNOTICE) wiz.setS('noteid', str(int(id))) wiz.setS('notedismiss', 'false') notify.notification(msg=msg) wiz.log("[Notifications] Complete", xbmc.LOGNOTICE) else: wiz.log("[Notifications] URL(%s): %s" % (NOTIFICATION, url), xbmc.LOGNOTICE) else: wiz.log("[Notifications] Turned Off", xbmc.LOGNOTICE) else: wiz.log("[Notifications] Not Enabled", xbmc.LOGNOTICE) wiz.log("[Installed Check] Started", xbmc.LOGNOTICE) if INSTALLED == 'true': if KODIV >= 17: wiz.kodi17Fix()
'[COLOR %s]Debrid Info: 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) try: 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]Debrid Info: Restored![/COLOR]' % COLOR2, 2000, icon) except Exception, e: wiz.log( "[Debrid Info] Unable to Restore %s (%s)" % (who, str(e)), xbmc.LOGERROR) #else: wiz.LogNotify(name,'Real Debrid Info: [COLOR red]Not Found![/COLOR]', 2000, icon) elif do == 'clearaddon': wiz.log('%s SETTINGS: %s' % (name, settings), xbmc.LOGDEBUG) if os.path.exists(settings): try: f = open(settings, "r") lines = f.readlines()
def checkSkin(): wiz.log("[Build Check] Invalid Skin Check Start") DEFAULTSKIN = wiz.getS('defaultskin') DEFAULTNAME = wiz.getS('defaultskinname') DEFAULTIGNORE = wiz.getS('defaultskinignore') gotoskin = False if not DEFAULTSKIN == '': if os.path.exists(os.path.join(ADDONS, DEFAULTSKIN)): if DIALOG.yesno( ADDONTITLE, "[COLOR %s]It seems that the skin has been set back to [COLOR %s]%s[/COLOR]" % (COLOR2, COLOR1, SKIN[5:].title()), "Would you like to set the skin back to:[/COLOR]", '[COLOR %s]%s[/COLOR]' % (COLOR1, DEFAULTNAME)): gotoskin = DEFAULTSKIN gotoname = DEFAULTNAME else: wiz.log("Skin was not reset", xbmc.LOGNOTICE) wiz.setS('defaultskinignore', 'true') gotoskin = False else: wiz.setS('defaultskin', '') wiz.setS('defaultskinname', '') DEFAULTSKIN = '' DEFAULTNAME = '' if DEFAULTSKIN == '': skinname = [] skinlist = [] for folder in glob.glob(os.path.join(ADDONS, 'skin.*/')): xml = "%s/addon.xml" % folder if os.path.exists(xml): f = open(xml, mode='r') g = f.read().replace('\n', '').replace('\r', '').replace('\t', '') f.close() match = wiz.parseDOM(g, 'addon', ret='id') match2 = wiz.parseDOM(g, 'addon', ret='name') wiz.log("%s: %s" % (folder, str(match[0])), xbmc.LOGNOTICE) if len(match) > 0: skinlist.append(str(match[0])) skinname.append(str(match2[0])) else: wiz.log("ID not found for %s" % folder, xbmc.LOGNOTICE) else: wiz.log("ID not found for %s" % folder, xbmc.LOGNOTICE) if len(skinlist) > 0: if len(skinlist) > 1: if DIALOG.yesno( ADDONTITLE, "[COLOR %s]It seems that the skin has been set back to [COLOR %s]%s[/COLOR]" % (COLOR2, COLOR1, SKIN[5:].title()), "Would you like to view a list of avaliable skins?[/COLOR]" ): choice = DIALOG.select("Select skin to switch to!", skinname) if choice == -1: wiz.log("Skin was not reset", xbmc.LOGNOTICE) wiz.setS('defaultskinignore', 'true') else: gotoskin = skinlist[choice] gotoname = skinname[choice] else: wiz.log("Skin was not reset", xbmc.LOGNOTICE) wiz.setS('defaultskinignore', 'true') else: if DIALOG.yesno( ADDONTITLE, "[COLOR %s]It seems that the skin has been set back to [COLOR %s]%s[/COLOR]" % (COLOR2, COLOR1, SKIN[5:].title()), "Would you like to set the skin back to:[/COLOR]", '[COLOR %s]%s[/COLOR]' % (COLOR1, skinname[0])): gotoskin = skinlist[0] gotoname = skinname[0] else: wiz.log("Skin was not reset", xbmc.LOGNOTICE) wiz.setS('defaultskinignore', 'true') else: wiz.log("No skins found in addons folder.", xbmc.LOGNOTICE) wiz.setS('defaultskinignore', 'true') gotoskin = False if gotoskin: if wiz.swapSkins(gotoskin): wiz.lookandFeelData('restore') wiz.log("[Build Check] Invalid Skin Check End", xbmc.LOGNOTICE)