diff options
author | Jesus E <heckyel@riseup.net> | 2023-05-28 21:06:53 -0400 |
---|---|---|
committer | Jesus E <heckyel@riseup.net> | 2023-05-28 21:06:53 -0400 |
commit | fb13fd21ef3a408b4d1be4901955aca38393d987 (patch) | |
tree | 91a459d36737cc9442bb4e159d7f4a0100260f65 | |
parent | 68752000f0213f801a7c5e8127b77afeba644f7d (diff) | |
download | yt-local-fb13fd21ef3a408b4d1be4901955aca38393d987.tar.lz yt-local-fb13fd21ef3a408b4d1be4901955aca38393d987.tar.xz yt-local-fb13fd21ef3a408b4d1be4901955aca38393d987.zip |
channels: Fix sorting & page prefixing not working
Further completes #151
-rw-r--r-- | youtube/channel.py | 5 |
1 files changed, 3 insertions, 2 deletions
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, |