Beispiel #1
0
def allWithProgress(_in, _out, dp):
	zin = zipfile.ZipFile(_in,  'r')
	nFiles = float(len(zin.namelist()))
	count = 0; errors = 0; error = '';
	zipit = str(_in).replace('\\', '/').split('/'); zname = zipit[len(zipit)-1].replace('.zip', '')
	try:
		for item in zin.infolist():
			count += 1; update = int(count / nFiles * 100);
			file = str(item.filename).split('/')
			x = len(file)-1
			if file[x] == 'sources.xml' and file[x-1] == 'userdata' and KEEPSOURCES == 'true': dp.update(update, '' ,'Skipping: [COLOR yellow]%s[/COLOR]' % item.filename); wiz.log("Skipping: %s" % item.filename)
			elif file[x] == 'favourites.xml' and file[x-1] == 'userdata' and KEEPFAVS == 'true': dp.update(update, '' ,'Skipping: [COLOR yellow]%s[/COLOR]' % item.filename); wiz.log("Skipping: %s" % item.filename)
			elif file[x] == 'profiles.xml' and file[x-1] == 'userdata' and KEEPPROFILES == 'true': dp.update(update, '' ,'Skipping: [COLOR yellow]%s[/COLOR]' % item.filename); wiz.log("Skipping: %s" % item.filename)
			elif file[x] == 'advancedsettings.xml' and file[x-1] == 'userdata' and KEEPADVANCED == 'true': dp.update(update, '' ,'Skipping: [COLOR yellow]%s[/COLOR]' % item.filename); wiz.log("Skipping: %s" % item.filename)
			elif file[x] in ["kodi.log", "kodi.old.log", "Thumb.db", ".DS_Store"]: dp.update(update, '' ,'Skipping: [COLOR yellow]%s[/COLOR]' % item.filename); wiz.log("Skipping: %s" % item.filename)
			elif not str(item.filename).find(ADDON_ID) == -1: dp.update(update, '' ,'Skipping: [COLOR yellow]%s[/COLOR]' % item.filename); wiz.log("Skipping: %s" % item.filename)
			else:
				dp.update(update, '[COLOR dodgerblue]%s[/COLOR] [Errors:%s]' % (zname, errors),'Extracting: [COLOR yellow]%s[/COLOR]' % item.filename)
				try:
					zin.extract(item, _out)
				except Exception, e:
					wiz.log('%s / %s' % (e, item.filename))
					errors += 1; error += '%s\n' % e
	except Exception, e:
		wiz.log('%s / %s' % (Exception, e)) 
Beispiel #2
0
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)
Beispiel #3
0
		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)
Beispiel #4
0
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)
Beispiel #5
0
def allWithProgress(_in, _out, dp, ignore):
	count = 0; errors = 0; error = ''; update = 0;
	try:
		zin = zipfile.ZipFile(_in,  'r')
	except Exception, e:
		errors += 1; error += '%s\n' % e
		wiz.log('%s / %s' % (Exception, e))
		return '%d/%d/%s' % (update, errors, error)
Beispiel #6
0
		def __init__(self,L=0,T=0,W=1280,H=720,TxtColor='0xFFFFFFFF',Font='font14',BorderWidth=10):
			if BUILDNAME == "" or not wiz.checkBuild(BUILDNAME, 'version'):
				bgArt   = ICON
				icon    = ICON
				build   = "Test Window"
				version = '1.0'
				latest  = '1.0'
			else:
				bgArt   = wiz.checkBuild(BUILDNAME, 'fanart')
				icon    = wiz.checkBuild(BUILDNAME, 'icon')
				build   = BUILDNAME
				version = BUILDVERSION
				latest  = wiz.checkBuild(BUILDNAME, 'version')
			wiz.log(bgArt)
			image_path = os.path.join(ART, 'ContentPanel.png')
			self.border = xbmcgui.ControlImage(L,T,W,H, image_path)
			self.addControl(self.border); 
			self.BG=xbmcgui.ControlImage(L+BorderWidth, T+BorderWidth, W-(BorderWidth*2), H-(BorderWidth*2), bgArt, aspectRatio=0, colorDiffuse='0x5FFFFFFF')
			self.addControl(self.BG)
			#title
			times = int(float(Font[-2:]))
			title = ADDONTITLE
			temp = title.replace('[', '<').replace(']', '>')
			temp = re.sub('<[^<]+?>', '', temp)
			title_width = len(str(temp))*(times - 1)
			title   = THEME2 % title
			self.title=xbmcgui.ControlTextBox(L+(W-title_width)/2,T+BorderWidth,title_width,30,font='font14',textColor='0xFF1E90FF')
			self.addControl(self.title)
			self.title.setText(title)
			#update
			if version < latest: msg = "Update avaliable for installed build:\n[COLOR %s]%s[/COLOR]\n\nCurrent Version: v[COLOR %s]%s[/COLOR]\nLatest Version: v[COLOR %s]%s[/COLOR]\n\n[COLOR %s]*Recommened: Fresh install[/COLOR]" % (COLOR1, build, COLOR1, version, COLOR1, latest, COLOR1)
			else: msg = "Running latest version of installed build:\n[COLOR %s]%s[/COLOR]\n\nCurrent Version: v[COLOR %s]%s[/COLOR]\nLatest Version: v[COLOR %s]%s[/COLOR]\n\n[COLOR %s]*Recommened: Fresh install[/COLOR]" % (COLOR1, build, COLOR1, version, COLOR1, latest, COLOR1)
			msg = THEME2 % msg
			self.update=xbmcgui.ControlTextBox(L+(BorderWidth*2),T+BorderWidth+30,W-150-(BorderWidth*3),H-(BorderWidth*2)-30,font=Font,textColor=TxtColor)
			self.addControl(self.update)
			self.update.setText(msg)
			#icon
			self.Icon=xbmcgui.ControlImage(L+W-(BorderWidth*2)-150, T+BorderWidth+35, 150, 150, icon, aspectRatio=0, colorDiffuse='0xAFFFFFFF')
			self.addControl(self.Icon)
			#buttons
			focus=os.path.join(ART, 'button-focus_lightblue.png'); nofocus=os.path.join(ART, 'button-focus_grey.png')
			w1      = int((W-(BorderWidth*5))/3); h1 = 35
			t       = int(T+H-h1-(BorderWidth*1.5))
			fresh   = int(L+(BorderWidth*1.5))
			normal  = int(fresh+w1+BorderWidth)
			ignore  = int(normal+w1+BorderWidth)
			
			self.buttonFRESH=xbmcgui.ControlButton(fresh,t, w1,h1,"Fresh Install",textColor="0xFF000000",focusedColor="0xFF000000",alignment=2,focusTexture=focus,noFocusTexture=nofocus)
			self.buttonNORMAL=xbmcgui.ControlButton(normal,t,w1,h1,"Normal Install",textColor="0xFF000000",focusedColor="0xFF000000",alignment=2,focusTexture=focus,noFocusTexture=nofocus)
			self.buttonIGNORE=xbmcgui.ControlButton(ignore,t,w1,h1,"Ignore 3 days",textColor="0xFF000000",focusedColor="0xFF000000",alignment=2,focusTexture=focus,noFocusTexture=nofocus)
			self.addControl(self.buttonFRESH); self.addControl(self.buttonNORMAL); self.addControl(self.buttonIGNORE)
			self.buttonIGNORE.controlLeft(self.buttonNORMAL); self.buttonIGNORE.controlRight(self.buttonFRESH)
			self.buttonNORMAL.controlLeft(self.buttonFRESH); self.buttonNORMAL.controlRight(self.buttonIGNORE)
			self.buttonFRESH.controlLeft(self.buttonIGNORE); self.buttonFRESH.controlRight(self.buttonNORMAL)
			self.setFocus(self.buttonFRESH)
Beispiel #7
0
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")
Beispiel #8
0
	def email_Log(self, email, results, file):
		URL = 'http://aftermathwizard.net/mail_logs.php'
		data = {'email': email, 'results': results, 'file': file, 'wizard': ADDONTITLE}
		params = urlencode(data)
		url_opener = pasteURLopener()
		try:
			result     = url_opener.open(URL, params)
			returninfo = result.read()
			wiz.log(str(returninfo), xbmc.LOGNOTICE)
		except Exception, e:
			a = 'failed to connect to the server'
			wiz.log("%s: %s" % (a, str(e)), xbmc.LOGERROR)
			return False, a
