A non-AI powered node.js library for solving GameFail's captcha.
npm install @zakku/ez-captchaA non-AI powered node.js library for solving GameFail's captcha.
``bash`
yarn add @zakku/ez-captchaor
npm i @zakku/ez-captcha
To use this package you need two things:
1. Captcha challenge id - Which you can retrieve by logging into the GameFail account and looking for gf-challenge-id{ requireCaptcha: boolean, id?: string }
header.
2. A login method - An asynchronous function that returns: object.
> Note: The id field needs to be present when requireCaptcha is equal to true
`typescript
import {LoginCaptcha, SolveResult, solveCaptcha} from "@banzar-team/ez-captcha";
const login = (): Promise
return fetch("https://spark.gameforge.com/api/v1/auth/sessions", {
method: "POST",
headers: {
"TNT-Installation-Id": "
},
body: JSON.stringify({
email: "
locale: "
password: "
}),
}).then((res) => {
if (res.status === 409) {
const challengeId = res.headers.get("gf-challenge-id");
return {
requireCaptcha: true,
id: challengeId !== null ? challengeId.split(";")[0] : undefined,
};
} else return {requireCaptcha: false};
});
};
(async () => {
const result: SolveResult = await solveCaptcha("
console.log(result) // { id: "
})();
``