예제 #1
0
def accountinfo():
	open = tools.OPEN_URL(panel_api)
	try:
		username   = tools.regex_from_to(open,'"username":"******"')
		password   = tools.regex_from_to(open,'"password":"******"')
		status     = tools.regex_from_to(open,'"status":"','"')
		connects   = tools.regex_from_to(open,'"max_connections":"','"')
		active     = tools.regex_from_to(open,'"active_cons":"','"')
		expiry     = tools.regex_from_to(open,'"exp_date":"','"')
		expiry     = datetime.datetime.fromtimestamp(int(expiry)).strftime('%d/%m/%Y - %H:%M')
		expreg     = re.compile('^(.*?)/(.*?)/(.*?)$',re.DOTALL).findall(expiry)
		for day,month,year in expreg:
			month     = tools.MonthNumToName(month)
			year      = re.sub(' -.*?$','',year)
			expiry    = month+' '+day+' - '+year
			ip        = tools.getlocalip()
			extip     = tools.getexternalip()
			tools.addDir('[COLOR blue]Username :[/COLOR] '+username,'','',icon,fanart,'')
			tools.addDir('[COLOR blue]Password :[/COLOR] '+password,'','',icon,fanart,'')
			tools.addDir('[COLOR blue]Expiry Date:[/COLOR] '+expiry,'','',icon,fanart,'')
			tools.addDir('[COLOR blue]Account Status :[/COLOR] %s'%status,'','',icon,fanart,'')
			tools.addDir('[COLOR blue]Current Connections:[/COLOR] '+ active,'','',icon,fanart,'')
			tools.addDir('[COLOR blue]Allowed Connections:[/COLOR] '+connects,'','',icon,fanart,'')
			tools.addDir('[COLOR blue]Local IP Address:[/COLOR] '+ip,'','',icon,fanart,'')
			tools.addDir('[COLOR blue]External IP Address:[/COLOR] '+extip,'','',icon,fanart,'')
	except:pass
예제 #2
0
def accountinfo():
		open = tools.OPEN_URL(panel_api)
		username   = tools.regex_from_to(open,'"username":"******"')
		password   = tools.regex_from_to(open,'"password":"******"')
		status     = tools.regex_from_to(open,'"status":"','"')
		connects   = tools.regex_from_to(open,'"max_connections":"','"')
		active     = tools.regex_from_to(open,'"active_cons":"','"')
		expiry     = tools.regex_from_to(open,'"exp_date":"','"')
		if not expiry=="":
			expiry     = datetime.datetime.fromtimestamp(int(expiry)).strftime('%d/%m/%Y - %H:%M')
			expreg     = re.compile('^(.*?)/(.*?)/(.*?)$',re.DOTALL).findall(expiry)
			for day,month,year in expreg:
				month     = tools.MonthNumToName(month)
				year      = re.sub(' -.*?$','',year)
				expiry    = month+' '+day+' - '+year
		else:
			expiry = 'Unlimited'
			
		ip        = tools.getlocalip()
		tools.addDir('[B][COLOR white]Username :[/COLOR][/B] '+username,'','',icon,background,'')
		tools.addDir('[B][COLOR white]Password :[/COLOR][/B] '+password,'','',icon,background,'')
		tools.addDir('[B][COLOR white]Expiry Date:[/COLOR][/B] '+expiry,'','',icon,background,'')
		tools.addDir('[B][COLOR white]Account Status :[/COLOR][/B] %s'%status,'','',icon,background,'')
		tools.addDir('[B][COLOR white]Current Connections:[/COLOR][/B] '+ active,'','',icon,background,'')
		tools.addDir('[B][COLOR white]Allowed Connections:[/COLOR][/B] '+connects,'','',icon,background,'')
		tools.addDir('[B][COLOR white]Local IP Address:[/COLOR][/B] '+ip,'','',icon,background,'')
		tools.addDir('[B][COLOR white]Kodi Version:[/COLOR][/B] '+str(KODIV),'','',icon,background,'')
예제 #3
0
def accountinfo(url):
    if 'server1' in url:
        username = control.setting('server1user')
        password = control.setting('server1pass')
        host = user.server1host
        port = user.server1port
        url = '%s:%s/panel_api.php?username=%s&password=%s' % (
            host, port, username, password)
        sub = '[COLOR FFE5E4E2]Platnium[/COLOR]'
    elif 'server2' in url:
        username = control.setting('server2user')
        password = control.setting('server2pass')
        host = user.server2host
        port = user.server2port
        url = '%s:%s/panel_api.php?username=%s&password=%s' % (
            host, port, username, password)
        sub = '[COLOR gold]Gold[/COLOR]'
    try:
        open = tools.OPEN_URL(url)
        username = tools.regex_from_to(open, '"username":"******"')
        password = tools.regex_from_to(open, '"password":"******"')
        status = tools.regex_from_to(open, '"status":"', '"')
        connects = tools.regex_from_to(open, '"max_connections":"', '"')
        active = tools.regex_from_to(open, '"active_cons":"', '"')
        expiry = tools.regex_from_to(open, '"exp_date":"', '"')
        if expiry == "":
            expiry = 'Unlimited'
        else:
            expiry = datetime.datetime.fromtimestamp(
                int(expiry)).strftime('%d/%m/%Y - %H:%M')
            expreg = re.compile('^(.*?)/(.*?)/(.*?)$',
                                re.DOTALL).findall(expiry)
            for day, month, year in expreg:
                month = tools.MonthNumToName(month)
                year = re.sub(' -.*?$', '', year)
                expiry = month + ' ' + day + ' - ' + year
        ip = tools.getlocalip()
        extip = tools.getexternalip()
        tools.addDir(
            '[COLOR white]Service:[/COLOR] [COLOR red]' + sub + '[/COLOR]', '',
            '', icon, fanart, '')
        tools.addDir('[COLOR white]Username:[/COLOR] ' + username, '', '',
                     icon, fanart, '')
        tools.addDir('[COLOR white]Password:[/COLOR] ' + password, '', '',
                     icon, fanart, '')
        tools.addDir('[COLOR white]Expiry Date:[/COLOR] ' + expiry, '', '',
                     icon, fanart, '')
        tools.addDir('[COLOR white]Account Status :[/COLOR] %s' % status, '',
                     '', icon, fanart, '')
        tools.addDir('[COLOR white]Current Connections:[/COLOR] ' + active, '',
                     '', icon, fanart, '')
        tools.addDir('[COLOR white]Allowed Connections:[/COLOR] ' + connects,
                     '', '', icon, fanart, '')
        tools.addDir('[COLOR white]Local IP Address:[/COLOR] ' + ip, '', '',
                     icon, fanart, '')
        tools.addDir('[COLOR white]External IP Address:[/COLOR] ' + extip, '',
                     '', icon, fanart, '')
        tools.addDir('[COLOR white]Kodi Version:[/COLOR] ' + str(KODIV), '',
                     '', icon, fanart, '')
    except:
        pass