fix(config): 修复 parser_bili_video_codes 环境变量 Pydantic 校验失败问题 - #577
Closed
yuexps wants to merge 1 commit into
Closed
Conversation
- 修复背景:在配置 parser_bili_video_codes 环境变量(如 ["hev", "av01", "avc"])时,因 bilibili_api 中 VideoCodecs 枚举成员值为元组类型,导致 Pydantic 默认枚举校验报 ValidationError。 - 解决方案:在 Config 模型中增加 parser_bili_video_codes 的前置字段校验器(@field_validator(mode="before")),支持将字符串列表、JSON 数组及逗号分隔字符串自动转换并映射至对应的 VideoCodecs 枚举成员。 - 影响范围:仅影响 config.py 中 parser_bili_video_codes 配置项的反序列化与兼容解析。
❌ 2 Tests Failed:
View the top 2 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
Owner
|
这个应该是 bilibili-api 中途改的,准备弃用 bilibili-api 了,vibe 好了没合,你先暂时用着吧 |
Author
好的👌 |
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.
parser_bili_video_codes环境变量(如["hev", "av01", "avc"])时,因bilibili_api中VideoCodecs枚举成员值为元组类型,导致 Pydantic 默认枚举校验报 ValidationError。Config模型中增加parser_bili_video_codes的前置字段校验器(@field_validator(mode="before")),支持将字符串列表、JSON 数组及逗号分隔字符串自动转换并映射至对应的VideoCodecs枚举成员。config.py中parser_bili_video_codes配置项的反序列化与兼容解析。