Fix comment reply url extraction due to youtube changes

Signed-off-by: Jesús <heckyel@hyperbola.info>
This commit is contained in:
James Taylor 2021-08-22 22:57:42 -07:00 committed by Jesús
parent 4e556efa3d
commit e76257f8b7
No known key found for this signature in database
GPG Key ID: F6EE7BC59A315766

View File

@ -256,9 +256,13 @@ def extract_comments_info(polymer_json, ctoken=None):
comment_info['reply_count'] = extract_int(deep_get(comment_thread, comment_info['reply_count'] = extract_int(deep_get(comment_thread,
'replies', 'commentRepliesRenderer', 'moreText' 'replies', 'commentRepliesRenderer', 'moreText'
), default=1) # With 1 reply, the text reads "View reply" ), default=1) # With 1 reply, the text reads "View reply"
comment_info['reply_ctoken'] = deep_get(comment_thread, comment_info['reply_ctoken'] = multi_deep_get(
'replies', 'commentRepliesRenderer', 'continuations', 0, comment_thread,
'nextContinuationData', 'continuation' ['replies', 'commentRepliesRenderer', 'contents', 0,
'continuationItemRenderer', 'button', 'buttonRenderer',
'command', 'continuationCommand', 'token'],
['replies', 'commentRepliesRenderer', 'continuations', 0,
'nextContinuationData', 'continuation']
) )
comment_renderer = deep_get(comment_thread, 'comment', 'commentRenderer', default={}) comment_renderer = deep_get(comment_thread, 'comment', 'commentRenderer', default={})
elif 'commentRenderer' in comment: # replies elif 'commentRenderer' in comment: # replies