fish2018/pansou · error

未找到潜在的Action ID

Error message

未找到潜在的Action ID

What it means

discoverActionIDs found zero candidate Action IDs: findPotentialActionIDs successfully fetched the site homepage but extracted no potential IDs from it. Without candidates the plugin cannot build credentials, so discovery aborts.

Solutions

  1. Enable DebugLog and inspect what findPotentialActionIDs actually fetched (page size, content).
  2. curl BaseURL and confirm the homepage still embeds candidate Action IDs.
  3. Update the extraction logic/regex in findPotentialActionIDs to match the new site bundle.
  4. Check for anti-bot interception (captcha/WAF page) and add appropriate headers or cookies.

Example fix

// before
potentialIDs, err := p.findPotentialActionIDs(p.client)
if err != nil {
    return nil, err
}
if len(potentialIDs) == 0 {
    return nil, fmt.Errorf("未找到潜在的Action ID")
}
// after
potentialIDs, err := p.findPotentialActionIDs(p.client)
if err != nil {
    return nil, fmt.Errorf("提取潜在Action ID失败: %w", err)
}
if len(potentialIDs) == 0 {
    if DebugLog {
        fmt.Println("panyq: homepage contained no candidate Action IDs — site layout may have changed")
    }
    return nil, fmt.Errorf("未找到潜在的Action ID")
}
Defensive patterns

Strategy: fallback

Validate before calling

resp, err := http.Get(BaseURL)
if err != nil || resp.StatusCode != 200 {
    return errors.New("cannot fetch homepage; discovery will fail")
}

Try / catch

results, err := plugin.Search(kw)
if err != nil && strings.Contains(err.Error(), "未找到潜在的Action ID") {
    log.Println("panyq site layout likely changed; using fallback source")
    return alternateSearch(kw)
}

Prevention

When it happens

Trigger: Called from doSearch (cold cache) or getOrDiscoverActionIDs when the homepage HTML/JS no longer contains the patterns findPotentialActionIDs matches — typically after an upstream site redesign or when the fetched page is not the real homepage (captcha page, error page, CDN block).

Common situations: Upstream changed its JS bundle so the ID-extraction regex/logic matches nothing; the request was intercepted by WAF/anti-bot returning HTML without IDs; offline proxy returned an empty or error page.

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/232999bfed9ac885. Report an issue: GitHub.

Appendix: source

Thrown at plugin/panyq/panyq.go:427

		
		// 保存到内存缓存
		actionIDCacheLock.Lock()
		for k, v := range finalIDs {
			actionIDCache[k] = v
		}
		actionIDCacheLock.Unlock()
		
		return finalIDs, nil
	}
	
	// 从网站获取潜在的Action ID
	potentialIDs, err := p.findPotentialActionIDs(p.client)
	if err != nil {
		return nil, err
	}
	
	if len(potentialIDs) == 0 {
		return nil, fmt.Errorf("未找到潜在的Action ID")
	}
	
	if DebugLog {
		// fmt.Printf("panyq: 找到 %d 个潜在的 Action ID\n", len(potentialIDs))
		if len(potentialIDs) > 0 {
			fmt.Printf("panyq: 样例ID: %s\n", potentialIDs[0])
		}
	}
	
	finalIDs = make(map[string]string)
	
	// 1. 验证credential_action_id - 并发验证
	if DebugLog {
		fmt.Println("panyq: validating credential_action_id...")
	}
	
	// 使用通道存储验证成功的ID
	credIDChan := make(chan string, len(potentialIDs))

View on GitHub (pinned to beaa561337)