fish2018/pansou · error
获取测试结果失败
Error message
获取测试结果失败: %w
What it means
After validating the credential and intermediate IDs, discoverActionIDs calls p.getSearchResults(testCreds.Sign, 1, p.client) to fetch a test result page, and that call returned an error. Discovery cannot obtain a test EID without it.
Solutions
- Retry discovery after a short backoff (transient or rate-limit failure).
- Add delays between discovery probe calls to stay under the site's rate limits.
- Inspect the wrapped getSearchResults error with DebugLog (HTTP status vs parse error).
- Confirm the search API response format is unchanged; update the plugin if not.
Defensive patterns
Strategy: retry
Try / catch
ids, err := plugin.DiscoverActionIDs()
if err != nil && strings.Contains(err.Error(), "获取测试结果失败") {
time.Sleep(backoff)
ids, err = plugin.DiscoverActionIDs()
} Prevention
- Back off after intensive probing
- Log wrapped HTTP status vs parse errors
- Monitor upstream search endpoint health
- Update parser on schema changes
When it happens
Trigger: Running discoverActionIDs when the search endpoint rejects the test Sign or fails (non-200, malformed JSON, timeout) for the test query — often right after many rapid discovery probes.
Common situations: Rate limiting / temporary IP block after intensive discovery probing; transient upstream 5xx; response format change breaking getSearchResults parsing.
Understand the failure class
Background: "API request failed": what wrapped HTTP errors from external APIs mean and how to find the real cause — this error's family across 29 libraries.
Related errors
AI-assisted analysis of fish2018/pansou@beaa561337 (2026-09-07).
Data as JSON: /api/errors/d7e66e50bc1d950e.
Report an issue: GitHub.
Appendix: source
Thrown at plugin/panyq/panyq.go:530
}
if p.validateIntermediateID(id, testCreds.Hash, testCreds.Sha) {
finalIDs[ActionIDKeys[1]] = id
intermediateIDFound = true
if DebugLog {
fmt.Printf("panyq: 找到有效的intermediate_action_id: %s\n", id)
}
break
}
}
if !intermediateIDFound {
return nil, fmt.Errorf("未能验证intermediate_action_id")
}
// 获取测试EID
testHits, _, err := p.getSearchResults(testCreds.Sign, 1, p.client) // 获取第一页测试结果
if err != nil {
return nil, fmt.Errorf("获取测试结果失败: %w", err)
}
if len(testHits) == 0 {
return nil, fmt.Errorf("获取测试EID失败: 无搜索结果")
}
testEID := testHits[0].EID
if DebugLog {
fmt.Printf("panyq: 获取到测试EID: %s\n", testEID)
}
// 从剩余ID中排除已使用的ID
newRemainingIDs := make([]string, 0, len(remainingIDs)-1)
for _, id := range remainingIDs {
if id != finalIDs[ActionIDKeys[1]] {
newRemainingIDs = append(newRemainingIDs, id)
}View on GitHub (pinned to beaa561337)