aboutsummaryrefslogtreecommitdiffstats
path: root/youtube/yt_data_extract/everything_else.py
diff options
context:
space:
mode:
authorJames Taylor <user234683@users.noreply.github.com>2020-08-11 19:59:25 -0700
committerJames Taylor <user234683@users.noreply.github.com>2020-08-11 19:59:25 -0700
commitfa61874f97a72c796dd9bcc2db910d51c0244339 (patch)
tree74c7652bd95d9114dc51182462e60cb21af66a68 /youtube/yt_data_extract/everything_else.py
parent81ff5ab99ca05c4559c604ba7517d17f4bc79ea8 (diff)
downloadyt-local-fa61874f97a72c796dd9bcc2db910d51c0244339.tar.lz
yt-local-fa61874f97a72c796dd9bcc2db910d51c0244339.tar.xz
yt-local-fa61874f97a72c796dd9bcc2db910d51c0244339.zip
extract_items: Handle case where continuation has multiple
[something]Continuation renderers, all of which are junk except one. Check the items in each one until the one which contains the items being sought is found. The usage in extract_comments_info needed to be changed to specify the items being sought. It was unspecified before which is strictly incorrect since extract_items by default looks for video/playlist/channel thumbnail items. It was relying on this special case for continuations. But now that wouldn't work anymore.
Diffstat (limited to 'youtube/yt_data_extract/everything_else.py')
-rw-r--r--youtube/yt_data_extract/everything_else.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/youtube/yt_data_extract/everything_else.py b/youtube/yt_data_extract/everything_else.py
index d1389c6..20e0f30 100644
--- a/youtube/yt_data_extract/everything_else.py
+++ b/youtube/yt_data_extract/everything_else.py
@@ -227,7 +227,8 @@ def extract_comments_info(polymer_json):
info['sort'] = metadata.get('sort')
info['video_title'] = None
- comments, ctoken = extract_items(response)
+ comments, ctoken = extract_items(response,
+ item_types={'commentThreadRenderer', 'commentRenderer'})
info['comments'] = []
info['ctoken'] = ctoken
for comment in comments: