Skip to main content

Overview

The PlaylistInfo class represents detailed information about a playlist on a streaming service. It extends the ListInfo<StreamInfoItem> base class and provides metadata about playlists including thumbnails, uploader information, stream count, and playlist type.

PlaylistType Enum

The PlaylistType enum defines different types of playlists:
NORMAL
PlaylistType
A normal playlist created by a user (not a mix)
MIX_STREAM
PlaylistType
A mix made only of streams related to a particular stream (e.g., YouTube mixes)
MIX_MUSIC
PlaylistType
A mix made only of music streams related to a particular stream (e.g., YouTube music mixes)
MIX_CHANNEL
PlaylistType
A mix made only of streams from or related to the same channel (deprecated, no longer used by services)
MIX_GENRE
PlaylistType
A mix made only of streams related to a particular musical genre (e.g., YouTube genre mixes)

Static Methods

getInfo(String url)

getInfo
PlaylistInfo
Extracts playlist information from a URL.

getInfo(StreamingService service, String url)

getInfo
PlaylistInfo
Extracts playlist information from a URL using a specific service.

getInfo(PlaylistExtractor extractor)

getInfo
PlaylistInfo
Extracts playlist information from a PlaylistExtractor instance.

getMoreItems(StreamingService service, String url, Page page)

getMoreItems
InfoItemsPage<StreamInfoItem>
Retrieves additional playlist items (for pagination).

Fields

Inherited from Info

serviceId
int
The ID of the streaming service
id
String
The unique identifier for this playlist
url
String
The cleaned URL of the playlist
originalUrl
String
The original URL used to start extraction
name
String
The name/title of the playlist

Inherited from ListInfo

List of streams/videos in the playlist
nextPage
Page
The next page object for pagination (null if no more pages)
contentFilters
List<String>
Content filters applied to the playlist
sortFilter
String
Sort filter applied to the playlist

Playlist Information

streamCount
long
The total number of streams in the playlist
playlistType
PlaylistType
The type of playlist (NORMAL, MIX_STREAM, MIX_MUSIC, etc.)
description
Description
The description of the playlist

Playlist Visuals

thumbnails
List<Image>
default:"[]"
List of thumbnail images for the playlist
banners
List<Image>
default:"[]"
List of banner images for the playlist

Uploader Information

uploaderName
String
The name of the playlist creator/uploader (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

Sub-Channel Information

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

Methods

Getters and Setters

All fields have corresponding getter and setter methods following JavaBean conventions:

Stream Count Methods

getStreamCount
long
Returns the total number of streams in the playlist
setStreamCount
void
Sets the stream count

Playlist Type Methods

getPlaylistType
PlaylistType
Returns the playlist type
setPlaylistType
void
Sets the playlist type

Description Methods

getDescription
Description
Returns the playlist description
setDescription
void
Sets the playlist description

Thumbnail Methods

getThumbnails
List<Image>
Returns the list of thumbnail images
setThumbnails
void
Sets the thumbnail images
getBanners
List<Image>
Returns the list of banner images
setBanners
void
Sets the banner images

Uploader Methods

getUploaderName
String
Returns the uploader name
setUploaderName
void
Sets the uploader name
getUploaderUrl
String
Returns the uploader URL
setUploaderUrl
void
Sets the uploader URL
getUploaderAvatars
List<Image>
Returns the uploader avatars
setUploaderAvatars
void
Sets the uploader avatars

Sub-Channel Methods

getSubChannelName
String
Returns the sub-channel name
setSubChannelName
void
Sets the sub-channel name
getSubChannelUrl
String
Returns the sub-channel URL
setSubChannelUrl
void
Sets the sub-channel URL
getSubChannelAvatars
List<Image>
Returns the sub-channel avatars
setSubChannelAvatars
void
Sets the sub-channel avatars

Inherited Methods from ListInfo

Returns the list of streams in the playlist
Sets the list of streams
hasNextPage
boolean
Returns true if there is a next page of items
getNextPage
Page
Returns the next page object for pagination
setNextPage
void
Sets the next page
getContentFilters
List<String>
Returns the content filters
getSortFilter
String
Returns the sort filter

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 playlist name
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.playlist.PlaylistInfo;
import org.schabi.newpipe.extractor.stream.StreamInfoItem;
import org.schabi.newpipe.extractor.Page;

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

// Extract playlist information
PlaylistInfo playlistInfo = PlaylistInfo.getInfo("https://www.youtube.com/playlist?list=PLexample");

// Access playlist properties
String playlistName = playlistInfo.getName();
long streamCount = playlistInfo.getStreamCount();
String uploaderName = playlistInfo.getUploaderName();

// Check playlist type
PlaylistInfo.PlaylistType type = playlistInfo.getPlaylistType();
if (type == PlaylistInfo.PlaylistType.MIX_MUSIC) {
    System.out.println("This is a music mix");
}

// Get playlist items
List<StreamInfoItem> items = playlistInfo.getRelatedItems();
for (StreamInfoItem item : items) {
    System.out.println(item.getName() + " - " + item.getUrl());
}

// Handle pagination
if (playlistInfo.hasNextPage()) {
    Page nextPage = playlistInfo.getNextPage();
    InfoItemsPage<StreamInfoItem> moreItems = PlaylistInfo.getMoreItems(
        playlistInfo.getService(),
        playlistInfo.getUrl(),
        nextPage
    );
    List<StreamInfoItem> additionalItems = moreItems.getItems();
}

// Get playlist visuals
List<Image> thumbnails = playlistInfo.getThumbnails();
List<Image> banners = playlistInfo.getBanners();

Build docs developers (and LLMs) love