fish2018/pansou · error

获取测试EID失败: 无搜索结果

Error message

获取测试EID失败: 无搜索结果

What it means

The test search call succeeded but returned zero hits, so discoverActionIDs cannot extract a test EID (testHits[0].EID would index out of range). The plugin treats an empty first page as a discovery failure.

Solutions

  1. Inspect the raw search response (DebugLog / curl) to confirm the site truly returned no hits vs the parser dropping them.
  2. Try a different, more common test keyword if the empty result is keyword-specific.
  3. Update the result-parsing logic in getSearchResults if the response schema changed.
  4. Re-run discovery later if the site is temporarily serving empty results.
Defensive patterns

Strategy: fallback

Try / catch

ids, err := plugin.DiscoverActionIDs()
if err != nil && strings.Contains(err.Error(), "获取测试EID失败") {
    log.Println("test search returned no hits; trying alternate probe keyword")
    return discoverWithKeyword("common")
}

Prevention

When it happens

Trigger: Running discoverActionIDs when the search endpoint returns HTTP 200 with an empty hit list for the "test" keyword — credentials are technically valid but yield no results, so no EID can be captured.

Common situations: Upstream changed its result schema so hits are parsed into an empty slice; the site filtered/blocking the test query; the search index returning empty for the probe keyword; region/IP-based empty results.

Understand the failure class

Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.

Related errors


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

Appendix: source

Thrown at plugin/panyq/panyq.go:534

			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)
		}
	}
	remainingIDs = newRemainingIDs
	
	// 3. 验证final_link_action_id

View on GitHub (pinned to beaa561337)