Beispiel #9
0
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)
Beispiel #10
0
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)
Beispiel #11
0
 def readLog(self, path):
     try:
         lf = xbmcvfs.File(path)
         content = lf.read()
         lf.close()
         if content:
             return True, content
         else:
             wiz.log('file is empty', xbmc.LOGNOTICE)
             return False, "File is Empty"
     except:
         wiz.log('unable to read file', xbmc.LOGNOTICE)
         return False, "Unable to Read File"
Beispiel #12
0
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)
Beispiel #13
0
	def postLog(self, data, name):
		params = {}
		params['poster'] = 'kodi'
		params['content'] = data
		params['syntax'] = 'text'
		params = urlencode(params)

		url_opener = pasteURLopener()

		try:
			page = url_opener.open(URL, params)
		except Exception, e:
			a = 'failed to connect to the server'
			wiz.log("%s: %s" % (a, str(e)), xbmc.LOGERROR)
			return False, a
Beispiel #14
0
	def showResult(self, message, url=None):
		if not url == None:
			try:
				fn        = url.split('/')[-2]
				imagefile = wiz.generateQR(url, fn)
				qr = QRCode( "loguploader.xml" , ADDON.getAddonInfo('path'), 'DefaultSkin', image=imagefile, text=message)
				qr.doModal()
				del qr
				try:
					os.remove(imagefile)
				except: 
					pass
			except Exception, e:
				wiz.log(str(e), xbmc.LOGNOTICE)
				confirm   = DIALOG.ok(ADDONTITLE, "[COLOR %s]%s[/COLOR]" % (COLOR2, message))
Beispiel #15
0
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')
Beispiel #16
0
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)
Beispiel #17
0
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)
Beispiel #18
0
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)
Beispiel #19
0
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')
Beispiel #20
0
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')
Beispiel #21
0
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')
Beispiel #22
0
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')
Beispiel #23
0
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')
Beispiel #24
0
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')
Beispiel #25
0
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)
Beispiel #26
0
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")
Beispiel #27
0
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)))
Beispiel #28
0
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)
Beispiel #29
0
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)
Beispiel #30
0
 def getFiles(self):
     logfiles = []
     log    = wiz.Grab_Log(file=True)
     old    = wiz.Grab_Log(file=True, old=True)
     wizard = False if not os.path.exists(WIZLOG) else WIZLOG
     if log != False:
         if os.path.exists(log): logfiles.append(['log', log])
         else: self.showResult("No log file found")
     else: self.showResult("No log file found")
     if self.oldlog:
         if old != False:
             if os.path.exists(old): logfiles.append(['oldlog', old])
             else: self.showResult("No old log file found")
         else: self.showResult("No old log file found")
     if self.wizlog:
         if wizard != False:
             logfiles.append(['wizlog', wizard])
         else: self.showResult("No wizard log file found")
     if self.crashlog:
         crashlog_path = ''
         items = []
         if xbmc.getCondVisibility('system.platform.osx'):
             crashlog_path = os.path.join(os.path.expanduser('~'), 'Library/Logs/DiagnosticReports/')
             filematch = 'Kodi'
         elif xbmc.getCondVisibility('system.platform.ios'):
             crashlog_path = '/var/mobile/Library/Logs/CrashReporter/'
             filematch = 'Kodi'
         elif wiz.platform() == 'linux':
             crashlog_path = os.path.expanduser('~') # not 100% accurate (crashlogs can be created in the dir kodi was started from as well)
             filematch = 'kodi_crashlog'
         elif wiz.platform() == 'windows':
             wiz.log("Windows crashlogs are not supported, please disable this option in the addon settings", xbmc.LOGNOTICE)
             #self.showResult("Windows crashlogs are not supported, please disable this option in the addon settings")
         elif wiz.platform() == 'android':
             wiz.log("Android crashlogs are not supported, please disable this option in the addon settings", xbmc.LOGNOTICE)
             #self.showResult("Android crashlogs are not supported, please disable this option in the addon settings")
         if crashlog_path and os.path.isdir(crashlog_path):
             dirs, files = xbmcvfs.listdir(crashlog_path)
             for item in files:
                 if filematch in item and os.path.isfile(os.path.join(crashlog_path, item)):
                     items.append(os.path.join(crashlog_path, item))
                     items.sort(key=lambda f: os.path.getmtime(f))
                     lastcrash = items[-1]
                     logfiles.append(['crashlog', lastcrash])
         if len(items) == 0:
             wiz.log("No crashlog file found", xbmc.LOGNOTICE)
     return logfiles
