fix(captcha): не жечь персону на эскалации checkbox -> slider

Эскалация происходит в каждой сессии - слайдер в той же сессии проходит с тем
же browser_fp и device, значит отпечаток VK не отвергал. Сжигание на ней меняло
VisitorID каждый визит, хотя персона выводится из seed именно ради стабильности
между визитами. Сжигание по факту отказа в token_call.go сохранено.
This commit is contained in:
samosvalishe committed 2026-08-04 10:34:16 +03:00
1 parent d9a0554489
commit ee1356308b
2 files changed
+11 -19

No files matched your search

@@ -102,8 +102,7 @@ type captchaSession struct {
sensors sensorConfig
// sensorsStart - момент ответа settings: с него виджет начинает тикать
// таймером телеметрии.
sensorsStart time.Time
onCompromised func()
sensorsStart time.Time
}
func (s *captchaSession) logger() logx.Logger {
@@ -121,7 +120,6 @@ func Solve(
client tlsclient.HttpClient,
profile browserprofile.Profile,
log logx.Logger,
onCompromised func(),
) (string, error) {
if captchaErr == nil || captchaErr.SessionToken == "" {
return "", fmt.Errorf("no session_token in redirect_uri")
@@ -130,15 +128,14 @@ func Solve(
l.Infof("[STREAM %d] [Captcha] Solving VK Smart Captcha automatically...", streamID)
s := &captchaSession{
ctx: ctx,
client: client,
profile: profile,
layout: layoutFor(profile),
domain: captchaDomain,
log: l,
browserFP: profile.VisitorID,
sensors: defaultSensorConfig(),
onCompromised: onCompromised,
ctx: ctx,
client: client,
profile: profile,
layout: layoutFor(profile),
domain: captchaDomain,
log: l,
browserFP: profile.VisitorID,
sensors: defaultSensorConfig(),
}
for attempt := 1; attempt <= captchaMaxAttempts; attempt++ {
@@ -253,9 +250,6 @@ func (s *captchaSession) escalate(sessionToken string, initContent captchaConten
if content.Value == "" {
return "", cause
}
if s.onCompromised != nil {
s.onCompromised()
}
s.logger().Debugf("[Captcha] escalated to slider in-session (content source=%s)", content.Source)
// Перерисовка виджета плюс пауза на осознание.
if err := s.dwell(500, 1100); err != nil {
@@ -10,7 +10,7 @@ import (
tlsclient "github.com/bogdanfinn/tls-client"
)
func (c *Client) defaultAutoSolve(
func (*Client) defaultAutoSolve(
ctx context.Context,
captchaErr *captcha.Error,
streamID int,
@@ -27,9 +27,7 @@ func (c *Client) defaultAutoSolve(
return "", fmt.Errorf("no redirect_uri for auto-solve")
}
successToken, err := captcha.Solve(ctx, captchaErr, streamID, client, profile, log, func() {
c.burnPersona(streamID)
})
successToken, err := captcha.Solve(ctx, captchaErr, streamID, client, profile, log)
if err != nil {
return "", err
}