diff options
Diffstat (limited to 'youtube/yt_data_extract')
-rw-r--r-- | youtube/yt_data_extract/everything_else.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/youtube/yt_data_extract/everything_else.py b/youtube/yt_data_extract/everything_else.py index ae8715f..197cf88 100644 --- a/youtube/yt_data_extract/everything_else.py +++ b/youtube/yt_data_extract/everything_else.py @@ -251,13 +251,19 @@ def extract_comments_info(polymer_json): info['video_title'] = extract_str(comment_thread.get('commentTargetTitle')) if 'replies' not in comment_thread: comment_info['reply_count'] = 0 + comment_info['reply_ctoken'] = None else: comment_info['reply_count'] = extract_int(deep_get(comment_thread, 'replies', 'commentRepliesRenderer', 'moreText' ), default=1) # With 1 reply, the text reads "View reply" + comment_info['reply_ctoken'] = deep_get(comment_thread, + 'replies', 'commentRepliesRenderer', 'continuations', 0, + 'nextContinuationData', 'continuation' + ) comment_renderer = deep_get(comment_thread, 'comment', 'commentRenderer', default={}) elif 'commentRenderer' in comment: # replies comment_info['reply_count'] = 0 # replyCount, below, not present for replies even if the reply has further replies to it + comment_info['reply_ctoken'] = None conservative_update(info, 'is_replies', True) comment_renderer = comment['commentRenderer'] else: |