feat: 支持解析并返回评论中的图片#61
Open
yskhhh wants to merge 1 commit intoautoclaw-cc:mainfrom
Open
Conversation
评论数据中存在 pictures 字段,但原始 Comment 类未对其解析, 导致图片评论的 content 为空字符串,图片信息完全丢失。 新增 CommentPicture 数据类,在 Comment 中增加 pictures 字段, from_dict 解析 pictures 数组,to_dict 在有图片时输出 pictures。 图片评论(如晒 ootd 的回复)现在可正确返回图片尺寸和 CDN URL。
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.
问题
小红书评论支持发送图片,服务端在 INITIAL_STATE 中通过
pictures字段返回图片信息。但原有Comment类未声明该字段,导致图片评论的
content为空字符串,图片数据完全丢失。受影响场景:晒穿搭、晒产品等以图片为主的评论,
在 get-feed-detail 返回结果中无法获取任何有效内容。
修复
CommentPicture数据类,包含width、height、urlDefault、urlPreComment增加pictures: list[CommentPicture]字段from_dict解析pictures数组(兼容空列表)to_dict在存在图片时输出pictures,仅含图片时content为空字符串属正常行为