Skip to content

Conversation

@molanp
Copy link
Contributor

@molanp molanp commented Jan 20, 2026

molanp and others added 2 commits January 20, 2026 22:08
- 支持解析哔哩哔哩图文动态内容,并将动态和图文信息合并为统
一接口。同时修复了代码格式化问题,优化了部分函数参数
换行以提高可读性。
- Bug: 字体资源被持续占用未释放
Fixes fllesser#433
- Bug: B站动态解析缺少图片资源
Fixes fllesser#443
- Bug: 动态解析错误
Fixes fllesser#442
@codecov
Copy link

codecov bot commented Jan 20, 2026

Codecov Report

❌ Patch coverage is 80.95238% with 4 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
.../nonebot_plugin_parser/parsers/bilibili/dynamic.py 57.14% 3 Missing ⚠️
...nonebot_plugin_parser/parsers/bilibili/__init__.py 92.85% 1 Missing ⚠️
Files with missing lines Coverage Δ
...nonebot_plugin_parser/parsers/bilibili/__init__.py 71.49% <92.85%> (+0.64%) ⬆️
.../nonebot_plugin_parser/parsers/bilibili/dynamic.py 68.06% <57.14%> (+3.15%) ⬆️

... and 9 files with indirect coverage changes

molanp and others added 3 commits January 20, 2026 22:15
移除重复的opus测试函数,将测试数据合并到dynamic测试中,
统一测试逻辑并优化代码结构,提高测试效率。
移除了对动态解析结果中标题字段的非空断言,
保留了作者字段的断言以确保基本功能正常
@handle("/BV", r"bilibili\.com(?:/video)?/(?P<bvid>BV[0-9a-zA-Z]{10})(?:\?p=(?P<page_num>\d{1,3}))?")
@handle(
"/BV",
r"bilibili\.com(?:/video)?/(?P<bvid>BV[0-9a-zA-Z]{10})(?:\?p=(?P<page_num>\d{1,3}))?",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里为什么要换行

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

格式化插件自动的

@handle("/av", r"bilibili\.com(?:/video)?/av(?P<avid>\d{6,})(?:\?p=(?P<page_num>\d{1,3}))?")
@handle(
"/av",
r"bilibili\.com(?:/video)?/av(?P<avid>\d{6,})(?:\?p=(?P<page_num>\d{1,3}))?",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fllesser
Copy link
Owner

没改吗

@molanp
Copy link
Contributor Author

molanp commented Jan 31, 2026

改什么

@fllesser
Copy link
Owner

comment 没看到吗

@fllesser fllesser self-requested a review January 31, 2026 09:06
@fllesser fllesser changed the title feat(bilibili): 增强哔哩哔哩图文动态解析&修复字体占用 feat(bilibili): 增强哔哩哔哩图文动态解析 Jan 31, 2026
@fllesser fllesser merged commit 6c7b059 into fllesser:master Jan 31, 2026
17 checks passed
@fllesser fllesser added the bug Something isn't working label Jan 31, 2026
@molanp molanp deleted the fix/pro branch January 31, 2026 09:48
Anyuluo996 added a commit to Anyuluo996/nonebot-plugin-parser that referenced this pull request Jan 31, 2026
合并内容:
1. 原项目的增强功能:
   - is_article() 检测 - 自动识别文章类型动态
   - 统一的 parse_bilibili_api_opus() 处理
   - DynamicMajor.desc 字段支持
   - 依赖更新 (urllib3, yt-dlp等)

2. 我们项目的保留修复:
   - 转发动态完整修复 (区分 current_info/content_source)
   - Draw 类型支持 (普通图文动态)
   - 容错处理 (_major 方法)
   - 更多的字段默认值

3. 冲突解决策略:
   - bilibili/__init__.py: 保留转发逻辑 + 合入 is_article() 检测
   - bilibili/dynamic.py: 合并 draw + desc 字段
   - 其他文件: 采用原项目的更新

相关 PR:
- upstream fllesser#444: feat(bilibili): 增强哔哩哔哩图文动态解析
- upstream fllesser#445: fix(nga, tiktok): 更新解析器的处理规则
- upstream fllesser#448: fix(helper): enhance helper to simpify code
- upstream fllesser#449-451: 依赖和 CI 更新

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: B站动态解析缺少图片资源 Bug: 动态解析错误 Bug: 字体资源被持续占用未释放

2 participants