fix(fetcher): improve Flaresolverr fetching
- use queued fetching to not mix sessions - log issue responses
This commit is contained in:
parent
7c45c78788
commit
2c9faebcdc
1 changed files with 2 additions and 1 deletions
|
|
@ -82,8 +82,9 @@ export class Fetcher {
|
|||
this.logger.info(`Query FlareSolverr for ${url.href}`, ctx);
|
||||
|
||||
const body = { cmd: 'request.get', url: url.href, session: 'default' };
|
||||
const challengeResult = await (await fetch(new URL(flareSolverrEndpoint), { method: 'POST', body: JSON.stringify(body), headers: { 'Content-Type': 'application/json' } })).json();
|
||||
const challengeResult = await (await this.queuedFetch(ctx, new URL(flareSolverrEndpoint), { method: 'POST', body: JSON.stringify(body), headers: { 'Content-Type': 'application/json' } })).json();
|
||||
if (challengeResult.status !== 'ok') {
|
||||
this.logger.warn(`FlareSolverr issue: ${JSON.stringify(challengeResult)}`, ctx);
|
||||
throw new BlockedError('flaresolverr_failed', {});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue