1- from keyauth import api
21import os
32import sys
43import os .path
5- import platform
64import hashlib
5+
76from time import sleep
7+ from keyauth import api
88from 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+
1118os .system ("cls" )
1219os .system ("title Python Example" )
1320print ("Initializing" )
21+
1422def 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
2527keyauthapp = 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"\n App data:\n Number of users: { keyauthapp .app_data .numUsers } \n Number of online users: { keyauthapp .app_data .onlineUsers } \n Number of keys: { keyauthapp .app_data .numKeys } \n Application Version: { keyauthapp .app_data .app_ver } \n Customer panel link: { keyauthapp .app_data .customer_panel } \n " )
4136print (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 ("\n 1.Login\n 2.Register\n 3.Upgrade\n 4.License Key Only\n " )
39+
4940ans = 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 ("\n Not 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 ("\n Not Valid Option" ) ; sys .exit ()
7056
7157
7258#region Extra Functions
@@ -116,27 +102,21 @@ def getchecksum():
116102
117103#endregion
118104
119- print ("\n User 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 ("\n User 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
125108subs = keyauthapp .user_data .subscriptions ## Get all Subscription names, expiry, and timeleft
126109for 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
133115onlineUsers = keyauthapp .fetchOnline ()
134116OU = "" ## 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"
137118else :
138- for i in range (len (onlineUsers )):
139- OU += onlineUsers [i ]["credential" ] + " "
119+ for i in range (len (onlineUsers )): OU += onlineUsers [i ]["credential" ] + " "
140120
141121print ("\n " + OU + "\n " )
142122
@@ -146,5 +126,4 @@ def getchecksum():
146126print ("Expires at: " + datetime .utcfromtimestamp (int (keyauthapp .user_data .expires )).strftime ('%Y-%m-%d %H:%M:%S' ))
147127print (f"Current Session Validation Status: { keyauthapp .check ()} " )
148128print ("Exiting in 10 secs...." )
149- sleep (10 )
150- sys .exit (0 )
129+ sleep (10 ) ; sys .exit (0 )
0 commit comments