diff options
| author | Astounds <kirito@disroot.org> | 2026-04-05 18:19:05 -0500 |
|---|---|---|
| committer | Astounds <kirito@disroot.org> | 2026-04-05 18:19:05 -0500 |
| commit | e8e2aa93d621b3f2ffe9c8f7b06d381012f6bff8 (patch) | |
| tree | 3c21da955b4a3d8025de77984e6dc2e166dce645 /youtube/templates/channel.html | |
| parent | 8403e30b3abe810d764fc6dc57c0a0386273356e (diff) | |
| download | yt-local-e8e2aa93d621b3f2ffe9c8f7b06d381012f6bff8.tar.lz yt-local-e8e2aa93d621b3f2ffe9c8f7b06d381012f6bff8.tar.xz yt-local-e8e2aa93d621b3f2ffe9c8f7b06d381012f6bff8.zip | |
fix(channel): fix shorts/streams pagination using continuation tokens
- Add continuation_token_cache to store ctokens between page requests
- Use cached ctoken for page 2+ instead of generating fresh tokens
- Switch shorts/streams to Next/Previous buttons (no page numbers)
- Show "N+ videos" indicator when more pages are available
- Fix UnboundLocalError when page_call was undefined for shorts/streams
The issue was that YouTube's InnerTube API requires continuation tokens
for pagination on shorts/streams tabs, but the code was generating a new
ctoken each time, always returning the same 30 videos.
Diffstat (limited to 'youtube/templates/channel.html')
| -rw-r--r-- | youtube/templates/channel.html | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/youtube/templates/channel.html b/youtube/templates/channel.html index 2c0a1a2..274b727 100644 --- a/youtube/templates/channel.html +++ b/youtube/templates/channel.html @@ -82,7 +82,11 @@ <div id="links-metadata"> {% if current_tab in ('videos', 'shorts', 'streams') %} {% set sorts = [('3', 'newest'), ('4', 'newest - no shorts')] %} - <div id="number-of-results">{{ number_of_videos }} videos</div> + {% if current_tab in ('shorts', 'streams') and not is_last_page %} + <div id="number-of-results">{{ number_of_videos }}+ videos</div> + {% else %} + <div id="number-of-results">{{ number_of_videos }} videos</div> + {% endif %} {% elif current_tab == 'playlists' %} {% set sorts = [('3', 'newest'), ('4', 'last video added')] %} {% if items %} @@ -117,7 +121,11 @@ <hr/> <footer class="pagination-container"> - {% if current_tab in ('videos', 'shorts', 'streams') %} + {% if current_tab in ('shorts', 'streams') %} + <nav class="next-previous-button-row"> + {{ common_elements.next_previous_buttons(is_last_page, channel_url + '/' + current_tab, parameters_dictionary) }} + </nav> + {% elif current_tab == 'videos' %} <nav class="pagination-list"> {{ common_elements.page_buttons(number_of_pages, channel_url + '/' + current_tab, parameters_dictionary, include_ends=(current_sort.__str__() in '34')) }} </nav> |
