feat: Update CycleTLS to v1.0.30 and adapt API usage

This commit is contained in:
2025-11-19 05:10:58 +00:00
parent 65b46e1975
commit 5ae735ce8d
5 changed files with 26 additions and 42 deletions

View File

@@ -36,7 +36,7 @@ func GetInstance(URL string, sessionID string, proxy string) (*Flaresolverr, err
}
func (f *Flaresolverr) requestV1(req *V1RequestBase) (*V1ResponseBase, error) {
resp, err := request().SetBody(req).Post(f.v1Url)
resp, err := restyClient.R().SetBody(req).Post(f.v1Url)
if err != nil {
return nil, err
}
@@ -170,7 +170,7 @@ func (f *Flaresolverr) SimulateGet(URL string, opts *SimulateOptions) (cycletls.
return cycletls.Response{}, err
}
return f.cycletlsC.Get(URL, &opts.Options)
return f.cycletlsC.Get(URL, opts.Options)
}
func (f *Flaresolverr) SimulatePost(URL string, opts *SimulateOptions) (cycletls.Response, error) {
@@ -179,11 +179,11 @@ func (f *Flaresolverr) SimulatePost(URL string, opts *SimulateOptions) (cycletls
return cycletls.Response{}, err
}
return f.cycletlsC.Post(URL, &opts.Options)
return f.cycletlsC.Post(URL, opts.Options)
}
type SimulateOptions struct {
cycletls.Options
*cycletls.Options
HttpCookies []*http.Cookie
}