{"record":{"id":"2d4044e569c184b0","repo":"fish2018/pansou","slug":"s-2d4044","errorCode":null,"errorMessage":"盘链网盘接口异常: %s","messagePattern":"盘链网盘接口异常: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugin/panlian/panlian.go","lineNumber":844,"sourceCode":"\t}\n\treturn &resp, nil\n}\n\nfunc (p *PanlianPlugin) fetchPanLinks(client *http.Client, cookie string, keyword string, vodID int) (*PanLinkResponse, error) {\n\tvalues := url.Values{}\n\tvalues.Set(\"keyword\", keyword)\n\tvalues.Set(\"vod_id\", fmt.Sprintf(\"%d\", vodID))\n\tvalues.Set(\"_t\", fmt.Sprintf(\"%d\", time.Now().UnixMilli()))\n\n\tvar resp PanLinkResponse\n\tif err := p.doJSONGET(client, cookie, \"/api/search_pan_links.php\", values, &resp); err != nil {\n\t\treturn nil, err\n\t}\n\tif !resp.Success && strings.Contains(resp.Message, \"登录\") {\n\t\treturn nil, fmt.Errorf(\"%w: %s\", errLoginRequired, resp.Message)\n\t}\n\tif !resp.Success {\n\t\treturn nil, fmt.Errorf(\"盘链网盘接口异常: %s\", resp.Message)\n\t}\n\tp.resolvePanLinkTokens(client, cookie, resp.Data)\n\treturn &resp, nil\n}\n\nfunc (p *PanlianPlugin) resolvePanLinkTokens(client *http.Client, cookie string, groups map[string]PanGroup) {\n\ttype tokenJob struct {\n\t\tgroupKey string\n\t\tindex    int\n\t\ttoken    string\n\t}\n\ttype tokenResult struct {\n\t\tgroupKey string\n\t\tindex    int\n\t\turl      string\n\t}\n\n\tjobs := make([]tokenJob, 0)","sourceCodeStart":826,"sourceCodeEnd":862,"githubUrl":"https://github.com/fish2018/pansou/blob/beaa56133755a548ebc51b090b3816e2ae044aa6/plugin/panlian/panlian.go#L826-L862","documentation":"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.","triggerScenarios":"Success=false due to invalid keyword, rate limiting, account restriction, server error, or API contract change — anything not matching the login message branch.","commonSituations":"Searching too frequently hitting panlian rate limits; keyword contains characters the API rejects; panlian backend degraded; account shadow-banned from 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."],"exampleFix":"// before\nif !resp.Success { return nil, fmt.Errorf(\"盘链网盘接口异常: %s\", resp.Message) }\n// after\nif !resp.Success {\n    if strings.Contains(resp.Message, \"频繁\") { return nil, ErrRateLimited }\n    return nil, fmt.Errorf(\"盘链网盘接口异常: %s\", resp.Message)\n}","handlingStrategy":"retry","validationCode":"// keep request rate under panlian limits before calling\nif time.Since(lastPanLinkCall) < 2*time.Second {\n    time.Sleep(2*time.Second - time.Since(lastPanLinkCall))\n}","typeGuard":null,"tryCatchPattern":"links, err := plugin.FetchPanLinks(ctx, keyword, vodID)\nif err != nil && strings.Contains(err.Error(), \"盘链网盘接口异常\") {\n    log.Printf(\"pan-link API abnormal: %v\", err)\n    return degradedSearch(keyword) // fallback results\n}","preventionTips":["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."],"tags":["api","upstream-api","error-response","search"],"backgroundTag":"api-error-response","analyzedSha":"beaa56133755a548ebc51b090b3816e2ae044aa6","analyzedAt":"2026-09-07T00:31:18.025Z","contentChangedAt":"2026-09-07T00:31:18.025Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}