feat: release v0.1.3 with video favorites
This commit is contained in:
1 parent
e8cd96eb5e
commit
a9f38d7359
28 files changed
+1492
-50
No files matched your search
@@ -9,9 +9,12 @@ The application has one Android app module and no backend service.
|
||||
- `SessionStore` encrypts cookies with an Android Keystore AES-GCM key and writes an atomic file in `noBackupFilesDir`.
|
||||
- `ContentRepository` retrieves official catalogue/details/playback responses; `WbiSigner` caches official signing material; pure `ContentJson` parsing separates format and entitlement checks from transport.
|
||||
- `SearchRepository` uses official category search and the shared first-party session; pure `SearchJson` parses highlights, content identifiers, rights badges and bounded pagination. `SearchController` owns draft/submitted queries, category, deduplicated pages and cancellable requests. A generation guard also rejects non-cooperative late responses after a new query, category, clear, close or logout. It keeps no durable history.
|
||||
- `FavoriteRepository` reads official account folders, archive memberships and paginated resources, and submits explicit membership diffs. Account-bound requests capture a cookie epoch, require matching UID/SESSDATA and API-scoped CSRF for writes, and disable redirects and connection retries. `FavoriteJson` validates membership completeness and filters invalid or unsupported resources.
|
||||
- `FavoriteLibraryController` owns the selected folder and deduplicated pagination. `FavoriteActionController` separates the player's draft selections from confirmed server membership; only Save writes. Both cancel and reject late results after account/folder/video changes. Uncertain writes require an authoritative reload before retry. Logout clears the library; it has no durable cache.
|
||||
- `BulubuluHome`, dialogs and `TvAction` own TV layout/focus. Home stays composed beneath overlays, with focus/clicks disabled while inactive.
|
||||
- `SearchScreen` uses the device IME and the existing card components. It stays composed beneath details/player and restores result focus independently of Home.
|
||||
- `PlayerScreen` creates and releases Media3 with the composable lifecycle, merges separate AVC/AAC tracks and handles D-pad/media keys. CDN requests never receive account cookies.
|
||||
- `PlaybackQualitySwitcher` owns manual quality changes and commits the selected label only when the replacement source is ready. It preserves position/play intent, rejects overlapping requests and attempts the original source once after failure. `playbackMediaSource` shares HTTP identity, backup CDN handling and track merging between initial playback and changes. `QualityDialog` scrolls to and focuses the current actual track; one ExoPlayer is retained throughout the screen lifecycle.
|
||||
- `FavoriteDialog` provides multiple folder choices and explicit Save/Close actions. `PlayerScreen` restores its favorite action after the dialog regains the parent window's focus; opening or saving favorites does not recreate the player or media source.
|
||||
|
||||
There is no analytics, self-update service, local media scanning or private server. Login credentials and signed playback URLs must never appear in application logs or raw error messages. Account entitlements and region/DRM restrictions remain server-controlled. Tests use fake sessions in isolated storage and do not require a real account.
|
||||
+2
-1
@@ -7,6 +7,7 @@
|
||||
- HTTP 层每一跳重新计算 Cookie,严格遵守域名、路径、有效期,并且仅向 HTTPS 的 `bilibili.com` 及其子域发送。图片/CDN、第三方和 HTTP 不会收到会话 Cookie。
|
||||
- 退出登录先立即删除本地会话,再用隔离的旧会话尽力调用官方注销接口。该请求迟到也不会删除之后的新登录。Cookie 代次保护还可避免旧网络响应覆盖已验证的新账号。
|
||||
- 只有官方明确返回未登录时清理失效凭据。网络失败、HTTP 412 风控和服务器错误不会触发删除登录状态。
|
||||
- 收藏读写绑定请求创建时的账号 Cookie 代次;发送前重新检查,退出或账号替换后的旧请求会失败,不能携带新账号凭据提交。写入还要求匹配 UID、SESSDATA 和 API 域可用的 `bili_jct`,关闭重定向与连接自动重试;CSRF 不发送给图片或媒体服务器。
|
||||
- 没有统计 SDK、崩溃上传、口令输入、刷新令牌上传或自动升级器。没有实现 Cookie 自动续期;失效后重新扫码。
|
||||
|
||||
验证范围:官方匿名 nav 和 QR 生成接口已成功做只读探测。未使用用户账号完成扫码,也未在电视上安装。单元测试覆盖 Cookie 域名/路径/HTTPS/过期/替换、退出登录竞态,以及 JSON API URL 限制。Keystore 加密需要真机或 Android 模拟器验证,普通 JVM 单元测试不能代替。
|
||||
验证范围:官方匿名 nav 和 QR 生成接口已成功做只读探测。应用已部署到目标电视;开发测试未使用真实账号完成扫码或收藏写入。单元测试覆盖 Cookie 域名/路径/HTTPS/过期/替换、退出登录竞态、JSON API URL 限制,以及收藏请求的账号 / CSRF 绑定。Android 模拟器已验证 Keystore 密文重建和篡改拒绝;真实账号的端到端验证仍待进行。
|
||||
@@ -0,0 +1,28 @@
|
||||
# 收藏接口与状态
|
||||
|
||||
所有请求直接访问官方 `https://api.bilibili.com`,使用扫码取得的本机加密会话。没有第三方收藏服务,不持久缓存收藏列表,也不在开发测试中修改真实账号收藏。
|
||||
|
||||
| 方法 | 路径 | 用途与主要参数 |
|
||||
| --- | --- | --- |
|
||||
| GET | `/x/v3/fav/folder/created/list-all` | `up_mid=uid&type=2` 读取自己的收藏夹;附加 `rid=aid` 时读取每个收藏夹的 `fav_state` |
|
||||
| GET | `/x/v3/fav/resource/list` | `media_id`、`pn`、`ps=20`、`order=mtime`、`platform=web`、`type=0`、`tid=0`,按收藏时间读取视频 |
|
||||
| GET | `/x/v2/fav/video/favoured` | `aid` 读取当前稿件是否已收藏 |
|
||||
| POST | `/x/v3/fav/resource/deal` | `rid=aid&type=2`、逗号分隔的 `add_media_ids` / `del_media_ids`、`csrf`、`platform=web`,提交收藏夹差量 |
|
||||
|
||||
收藏夹与资源查询附带 `web_location=333.1387`。收藏夹和稿件 ID 全程使用 Long。资源分页遵守 `has_more`,每页去重;整页都是失效或不支持的条目时,仍允许继续加载。页码上限 1000,重复的非空视频页停止追加。
|
||||
|
||||
当前只展示 `type=2` 的视频稿件,过滤 `attr & 9 != 0` 的失效条目和其他资源类型,复用已有详情 / 分 P / 播放流程。播放器通过当前选集的 `aid` 收藏稿件,不能代替番剧或电影的追番 / 追剧。收藏夹数量可能包含已过滤的条目,因此不保证等于页面显示的视频数。创建、重命名、删除收藏夹尚未实现。
|
||||
|
||||
## 显式保存与错误处理
|
||||
|
||||
打开菜单读取权威的收藏夹归属;缺少 `fav_state` 时拒绝编辑,避免把已有归属误判为空。勾选仅修改本地草稿;新视频默认勾选第一个收藏夹。按「保存」才计算新增 / 移出差量,无变化时直接关闭。明确收到 `code=0` 才确认成功,随后刷新已经打开过的收藏库。
|
||||
|
||||
保存失败、取消在途保存或网络中断都可能产生不确定结果,界面不会自动重发写入;先重新读取状态,再允许编辑保存。关闭菜单和取消请求不能撤回已送达服务端的操作。切换账号、切换视频和关闭菜单后,旧响应不能改变当前界面。
|
||||
|
||||
收藏夹接口的 `data:null` 既可能是空账号,也可能是登录失效,因此额外调用同一账号绑定的 `/x/web-interface/nav`;确认 `isLogin=true` 且 UID 一致后才展示空收藏夹。其他格式错误与空结果分别处理。
|
||||
|
||||
## 会话边界与验证
|
||||
|
||||
请求创建时要求 API 域可用的 `DedeUserID` 与预期 UID 匹配,并有非空 `SESSDATA`;写入同时捕获该会话的 `bili_jct`。网络发送前检查 Cookie 代次,退出或替换账号后拒绝排队中的旧请求。账号请求与表单写入禁用重定向和连接自动重试。图片与视频 CDN 不接收会话 Cookie 或 CSRF。
|
||||
|
||||
2026-11-05 依据公开 `bilibili-api-python` 17.4.2 源码静态核对参数,未安装或执行该库。匿名探测确认未登录的状态接口返回 `-101`,并观察到收藏夹接口的 `data:null` 行为。解析、保存状态机、账号竞态和遥控器导航已用固定数据测试;真实账号的收藏夹读取、收藏 / 取消及其他官方客户端同步仍待实测。
|
||||
+3
-1
@@ -10,8 +10,10 @@ At a typical 960 × 540 dp TV viewport, the home screen has 38 dp horizontal and
|
||||
- Search: the header entry opens a separate screen while preserving Home. Confirm on the text field opens the system IME; its Search action, Enter, or the explicit search button submits. Typing alone never requests results. Down moves to the selected video/movie/bangumi filter, then into the four/five-column result grid. Results use the existing details/episode/player flow. Back first hides the keyboard, then returns from the grid to the selected filter, then closes search. Clear returns to the input. Closing clears the transient query and results; there is no search history.
|
||||
- Details: first episode receives focus after loading. Confirm starts playback. Multi-part videos and series have an episode grid. Back closes the dialog.
|
||||
- Login: QR code is generated locally with ZXing, not uploaded to a QR service. Refresh and close are D-pad targets. Closing cancels the parent-owned poll task. No password input is present.
|
||||
- Player: confirm or play/pause toggles playback; left/right seek ten seconds, with long press throttled to one step per 250 ms. Up reveals controls and focuses the top-right quality action; confirm opens its menu. Down returns focus to the video. Back exits playback directly. Both key-down and key-up are consumed so Android PlayerView cannot apply the same event twice. Controls remain visible when paused/end/error, while the quality action is focused or while its menu is open, and otherwise hide after four seconds during playback.
|
||||
- Favorites: a fourth tab, 「我的收藏」, appears only while logged in. A horizontal folder row sits above a four-column landscape grid. Confirm selects a folder or opens a video; Down from the tab scrolls the selected folder into view and focuses it. Back from videos returns to the selected folder, then to the tab. Folder changes reset the video scroll; pagination retains focus during loading and then focuses the first appended card. Empty folders, filtered pages, failed requests and accounts with no folders have explicit states.
|
||||
- Player: confirm or play/pause toggles playback; left/right seek ten seconds, with long press throttled to one step per 250 ms. Up reveals controls and focuses the top-right quality action; left/right then move between quality and favorites, and confirm opens the focused action. Down returns focus to the video. Back exits playback directly. Both key-down and key-up are consumed for playback commands so Android PlayerView cannot apply the same event twice. Controls remain visible when paused/end/error, while a top action is focused or its menu is open, and otherwise hide after four seconds during playback.
|
||||
- Quality menu: the current option is marked and receives focus, scrolling into view if necessary. Up/down navigate and confirm selects. Back/Close returns focus to the quality action. Only actual compatible tracks are shown; a single available option is explained. Changes briefly rebuffer at the same position and retain pause/play intent. An in-flight change disables duplicate selection; failure attempts the original quality once and reports recovery after it is ready. Choosing the current option closes without reloading. This is manual selection; each new video starts at the default quality and there is no automatic bitrate adaptation.
|
||||
- Favorite menu: the player's favorite action reads 「收藏」 or 「已收藏」; guests receive a login prompt. Existing memberships are checked, or the first folder is selected as a draft for a new video. Confirm toggles independent folder choices; Down from the final choice reaches Save. Only Save submits additions/removals, including removal from all folders. Saving disables duplicate choices/submission while Back/Close can dismiss. A failed or uncertain write requires Reload before another Save. Closing restores the favorite action after actual window focus returns. Folder creation/rename/deletion and season following are outside this screen's scope.
|
||||
- App backgrounding pauses the player; foregrounding resumes only if it was previously playing. Leaving the player releases Media3 and screen-on state.
|
||||
|
||||
Search remains composed beneath details and playback, with focus/clicks disabled while inactive. Returning restores the selected result and scroll position. Load more retains its focus during the request, then moves focus to the first appended result. If the final page adds no items, focus returns to the last result. Empty, error, risk-control and loading states do not use placeholder search results.
|
||||
|
||||
+13
-1
@@ -1,6 +1,6 @@
|
||||
# 验证记录
|
||||
|
||||
记录范围:2026-11-03 至 2026-11-04。
|
||||
记录范围:2026-11-03 至 2026-11-05。
|
||||
|
||||
## v0.1.0-alpha 已验证
|
||||
|
||||
@@ -56,6 +56,18 @@
|
||||
- 实际匿名投稿视频曾从 480P 切到 360P,画面和进度继续推进至 `00:42 / 03:31`。后续双向切换与暂停状态的完整复测未完成:模拟器出现绿屏、Codec2 超时和宿主图形缓冲错误,重新启动后的首次播放也能复现,尚未完成原因隔离。单元测试通过不代表真实解码、音画同步和所有清晰度已经端到端验证。
|
||||
- 本轮 ADB 连接目标电视超时,未把本功能覆盖安装到电视;最终实机双向切换、暂停后切换和高档位解码仍待验证。用户决定先提交为 `v0.1.2`,晚上进行电视实机验证;应用版本号更新为 `0.1.2`,Android `versionCode` 递增为 `3`,既有 `v0.1.1` 标签保留。
|
||||
|
||||
## v0.1.2 后续部署
|
||||
|
||||
- 用户开启电视后,已将 `v0.1.2` 覆盖安装到 `192.168.1.20:5555`;设备确认 `versionName=0.1.2`、`versionCode=3`,启动返回 `Status: ok`。之后 ADB 离线;安装成功不等于清晰度双向切换和真实遥控器已验证。
|
||||
|
||||
## v0.1.3 收藏功能 — 2026-11-05
|
||||
|
||||
- 开发版构建、Android Lint 和 `git diff --check` 通过。用户确认按 `v0.1.3` 提交,应用版本号更新为 `0.1.3` / `versionCode=4`;既有版本标签保留,本轮功能尚未安装到电视。
|
||||
- JVM 测试共 96 项通过,0 失败。新增 27 项覆盖收藏 JSON 解析、Long ID、归属完整性、失效 / 不支持条目过滤、分页、账号 / API 域 CSRF 绑定、退出后的旧请求拒绝、草稿不写入、差量保存、重复提交、保存结果不确定时重新读取,以及账号 / 收藏夹 / 视频切换后的迟到响应隔离。
|
||||
- Android 11 ARM64 模拟器共 21 项设备测试通过,0 失败;另有 1 项显式外网播放诊断按默认设置跳过。新增 7 项验证登录后才出现收藏页签、收藏夹与视频的返回层级、屏幕外收藏夹滚动聚焦、多选后显式保存、保存时禁止重复操作、长列表选中项可见、不确定结果要求重新加载,以及播放器顶部操作左右切换和收藏菜单关闭后的实际窗口焦点恢复。
|
||||
- 播放器收藏导航测试使用本地 socket 保持缓冲,未请求外部媒体或依赖模拟器实际解码。设备测试的账号和收藏夹均为固定测试数据,不代表真实账号接口已端到端验证,也没有修改用户实际收藏。
|
||||
- 官方参数通过公开库静态源码核对,匿名探测验证了未登录状态与 `data:null` 情况。真实账号收藏夹读取、添加 / 移出收藏、多个客户端同步、账号失效提示和目标电视遥控器仍待实测。当前只实现视频稿件收藏,未实现追番 / 追剧或收藏夹管理。
|
||||
|
||||
## 复现
|
||||
|
||||
```sh
|
||||
|
||||
Reference in new issue
Block a user