Class YoutubeCommentsInfoItemExtractor
- java.lang.Object
-
- org.schabi.newpipe.extractor.services.youtube.extractors.YoutubeCommentsInfoItemExtractor
-
- All Implemented Interfaces:
CommentsInfoItemExtractor
,InfoItemExtractor
public class YoutubeCommentsInfoItemExtractor extends java.lang.Object implements CommentsInfoItemExtractor
-
-
Constructor Summary
Constructors Constructor Description YoutubeCommentsInfoItemExtractor(com.grack.nanojson.JsonObject commentRenderer, com.grack.nanojson.JsonObject commentRepliesRenderer, java.lang.String url, TimeAgoParser timeAgoParser)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getCommentId()
Description
getCommentText()
The text of the commentint
getLikeCount()
Return the like count of the comment, orCommentsInfoItem.NO_LIKE_COUNT
if it is unavailable.java.lang.String
getName()
Page
getReplies()
The continuation page which is used to get comment replies from.int
getReplyCount()
The count of comment replies.java.lang.String
getTextualLikeCount()
The unmodified like count given by the service
It may be language dependentjava.lang.String
getTextualUploadDate()
The upload date given by the service, unmodifiedjava.util.List<Image>
getThumbnails()
DateWrapper
getUploadDate()
The upload date wrapped with DateWrapper classjava.util.List<Image>
getUploaderAvatars()
java.lang.String
getUploaderName()
java.lang.String
getUploaderUrl()
java.lang.String
getUrl()
boolean
hasCreatorReply()
Whether the comment was replied to by the creator.boolean
isChannelOwner()
Whether the comment was made by the channel owner.boolean
isHeartedByUploader()
Whether the comment has been hearted by the uploaderboolean
isPinned()
Whether the comment is pinnedboolean
isUploaderVerified()
Whether the uploader is verified by the service-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.schabi.newpipe.extractor.comments.CommentsInfoItemExtractor
getStreamPosition
-
-
-
-
Constructor Detail
-
YoutubeCommentsInfoItemExtractor
public YoutubeCommentsInfoItemExtractor(@Nonnull com.grack.nanojson.JsonObject commentRenderer, @Nullable com.grack.nanojson.JsonObject commentRepliesRenderer, @Nonnull java.lang.String url, @Nonnull TimeAgoParser timeAgoParser)
-
-
Method Detail
-
getUrl
@Nonnull public java.lang.String getUrl() throws ParsingException
- Specified by:
getUrl
in interfaceInfoItemExtractor
- Throws:
ParsingException
-
getThumbnails
@Nonnull public java.util.List<Image> getThumbnails() throws ParsingException
- Specified by:
getThumbnails
in interfaceInfoItemExtractor
- Throws:
ParsingException
-
getName
public java.lang.String getName() throws ParsingException
- Specified by:
getName
in interfaceInfoItemExtractor
- Throws:
ParsingException
-
getTextualUploadDate
public java.lang.String getTextualUploadDate() throws ParsingException
Description copied from interface:CommentsInfoItemExtractor
The upload date given by the service, unmodified- Specified by:
getTextualUploadDate
in interfaceCommentsInfoItemExtractor
- Throws:
ParsingException
- See Also:
StreamExtractor.getTextualUploadDate()
-
getUploadDate
@Nullable public DateWrapper getUploadDate() throws ParsingException
Description copied from interface:CommentsInfoItemExtractor
The upload date wrapped with DateWrapper class- Specified by:
getUploadDate
in interfaceCommentsInfoItemExtractor
- Throws:
ParsingException
- See Also:
StreamExtractor.getUploadDate()
-
getLikeCount
public int getLikeCount() throws ParsingException
Description copied from interface:CommentsInfoItemExtractor
Return the like count of the comment, orCommentsInfoItem.NO_LIKE_COUNT
if it is unavailable.
NOTE: Currently only implemented for YT
getLikeCount()
with limitations (only approximate like count is returned)- Specified by:
getLikeCount
in interfaceCommentsInfoItemExtractor
- Returns:
- the comment's like count
or
CommentsInfoItem.NO_LIKE_COUNT
if it is unavailable - Throws:
ParsingException
- See Also:
StreamExtractor.getLikeCount()
- Implementation Note:
- The method tries first to get the exact like count by using the accessibility data
returned. But if the parsing of this accessibility data fails, the method parses internally
a localized string.
- More than 1k likes will result in an inaccurate number
- This will fail for other languages than English. However as long as the Extractor
only uses "en-GB" (as seen in
YoutubeService.getSupportedLocalizations()
) , everything will work fine.
Consider usinggetTextualLikeCount()
-
getTextualLikeCount
public java.lang.String getTextualLikeCount() throws ParsingException
Description copied from interface:CommentsInfoItemExtractor
The unmodified like count given by the service
It may be language dependent- Specified by:
getTextualLikeCount
in interfaceCommentsInfoItemExtractor
- Throws:
ParsingException
-
getCommentText
@Nonnull public Description getCommentText() throws ParsingException
Description copied from interface:CommentsInfoItemExtractor
The text of the comment- Specified by:
getCommentText
in interfaceCommentsInfoItemExtractor
- Throws:
ParsingException
-
getCommentId
public java.lang.String getCommentId() throws ParsingException
- Specified by:
getCommentId
in interfaceCommentsInfoItemExtractor
- Throws:
ParsingException
-
getUploaderAvatars
@Nonnull public java.util.List<Image> getUploaderAvatars() throws ParsingException
- Specified by:
getUploaderAvatars
in interfaceCommentsInfoItemExtractor
- Throws:
ParsingException
-
isHeartedByUploader
public boolean isHeartedByUploader()
Description copied from interface:CommentsInfoItemExtractor
Whether the comment has been hearted by the uploader- Specified by:
isHeartedByUploader
in interfaceCommentsInfoItemExtractor
-
isPinned
public boolean isPinned()
Description copied from interface:CommentsInfoItemExtractor
Whether the comment is pinned- Specified by:
isPinned
in interfaceCommentsInfoItemExtractor
-
isUploaderVerified
public boolean isUploaderVerified() throws ParsingException
Description copied from interface:CommentsInfoItemExtractor
Whether the uploader is verified by the service- Specified by:
isUploaderVerified
in interfaceCommentsInfoItemExtractor
- Throws:
ParsingException
-
getUploaderName
public java.lang.String getUploaderName() throws ParsingException
- Specified by:
getUploaderName
in interfaceCommentsInfoItemExtractor
- Throws:
ParsingException
-
getUploaderUrl
public java.lang.String getUploaderUrl() throws ParsingException
- Specified by:
getUploaderUrl
in interfaceCommentsInfoItemExtractor
- Throws:
ParsingException
-
getReplyCount
public int getReplyCount()
Description copied from interface:CommentsInfoItemExtractor
The count of comment replies.- Specified by:
getReplyCount
in interfaceCommentsInfoItemExtractor
- Returns:
- the count of the replies
or
CommentsInfoItem.UNKNOWN_REPLY_COUNT
if replies are not supported
-
getReplies
public Page getReplies()
Description copied from interface:CommentsInfoItemExtractor
The continuation page which is used to get comment replies from.- Specified by:
getReplies
in interfaceCommentsInfoItemExtractor
- Returns:
- the continuation Page for the replies, or null if replies are not supported
-
isChannelOwner
public boolean isChannelOwner()
Description copied from interface:CommentsInfoItemExtractor
Whether the comment was made by the channel owner.- Specified by:
isChannelOwner
in interfaceCommentsInfoItemExtractor
-
hasCreatorReply
public boolean hasCreatorReply()
Description copied from interface:CommentsInfoItemExtractor
Whether the comment was replied to by the creator.- Specified by:
hasCreatorReply
in interfaceCommentsInfoItemExtractor
-
-