{"record":{"id":"bdcfbfa6ea71f6ce","repo":"AlistGo/alist","slug":"acw-sc-v2-validation-error","errorCode":null,"errorMessage":"acw_sc__v2 validation error","messagePattern":"acw_sc__v2 validation error","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/lanzou/util.go","lineNumber":146,"sourceCode":"\t\tres, err := req.Execute(method, url)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tbody = res.Body()\n\t\tlog.Debugf(\"lanzou request: url=>%s ,stats=>%d ,body => %s\\n\", res.Request.URL, res.StatusCode(), res.String())\n\n\t\tif findAcwScV2Reg.Match(body) {\n\t\t\tvs, e := CalcAcwScV2(string(body))\n\t\t\tif e != nil {\n\t\t\t\tlog.Errorf(\"lanzou: err => acw_sc__v2 validation error  ,data => %s\\n\", body)\n\t\t\t\treturn body, e\n\t\t\t}\n\t\t\tacwScV2 = vs\n\t\t\tcontinue\n\t\t}\n\t\treturn body, nil\n\t}\n\treturn body, errors.New(\"acw_sc__v2 validation error\")\n}\n\nvar loginURL = \"https://up.woozooo.com/mlogin.php\"\n\nfunc (d *LanZou) Login() ([]*http.Cookie, error) {\n\tclient := base.NewRestyClient().SetRedirectPolicy(resty.NoRedirectPolicy())\n\t// 登录接口同样可能返回 acw_sc__v2 反爬挑战页,需算出 cookie 后重试\n\tvar acwScV2 string\n\tvar resp *resty.Response\n\tvar err error\n\tfor i := 0; i < 3; i++ {\n\t\treq := client.R().SetFormData(map[string]string{\n\t\t\t\"task\":         \"3\",\n\t\t\t\"uid\":          d.Account,\n\t\t\t\"pwd\":          d.Password,\n\t\t\t\"setSessionId\": \"\",\n\t\t\t\"setSig\":       \"\",\n\t\t\t\"setScene\":     \"\",","sourceCodeStart":128,"sourceCodeEnd":164,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/lanzou/util.go#L128-L164","documentation":"The lanzou web endpoint serves an anti-bot JS challenge (acw_sc__v2); the driver detects it with findAcwScV2Reg, computes the cookie via CalcAcwScV2, and retries in a loop. This error means the loop exhausted (3 iterations) while the body still matches the challenge, or the challenge page could not be parsed (arg1 missing/malformed). It is an anti-crawl defeat, not a config error.","triggerScenarios":"Every retry response still contains the acw_sc__v2 challenge HTML — e.g. CalcAcwScV2 keeps failing on the page's arg1 value (obfuscation changed), or the site returns the challenge unconditionally to this IP (rate-limited/datacenter IP flagged).","commonSituations":"Lanzou rotated its JS obfuscation so the Go port of the acw_sc__v2 algorithm no longer computes the right cookie; alist server IP flagged by anti-bot; hammering the share pages too fast.","solutions":["Slow down: add spacing between lanzou requests / reduce concurrency — many challenges are purely rate-based","Route requests through a residential proxy or run the alist instance from a different IP","Update alist — a driver fix for a new acw_sc__v2 variant usually follows within days of lanzou changing it","Verify cookies (ylogin etc.) are valid: log in again so challenge pages are less aggressive"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":"func isAcwScV2Failure(err error) bool {\n\treturn err != nil && strings.Contains(err.Error(), \"acw_sc__v2\")\n}","tryCatchPattern":"var body []byte\nerr := backoff.Retry(func() error {\n\tvar e error\n\tbody, e = d.get(url, nil)\n\tif e != nil && isAcwScV2Failure(e) {\n\t\treturn e // retryable: challenge is often rate-based\n\t}\n\treturn backoff.Permanent(e)\n}, backoff.WithMaxRetries(backoff.NewExponentialBackOff(), 3))","preventionTips":["Rate-limit lanzou scraping aggressively; the challenge is triggered by request velocity","Keep alist updated — acw_sc__v2 algorithm fixes land quickly after lanzou rotates obfuscation","Prefer account cookies (ylogin) over anonymous scraping to reduce challenge frequency"],"tags":["lanzou","anti-bot","rate-limit","scraping","driver"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}