未验证 提交 97524332 编写于 作者: C coletdjnz 提交者: GitHub

[youtube:comments] Fix `is_favorited` (#491)

Authored by colethedj
上级 f0ff9979
...@@ -2002,14 +2002,15 @@ def _extract_comment(self, comment_renderer, parent=None): ...@@ -2002,14 +2002,15 @@ def _extract_comment(self, comment_renderer, parent=None):
lambda x: x['authorThumbnail']['thumbnails'][-1]['url'], compat_str) lambda x: x['authorThumbnail']['thumbnails'][-1]['url'], compat_str)
author_is_uploader = try_get(comment_renderer, lambda x: x['authorIsChannelOwner'], bool) author_is_uploader = try_get(comment_renderer, lambda x: x['authorIsChannelOwner'], bool)
is_liked = try_get(comment_renderer, lambda x: x['isLiked'], bool) is_favorited = 'creatorHeart' in (try_get(
comment_renderer, lambda x: x['actionButtons']['commentActionButtonsRenderer'], dict) or {})
return { return {
'id': comment_id, 'id': comment_id,
'text': text, 'text': text,
'timestamp': timestamp, 'timestamp': timestamp,
'time_text': time_text, 'time_text': time_text,
'like_count': votes, 'like_count': votes,
'is_favorited': is_liked, 'is_favorited': is_favorited,
'author': author, 'author': author,
'author_id': author_id, 'author_id': author_id,
'author_thumbnail': author_thumbnail, 'author_thumbnail': author_thumbnail,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册