[YouTube] Add fallback to system playlists when fetching age-restricted stream channel tabs directly#1100
Open
AudricV wants to merge 5 commits intoTeamNewPipe:devfrom
Open
[YouTube] Add fallback to system playlists when fetching age-restricted stream channel tabs directly#1100AudricV wants to merge 5 commits intoTeamNewPipe:devfrom
AudricV wants to merge 5 commits intoTeamNewPipe:devfrom
Conversation
The method has been moved from YoutubeChannelExtractor to YoutubeChannelHelper and has been made public in order to be used for channel and channel tabs extraction.
This fallback is only used for age-restricted channels and Videos, Shorts and Live tabs. It was already used when getting tabs from a channel extractor, but not when fetching directly the tabs.
- Add a test to fetch directly the Videos tab of an age-restricted channel; - Fetch directly the Shorts tab for the corresponding age-restricted channel test. In order to not duplicate code of the existing Videos tab test, an abstract test class with the common code of the two Videos tab tests has been created.
FireMasterK
approved these changes
Sep 13, 2023
Comment on lines
+111
to
+113
| if (ChannelTabs.VIDEOS.equals(channelTabName) | ||
| || ChannelTabs.SHORTS.equals(channelTabName) | ||
| || ChannelTabs.LIVESTREAMS.equals(channelTabName)) { |
Member
There was a problem hiding this comment.
Can we add these to a list and check if it contains the channelTabName instead?
Member
Author
There was a problem hiding this comment.
We could, but would this change improve the performance of the checks or not?
Contributor
|
any reason why this PR was not merged? |
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.
This PR adds support of the channel tabs fallback to system YouTube upload playlists when fetching directly Videos, Shorts or Live tabs of an age-restricted channel.
It makes the data returned in this case consistent as the ones returned when getting the data of tabs got from a YouTube
ChannelExtractorinstance.If other tabs are requested directly, no items will be returned, like before this PR.
I updated the corresponding Shorts tab test, which fetches now directly the tabs, and added a Videos tab test which do so too.
I also kept the test using the original behavior of fetching the Videos channel tab from the channel tabs got by a
ChannelExtractorinstance, in order to ensure both approaches work properly.As the Videos tab tests expect the same data, I put the common code of these two test classes inside an abstract test class.
I also removed unneeded test method overrides in
YoutubeChannelTabExtractorTest, and updated the channel tabs tests' mocks.