Skip to content

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

Merged
litetex merged 2 commits intoTeamNewPipe:devfrom
G-flat:fix_fetching_yt_stream_info_item_lockup_duration
Apr 7, 2026
Merged

[YouTube] Fix fetching item duration of related items from the new A/B test#1464
litetex merged 2 commits intoTeamNewPipe:devfrom
G-flat:fix_fetching_yt_stream_info_item_lockup_duration

Conversation

@G-flat
Copy link
Copy Markdown
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

This comment was marked as resolved.

Copy link
Copy Markdown
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 or PR is related to a bug YouTube Service, https://www.youtube.com/ labels Mar 1, 2026
@G-flat
Copy link
Copy Markdown
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
@litetex litetex self-assigned this Apr 7, 2026
@litetex litetex self-requested a review April 7, 2026 13:59
@litetex litetex force-pushed the fix_fetching_yt_stream_info_item_lockup_duration branch from d3d3c47 to f7185dc Compare April 7, 2026 14:06
@litetex
Copy link
Copy Markdown
Member

litetex commented Apr 7, 2026

So to get this finally fixed:

  1. I rebased the branch
  2. I removed the old extraction mechnism, because only the new one is in use as of now
  3. I updated the mocks

Should be good to merge now.
If I don't hear any negative feedback until in a few hours I will do it myself.

@litetex litetex force-pushed the fix_fetching_yt_stream_info_item_lockup_duration branch from f7185dc to c0cb0c6 Compare April 7, 2026 14:21
@sonarqubecloud

This comment was marked as resolved.

Copy link
Copy Markdown
Member

@litetex litetex left a comment

Choose a reason for hiding this comment

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

CI tests are successful. Ready to merge

@litetex litetex merged commit 5106444 into TeamNewPipe:dev Apr 7, 2026
3 checks passed
litetex added a commit to litetex/NewPipe that referenced this pull request Apr 8, 2026
@AudricV AudricV changed the title [YouTube] Fix fetching item duration from the new A/B test [YouTube] Fix fetching item duration of related items from the new A/B test Apr 10, 2026
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] Could not parse website (could not get item duration)

4 participants