Skip to content

Feature/live chat comments#1481

Open
Ecomont wants to merge 29 commits into
TeamNewPipe:devfrom
Ecomont:feature/live-chat-comments
Open

Feature/live chat comments#1481
Ecomont wants to merge 29 commits into
TeamNewPipe:devfrom
Ecomont:feature/live-chat-comments

Conversation

@Ecomont

@Ecomont Ecomont commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

This PR adds support for extracting YouTube live chat messages and exposing them through the existing comments API. When a live stream has regular comments disabled, the extractor now falls back to fetching live chat messages instead.

Changes

  • CommentsExtractor / CommentsInfo: Added isLiveChat() flag to distinguish live chat from regular comments.
  • YoutubeCommentsExtractor: Added findLiveChatContinuation() and fetchLiveChat() to retrieve live chat via the live_chat/get_live_chat endpoint.
  • YoutubeLiveChatInfoItemExtractor: New extractor that maps liveChatTextMessageRenderer JSON to CommentsInfoItem, with proper emoji run handling.
  • Page routing: Live chat continuations are marked with a live_chat page identifier so getPage() routes correctly on subsequent extractor instances.

Implementation notes

The approach is based on the live chat implementation in PipePipe, adapted to fit the NewPipe Extractor architecture. Key adaptations include:

  • Reusing the existing CommentsInfoItem type instead of introducing a separate live chat item class.
  • Proper isLiveStream flag handling to avoid hitting the replay endpoint on fresh extractors.
  • Emoji extraction with fallback chain: emojiIdshortcuts[]searchTerms[][emoji].

Checklist

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

@TobiGr TobiGr added enhancement New feature or request YouTube Service, https://www.youtube.com/ labels Apr 24, 2026

@absurdlylongusername absurdlylongusername left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Will do proper review later, but for now:

Please add tests. We should not be adding any new functionality to the extractor without adequate testing.

@Ecomont Ecomont marked this pull request as draft April 27, 2026 04:56

@TobiGr TobiGr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

thank you

@sonarqubecloud

sonarqubecloud Bot commented May 5, 2026

Copy link
Copy Markdown

@Ecomont Ecomont requested a review from TobiGr May 5, 2026 06:15
@TobiGr

TobiGr commented May 25, 2026

Copy link
Copy Markdown
Contributor

LGTM now. Is there a specific reason why this is still a draft?

@Ecomont Ecomont marked this pull request as ready for review May 26, 2026 02:31
@Ecomont

Ecomont commented May 26, 2026

Copy link
Copy Markdown
Contributor Author

LGTM now. Is there a specific reason why this is still a draft?

I forgot to reopen it

pythonivelt and others added 2 commits May 27, 2026 12:21
YouTube is enforcing the SABR protocol on standard clients (WEB, ANDROID),
which removes traditional stream URLs from adaptive formats. This leaves
only the progressive 360p stream (itag 18) playable.

This adds the ANDROID_VR client (Oculus Quest 3, client ID 28) as a
fallback when the regular Android client returns SABR-only streaming
data (adaptive formats without url/signatureCipher fields). The VR
client still receives traditional stream URLs from YouTube.

Changes:
- Add ANDROID_VR client constants and InnertubeClientRequestInfo factory
- Add getAndroidVRPlayerResponse in YoutubeStreamHelper
- Detect SABR-only responses via isSabrOnlyStreamingData helper
- Fall back to VR client in onFetchPage when SABR detected
- Include VR streaming data in getItags, DASH/HLS manifest, and duration

Fixes TeamNewPipe/NewPipe#13320
@TobiGr

TobiGr commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Please resolve the conflict. The PR will be merged once there are no conflicts.

@AudricV AudricV left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't really like the class design for this feature. Live chats should get their own extractor and maybe their own info items (maybe not in this PR as it requires some thinking).

Comment on lines +73 to +74
protected String liveChatContinuation = null;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This class has no field, so you shouldn't introduce a new one here.

@sonarqubecloud

Copy link
Copy Markdown

@Ecomont Ecomont requested a review from AudricV June 20, 2026 05:04
@AudricV

AudricV commented Jun 20, 2026

Copy link
Copy Markdown
Member

Your branch is in a bad state with unrelated changes, please rebase it on the dev one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request YouTube Service, https://www.youtube.com/

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants