]> jfr.im git - yt-dlp.git/commitdiff
[youtube:comments] Fix `is_favorited` (#491)
authorcoletdjnz <redacted>
Mon, 12 Jul 2021 01:20:03 +0000 (13:20 +1200)
committerGitHub <redacted>
Mon, 12 Jul 2021 01:20:03 +0000 (06:50 +0530)
Authored by colethedj

yt_dlp/extractor/youtube.py

index bdfdf00868cafa45657cf5ba5ee53fd8ce28c473..cb1d571f9b28e2486b9ed868058300c4d2451b0e 100644 (file)
@@ -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,