Skip to main content

Overview

The StreamInfo class represents detailed information about a video or audio stream. It extends the Info base class and provides comprehensive metadata about streams, including video/audio formats, uploader information, statistics, and additional metadata.

Static Methods

getInfo(String url)

getInfo
StreamInfo
Extracts stream information from a URL.

getInfo(StreamingService service, String url)

getInfo
StreamInfo
Extracts stream information from a URL using a specific service.

getInfo(StreamExtractor extractor)

getInfo
StreamInfo
Extracts stream information from a StreamExtractor instance.

Fields

Inherited from Info

serviceId
int
The ID of the streaming service
id
String
The unique identifier for this stream (e.g., for YouTube: “RER5qCTzZ7”)
url
String
The cleaned URL of the stream
originalUrl
String
The original URL used to start extraction
name
String
The name/title of the stream

Stream Type and Basic Info

streamType
StreamType
The type of stream. Possible values:
  • VIDEO_STREAM - Normal video with audio
  • AUDIO_STREAM - Audio-only stream
  • LIVE_STREAM - Live video stream
  • AUDIO_LIVE_STREAM - Live audio stream
  • POST_LIVE_STREAM - Recently ended live video
  • POST_LIVE_AUDIO_STREAM - Recently ended live audio
ageLimit
int
The age restriction for this stream
duration
long
default:"-1"
The duration of the stream in seconds. Returns -1 if not available.

Media Information

thumbnails
List<Image>
default:"[]"
List of thumbnail images for the stream
description
Description
The description of the stream

Stream URLs and Formats

videoStreams
List<VideoStream>
default:"[]"
List of available video streams (usually with audio)
audioStreams
List<AudioStream>
default:"[]"
List of available audio-only streams
videoOnlyStreams
List<VideoStream>
default:"[]"
List of available video-only streams (no audio)
dashMpdUrl
String
The URL to the DASH manifest for adaptive streaming (empty string by default)
hlsUrl
String
The URL to the HLS manifest for adaptive streaming (empty string by default)
subtitles
List<SubtitlesStream>
default:"[]"
List of available subtitle tracks

Uploader Information

uploaderName
String
The name of the uploader/channel (empty string by default)
uploaderUrl
String
The URL to the uploader’s channel (empty string by default)
uploaderAvatars
List<Image>
default:"[]"
List of uploader avatar images
uploaderVerified
boolean
default:"false"
Whether the uploader is verified
uploaderSubscriberCount
long
default:"-1"
The number of subscribers the uploader has. Returns -1 if not available.

Sub-Channel Information

subChannelName
String
The name of the sub-channel (empty string by default, if applicable)
subChannelUrl
String
The URL to the sub-channel (empty string by default)
subChannelAvatars
List<Image>
default:"[]"
List of sub-channel avatar images

Statistics

viewCount
long
default:"-1"
The number of views. Returns -1 if not available.
likeCount
long
default:"-1"
The number of likes. Returns -1 if not available.
dislikeCount
long
default:"-1"
The number of dislikes. Returns -1 if not available.

Upload Date

textualUploadDate
String
The upload date as a text string (e.g., “2 days ago”)
uploadDate
DateWrapper
The parsed upload date

Additional Metadata

host
String
The host/platform of the stream (empty string by default)
privacy
StreamExtractor.Privacy
The privacy setting of the stream
category
String
The category of the stream (empty string by default)
licence
String
The license information for the stream (empty string by default)
language
Locale
The language of the stream content
tags
List<String>
default:"[]"
List of tags associated with the stream
supportInfo
String
Information about how to support the creator (empty string by default)

Playback Features

startPosition
long
default:"0"
The starting position/timestamp in seconds
streamSegments
List<StreamSegment>
default:"[]"
List of stream segments/chapters
previewFrames
List<Frameset>
default:"[]"
Preview frames for storyboard/seekbar thumbnail previews
List of related streams/videos
metaInfo
List<MetaInfo>
default:"[]"
Additional metadata information

Content Classification

shortFormContent
boolean
default:"false"
Whether this is short-form content (e.g., YouTube Shorts)
contentAvailability
ContentAvailability
default:"AVAILABLE"
The availability status of the content

Methods

Getters and Setters

All fields have corresponding getter and setter methods following JavaBean conventions:
  • getStreamType() / setStreamType(StreamType)
  • getThumbnails() / setThumbnails(List<Image>)
  • getDuration() / setDuration(long)
  • getAgeLimit() / setAgeLimit(int)
  • And so on for all fields listed above

Inherited Methods from Info

getServiceId
int
Returns the service ID
getService
StreamingService
Returns the StreamingService instance for this info object
getId
String
Returns the unique identifier
getUrl
String
Returns the cleaned URL
getOriginalUrl
String
Returns the original URL used for extraction
getName
String
Returns the name/title
getErrors
List<Throwable>
Returns a list of non-fatal errors that occurred during extraction
addError
void
Adds an error to the error list

Example Usage

import org.schabi.newpipe.extractor.NewPipe;
import org.schabi.newpipe.extractor.stream.StreamInfo;

// Initialize NewPipe
NewPipe.init(DownloaderFactory.getDownloader());

// Extract stream information
StreamInfo streamInfo = StreamInfo.getInfo("https://www.youtube.com/watch?v=dQw4w9WgXcQ");

// Access stream properties
String title = streamInfo.getName();
long duration = streamInfo.getDuration();
String uploaderName = streamInfo.getUploaderName();
long viewCount = streamInfo.getViewCount();

// Get available streams
List<VideoStream> videoStreams = streamInfo.getVideoStreams();
List<AudioStream> audioStreams = streamInfo.getAudioStreams();

// Check stream type
if (streamInfo.getStreamType() == StreamType.LIVE_STREAM) {
    System.out.println("This is a live stream");
}

Build docs developers (and LLMs) love