{"record":{"id":"ea9bbdd3f5d26854","repo":"fish2018/pansou","slug":"d-ea9bbd","errorCode":null,"errorMessage":"令牌接口返回状态码 %d","messagePattern":"令牌接口返回状态码 (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugin/ting77/ting77.go","lineNumber":317,"sourceCode":"\treq, err := http.NewRequestWithContext(ctx, http.MethodGet, p.baseURL+\"/api/link/token?\"+query.Encode(), nil)\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\tsetRequestHeaders(req, p.baseURL+\"/resource/\"+resourceID, \"application/json\")\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\tdefer resp.Body.Close()\n\tbody, err := io.ReadAll(io.LimitReader(resp.Body, 512<<10))\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\tif resp.StatusCode != http.StatusOK {\n\t\tif resp.StatusCode == http.StatusTooManyRequests {\n\t\t\treturn \"\", \"\", errRateLimited\n\t\t}\n\t\treturn \"\", \"\", fmt.Errorf(\"令牌接口返回状态码 %d\", resp.StatusCode)\n\t}\n\tvar token tokenResponse\n\tif err := json.Unmarshal(body, &token); err != nil {\n\t\treturn \"\", \"\", fmt.Errorf(\"解析链接令牌失败: %w\", err)\n\t}\n\tif token.Code != 0 || token.Data.Token == \"\" || token.Data.TS == \"\" {\n\t\tif token.Code == http.StatusTooManyRequests {\n\t\t\treturn \"\", \"\", errRateLimited\n\t\t}\n\t\treturn \"\", \"\", fmt.Errorf(\"链接令牌无效: %s\", token.Message)\n\t}\n\treturn token.Data.Token, token.Data.TS, nil\n}\n\nfunc setRequestHeaders(req *http.Request, referer, accept string) {\n\treq.Header.Set(\"User-Agent\", browserUserAgent)\n\treq.Header.Set(\"Accept\", accept)\n\treq.Header.Set(\"Accept-Language\", \"zh-CN,zh;q=0.9,en;q=0.8\")","sourceCodeStart":299,"sourceCodeEnd":335,"githubUrl":"https://github.com/fish2018/pansou/blob/beaa56133755a548ebc51b090b3816e2ae044aa6/plugin/ting77/ting77.go#L299-L335","documentation":"Status error in ting77's fetchLinkToken (plugin/ting77/ting77.go:317): the link-token API returned a non-200 status other than 429 (429 is mapped to errRateLimited earlier), so the resource's token cannot be obtained.","triggerScenarios":"Thrown at plugin/ting77/ting77.go:317 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Honor errRateLimited separately with backoff","For 403/5xx, retry with jitter or drop the entry","Log resourceID to find systematically failing entries"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}