Skip to content
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] Support richGridRenderer on channel page to fix extraction of videos in channels #944

Merged
merged 2 commits into from
Nov 2, 2022

Conversation

Theta-Dev
Copy link
Contributor

@Theta-Dev Theta-Dev commented Oct 12, 2022

YouTube is currently A/B testing a new layout on their channel pages, which uses a RichGridRenderer. The current version of NewPipe cant extract any videos from it, resulting in an empty channel page. This PR adds support for it.

Here is a response file with the new layout: https://code.thetadev.de/ThetaDev/rustypipe/src/branch/main/testfiles/channel/channel_videos_20221011_richgrid2.json

I could not reproduce the error on my own without tools (the A/B test seems to be pretty rare for me). But there are already people having issues with the channel pages in NewPipe. See https://libreddit.kavin.rocks/r/NewPipe/comments/y1zg5m/why_are_certain_educative_channels_invisible_from/

  • I carefully read the contribution guidelines and agree to them.
  • I have tested the API against NewPipe.
  • I agree to create a pull request for NewPipe as soon as possible to make it compatible with the changed API (no API changes).

Fixes TeamNewPipe/NewPipe#9223

@Theta-Dev
Copy link
Contributor Author

Theta-Dev commented Oct 12, 2022

Here is a debug build for testing:

app-debug.zip

@Theta-Dev
Copy link
Contributor Author

Note that this new channel layout includes up to 3 tabs for videos, livestreams and shorts. So we need a way to fetch up to 3 tabs at once to fully support this.

Lets hope YouTube is not going to make this permanent...

Screenshot from 2022-10-18 23-38-32

@AudricV
Copy link
Member

AudricV commented Oct 19, 2022

Lets hope YouTube is not going to make this permanent...

It will be, as it has been announced by YouTube. Check out this video of the Creator Insights official YouTube channel.

So we need a way to fetch up to 3 tabs at once to fully support this.

I don't think that's a good idea, we should just implement channel tabs in the extractor instead.

@AudricV AudricV added bug youtube service, https://www.youtube.com/ labels Oct 19, 2022
@Theta-Dev
Copy link
Contributor Author

I guess you are right. I was thinking about having to use up to 3 requests go get subscription feed data, but that wont work anyway. YouTube does not show the upload date of shorts, so it wont be possible to merge the 3 tabs into a chronological feed.

So I guess we should stick to using the RSS feed for fetching the subscription feed (maybe make that the default option once channel tabs are permanently established).

For the actual channel views we would need the 3tab layout in NewPipe (and by that occasion, add channel playlists, too).

Copy link
Member

@AudricV AudricV left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I just have a question.

@AudricV AudricV changed the title [YouTube] fix: support richGridRenderer on channel page [YouTube] Support richGridRenderer on channel page to fix extraction of videos in channels Oct 28, 2022
@AudricV AudricV added the ASAP label Oct 29, 2022
@AudricV
Copy link
Member

AudricV commented Oct 29, 2022

@Theta-Dev Could you answer our questions, please? We'd like to merge this fix ASAP.

@Theta-Dev
Copy link
Contributor Author

Okay, I added the setVisitorData method from my channel tabs PR to reproduce the A/B test that way.

Also redownloaded the mock files and switched the test to a channel (Jeff Geerling) that has all 3 tabs.

Copy link
Member

@AudricV AudricV left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost good!


@Test
public void testDescription() throws Exception {
ExtractorAsserts.assertContains("K8s, Ansible, Raspberry Pi, photography, tech, DIY, tools", extractor.getDescription());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we worried about whether the description changes at all? I figure they usually don't, but I wasn't sure how these tests need to be maintained when the description on this channel is changed. (Unless we're working with the owner of this channel and he's agreed not to change the description).

@gokulaknnan

This comment was marked as off-topic.

@SebiderSushi

This comment was marked as off-topic.

Theta-Dev and others added 2 commits November 2, 2022 19:01
YouTube is deploying a new layout on their channel pages, which uses richGridRenderer JSON objects.
@AudricV
Copy link
Member

AudricV commented Nov 2, 2022

As the change seems to be globally rolled out, I removed the visitorData changes and the addition of your channel test (see why here: #944 (comment)). I also updated all the channel mocks, which contains these richGridRenderers.

This doesn't mean that I didn't like your code, please don't take this personally (especially because this is the third time that I do this in your PRs): I find the visitorData changes useful, but as they are not needed to fix this issue, I think it is better to open a separate PR for them!

Copy link
Member

@Stypox Stypox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! I could not find anything to say about the code

@AudricV AudricV merged commit 31bf704 into TeamNewPipe:dev Nov 2, 2022
@plusterkopp

This comment was marked as off-topic.

@yauhen-l

This comment was marked as outdated.

@opusforlife2

This comment was marked as resolved.

@Theta-Dev
Copy link
Contributor Author

Theta-Dev commented Jan 19, 2023

@yauhen-l The error parsing the subscriber counts on the search page is unrelated to this PR and is already fixed by #978.

The missing livestreams issue will be fixed by #951. Since that requires new tabs to be added to the UI, implementing it might take some more time.

You can download a test build with channel tabs here: TeamNewPipe/NewPipe#9182

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ASAP bug youtube service, https://www.youtube.com/
Projects
None yet
10 participants