Skip to content

Commit edd6286

Browse files
author
CookiesKush420
authored
Cleanup
1 parent b91d2a2 commit edd6286

File tree

2 files changed

+53
-83
lines changed

2 files changed

+53
-83
lines changed

keyauth.py

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,15 @@
1-
import win32security #get sid
2-
import json as jsond # json
31

4-
import time # sleep before exit
5-
6-
import binascii # hex encoding
7-
8-
# https requests
9-
10-
from uuid import uuid4 # gen random guid
11-
import webbrowser
12-
import platform
13-
import subprocess
14-
import datetime
15-
import sys
162
import os
3+
import sys
4+
import time
5+
import binascii
6+
import platform
177
import requests
18-
from requests_toolbelt.adapters.fingerprint import FingerprintAdapter
8+
import win32security
9+
10+
import json as jsond
11+
12+
from uuid import uuid4
1913

2014
try:
2115
from Crypto.Cipher import AES
@@ -33,13 +27,10 @@ class api:
3327
name = ownerid = secret = version = hash_to_check = ""
3428

3529
def __init__(self, name, ownerid, secret, version, hash_to_check):
36-
self.name = name
37-
38-
self.ownerid = ownerid
39-
40-
self.secret = secret
41-
42-
self.version = version
30+
self.name = name
31+
self.ownerid = ownerid
32+
self.secret = secret
33+
self.version = version
4334
self.hash_to_check = hash_to_check
4435
self.init()
4536

main.py

Lines changed: 40 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,28 @@
1-
from keyauth import api
21
import os
32
import sys
43
import os.path
5-
import platform
64
import hashlib
5+
76
from time import sleep
7+
from keyauth import api
88
from datetime import datetime
99

10-
# watch setup video if you need help https://www.youtube.com/watch?v=L2eAQOmuUiA
10+
'''
11+
12+
Watch setup video if you need help
13+
https://www.youtube.com/watch?v=L2eAQOmuUiA
14+
15+
'''
16+
17+
1118
os.system("cls")
1219
os.system("title Python Example")
1320
print("Initializing")
21+
1422
def getchecksum():
1523
path = os.path.basename(__file__)
16-
if not os.path.exists(path):
17-
path = path[:-2] + "exe"
18-
md5_hash = hashlib.md5()
19-
a_file = open(path,"rb")
20-
content = a_file.read()
21-
md5_hash.update(content)
22-
digest = md5_hash.hexdigest()
23-
return digest
24+
if not os.path.exists(path): path = path[:-2] + "exe"
25+
md5_hash = hashlib.md5() ; a_file = open(path,"rb") ; content = a_file.read() ; md5_hash.update(content) ; digest = md5_hash.hexdigest() ; return digest
2426

2527
keyauthapp = api(
2628
name = "",
@@ -30,43 +32,27 @@ def getchecksum():
3032
hash_to_check = getchecksum()
3133
)
3234

33-
print(f"""
34-
App data:
35-
Number of users: {keyauthapp.app_data.numUsers}
36-
Number of online users: {keyauthapp.app_data.onlineUsers}
37-
Number of keys: {keyauthapp.app_data.numKeys}
38-
Application Version: {keyauthapp.app_data.app_ver}
39-
Customer panel link: {keyauthapp.app_data.customer_panel}
40-
""")
35+
print(f"\nApp data:\nNumber of users: {keyauthapp.app_data.numUsers}\nNumber of online users: {keyauthapp.app_data.onlineUsers}\nNumber of keys: {keyauthapp.app_data.numKeys}\nApplication Version: {keyauthapp.app_data.app_ver}\nCustomer panel link: {keyauthapp.app_data.customer_panel}\n")
4136
print(f"Current Session Validation Status: {keyauthapp.check()}")
42-
print(f"Blacklisted? : {keyauthapp.checkblacklist()}") # check if blacklisted, you can edit this and make it exit the program if blacklisted
43-
print ("""
44-
1.Login
45-
2.Register
46-
3.Upgrade
47-
4.License Key Only
48-
""")
37+
print(f"Blacklisted? : {keyauthapp.checkblacklist()}") ## check if blacklisted, you can edit this and make it exit the program if blacklisted
38+
print ("\n1.Login\n2.Register\n3.Upgrade\n4.License Key Only\n")
39+
4940
ans=input("Select Option: ")
50-
if ans=="1":
51-
user = input('Provide username: ')
52-
password = input('Provide password: ')
53-
keyauthapp.login(user,password)
54-
elif ans=="2":
55-
user = input('Provide username: ')
56-
password = input('Provide password: ')
57-
license = input('Provide License: ')
58-
keyauthapp.register(user,password,license)
59-
elif ans=="3":
60-
user = input('Provide username: ')
61-
license = input('Provide License: ')
62-
keyauthapp.upgrade(user,license)
41+
42+
if ans=="1": ## Login
43+
user = input('Provide username: ') ; password = input('Provide password: ') ; keyauthapp.login(user,password)
44+
45+
elif ans=="2": ## Register
46+
user = input('Provide username: ') ; password = input('Provide password: ') ; license = input('Provide License: ') ; keyauthapp.register(user,password,license)
47+
48+
elif ans=="3": ## Upgrade
49+
user = input('Provide username: ') ; license = input('Provide License: ') ; keyauthapp.upgrade(user,license)
6350

