Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
72c65c51ed
7 files changed
+30
-9
No files matched your search
@@ -35,7 +35,7 @@ func SetLogger(l logx.Logger) { Log = logx.OrNop(l) }
|
||||
|
||||
const (
|
||||
captchaAPIVersion = "5.131"
|
||||
captchaScriptVersion = "1.1.1357"
|
||||
captchaScriptVersion = "1.1.1359"
|
||||
captchaDeviceInfo = `{"screenWidth":1920,"screenHeight":1080,"screenAvailWidth":1920,"screenAvailHeight":1080,"innerWidth":1920,"innerHeight":951,"devicePixelRatio":1,"language":"en-US","languages":["en-US","en"],"webdriver":false,"hardwareConcurrency":8,"notificationsPermission":"denied"}`
|
||||
)
|
||||
|
||||
|
||||
@@ -40,16 +40,11 @@ func ParseError(errData map[string]any) *Error {
|
||||
if sidNum, ok2 := errData["captcha_sid"].(float64); ok2 {
|
||||
captchaSid = fmt.Sprintf("%.0f", sidNum)
|
||||
} else {
|
||||
Log.Warnf("[Captcha] missing captcha_sid in error data")
|
||||
return nil
|
||||
Log.Debugf("[Captcha] captcha_sid not present in error data")
|
||||
}
|
||||
}
|
||||
|
||||
captchaImg, ok := errData["captcha_img"].(string)
|
||||
if !ok {
|
||||
Log.Warnf("[Captcha] missing captcha_img in error data")
|
||||
return nil
|
||||
}
|
||||
captchaImg, _ := errData["captcha_img"].(string)
|
||||
|
||||
errorMsg, ok := errData["error_msg"].(string)
|
||||
if !ok {
|
||||
|
||||
@@ -169,6 +169,12 @@ func (c *Client) solveCaptcha(
|
||||
|
||||
// buildCaptchaRetryData формирует тело POST для следующей попытки captcha.
|
||||
func buildCaptchaRetryData(link, escapedName, token1 string, captchaErr *captcha.Error, successToken, captchaKey string) string {
|
||||
if captchaErr.CaptchaSid == "" {
|
||||
return fmt.Sprintf(
|
||||
"vk_join_link=https://vk.ru/call/join/%s&name=%s&success_token=%s&access_token=%s",
|
||||
link, escapedName, neturl.QueryEscape(successToken), token1,
|
||||
)
|
||||
}
|
||||
if captchaKey != "" {
|
||||
return fmt.Sprintf(
|
||||
"vk_join_link=https://vk.ru/call/join/%s&name=%s&captcha_key=%s&captcha_sid=%s&access_token=%s",
|
||||
|
||||
Reference in new issue
Block a user