Beispiel #31
0
            wiz.lookandFeelData('restore')
        else:
            wiz.LogNotify("[COLOR %s]%s[/COLOR]" % (COLOR1, ADDONTITLE),
                          '[COLOR %s]Skin Wechsel Timed Out![/COLOR]' % COLOR2)
    wiz.log("[Build Check] Invalid Skin Check End", xbmc.LOGNOTICE)


while xbmc.Player().isPlayingVideo():
    xbmc.sleep(1000)

if KODIV >= 17:
    NOW = datetime.now()
    temp = wiz.getS('kodi17iscrap')
    if not temp == '':
        if temp > str(NOW - timedelta(minutes=2)):
            wiz.log("Killing Start Up Script")
            sys.exit()
    wiz.log("%s" % (NOW))
    wiz.setS('kodi17iscrap', str(NOW))
    xbmc.sleep(1000)
    if not wiz.getS('kodi17iscrap') == str(NOW):
        wiz.log("Killing Start Up Script")
        sys.exit()
    else:
        wiz.log("Continuing Start Up Script")

wiz.log("[Path Check] Started", xbmc.LOGNOTICE)
path = os.path.split(ADDONPATH)
if not ADDONID == path[1]:
    DIALOG.ok(
        ADDONTITLE,
Beispiel #32
0
 def doIgnore(self):
     self.close()
     wiz.log(
         "[First Run] [User Selected: Ignore Build Menu] [Next Check: %s]"
         % str(NEXTCHECK), xbmc.LOGNOTICE)
     wiz.setS('lastbuildcheck', str(NEXTCHECK))
Beispiel #33
0
         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]Real Debrid: Restored![/COLOR]' % COLOR2, 2000,
                 icon)
         except Exception, e:
             wiz.log(
                 "[Real Debrid Data] Unable to Restore %s (%s)" %
                 (who, str(e)), xbmc.LOGERROR)
     #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):
         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)
Beispiel #34
0
TODAY = date.today()
TOMORROW = TODAY + timedelta(days=1)
TWODAYS = TODAY + timedelta(days=2)
THREEDAYS = TODAY + timedelta(days=3)
ONEWEEK = TODAY + timedelta(days=7)
MONTH = TODAY + timedelta(days=30)
KODIV = float(xbmc.getInfoLabel("System.BuildVersion")[:4])
EXCLUDES = uservar.EXCLUDES
COLOR1 = uservar.COLOR1
COLOR2 = uservar.COLOR2
FAILED = False

###########################
####  ######
###########################
wiz.log("[Auto Clean Up] Started", xbmc.LOGNOTICE)
if AUTOCLEANUP == 'true':
    service = False
    days = [TODAY, TOMORROW, THREEDAYS, ONEWEEK, MONTH]
    feq = int(float(AUTOFEQ))
    if AUTONEXTRUN <= str(TODAY) or feq == 0:
        service = True
        next_run = days[feq]
        wiz.setS('nextautocleanup', str(next_run))
    else:
        wiz.log("[Auto Clean Up] Next Clean Up %s" % AUTONEXTRUN,
                xbmc.LOGNOTICE)
    if service == True:
        AUTOCACHE = wiz.getS('clearcache')
        AUTOPACKAGES = wiz.getS('clearpackages')
        AUTOTHUMBS = wiz.getS('clearthumbs')
Beispiel #35
0
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]Es scheint der Skin wurde zuruck gesetzt auf [COLOR %s]%s[/COLOR]"
                    % (COLOR2, COLOR1, SKIN[5:].title()),
                    "Willst du den Skin zuruck setzten auf:[/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]Es scheint der Skin wurde zuruck gesetzt auf [COLOR %s]%s[/COLOR]"
                        % (COLOR2, COLOR1, SKIN[5:].title()),
                        "Willst du eine Liste aller Skins sehen?[/COLOR]"):
                    choice = DIALOG.select("Wahle Skin aus!", 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]Es scheint der Skin wurde zuruck gesetzt auf [COLOR %s]%s[/COLOR]"
                        % (COLOR2, COLOR1, SKIN[5:].title()),
                        "Willst du den Skin zuruck setzten auf:[/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 Wechsel Timed Out![/COLOR]' % COLOR2)
    wiz.log("[Build Check] Invalid Skin Check End", xbmc.LOGNOTICE)