From fb13fd21ef3a408b4d1be4901955aca38393d987 Mon Sep 17 00:00:00 2001 From: Jesus E Date: Sun, 28 May 2023 21:06:53 -0400 Subject: channels: Fix sorting & page prefixing not working Further completes #151 --- youtube/channel.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'youtube/channel.py') diff --git a/youtube/channel.py b/youtube/channel.py index a84cf6a..de3b449 100644 --- a/youtube/channel.py +++ b/youtube/channel.py @@ -33,7 +33,7 @@ generic_cookie = (('Cookie', 'VISITOR_INFO1_LIVE=ST1Ti53r4fU'),) # https://github.com/user234683/youtube-local/issues/151 def channel_ctoken_v4(channel_id, page, sort, tab, view=1): - new_sort = (2 if sort == 1 else 1) + new_sort = (2 if int(sort) == 1 else 1) offset = str(30*(int(page) - 1)) pointless_nest = proto.string(80226972, proto.string(2, channel_id) @@ -347,7 +347,6 @@ def get_channel_page_general_url(base_url, tab, request, channel_id=None): if info['error'] is not None: return flask.render_template('error.html', error_message=info['error']) - post_process_channel_info(info) if tab == 'videos': info['number_of_videos'] = number_of_videos info['number_of_pages'] = math.ceil(number_of_videos/30) @@ -363,6 +362,8 @@ def get_channel_page_general_url(base_url, tab, request, channel_id=None): info['page_number'] = page_number info['subscribed'] = subscriptions.is_subscribed(info['channel_id']) + post_process_channel_info(info) + return flask.render_template( 'channel.html', parameters_dictionary=request.args, -- cgit v1.2.3