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

Authored by colethedj
This commit is contained in:
coletdjnz 2021-07-12 13:20:03 +12:00 committed by GitHub
parent f0ff9979c6
commit 9752433221
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -2002,14 +2002,15 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
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,