@@ -13,8 +13,6 @@ also if you want to use an obfuscator for rust i recommend using [obfstr](https:
1313
1414use uuid:: Uuid ;
1515use std:: collections:: HashMap ;
16- use std:: io:: Read ;
17- use std:: net:: TcpListener ;
1816use reqwest:: blocking:: Client ;
1917use reqwest:: blocking:: Response ;
2018use hmac_sha256:: HMAC ;
@@ -42,6 +40,8 @@ pub struct KeyauthApi {
4240 pub create_date : String ,
4341 pub last_login : String ,
4442 pub subscription : String ,
43+ pub sub_time_left : i64 ,
44+ pub expiry : String ,
4545 pub message : String ,
4646 pub success : bool ,
4747 pub blacklisted : bool ,
@@ -71,6 +71,8 @@ impl KeyauthApi {
7171 create_date : String :: new ( ) ,
7272 last_login : String :: new ( ) ,
7373 subscription : String :: new ( ) ,
74+ sub_time_left : 0 ,
75+ expiry : String :: new ( ) ,
7476 message : String :: new ( ) ,
7577 success : false ,
7678 blacklisted : false ,
@@ -195,6 +197,8 @@ impl KeyauthApi {
195197 self . create_date = json_rep[ "info" ] [ "createdate" ] . as_str ( ) . unwrap ( ) . to_string ( ) ;
196198 self . last_login = json_rep[ "info" ] [ "lastlogin" ] . as_str ( ) . unwrap ( ) . to_string ( ) ;
197199 self . subscription = json_rep[ "info" ] [ "subscriptions" ] [ 0 ] [ "subscription" ] . as_str ( ) . unwrap ( ) . to_string ( ) ;
200+ self . sub_time_left = json_rep[ "info" ] [ "subscriptions" ] [ 0 ] [ "timeleft" ] . as_i64 ( ) . unwrap ( ) ;
201+ self . expiry = json_rep[ "info" ] [ "subscriptions" ] [ 0 ] [ "expiry" ] . as_str ( ) . unwrap ( ) . to_string ( ) ;
198202 Ok ( ( ) )
199203 } else {
200204 Err ( json_rep[ "message" ] . as_str ( ) . unwrap ( ) . to_string ( ) )
@@ -294,6 +298,8 @@ impl KeyauthApi {
294298 self . create_date = json_rep[ "info" ] [ "createdate" ] . as_str ( ) . unwrap ( ) . to_string ( ) ;
295299 self . last_login = json_rep[ "info" ] [ "lastlogin" ] . as_str ( ) . unwrap ( ) . to_string ( ) ;
296300 self . subscription = json_rep[ "info" ] [ "subscriptions" ] [ 0 ] [ "subscription" ] . as_str ( ) . unwrap ( ) . to_string ( ) ;
301+ self . sub_time_left = json_rep[ "info" ] [ "subscriptions" ] [ 0 ] [ "timeleft" ] . as_i64 ( ) . unwrap ( ) ;
302+ self . expiry = json_rep[ "info" ] [ "subscriptions" ] [ 0 ] [ "expiry" ] . as_str ( ) . unwrap ( ) . to_string ( ) ;
297303 Ok ( ( ) )
298304 } else {
299305 Err ( json_rep[ "message" ] . as_str ( ) . unwrap ( ) . to_string ( ) )
@@ -349,6 +355,8 @@ impl KeyauthApi {
349355 self . create_date = json_rep[ "info" ] [ "createdate" ] . as_str ( ) . unwrap ( ) . to_string ( ) ;
350356 self . last_login = json_rep[ "info" ] [ "lastlogin" ] . as_str ( ) . unwrap ( ) . to_string ( ) ;
351357 self . subscription = json_rep[ "info" ] [ "subscriptions" ] [ 0 ] [ "subscription" ] . as_str ( ) . unwrap ( ) . to_string ( ) ;
358+ self . sub_time_left = json_rep[ "info" ] [ "subscriptions" ] [ 0 ] [ "timeleft" ] . as_i64 ( ) . unwrap ( ) ;
359+ self . expiry = json_rep[ "info" ] [ "subscriptions" ] [ 0 ] [ "expiry" ] . as_str ( ) . unwrap ( ) . to_string ( ) ;
352360 Ok ( ( ) )
353361 } else {
354362 Err ( json_rep[ "message" ] . as_str ( ) . unwrap ( ) . to_string ( ) )
0 commit comments