fish2018/pansou · error

请求PanTa搜索页面失败

Error message

请求PanTa搜索页面失败: %v

What it means

Wrapped request failure in PantaAsyncPlugin.doSearch (plugin/panta/panta.go:263): doRequestWithRetry could not obtain a successful response for the PanTa search page after retries — transport error or persistent failure.

Solutions

  1. 确认 91panta.cn 可达
  2. 增加重试次数与超时
  3. 失败时跳过该插件并提示用户
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at plugin/panta/panta.go:263 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at plugin/panta/panta.go:263

	// 创建请求
	req, err := http.NewRequestWithContext(ctx, "GET", searchURL, nil)
	if err != nil {
		return nil, fmt.Errorf("创建请求失败: %v", err)
	}
	
	// 设置User-Agent和Referer
	req.Header.Set("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36")
	req.Header.Set("Referer", "https://www.91panta.cn/index")
	req.Header.Set("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8")
	req.Header.Set("Accept-Language", "zh-CN,zh;q=0.9,en;q=0.8")
	req.Header.Set("Connection", "keep-alive")
	req.Header.Set("Upgrade-Insecure-Requests", "1")
	req.Header.Set("Cache-Control", "max-age=0")
	
	// 使用带重试的请求方法发送HTTP请求
	resp, err := p.doRequestWithRetry(req, client)
	if err != nil {
		return nil, fmt.Errorf("请求PanTa搜索页面失败: %v", err)
	}
	defer resp.Body.Close()
	
	// 检查状态码
	if resp.StatusCode != http.StatusOK {
		return nil, fmt.Errorf("请求PanTa搜索页面失败,状态码: %d", resp.StatusCode)
	}
	
	// 使用goquery解析HTML
	doc, err := goquery.NewDocumentFromReader(resp.Body)
	if err != nil {
		return nil, fmt.Errorf("解析HTML失败: %v", err)
	}
	
	// 解析搜索结果
	results, err := p.parseSearchResults(doc, client)
	if err != nil {
		return nil, err

View on GitHub (pinned to beaa561337)