优化爬虫,增加缓存,线程池,保存浏览器用户信息
This commit is contained in:
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace app\common\library\scrm\spider;
|
||||
|
||||
use app\common\library\scrm\AbstractScrmSpider;
|
||||
use app\common\library\scrm\AntiBotConfigBuilder;
|
||||
use app\common\library\scrm\UnifiedScrmData;
|
||||
|
||||
/**
|
||||
@@ -47,8 +48,6 @@ class WhatshubSpider extends AbstractScrmSpider
|
||||
/** @return array<string, mixed> */
|
||||
protected function getSpiderConfig(): array
|
||||
{
|
||||
$host = (string) parse_url($this->pageUrl, PHP_URL_HOST);
|
||||
|
||||
return [
|
||||
'pageUrl' => $this->pageUrl,
|
||||
'listApi' => self::API_LIST,
|
||||
@@ -62,15 +61,7 @@ class WhatshubSpider extends AbstractScrmSpider
|
||||
['type' => 'vue_click', 'selector' => '.vxe-button-group .theme--primary'],
|
||||
['type' => 'wait', 'ms' => 2200],
|
||||
],
|
||||
// Whatshub 专用:Real Browser + Turnstile + Captcha API 兜底 + 会话复用
|
||||
'antiBot' => [
|
||||
'enabled' => true,
|
||||
'profile' => 'real',
|
||||
'turnstile' => true,
|
||||
'solverFallback' => true,
|
||||
'sessionKey' => 'whatshub:' . $host,
|
||||
'challengeTimeoutMs' => 60000,
|
||||
],
|
||||
'antiBot' => AntiBotConfigBuilder::build('whatshub', $this->pageUrl),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user