refactor: reorganize API and WebSocket modules

Split client, endpoint, and WebSocket implementations into domain-focused modules while preserving the public API.\n\nImprove crate and API documentation to describe responsibilities, authentication boundaries, and response compatibility.
This commit is contained in:
2026-07-19 22:31:47 -07:00
parent c5db920738
commit b3e3a3c87c
33 changed files with 2956 additions and 2712 deletions
+13 -4
View File
@@ -1,8 +1,17 @@
//! Bilibili Web 与直播接口的异步客户端。
//! Bilibili Web 与直播接口的异步 Rust 客户端。
//!
//! 本 crate 不实现密码、二维码、验证码或 OAuth 登录流程。请通过 Bilibili 的正常登录页面
//! 获得会话,再将 `SESSDATA` 和 `bili_jct` 传给 [`Credentials`]。会改变账号状态的
//! Cookie 请求会自动携带 `csrf` 和 `csrf_token`。
//! # 设计范围
//!
//! 本 crate 提供可复用的 HTTP 请求基础设施、WBI 查询签名、会话凭据处理,以及直播
//! WebSocket 数据包与业务命令解析。常用 Web API 按直播、视频、用户、评论和搜索等
//! 领域组织;各领域方法返回 [`serde_json::Value`],以兼容服务端持续变化的响应字段。
//! 调用方也可以使用 [`Client`] 的通用请求方法访问尚未封装的端点。
//!
//! # 认证与状态变更
//!
//! 本 crate 不实现密码、二维码、验证码或 OAuth 登录流程。请通过 Bilibili 的正常登录
//! 流程取得会话,再将 `SESSDATA` 和 `bili_jct` 提供给 [`Credentials`]。需要会话的
//! 状态变更请求会自动补充 `csrf` 与 `csrf_token`;没有可用 CSRF token 时会返回错误。
//!
//! ```no_run
//! use libilibili::Client;