{"record":{"id":"0ad868a38e26cd4b","repo":"fish2018/pansou","slug":"w-0ad868","errorCode":null,"errorMessage":"解析链接令牌失败: %w","messagePattern":"解析链接令牌失败: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugin/ting77/ting77.go","lineNumber":321,"sourceCode":"\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\")\n\treq.Header.Set(\"Cache-Control\", \"no-cache\")\n\tif referer != \"\" {\n\t\treq.Header.Set(\"Referer\", referer)\n\t}","sourceCodeStart":303,"sourceCodeEnd":339,"githubUrl":"https://github.com/fish2018/pansou/blob/beaa56133755a548ebc51b090b3816e2ae044aa6/plugin/ting77/ting77.go#L303-L339","documentation":"json.Unmarshal failed on the ting77 token endpoint body despite a 200. The endpoint returned non-JSON (challenge page) or a changed schema for tokenResponse. Distinct from status-code and rate-limit errors, which are checked before this.","triggerScenarios":"Thrown at plugin/ting77/ting77.go:321 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Dump the body to identify HTML interstitials","Update tokenResponse if the JSON shape changed","Retry once for transient garbage responses"],"exampleFix":null,"handlingStrategy":"validation","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"}