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