fish2018/pansou · error

[ ] 命中验证页

Error message

[%s] 命中验证页: %s

What it means

Raised in searchSuggest (plugin/qiwei/qiwei.go:204) when the body is detected as a verification page, solveVerification runs and claims success, but a re-fetch of the suggest URL still yields a verification page. It means the automatic verification did not actually clear the challenge; the plugin gives up on this host and the fallback loop tries the next mirror.

Solutions

  1. Verify manually whether the challenge is solvable (curl the verification endpoint with the same cookie jar flow); if it loops, the IP is flagged — switch egress IP/proxy.
  2. Update the verification regexes/endpoint handling in qiwei.go if the challenge page format changed so solveVerification silently does the wrong POST.
  3. Reduce concurrency/request rate; enrichResults fires up to 12 concurrent detail requests which can trigger aggressive re-challenging.
  4. Rely on fallback: ensure at least one mirror is clean; also consider clearing the plugin's cookie jar so a fresh session is used.
Defensive patterns

Strategy: fallback

Validate before calling

// after solving, verify the refetched body is really clean before parsing
if looksLikeVerifyPage(body) {
    return fmt.Errorf("verification loop on %s, switch host", host)
}

Try / catch

items, host, err := p.searchSuggestWithFallback(client, keyword)
if err != nil {
    log.Printf("qiwei verification loop / host failure: %v", err)
    return p.searchViaOtherPlugin(keyword) // or return empty results gracefully
}

Prevention

When it happens

Trigger: First fetch returns a verify page -> solveVerification succeeds -> second fetchBody for the same searchURL again matches isVerifyPage. Exact condition: isVerifyPage(body) true on the post-solve refetch.

Common situations: The site invalidates the verification cookie immediately (challenge loop); solveVerification computed the key/value but the site requires additional JS steps (fingerprinting) the plugin cannot emulate; the IP is hard-flagged so every request re-challenges regardless of cookies.

Understand the failure class

Background: "API error: {status}" and "HTTP 401/403/404/429/5xx" errors: non-2xx HTTP responses explained — this error's family across 27 libraries.

Related errors


AI-assisted analysis of fish2018/pansou@beaa561337 (2026-09-07). Data as JSON: /api/errors/526c2b2cab04e1eb. Report an issue: GitHub.

Appendix: source

Thrown at plugin/qiwei/qiwei.go:204

	return nil, "", lastErr
}

func (p *QiweiPlugin) searchSuggest(client *http.Client, host, keyword string) ([]suggestItem, error) {
	searchURL := fmt.Sprintf("%s/index.php/ajax/suggest?mid=1&limit=%d&wd=%s", host, searchSuggestLimit, url.QueryEscape(keyword))
	body, err := p.fetchBody(client, searchURL, host+"/", searchTimeout)
	if err != nil {
		return nil, err
	}
	if isVerifyPage(body) {
		if err := p.solveVerification(client, searchURL, body); err != nil {
			return nil, fmt.Errorf("[%s] 搜索验证失败: %w", p.Name(), err)
		}
		body, err = p.fetchBody(client, searchURL, host+"/", searchTimeout)
		if err != nil {
			return nil, err
		}
		if isVerifyPage(body) {
			return nil, fmt.Errorf("[%s] 命中验证页: %s", p.Name(), host)
		}
	}

	var resp suggestResponse
	if err := json.Unmarshal([]byte(body), &resp); err != nil {
		return nil, fmt.Errorf("[%s] suggest 响应解析失败: %w", p.Name(), err)
	}

	if resp.Code != 1 && len(resp.List) == 0 {
		return nil, fmt.Errorf("[%s] suggest 响应异常: host=%s code=%d msg=%s", p.Name(), host, resp.Code, resp.Msg)
	}

	return resp.List, nil
}

func (p *QiweiPlugin) enrichResults(client *http.Client, host string, items []suggestItem, forceRefresh bool) []model.SearchResult {
	results := make([]model.SearchResult, len(items))
	var wg sync.WaitGroup

View on GitHub (pinned to beaa561337)