Skip to content

[YouTube] Fix fetching item duration from the new A/B test#1464

Open
G-flat wants to merge 1 commit intoTeamNewPipe:devfrom
G-flat:fix_fetching_yt_stream_info_item_lockup_duration
Open

[YouTube] Fix fetching item duration from the new A/B test#1464
G-flat wants to merge 1 commit intoTeamNewPipe:devfrom
G-flat:fix_fetching_yt_stream_info_item_lockup_duration

Conversation

@G-flat
Copy link
Contributor

@G-flat G-flat commented Mar 1, 2026

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

There's currently an A/B test where the names of the objects storing item durations can change, which causes YoutubeStreamInfoItemLockupExtractor.getDuration() to occasionally fail to fetch item durations. The thumbnailOverlayBadgeViewModel object can appear as thumbnailBottomOverlayViewModel, and when that happens, the thumbnailBadges array is renamed to badges.

This pull request fixes TeamNewPipe/NewPipe#13281 by changing the method to support fetching item durations during the A/B test.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 1, 2026

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 LGTM, thank you!

If you have them at hand, could you provide youtube response snippets with the two JSON formats?

Also I guess after this gets deployed 100%, we'll have to update test mocks.

@ShareASmile ShareASmile added bug Issue is related to a bug youtube service, https://www.youtube.com/ labels Mar 1, 2026
@G-flat
Copy link
Contributor Author

G-flat commented Mar 2, 2026

I've uploaded YouTube response snippets for the two JSON formats, one for the original thumbnailOverlayBadgeViewModel object and another for the new thumbnailBottomOverlayViewModel object:

thumbnailOverlayBadgeViewModel_response.json
thumbnailBottomOverlayViewModel_response.json

FineFindus added a commit to FineFindus/LibreTube that referenced this pull request Mar 7, 2026
Includes TeamNewPipe/NewPipeExtractor#1464, which fixes
the extraction of the duration of related videos.

Closes: libre-tube#8217
FineFindus added a commit to libre-tube/LibreTube that referenced this pull request Mar 7, 2026
Includes TeamNewPipe/NewPipeExtractor#1464, which fixes
the extraction of the duration of related videos.

Closes: #8217
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 youtube service, https://www.youtube.com/

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[YouTube] Could not parse website (could not get item duration)

3 participants