mirror of
https://git.mirrors.martin98.com/https://github.com/jina-ai/reader
synced 2025-08-17 01:15:53 +08:00
saas: use android ua
This commit is contained in:
parent
fe26921648
commit
5ba93067d2
@ -233,6 +233,7 @@ export class SERPSpecializedPuppeteerControl extends AsyncService {
|
|||||||
livePages = new Set<Page>();
|
livePages = new Set<Page>();
|
||||||
lastPageCratedAt: number = 0;
|
lastPageCratedAt: number = 0;
|
||||||
ua: string = '';
|
ua: string = '';
|
||||||
|
effectiveUA: string = '';
|
||||||
|
|
||||||
protected _REPORT_FUNCTION_NAME = 'bingo';
|
protected _REPORT_FUNCTION_NAME = 'bingo';
|
||||||
|
|
||||||
@ -299,7 +300,8 @@ export class SERPSpecializedPuppeteerControl extends AsyncService {
|
|||||||
});
|
});
|
||||||
this.ua = await this.browser.userAgent();
|
this.ua = await this.browser.userAgent();
|
||||||
this.logger.info(`Browser launched: ${this.browser.process()?.pid}, ${this.ua}`);
|
this.logger.info(`Browser launched: ${this.browser.process()?.pid}, ${this.ua}`);
|
||||||
this.curlControl.impersonateChrome(this.ua.replace(/Headless/i, ''));
|
this.effectiveUA = this.ua.replace(/Headless/i, '').replace('Mozilla/5.0 (X11; Linux x86_64)', 'Mozilla/5.0 (Linux; Android 10; K)');
|
||||||
|
this.curlControl.impersonateChrome(this.effectiveUA);
|
||||||
|
|
||||||
await this.newPage('beware_deadlock').then((r) => this.__loadedPage.push(r));
|
await this.newPage('beware_deadlock').then((r) => this.__loadedPage.push(r));
|
||||||
|
|
||||||
@ -322,7 +324,7 @@ export class SERPSpecializedPuppeteerControl extends AsyncService {
|
|||||||
}
|
}
|
||||||
const preparations = [];
|
const preparations = [];
|
||||||
|
|
||||||
preparations.push(page.setUserAgent(this.ua.replace(/Headless/i, '')));
|
preparations.push(page.setUserAgent(this.effectiveUA));
|
||||||
// preparations.push(page.setUserAgent(`Slackbot-LinkExpanding 1.0 (+https://api.slack.com/robots)`));
|
// preparations.push(page.setUserAgent(`Slackbot-LinkExpanding 1.0 (+https://api.slack.com/robots)`));
|
||||||
// preparations.push(page.setUserAgent(`Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; GPTBot/1.0; +https://openai.com/gptbot)`));
|
// preparations.push(page.setUserAgent(`Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; GPTBot/1.0; +https://openai.com/gptbot)`));
|
||||||
preparations.push(page.setBypassCSP(true));
|
preparations.push(page.setBypassCSP(true));
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 6fac86977536a7b7440edba8d4cf2a1f0e769e8c
|
Subproject commit 165a1fe0cb12728f320c081226c28d7f7b53b0ed
|
Loading…
x
Reference in New Issue
Block a user