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 Shorts UI in playlists #1093

Merged
merged 5 commits into from
Aug 12, 2023

Conversation

AudricV
Copy link
Member

@AudricV AudricV commented Aug 7, 2023

  • I carefully read the contribution guidelines and agree to them.
  • I have tested the API against NewPipe.
    I only used my test class on which no errors occurred during my tests.

This PR fixes the extraction of items in YouTube playlists returning a Shorts UI.

A new test in YoutubePlaylistExtractorTest has been added to test the extraction of items with this playlist UI, which uses the system playlist of uploaded shorts by the official YouTube channel (UUSHBR8-60-B28hp2BmDPdntcQ).

As one of the effects of YouTube using a shorts UI, no uploader info is available for each stream. The default tests expected that the uploader name was set, so I had to remove this check (I also removed the uploader URL one, as it was commented out).

Finally this PR removes an outdated A/B test comment in YoutubePlaylistExtractor and fixes a bug in the assertNotEmpty test method of the extractor's assertions class (ExtractorAsserts) which tested that the test failure message, annotated as nullable, was not null instead of the string to check (it was the initial cause of the stream items' tests failures of my test class added with this PR, as no uploader name was provided and a NullPointerException was thrown).

Fixes #1077.

Also remove an outdated A/B test comment.
The system Shorts videos uploads playlist of the YouTube official channel has
been chosen for this test.
The non-null assertion was made on the exception message instead of the string
to check, causing a NullPointerException if the string to check was null.
This change is required as some services can return no uploader info, such as
YouTube for playlists with a Shorts UI.
@AudricV AudricV added bug youtube service, https://www.youtube.com/ labels Aug 7, 2023
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.

LGTM, thanks! Just one thing to check

@Stypox Stypox merged commit 7294675 into TeamNewPipe:dev Aug 12, 2023
4 checks passed
@AudricV AudricV deleted the yt_support-shorts-ui-playlists branch August 12, 2023 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug youtube service, https://www.youtube.com/
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[YouTube] Cannot get streams of playlists with only shorts
2 participants