Fix video fetch when using invidious API and sorting by popular. #3126
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix video fetch when using invidious API and sorting by popular.
Pull Request Type
Related issue
Partially solves #2887.
Description
While using Invidious API as primary, using sort by function on a channel page return nothing. Using debug mode, I verified that the API returns video list properly. However, the video list is under 'videos' key in the response Json.
Furthermore, the current popular videos fetch method doesn't work because the API requires continuation token which is returned in the first query. Only then the rest of the list is provided.
Screenshots
Before:
After:
Testing
I normally use the windows build however, for development & testing I've used WSL2 + Ubuntu22.04.
I tested this by going to a channel page, select sort by most popular and press fetch more videos.
Desktop
Additional context
Invidious API - Channels endpoint