Documentation Index
Fetch the complete documentation index at: https://mintlify.com/TeamNewPipe/NewPipeExtractor/llms.txt
Use this file to discover all available pages before exploring further.
Overview
TheCommentsExtractor class extracts comments from videos and streams on streaming services. It extends ListExtractor<CommentsInfoItem> and provides methods to retrieve paginated comments and metadata about comment availability.
Package: org.schabi.newpipe.extractor.comments
Extends: ListExtractor<CommentsInfoItem>
Constructor
The streaming service this extractor belongs to
The list link handler containing URL information for the commented content
Base Methods (Inherited from Extractor)
getId()
The content’s unique ID
getName()
Always returns “Comments”
getUrl()
The content URL
getOriginalUrl()
The original URL
getBaseUrl()
The base URL
fetchPage()
getService()
The associated streaming service
getServiceId()
The service ID
List Extraction Methods (Inherited from ListExtractor)
getInitialPage()
Page object containing initial comments and next page reference
getPage()
The page reference obtained from a previous page’s
getNextPage() methodPage object containing comments and next page reference
Comments-Specific Methods
isCommentsDisabled()
true if comments are disabled, false otherwise (default)getCommentsCount()
Total comment count, or -1 if unavailable
Localization Methods
forceLocalization()
The localization to use
forceContentCountry()
The content country to use
Usage Example
Loading Comment Replies
CommentsInfoItem Properties
EachCommentsInfoItem in the results contains:
Unique identifier for the comment
The comment text content
Name of the comment author
URL to the comment author’s channel
Author’s profile pictures
Number of likes on the comment
Original date string as provided by the service
Parsed upload date
Page reference to load comment replies, or null if no replies
Number of replies to this comment
Whether the comment is pinned
Whether the comment author is verified
Whether the comment was hearted by the content creator
InfoItemsPage Object
TheInfoItemsPage returned by getInitialPage() and getPage() contains:
The list of comments on this page
Reference to the next page, or null if this is the last page
Any errors that occurred during extraction of this page
Notes
- Always call
fetchPage()before accessing comments - Use
isCommentsDisabled()to check if comments are available before trying to extract them - The
getCommentsCount()method may return -1 if the service doesn’t provide the total count - Comments can be nested (replies to comments), accessed via the
getReplies()method on individual comments - The
isCommentsDisabled()method is marked as experimental and may change in future versions - Some services may not support all comment features (likes, replies, pinning, etc.)