{"record":{"id":"c8b8609efbb7121c","repo":"AlistGo/alist","slug":"acw-sc-v2","errorCode":null,"errorMessage":"无法匹配acw_sc__v2","messagePattern":"无法匹配acw_sc__v2","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/lanzou/help.go","lineNumber":128,"sourceCode":"\t\t}\n\t\tif inComment || inSingleLineComment {\n\t\t\tcontinue\n\t\t}\n\t\tresult.WriteByte(v)\n\t}\n\n\treturn result.String()\n}\n\nvar findAcwScV2Reg = regexp.MustCompile(`arg1='([0-9A-Z]+)'`)\n\n// 在页面被过多访问或其他情况下，有时候会先返回一个加密的页面，其执行计算出一个acw_sc__v2后放入页面后再重新访问页面才能获得正常页面\n// 若该页面进行了js加密，则进行解密，计算acw_sc__v2，并加入cookie\nfunc CalcAcwScV2(html string) (string, error) {\n\tlog.Debugln(\"acw_sc__v2\", html)\n\tacwScV2s := findAcwScV2Reg.FindStringSubmatch(html)\n\tif len(acwScV2s) != 2 {\n\t\treturn \"\", fmt.Errorf(\"无法匹配acw_sc__v2\")\n\t}\n\treturn HexXor(Unbox(acwScV2s[1]), \"3000176000856006061501533003690027800375\"), nil\n}\n\nfunc Unbox(hex string) string {\n\tvar box = []int{6, 28, 34, 31, 33, 18, 30, 23, 9, 8, 19, 38, 17, 24, 0, 5, 32, 21, 10, 22, 25, 14, 15, 3, 16, 27, 13, 35, 2, 29, 11, 26, 4, 36, 1, 39, 37, 7, 20, 12}\n\tvar newBox = make([]byte, len(hex))\n\tfor i := 0; i < len(box); i++ {\n\t\tj := box[i]\n\t\tif len(newBox) > j {\n\t\t\tnewBox[j] = hex[i]\n\t\t}\n\t}\n\treturn string(newBox)\n}\n\nfunc HexXor(hex1, hex2 string) string {\n\tvar out strings.Builder","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/lanzou/help.go#L110-L146","documentation":"CalcAcwScV2 fails when the anti-bot challenge page returned by LanZou (via an Alibaba-style WAF) does not contain the expected arg1='<HEX>' payload matched by the regex `arg1='([0-9A-Z]+)'`. The driver then cannot compute the acw_sc__v2 cookie needed to fetch the real page.","triggerScenarios":"A LanZou request receives a JS challenge page whose format changed (different obfuscation, different variable name, or an HTML-escaped payload), so FindStringSubmatch returns no groups and len(acwScV2s) != 2.","commonSituations":"LanZou/WAF frontend updated its anti-crawler script; rate-limiting returning a different block page (e.g. plain 403 HTML); regional CDN nodes serving a newer challenge variant; the constant XOR key '3000176000856006061501533003690027800375' no longer matching the deployed script.","solutions":["Enable debug logs and inspect the logged challenge HTML (log.Debugln prints it) to see the new format","Reduce request frequency / wait: some challenge pages are rate-limit responses that clear after a pause","Update OpenList to a newer version where the lanzou helper regex/algorithm matches the current challenge","As a driver maintainer: extend findAcwScV2Reg to also match the new arg1 format (e.g. allow lowercase hex) and re-derive the XOR key"],"exampleFix":"// before\nvar findAcwScV2Reg = regexp.MustCompile(`arg1='([0-9A-Z]+)'`)\n// after (also accept lowercase and larger alphabets used by newer challenge pages)\nvar findAcwScV2Reg = regexp.MustCompile(`arg1='([0-9A-Za-z]+)'`)","handlingStrategy":"retry","validationCode":null,"typeGuard":"func isAcwScV2Challenge(html string) bool {\n    return findAcwScV2Reg.MatchString(html)\n}","tryCatchPattern":"v, err := CalcAcwScV2(html)\nif err != nil {\n    if !isAcwScV2Challenge(html) {\n        // not a challenge page at all — do not retry the same way\n        return fmt.Errorf(\"unexpected page instead of challenge: %w\", err)\n    }\n    // challenge present but unparseable: back off and retry once later\n    time.Sleep(30 * time.Second)\n}","preventionTips":["Rate-limit lanzou requests to avoid triggering stricter challenge variants","Keep OpenList updated — the challenge solver is maintained against live changes","Log challenge bodies at debug level to detect format drift early"],"tags":["lanzou","anti-bot","waf","scraping","regex","openlist"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}