FUNCTION Constant "<USER>" -> VAR "U"
Ls Constant "<PASS>" -> VAR "P"
FUNCTION GenerateGUID -> VAR "GUTK"
FUNCTION ToUppercase "<GUTK>" -> VAR "GUTK"
REQUEST POST "https://api.ipvanish.com/api/v3/login"
CONTENT "{\"username\":\"<USER>\",\"password\":\"<PASS>\",\"os\":\"iOS_15_7_0\",\"api_key\":\"185f600f32cee535b0bef41ad77c1acd\",\"client\":\"IPVanish_iOS_4.5.0_27\",\"uuid\":\"<GUTK>\"}"
CONTENTTYPE "application/json"
HEADER "Accept: */*"
HEADER "User-Agent: IPVanish/27 CFNetwork/1335.0.3 Darwin/21.6.0"
KEYCHECK
KEYCHAIN Failure OR
KEY "The username or password provided is incorrect"
KEY "code\":1100"
KEYCHAIN Success OR
KEY "account_type"
PARSE "<SOURCE>" JSON "account_type" CreateEmpty=FALSE -> CAP "SUBSCRIPTION PLAN"
PARSE "<SOURCE>" JSON "sub_end_epoch" -> VAR "expire"
FUNCTION CurrentUnixTime -> VAR "currentTime"
FUNCTION UnixTimeToDate "yyyy-MM-dd:HH-mm-ss" "<expire>" -> CAP "EXPIRATION DATE"
KEYCHECK BanOnToCheck=FALSE
KEYCHAIN Custom "EXPIRED" OR
KEY "<expire>" LessThan "<currentTime>"
KEYCHAIN Custom "FREE TRIAL 7d" OR
KEY "<Type>" EqualTo "1"
FUNCTION Constant "True✅" -> CAP "Mail Access"