mirror of
https://github.com/FlareSolverr/FlareSolverr.git
synced 2026-05-01 03:55:35 +02:00
Remove outdated chaptcha solvers
This commit is contained in:
@@ -1,31 +0,0 @@
|
||||
import got from 'got'
|
||||
import { sleep } from '../services/utils'
|
||||
|
||||
/*
|
||||
This method uses the captcha-harvester project:
|
||||
https://github.com/NoahCardoza/CaptchaHarvester
|
||||
|
||||
While the function must take url/sitekey/type args,
|
||||
they aren't used because the harvester server must
|
||||
be preconfigured.
|
||||
|
||||
ENV:
|
||||
HARVESTER_ENDPOINT: This must be the full path
|
||||
to the /token endpoint of the harvester.
|
||||
E.G. "https://127.0.0.1:5000/token"
|
||||
*/
|
||||
|
||||
export default async function solve(): Promise<string> {
|
||||
const endpoint = process.env.HARVESTER_ENDPOINT
|
||||
if (!endpoint) { throw Error('ENV variable `HARVESTER_ENDPOINT` must be set.') }
|
||||
while (true) {
|
||||
try {
|
||||
return (await got.get(process.env.HARVESTER_ENDPOINT, {
|
||||
https: { rejectUnauthorized: false }
|
||||
})).body
|
||||
} catch (e) {
|
||||
if (e.response.statusCode !== 418) { throw e }
|
||||
}
|
||||
await sleep(3000)
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
const solveCaptcha = require('hcaptcha-solver');
|
||||
import { SolverOptions } from '.'
|
||||
/*
|
||||
This method uses the hcaptcha-solver project:
|
||||
https://github.com/JimmyLaurent/hcaptcha-solver
|
||||
|
||||
TODO: allow user pass custom options to the solver.
|
||||
|
||||
ENV:
|
||||
There are no other variables that must be set to get this to work
|
||||
*/
|
||||
|
||||
export default async function solve({ url }: SolverOptions): Promise<string> {
|
||||
throw new Error("hcaptcha-solver is not able to solve the new hCaptcha challenge. This issue is already reported #31.");
|
||||
|
||||
/*
|
||||
try {
|
||||
return await solveCaptcha(url)
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
return null
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user