diff options
author | James Taylor <user234683@users.noreply.github.com> | 2021-08-22 22:57:42 -0700 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2021-08-23 18:42:16 -0500 |
commit | e76257f8b7f897b8f15224c3d5a8120f058e0441 (patch) | |
tree | 128bc9514d3e402d56eb2ae7195790f6899763f8 /youtube/yt_data_extract | |
parent | 4e556efa3dc81dfc9924c0aedae95051fcc1b2d4 (diff) | |
download | yt-local-0.1.0.tar.lz yt-local-0.1.0.tar.xz yt-local-0.1.0.zip |
Fix comment reply url extraction due to youtube changes0.1.0
Signed-off-by: Jesús <heckyel@hyperbola.info>
Diffstat (limited to 'youtube/yt_data_extract')
-rw-r--r-- | youtube/yt_data_extract/everything_else.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/youtube/yt_data_extract/everything_else.py b/youtube/yt_data_extract/everything_else.py index ba3cd77..6d94681 100644 --- a/youtube/yt_data_extract/everything_else.py +++ b/youtube/yt_data_extract/everything_else.py @@ -256,9 +256,13 @@ def extract_comments_info(polymer_json, ctoken=None): 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_info['reply_ctoken'] = multi_deep_get( + comment_thread, + ['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={}) elif 'commentRenderer' in comment: # replies |