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 shows and page header on user channels #1203

Merged

Conversation

AudricV
Copy link
Member

@AudricV AudricV commented Jul 24, 2024

  • 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.

This PR is a continuation of my original work in #1169 and #1170.

It fixes the extraction of channel metadata on user channels in which a pageHeaderRenderer is returned, which is now the main channel header used of user channels, and adds support for shows' items (returned in searches and channels).

Several related improvements and fixes in the YouTube service have been also done on the fly (see the commits for more details).

Fixes TeamNewPipe/NewPipe#5793, fixes TeamNewPipe/NewPipe#10826.

The runs object was computed twice in getTextFromObject and getUrlFromObject
methods, leading to unneeded search costs. This has been avoided by storing the
array in method variables.
…lHelper

Also throw an exception when we cannot get the verified status of a channel in
YoutubeChannelExtractor due to a missing channelHeader, if the channel has no
channelAgeGateRenderer.
As there are multiple show UI elements which share a lot of common data, a base
implementation, an abstract class named YoutubeBaseShowInfoItemExtractor, has
been created to handle common cases.
Also fix naming of info items' collection methods.
…hannels

Also move duplicate strings into constants and support pageHeader channel
header in user channels on YoutubeChannelHelper methods.
@AudricV AudricV added bug Issue is related to a bug enhancement youtube service, https://www.youtube.com/ tests Issues and PR related to unit tests labels Jul 24, 2024
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.

Code looks good to me, I reviewed all commits one by one. Thank you!
Here's a testing APK: app-debug.zip
Unfortunately channel avatars and banners still don't work, is that expected? The subscriber count now works though

Also move duplicate strings into constants and add a missing default switch
case.
The channel description has been changed and some expected words have been
removed.
For some reason, mocks of the continuation were not parsed. All mocks of the
test have been updated to fix the issue.
@AudricV AudricV force-pushed the yt_support-shows-and-pageheader-on-user-channels branch from f23277a to 8db7249 Compare July 25, 2024 15:54
@AudricV
Copy link
Member Author

AudricV commented Jul 25, 2024

Unfortunately channel avatars and banners still don't work, is that expected?

No, I forgot to add the part of paths for which I check their presence in the paths to get avatars and banners. This is fixed.

@AudricV AudricV requested a review from Stypox July 25, 2024 15:59
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.

Thanks, I can confirm it works now!
app-debug.zip

@Stypox Stypox merged commit 996eb04 into TeamNewPipe:dev Jul 25, 2024
3 of 4 checks passed
@AudricV AudricV deleted the yt_support-shows-and-pageheader-on-user-channels branch July 25, 2024 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is related to a bug enhancement tests Issues and PR related to unit tests youtube service, https://www.youtube.com/
Projects
None yet
2 participants