Browse Source

style: used gofmt

pull/162/head
Moroka8 2 months ago
parent
commit
fdfa004638
  1. 3
      client/main.go
  2. 2
      client/manual_captcha.go
  3. 6
      client/slider_captcha.go

3
client/main.go

@ -291,7 +291,6 @@ func generateCheckboxCursor() string {
}
*/
func getCustomNetDialer() net.Dialer {
return net.Dialer{
Timeout: 20 * time.Second,
@ -610,7 +609,7 @@ func callCaptchaNotRobot(ctx context.Context, sessionToken, hash string, streamI
cursorJSON := "[]"
answer := base64.StdEncoding.EncodeToString([]byte("{}"))
// The real browser sends a static SHA-256 hash for debug_info.
// The real browser sends a static SHA-256 hash for debug_info.
// We use the exact one captured from the real browser's session.
debugInfo := "f3ef768dab7a20f574c6461f34e4257894d2a3c30a53d8727a3edaf7ab70847d"

2
client/manual_captcha.go

@ -560,7 +560,7 @@ type loggingTransport struct {
func (t *loggingTransport) RoundTrip(req *http.Request) (*http.Response, error) {
isCaptchaRequest := req.Body != nil && (strings.Contains(req.URL.Path, "captchaNotRobot.check") || strings.Contains(req.URL.Path, "captchaNotRobot.componentDone"))
if isCaptchaRequest {
b, _ := io.ReadAll(req.Body)
req.Body = io.NopCloser(bytes.NewReader(b))

6
client/slider_captcha.go

@ -22,6 +22,7 @@ import (
fhttp "github.com/bogdanfinn/fhttp"
tlsclient "github.com/bogdanfinn/tls-client"
)
const (
sliderCaptchaType = "slider"
defaultSliderAttempts = 4
@ -240,8 +241,8 @@ func (s *captchaNotRobotSession) requestSliderCheck(activeSteps []int, candidate
func (s *captchaNotRobotSession) requestCheck(cursor string, answer string) (*captchaCheckResult, error) {
values := s.baseValues()
// The real browser sends a static SHA-256 hash for debug_info.
// The real browser sends a static SHA-256 hash for debug_info.
// We use the exact one captured from the real browser's session.
debugInfo := "f3ef768dab7a20f574c6461f34e4257894d2a3c30a53d8727a3edaf7ab70847d"
@ -979,7 +980,6 @@ func buildSliderCursor(candidateIndex int, candidateCount int, startTime int64)
}
*/
func trySliderCaptchaCandidates(
candidates []sliderCandidate,
maxAttempts int,

Loading…
Cancel
Save