diff --git a/pkg/coach-client/client_cn_test.go b/pkg/coach-client/client_cn_test.go index 7a75eed..71cf67b 100644 --- a/pkg/coach-client/client_cn_test.go +++ b/pkg/coach-client/client_cn_test.go @@ -6,7 +6,7 @@ import ( ) func TestCNClient(t *testing.T) { - cli, err := CNClient() + cli, err := CNClient(XMac_Coach) if err != nil { t.Fatal(err) } diff --git a/pkg/coach-client/client_us.go b/pkg/coach-client/client_us.go index f36e210..50f2ca5 100644 --- a/pkg/coach-client/client_us.go +++ b/pkg/coach-client/client_us.go @@ -110,7 +110,14 @@ type ProductData struct { } `json:"prices"` Remark string `json:"-"` } - +type ImageGroup struct { + Images []struct { + Src string `json:"src"` + Title string `json:"title"` + Alt string `json:"alt"` + } `json:"images"` + ViewType string `json:"viewType"` +} type ProductDataResponse struct { ProductData []*ProductData `json:"productsData"` } diff --git a/pkg/coach-client/client_us_test.go b/pkg/coach-client/client_us_test.go index 3ff3e93..dd792c7 100644 --- a/pkg/coach-client/client_us_test.go +++ b/pkg/coach-client/client_us_test.go @@ -7,7 +7,7 @@ import ( ) func TestClient(t *testing.T) { - subs := []string{"https://us.timerzz.com:26106/vmess/sub", "https://us.timerzz.com:26106/trojan/sub", "https://us.timerzz.com:26106/ssr/sub"} + subs := []string{"https://us.timerzz.com:26106/vmess/sub"} pool := proxy.NewProxyPool(subs) client := USClient(pool) resp, err := client.ViewAllBags(context.Background(), 1) diff --git a/pkg/restry-pool/resty.go b/pkg/restry-pool/resty.go index 5a5d4e5..a1d5af1 100644 --- a/pkg/restry-pool/resty.go +++ b/pkg/restry-pool/resty.go @@ -2,12 +2,13 @@ package restry_pool import ( "context" - "github.com/corpix/uarand" - "github.com/go-resty/resty/v2" "net" "net/http" "sync" "time" + + "github.com/corpix/uarand" + "github.com/go-resty/resty/v2" ) var rp *restyPool @@ -35,6 +36,15 @@ const ( func beforeRequest(cli *resty.Client, req *resty.Request) error { cli.SetHeader("User-Agent", uarand.GetRandom()) + cli.SetHeader("sec-fetch-site", "same-origin") + cli.SetHeader("upgrade-insecure-requests", "1") + cli.SetHeaders(map[string]string{ + "sec-fetch-dest": "empty", + "sec-fetch-mode": "navigate", + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate, br", + "Connection": "keep-alive", + }) return nil } func NewRestyPool() *restyPool {