feat: WebUI 增强 - 按运行分组管理 BGM/评论 + BGM 删除与场景标签 - #938
Open
00-ld wants to merge 4 commits into
Open
Conversation
- 三个 README(中/英/西)的赞助商展示区改为左 logo、右文案的两列表格,更紧凑 - 新增 Bloome 赞助商条目 - logo 与文案品牌名均可点击跳转对应链接 - TikHub 文案补充可点击链接
为 MediaCrawler WebUI 增加按"每次爬取"分组管理爬取内容的能力, 并补齐 BGM 试听、评论查看、运行历史等缺失的查看层。 ## 主要功能 ### 1. run_id 注入链路(按运行分组的基础) - API 生成 run_id,通过 --run_id CLI 参数注入爬虫子进程 - config.RUN_ID -> run_id_var contextvar -> store 层写数据行 + 文件名后缀 - 全平台(dy/xhs/ks/weibo/bili/tieba/zhihu)content+comment item 注入 run_id - 文件名纳入 run_id 时旧格式(空 run_id)向后兼容 ### 2. BGM 播放器(按运行分组) - 遍历所有 search_bgm_playlist_*.jsonl,按 aweme_id 去重 - 按 run 分组折叠展示,历史无 run_id 数据归"历史数据"组 - 粘性播放器,支持 HTTP Range 拖动进度 - 支持 BGM 删除(原子重写 jsonl + 可选删音频文件) - 场景标签:自动从爬取关键词推断 + 手动可编辑(存 data/.bgm_tags.json) ### 3. 评论查看页(新增) - 按 run 分组展示评论,明确每条评论来自哪次爬取 - 显示昵称/内容/点赞/时间/子评论数,可跳转原视频 ### 4. 运行历史页 - 记录每次爬取的元信息(平台/类型/关键词/状态/时长/条数) - 支持清历史(保护 .run_history.json 和 .bgm_tags.json 不被误删) ### 5. 其他 - 隐藏业务 ID 展示,平台业务 ID 统一改 String - i18n 中英双语补齐(bgm/comments/history/common 命名空间) ## 后端 - api/routers/data.py: BGM playlist 改造 + 删除/场景标签端点 + 评论端点 + _enrich_run_groups - api/services/run_history.py: 运行历史记录服务(新增) - api/services/crawler_manager.py: _build_command 加 --run_id + 顺序调整 - tools/async_file_writer.py: 文件名纳入 run_id(向后兼容) - store/<platform>/__init__.py: 全平台 item 注入 run_id ## 前端 - BgmPlayer + BgmRunGroupCard(容器/展示分离) - CommentsView + CommentRunGroupCard - HistoryView + RunRow - useBgm / useComments hooks - types/crawler.ts 类型补齐 ## 说明 这是多轮 WebUI 增强的合集提交,主要面向提升爬取内容的可管理性。 作为参考建议提交,欢迎维护者挑选需要的部分合入。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
为 MediaCrawler WebUI 增加按「每次爬取」分组管理爬取内容的能力,并补齐 BGM 试听、评论查看、运行历史等查看层。作为参考建议提交,欢迎维护者挑选需要的部分合入。
主要功能
1. run_id 注入链路(按运行分组的基础)
--run_idCLI 参数注入爬虫子进程config.RUN_ID→run_id_varcontextvar → store 层写数据行 + 文件名后缀2. BGM 播放器(按运行分组)
search_bgm_playlist_*.jsonl,按 aweme_id 去重data/.bgm_tags.json)3. 评论查看页(新增)
4. 运行历史页
.run_history.json和.bgm_tags.json不被误删)5. 其他
后端改动
api/routers/data.py: BGM playlist 改造 + 删除/场景标签端点 + 评论端点 +_enrich_run_groupsapi/services/run_history.py: 运行历史记录服务(新增)api/services/crawler_manager.py:_build_command加--run_id+ 顺序调整tools/async_file_writer.py: 文件名纳入 run_id(向后兼容)store/<platform>/__init__.py: 全平台 item 注入 run_id前端改动
BgmPlayer+BgmRunGroupCard(容器/展示分离)CommentsView+CommentRunGroupCardHistoryView+RunRowuseBgm/useCommentshookstypes/crawler.ts类型补齐验证
cd webui && npm run build:tsc 零错,vite 构建成功说明
这是多轮 WebUI 增强的合集提交,主要面向提升爬取内容的可管理性。如维护者认为范围过大,可只挑选 run_id 注入 + BGM 分组 这部分核心改动。欢迎反馈。