From 1532a48ef440079efb43cb4a4c6ad3043fecd2a3 Mon Sep 17 00:00:00 2001 From: James Taylor Date: Tue, 2 Mar 2021 19:32:56 -0800 Subject: Fix regression: Channels not sorting by oldest/popular MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit get_channel_first_page was mistakenly used when the sorting or view is different. Must use channel_tab which generates the necessary ctokens. Signed-off-by: Jesús --- youtube/channel.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'youtube/channel.py') diff --git a/youtube/channel.py b/youtube/channel.py index d60f1d3..a182320 100644 --- a/youtube/channel.py +++ b/youtube/channel.py @@ -237,8 +237,9 @@ def get_channel_page_general_url(base_url, tab, request, channel_id=None): view = request.args.get('view', '1') query = request.args.get('query', '') ctoken = request.args.get('ctoken', '') + default_params = (page_number == 1 and sort == '3' and view == '1') - if tab == 'videos' and channel_id and page_number > 1: + if tab == 'videos' and channel_id and not default_params: tasks = ( gevent.spawn(get_number_of_videos_channel, channel_id), gevent.spawn(get_channel_tab, channel_id, page_number, sort, -- cgit v1.2.3