From ea46986b1d92d34b0fb3de21b927a0b1a00af4a7 Mon Sep 17 00:00:00 2001 From: aurorax-neo <15047150695@163.com> Date: Tue, 23 Apr 2024 22:07:19 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E2=9C=A8optimization=20fingerprint?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ProxyPool/ProxyPool.go | 4 ++-- chat/Gpt35.go | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ProxyPool/ProxyPool.go b/ProxyPool/ProxyPool.go index 0078d06..b4e6417 100644 --- a/ProxyPool/ProxyPool.go +++ b/ProxyPool/ProxyPool.go @@ -37,7 +37,7 @@ func GetProxyPoolInstance() *ProxyPool { Instance.AddProxy(&Proxy{ Link: common.ParseUrl(px), CanUseAt: common.GetTimestampSecond(0), - Ua: browser.Random(), + Ua: browser.Safari(), Language: common.RandomLanguage(), }) } @@ -82,7 +82,7 @@ func (PP *ProxyPool) AddProxy(proxy *Proxy) { func (PP *ProxyPool) timingUpdateProxy(nanosecond time.Duration) { common.TimingTask(nanosecond, func() { for _, px := range PP.Proxies { - px.Ua = browser.Random() + px.Ua = browser.Safari() px.Language = common.RandomLanguage() } }) diff --git a/chat/Gpt35.go b/chat/Gpt35.go index 7d32f0d..b9e095c 100644 --- a/chat/Gpt35.go +++ b/chat/Gpt35.go @@ -9,6 +9,7 @@ import ( "free-gpt3.5-2api/config" "github.com/aurorax-neo/go-logger" fhttp "github.com/bogdanfinn/fhttp" + "github.com/bogdanfinn/tls-client/profiles" "github.com/google/uuid" "io" ) @@ -78,7 +79,7 @@ func (G *Gpt35) getNewRequestClient(newType int) error { return fmt.Errorf(errStr) } // 请求客户端 - G.RequestClient = RequestClient.NewTlsClient(300, RequestClient.RandomClientProfile()) + G.RequestClient = RequestClient.NewTlsClient(300, profiles.Safari_16_0) if G.RequestClient == nil { errStr := fmt.Sprint("RequestClient is nil") logger.Logger.Debug(errStr)