64-
elif ans=="4":
65-
key = input('Enter your license: ')
66-
keyauthapp.license(key)
67-
else:
68-
print("\nNot Valid Option")
69-
sys.exit()
51+
elif ans=="4": ## License Key Only
52+
key = input('Enter your license: ') ; keyauthapp.license(key)
53+
54+
else: ## Invalid Option
55+
print("\nNot Valid Option") ; sys.exit()
7056

7157

7258
#region Extra Functions
@@ -116,27 +102,21 @@ def getchecksum():
116102

117103
#endregion
118104

119-
print("\nUser data: ")
120-
print("Username: " + keyauthapp.user_data.username)
121-
print("IP address: " + keyauthapp.user_data.ip)
122-
print("Hardware-Id: " + keyauthapp.user_data.hwid)
123-
#print("Subcription: " + keyauthapp.user_data.subscription) ## Print Subscription "ONE" name
105+
print("\nUser data: ") ; print("Username: " + keyauthapp.user_data.username) ; print("IP address: " + keyauthapp.user_data.ip) ; print("Hardware-Id: " + keyauthapp.user_data.hwid)
106+
# print("Subcription: " + keyauthapp.user_data.subscription) ## Print Subscription "ONE" name
124107

125108
subs = keyauthapp.user_data.subscriptions ## Get all Subscription names, expiry, and timeleft
126109
for i in range(len(subs)):
127-
sub = subs[i]["subscription"] # Subscription from every Sub
128-
expiry = datetime.utcfromtimestamp(int(subs[i]["expiry"])).strftime('%Y-%m-%d %H:%M:%S') ## Expiry date from every Sub
129-
timeleft = subs[i]["timeleft"] ## Timeleft from every Sub
130-
131-
print(f"[{i + 1} / {len(subs)}] | Subscription: {sub} - Expiry: {expiry} - Timeleft: {timeleft}")
110+
sub = subs[i]["subscription"] ## Subscription from every Sub
111+
expiry = datetime.utcfromtimestamp(int(subs[i]["expiry"])).strftime('%Y-%m-%d %H:%M:%S') ## Expiry date from every Sub
112+
timeleft = subs[i]["timeleft"] ## Timeleft from every Sub
113+
print(f"[{i + 1} / {len(subs)}] | Subscription: {sub} - Expiry: {expiry} - Timeleft: {timeleft}")
132114

133115
onlineUsers = keyauthapp.fetchOnline()
134116
OU = "" ## KEEP THIS EMPTY FOR NOW, THIS WILL BE USED TO CREATE ONLINE USER STRING.
135-
if onlineUsers == None:
136-
OU = "No online users"
117+
if onlineUsers == None: OU = "No online users"
137118
else:
138-
for i in range(len(onlineUsers)):
139-
OU += onlineUsers[i]["credential"] + " "
119+
for i in range(len(onlineUsers)): OU += onlineUsers[i]["credential"] + " "
140120

141121
print("\n" + OU + "\n")
142122

@@ -146,5 +126,4 @@ def getchecksum():
146126
print("Expires at: " + datetime.utcfromtimestamp(int(keyauthapp.user_data.expires)).strftime('%Y-%m-%d %H:%M:%S'))
147127
print(f"Current Session Validation Status: {keyauthapp.check()}")
148128
print("Exiting in 10 secs....")
149-
sleep(10)
150-
sys.exit(0)
129+
sleep(10) ; sys.exit(0)

0 commit comments

Comments
 (0)