diff options
Diffstat (limited to 'youtube/yt_data_extract')
-rw-r--r-- | youtube/yt_data_extract/common.py | 8 | ||||
-rw-r--r-- | youtube/yt_data_extract/everything_else.py | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/youtube/yt_data_extract/common.py b/youtube/yt_data_extract/common.py index 57a84ed..2b394e6 100644 --- a/youtube/yt_data_extract/common.py +++ b/youtube/yt_data_extract/common.py @@ -450,6 +450,14 @@ def extract_items_from_renderer(renderer, item_types=_item_types): if key in item_types: items.append(renderer) + # ctoken sometimes placed in these renderers, e.g. channel playlists + elif key == 'continuationItemRenderer': + cont = deep_get( + value, 'continuationEndpoint', 'continuationCommand', 'token' + ) + if cont: + ctoken = cont + # has a list in it, add it to the iter stack elif get_nested_renderer_list_function(key): renderer_list, cont = get_nested_renderer_list_function(key)(value) diff --git a/youtube/yt_data_extract/everything_else.py b/youtube/yt_data_extract/everything_else.py index 197cf88..f9c47cb 100644 --- a/youtube/yt_data_extract/everything_else.py +++ b/youtube/yt_data_extract/everything_else.py @@ -77,7 +77,7 @@ def extract_channel_info(polymer_json, tab): additional_info = {'author': info['channel_name'], 'author_url': info['channel_url']} info['items'] = [extract_item_info(renderer, additional_info) for renderer in items] info['ctoken'] = ctoken - if tab == 'search': + if tab in ('search', 'playlists'): info['is_last_page'] = (ctoken is None) elif tab == 'about': items, _ = extract_items(response, item_types={'channelAboutFullMetadataRenderer'}) |