-
Notifications
You must be signed in to change notification settings - Fork 422
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[YouTube] Add fallback to system playlists when fetching age-restricted stream channel tabs directly #1100
base: dev
Are you sure you want to change the base?
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
if (ChannelTabs.VIDEOS.equals(channelTabName) | ||
|| ChannelTabs.SHORTS.equals(channelTabName) | ||
|| ChannelTabs.LIVESTREAMS.equals(channelTabName)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add these to a list and check if it contains the channelTabName
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could, but would this change improve the performance of the checks or not?
any reason why this PR was not merged? |
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
ChannelExtractor
instance.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
ChannelExtractor
instance, 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.