{"record":{"id":"c14be9b7b0e98a61","repo":"RayWangQvQ/BiliBiliToolPro","slug":"cookie-config-constants-sourcecodeurl","errorCode":null,"errorMessage":"请正确配置Cookie后再运行，配置方式见 {Config.Constants.SourceCodeUrl}","messagePattern":"请正确配置Cookie后再运行，配置方式见 (.+?)","errorType":"validation","errorClass":"BiliValidationException","httpStatus":null,"severity":"error","filePath":"src/Ray.BiliBiliTool.Agent/BiliCookie.cs","lineNumber":112,"sourceCode":"\n        //SessData为空，抛异常\n        if (string.IsNullOrWhiteSpace(SessData))\n        {\n            throw new BiliValidationException(\n                string.Format(msg, GetPropertyDescription(nameof(SessData)))\n            );\n        }\n\n        //BiliJct为空，抛异常\n        if (string.IsNullOrWhiteSpace(BiliJct))\n        {\n            throw new BiliValidationException(\n                string.Format(msg, GetPropertyDescription(nameof(BiliJct)))\n            );\n        }\n\n        if (!result)\n            throw new BiliValidationException(\n                $\"请正确配置Cookie后再运行，配置方式见 {Config.Constants.SourceCodeUrl}\"\n            );\n    }\n\n    private string GetPropertyDescription(string propertyName)\n    {\n        return GetType().GetPropertyDescription(propertyName);\n    }\n}\n","sourceCodeStart":94,"sourceCodeEnd":122,"githubUrl":"https://github.com/RayWangQvQ/BiliBiliToolPro/blob/c599b2c0da964e16ea8c454397aa07bb16212628/src/Ray.BiliBiliTool.Agent/BiliCookie.cs#L94-L122","documentation":"Final fallback in Check: if any secondary validation set result=false, the library throws BiliValidationException pointing to the project's documentation URL (Config.Constants.SourceCodeUrl) so users know how to configure the cookie properly.","triggerScenarios":"Any Check() path that accumulates validation failures (result=false) without one of the earlier specific throws, e.g. other invalid cookie item values flagged during aggregate validation.","commonSituations":"First-time setup with an incorrectly formatted or incomplete cookie; users skipping the README cookie configuration instructions; expired/regenerated cookies after password change or logout.","solutions":["Follow the configuration guide at the URL in the message (project source README) to build the cookie correctly.","Re-export all cookies fresh from a logged-in browser session.","If the cookie was recently valid, re-login to bilibili — logging out invalidates SESSDATA/bili_jct."],"exampleFix":"// before (placeholder config)\n\"BiliCookie\": \"your cookie here\"\n// after\n\"BiliCookie\": \"DedeUserID=12345; SESSDATA=abc%2Cdef; bili_jct=6789token\"","handlingStrategy":"validation","validationCode":"var required = new[] { \"DedeUserID\", \"SESSDATA\", \"bili_jct\" };\nvar ok = required.All(k => cookieString.Split(';').Any(p => p.TrimStart().StartsWith(k + \"=\")));\nif (!ok) throw new ArgumentException(\"Cookie 配置不完整，参见项目 README\");","typeGuard":null,"tryCatchPattern":"try { cookie.Check(); }\ncatch (BiliValidationException ex) { logger.LogError(\"请按文档配置 Cookie: {Msg}\", ex.Message); }","preventionTips":["Follow the README cookie configuration guide on first setup.","Re-export the whole cookie after any bilibili re-login.","Store the cookie as one verbatim string in a single config field."],"tags":["csharp","cookie","config","setup"],"backgroundTag":"invalid-config-value","analyzedSha":"c599b2c0da964e16ea8c454397aa07bb16212628","analyzedAt":"2026-09-12T09:48:04.090Z","contentChangedAt":"2026-09-12T09:48:04.090Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}