From 97524332213d3a5582e7cb5cdeb263a4ce84f0e9 Mon Sep 17 00:00:00 2001 From: coletdjnz Date: Mon, 12 Jul 2021 13:20:03 +1200 Subject: [PATCH] [youtube:comments] Fix `is_favorited` (#491) Authored by colethedj --- yt_dlp/extractor/youtube.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/yt_dlp/extractor/youtube.py b/yt_dlp/extractor/youtube.py index bdfdf0086..cb1d571f9 100644 --- a/yt_dlp/extractor/youtube.py +++ b/yt_dlp/extractor/youtube.py @@ -2002,14 +2002,15 @@ def _extract_comment(self, comment_renderer, parent=None): lambda x: x['authorThumbnail']['thumbnails'][-1]['url'], compat_str) 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 { 'id': comment_id, 'text': text, 'timestamp': timestamp, 'time_text': time_text, 'like_count': votes, - 'is_favorited': is_liked, + 'is_favorited': is_favorited, 'author': author, 'author_id': author_id, 'author_thumbnail': author_thumbnail,