fish2018/pansou · error
请求PanTa搜索页面失败,状态码
Error message
请求PanTa搜索页面失败,状态码: %d
What it means
Status error in PantaAsyncPlugin.doSearch (plugin/panta/panta.go:269): the PanTa search page responded with a non-200 status. The server was reached but rejected the request (rate limit, block, or redirect to a challenge).
Solutions
- 补充/更新浏览器请求头
- 对 429 做退避重试
- 记录状态码监控站点健康
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at plugin/panta/panta.go:269 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/c0b1eea8bb149dd8.
Report an issue: GitHub.
Appendix: source
Thrown at plugin/panta/panta.go:269
// 设置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
}
// 使用过滤功能过滤结果
filteredResults := plugin.FilterResultsByKeyword(results, keyword)
return filteredResults, nilView on GitHub (pinned to beaa561337)