mirror of
https://github.com/201206030/novel-plus.git
synced 2026-02-08 17:52:23 +08:00
perf: 禁用爬虫的 Cookie 管理以绕过 Cookie 限制
有助于绕过部分通过 Cookie 来识别爬虫的反爬机制。
This commit is contained in:
@@ -63,6 +63,8 @@ public class RestTemplates {
|
||||
connectionManager.setDefaultMaxPerRoute(300);
|
||||
|
||||
HttpClientBuilder clientBuilder = HttpClients.custom();
|
||||
// 禁用 Cookie 管理
|
||||
clientBuilder.disableCookieManagement();
|
||||
if (Objects.nonNull(httpProxyProperties) && Boolean.TRUE.equals(httpProxyProperties.getEnabled())) {
|
||||
HttpHost proxy = new HttpHost(httpProxyProperties.getIp(), httpProxyProperties.getPort());
|
||||
clientBuilder.setProxy(proxy);
|
||||
|
||||
Reference in New Issue
Block a user