fish2018/pansou · error
未找到滑动验证脚本
Error message
未找到滑动验证脚本
What it means
solveVerification parses the verification page HTML for the slider-challenge script via verificationScriptRegex. When no script tag/URL in the HTML matches the regex, it returns this error, aborting the automated verification solve for that page. The caller (getDetailInfo or searchSuggest) then records the failure and moves to the next candidate URL.
Solutions
- Fetch the verification page manually (browser DevTools or curl) and compare its script tags against verificationScriptRegex; update the regex to the new markup.
- Check whether the site now serves a different challenge type entirely — if so the slider solver needs rework, not just the regex.
- Confirm isVerifyPage isn't a false positive: if the page isn't really a verification page, tighten its detection to avoid entering solveVerification needlessly.
- Add the captured HTML to a test fixture and pin verificationScriptRegex behavior against it to catch future site changes.
Example fix
// before
scriptMatch := verificationScriptRegex.FindStringSubmatch(verifyHTML)
if len(scriptMatch) < 2 {
return fmt.Errorf("未找到滑动验证脚本")
}
// after
scriptMatch := verificationScriptRegex.FindStringSubmatch(verifyHTML)
if len(scriptMatch) < 2 {
return fmt.Errorf("未找到滑动验证脚本 (pageURL=%s, htmlLen=%d)", pageURL, len(verifyHTML)) // aid diagnosis
} Defensive patterns
Strategy: type-guard
Validate before calling
// pre-check the page for the expected script marker before attempting a solve
if isVerifyPage(body) && !verificationScriptRegex.MatchString(body) {
return errors.New("verification page lacks expected slider script; site markup likely changed")
} Type guard
func hasVerificationScript(html string) bool {
return verificationScriptRegex.MatchString(html)
} Try / catch
if err := plugin.SolveVerification(client, pageURL, body); err != nil {
if strings.Contains(err.Error(), "未找到滑动验证脚本") {
// site markup drift: log body snapshot for regex maintenance, skip candidate
saveDebugHTML(pageURL, body)
return errSkipCandidate
}
return err
} Prevention
- Pin verificationScriptRegex against stored fixtures of the real verification page and refresh them periodically.
- Save the raw HTML when this error occurs so regex updates are data-driven.
- Keep isVerifyPage strict to avoid running the solver on non-verification pages.
- Set an alert when this error rate rises — it almost always means a site-side markup change.
When it happens
Trigger: isVerifyPage classified the response as a verification page, but verificationScriptRegex.FindStringSubmatch(verifyHTML) returned fewer than 2 groups — i.e. the HTML contains no script URL matching the expected pattern.
Common situations: The site updated its verification page and now embeds the script differently (inline JS, different tag, renamed bundle); a CDN/edge served a generic challenge page not matching the plugin's assumptions; the response is actually an error/interstitial page misclassified by isVerifyPage.
Related errors
AI-assisted analysis of fish2018/pansou@beaa561337 (2026-09-07).
Data as JSON: /api/errors/71558831a779c696.
Report an issue: GitHub.
Appendix: source
Thrown at plugin/qiwei/qiwei.go:354
}
p.detailCache.Store(detailURL, detailCacheEntry{Info: info, CachedAt: time.Now()})
return info, nil
}
if lastErr == nil {
lastErr = fmt.Errorf("[%s] 获取详情失败: %s", p.Name(), detailURL)
}
return detailInfo{}, lastErr
}
// solveVerification completes the site's deterministic slider challenge. The
// challenge is session-bound, so the caller and this method must share a
// cookie jar on the same http.Client.
func (p *QiweiPlugin) solveVerification(client *http.Client, pageURL, verifyHTML string) error {
scriptMatch := verificationScriptRegex.FindStringSubmatch(verifyHTML)
if len(scriptMatch) < 2 {
return fmt.Errorf("未找到滑动验证脚本")
}
scriptURL := normalizeURL(pageURL, scriptMatch[1])
jsBody, err := p.fetchBody(client, scriptURL, pageURL, detailTimeout)
if err != nil {
return fmt.Errorf("获取验证脚本失败: %w", err)
}
typeMatch := verificationTypeRegex.FindStringSubmatch(jsBody)
keyMatch := verificationKeyRegex.FindStringSubmatch(jsBody)
valueMatch := verificationValueRegex.FindStringSubmatch(jsBody)
if len(typeMatch) < 2 || len(keyMatch) < 2 || len(valueMatch) < 2 {
return fmt.Errorf("验证脚本参数不完整")
}
encodedValue := md5StringToHex(valueMatch[1])
endpointPath := "/a20be899_96a6_40b2_88ba_32f1f75f1552_yanzheng_huadong.php"
if endpointMatch := verificationEndpointRegex.FindStringSubmatch(jsBody); len(endpointMatch) > 1 {
endpointPath = "/" + endpointMatch[1]View on GitHub (pinned to beaa561337)