fish2018/pansou · error
盘链网盘接口异常
Error message
盘链网盘接口异常: %s
What it means
When /api/search_pan_links.php returns Success=false (non-login failure), the plugin returns '盘链网盘接口异常: <Message>' ('panlian pan-link API abnormal'). The API answered but reported a business-level error for the pan-link search.
Solutions
- Inspect the Message suffix in the error for the upstream cause.
- Back off and retry with fewer/normalized keywords if rate-limited.
- Check account status and quotas on the panlian site.
- Update the plugin if the API contract changed.
Example fix
// before
if !resp.Success { return nil, fmt.Errorf("盘链网盘接口异常: %s", resp.Message) }
// after
if !resp.Success {
if strings.Contains(resp.Message, "频繁") { return nil, ErrRateLimited }
return nil, fmt.Errorf("盘链网盘接口异常: %s", resp.Message)
} Defensive patterns
Strategy: retry
Validate before calling
// keep request rate under panlian limits before calling
if time.Since(lastPanLinkCall) < 2*time.Second {
time.Sleep(2*time.Second - time.Since(lastPanLinkCall))
} Try / catch
links, err := plugin.FetchPanLinks(ctx, keyword, vodID)
if err != nil && strings.Contains(err.Error(), "盘链网盘接口异常") {
log.Printf("pan-link API abnormal: %v", err)
return degradedSearch(keyword) // fallback results
} Prevention
- Throttle pan-link searches (per-account rate limiter).
- Sanitize keywords (strip symbols/emoji) before sending.
- Log resp.Message verbatim when surfacing the wrapped error.
- Watch for panlian API contract updates and bump the plugin accordingly.
When it happens
Trigger: Success=false due to invalid keyword, rate limiting, account restriction, server error, or API contract change — anything not matching the login message branch.
Common situations: Searching too frequently hitting panlian rate limits; keyword contains characters the API rejects; panlian backend degraded; account shadow-banned from pan-link search.
Related errors
AI-assisted analysis of fish2018/pansou@beaa561337 (2026-09-07).
Data as JSON: /api/errors/2d4044e569c184b0.
Report an issue: GitHub.
Appendix: source
Thrown at plugin/panlian/panlian.go:844
}
return &resp, nil
}
func (p *PanlianPlugin) fetchPanLinks(client *http.Client, cookie string, keyword string, vodID int) (*PanLinkResponse, error) {
values := url.Values{}
values.Set("keyword", keyword)
values.Set("vod_id", fmt.Sprintf("%d", vodID))
values.Set("_t", fmt.Sprintf("%d", time.Now().UnixMilli()))
var resp PanLinkResponse
if err := p.doJSONGET(client, cookie, "/api/search_pan_links.php", values, &resp); err != nil {
return nil, err
}
if !resp.Success && strings.Contains(resp.Message, "登录") {
return nil, fmt.Errorf("%w: %s", errLoginRequired, resp.Message)
}
if !resp.Success {
return nil, fmt.Errorf("盘链网盘接口异常: %s", resp.Message)
}
p.resolvePanLinkTokens(client, cookie, resp.Data)
return &resp, nil
}
func (p *PanlianPlugin) resolvePanLinkTokens(client *http.Client, cookie string, groups map[string]PanGroup) {
type tokenJob struct {
groupKey string
index int
token string
}
type tokenResult struct {
groupKey string
index int
url string
}
jobs := make([]tokenJob, 0)View on GitHub (pinned to beaa561337)