fix: use correct fetch for FlareSolverr
This commit is contained in:
parent
b7930014ab
commit
68cfa65135
1 changed files with 2 additions and 3 deletions
|
|
@ -219,9 +219,8 @@ export class Fetcher {
|
|||
|
||||
this.logger.info(`Query FlareSolverr for ${url.href}`, ctx);
|
||||
|
||||
const body = { cmd: 'request.get', url: url.href, session: 'default' };
|
||||
// @ts-expect-error idjaow awdiajwdoajwdoiajwdoi
|
||||
const challengeResult = await (await this.queuedFetch(ctx, new URL(flareSolverrEndpoint), { method: 'POST', body: JSON.stringify(body), headers: { 'Content-Type': 'application/json' }, queueLimit: 1, timeout: 15000 })).json() as FlareSolverrResult;
|
||||
const data = { cmd: 'request.get', url: url.href, session: 'default' };
|
||||
const challengeResult = (await this.queuedFetch(ctx, new URL(flareSolverrEndpoint), { method: 'POST', data, headers: { 'Content-Type': 'application/json' }, queueLimit: 1, timeout: 15000 })).data as FlareSolverrResult;
|
||||
if (challengeResult.status !== 'ok') {
|
||||
this.logger.warn(`FlareSolverr issue: ${JSON.stringify(challengeResult)}`, ctx);
|
||||
throw new BlockedError(url, BlockedReason.flaresolverr_failed, {});
|
||||
|
|
|
|||
Loading…
Reference in a new issue