Interface StreamInfoItemExtractor

    • Method Detail

      • isAd

        boolean isAd()
              throws ParsingException
        Check if the stream is an ad.
        Returns:
        true if the stream is an ad.
        Throws:
        ParsingException - if there is an error in the extraction
      • getDuration

        long getDuration()
                  throws ParsingException
        Get the stream duration in seconds
        Returns:
        the stream duration in seconds or -1 if no duration is available
        Throws:
        ParsingException - if there is an error in the extraction
      • getViewCount

        long getViewCount()
                   throws ParsingException
        Parses the number of views
        Returns:
        the number of views or -1 for live streams
        Throws:
        ParsingException - if there is an error in the extraction
      • getUploaderName

        java.lang.String getUploaderName()
                                  throws ParsingException
        Get the uploader name
        Returns:
        the uploader name
        Throws:
        ParsingException - if there is an error in the extraction
      • getUploaderAvatars

        @Nonnull
        default java.util.List<Image> getUploaderAvatars()
                                                  throws ParsingException
        Get the uploader avatars.
        Returns:
        the uploader avatars or an empty list if not provided by the service
        Throws:
        ParsingException - if there is an error in the extraction
      • isUploaderVerified

        boolean isUploaderVerified()
                            throws ParsingException
        Whether the uploader has been verified by the service's provider. If there is no verification implemented, return false.
        Returns:
        whether the uploader has been verified by the service's provider
        Throws:
        ParsingException - if there is an error in the extraction
      • getTextualUploadDate

        @Nullable
        java.lang.String getTextualUploadDate()
                                       throws ParsingException
        The original textual date provided by the service. Should be used as a fallback if getUploadDate() isn't provided by the service, or it fails for some reason.
        Returns:
        The original textual date provided by the service or null if not provided.
        Throws:
        ParsingException - if there is an error in the extraction
        See Also:
        getUploadDate()
      • getUploadDate

        @Nullable
        DateWrapper getUploadDate()
                           throws ParsingException
        Extracts the upload date and time of this item and parses it.

        If the service doesn't provide an exact time, an approximation can be returned.
        If the service doesn't provide any date at all, then null should be returned.

        Returns:
        The date and time (can be approximated) this item was uploaded or null.
        Throws:
        ParsingException - if there is an error in the extraction or the extracted date couldn't be parsed
        See Also:
        getTextualUploadDate()
      • getShortDescription

        @Nullable
        default java.lang.String getShortDescription()
                                              throws ParsingException
        Get the video's short description.
        Returns:
        The video's short description or null if not provided by the service.
        Throws:
        ParsingException - if there is an error in the extraction
      • isShortFormContent

        default boolean isShortFormContent()
                                    throws ParsingException
        Whether the stream is a short-form content.

        Short-form contents are contents in the style of TikTok, YouTube Shorts, or Instagram Reels videos.

        Returns:
        whether the stream is a short-form content
        Throws:
        ParsingException - if there is an error in the extraction