fix(youtube): read the sort token from the dropdown chip on channels using it#73
Open
Priveetee wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Refs InfinityLoop1308/PipePipe#2549
Commits
Summary
latest/popular/oldest) being silently ignored on a subset of channels.Problem
YouTube rolled out a second chipBar layout on the channel Videos tab. Two layouts now coexist:
getSortContinuationTokendidchips.getObject(sortIndex)withlatest=0 / popular=1 / oldest=2. On the dropdown layout, index 1 is the "Members only" filter and index 2 is the "Public" filter, sopopularloaded members-only videos andoldestloaded public-filter videos in the default order.Observed on one of the reported channels (
UCfMaMDIYLcZbN2aagsTUO5Q), first five video IDs per sort:Changes
YoutubeChannelTabExtractor#getSortContinuationToken: when the first chip isCHIP_VIEW_MODEL_DISPLAY_TYPE_DROP_DOWN, read the sort token from its sheetlistItems[sortIndex]instead ofchips[sortIndex].extractContinuationTokenFromListItemto pullcontinuationCommand.tokenout ofcommandExecutorCommand.commands[](it sits next to anentityUpdateCommand, so no hardcoded command index).Validation
./gradlew :extractor:compileJavaAfter, same channel:
Also probed three more reported dropdown channels (
UC9YOQFPfEUXbulKDtxeqqBA,UCpPQTM5BojSeZJC_Q-vvs5A,UCKAmgxBSTqfSGz6OPxhrCZA): all three sorts return distinct item orders after the fix.No regression on a flat-layout channel (
UCBJycsmduvYEL83R_U4JriQ): latest / popular / oldest stay distinct, same as before.Notes
listItemsorder being[Latest, Popular, Oldest], which matched every channel I captured and matches YouTube's UI. If YouTube reorders it, the helper returns null and we throw a cleanParsingExceptioninstead of silently loading the wrong content.#2546(channel search "Could not get url") is a separate bug on the search path and is not addressed here.