From 43679efff5c44c41e7e8c6ca46da145becbe7c03 Mon Sep 17 00:00:00 2001 From: James Taylor Date: Thu, 17 Dec 2020 13:46:29 -0800 Subject: channel: replace page #s w/ next page button using provided ctoken MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since yt doesn't accept page #'s when sorting by oldest Signed-off-by: Jesús --- youtube/yt_data_extract/everything_else.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'youtube/yt_data_extract/everything_else.py') diff --git a/youtube/yt_data_extract/everything_else.py b/youtube/yt_data_extract/everything_else.py index b4b612d..ae8715f 100644 --- a/youtube/yt_data_extract/everything_else.py +++ b/youtube/yt_data_extract/everything_else.py @@ -66,6 +66,7 @@ def extract_channel_info(polymer_json, tab): # get items info['items'] = [] + info['ctoken'] = None # empty channel if 'contents' not in response and 'continuationContents' not in response: @@ -75,6 +76,7 @@ def extract_channel_info(polymer_json, tab): items, ctoken = extract_items(response) 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': info['is_last_page'] = (ctoken is None) elif tab == 'about': -- cgit v1.2.3