Skip to content

[YouTube] Support lack of video info renderers for streams#968

Merged
FireMasterK merged 3 commits intoTeamNewPipe:devfrom
AudricV:yt-support-no-video-info-renderers-for-streams
Nov 16, 2022
Merged

[YouTube] Support lack of video info renderers for streams#968
FireMasterK merged 3 commits intoTeamNewPipe:devfrom
AudricV:yt-support-no-video-info-renderers-for-streams

Conversation

@AudricV
Copy link
Copy Markdown
Member

@AudricV AudricV commented Nov 4, 2022

This PR makes that for YouTube videos, if videoPrimaryInfoRenderer and videoSecondaryInfoRenderer are missing, the extraction of videos doesn't fail.

This allows extraction of videos which have, for an unknown reason, no visual metadata on YouTube clients and makes the extraction of YouTube less "breaking-change" dependent.

For the videos which I talked about above, errors will be raised for uploader subscriber count, like count, and uploader avatar URL (so in NewPipe, toasts with the Sorry, something went wrong message will be shown), as these informations are not available with the InnerTube API without the missing visual metadata.

I added a test with a video which has this specificity, "Makani’s first commercial-scale energy kite" (video ID: An8vtD1FDqs).

Fixes TeamNewPipe/NewPipe#5326.

…oSecondaryInfoRenderer not fatal

Also de-duplicated common code related to the obtain of these video info renderers.

This change allows extraction of videos without visual metadata.
The video "Makani’s first commercial-scale energy kite" (video ID:
An8vtD1FDqs), which has this behavior, is used for the new test,
NoVisualMetadataVideoTest, added in YoutubeStreamExtractorDefaultTest.

Tests of elements who throw an exception in this case (subscriber count, like
count, uploader avatar URL) test if the ParsingException exception is thrown by
YoutubeStreamExtractor.
@AudricV AudricV added bug Issue or PR is related to a bug YouTube Service, https://www.youtube.com/ labels Nov 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Issue or PR is related to a bug YouTube Service, https://www.youtube.com/

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[YouTube] Unable to extract videos without metadata on official clients (channel, description, ...)

2 participants