Skip to main content

Overview

The ChannelInfo class represents detailed information about a channel on a streaming service. It extends the Info base class and provides metadata about channels including avatars, banners, subscriber count, and channel tabs.

Static Methods

getInfo(String url)

getInfo
ChannelInfo
Extracts channel information from a URL.

getInfo(StreamingService service, String url)

getInfo
ChannelInfo
Extracts channel information from a URL using a specific service.

getInfo(ChannelExtractor extractor)

getInfo
ChannelInfo
Extracts channel information from a ChannelExtractor instance.

Fields

Inherited from Info

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

Channel Visuals

avatars
List<Image>
default:"[]"
List of avatar/profile images for the channel in various resolutions
banners
List<Image>
default:"[]"
List of banner images for the channel in various resolutions

Channel Information

description
String
The description/about text of the channel
subscriberCount
long
default:"-1"
The number of subscribers. Returns -1 if not available.
verified
boolean
default:"false"
Whether the channel is verified by the platform

Feed Information

feedUrl
String
The URL to the channel’s RSS/Atom feed (if available)

Parent Channel Information

parentChannelName
String
The name of the parent channel (for sub-channels)
parentChannelUrl
String
The URL to the parent channel
parentChannelAvatars
List<Image>
default:"[]"
List of parent channel avatar images
tabs
List<ListLinkHandler>
default:"[]"
List of available tabs on the channel (e.g., Videos, Playlists, About)
tags
List<String>
default:"[]"
List of tags associated with the channel
Array of donation/support links for the channel

Methods

Getters and Setters

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

Avatar Methods

getAvatars
List<Image>
Returns the list of avatar images
setAvatars
void
Sets the avatar images
getBanners
List<Image>
Returns the list of banner images
setBanners
void
Sets the banner images

Description Methods

getDescription
String
Returns the channel description
setDescription
void
Sets the channel description

Subscriber Methods

getSubscriberCount
long
Returns the subscriber count or -1 if not available
setSubscriberCount
void
Sets the subscriber count

Verification Methods

isVerified
boolean
Returns whether the channel is verified
setVerified
void
Sets the verification status

Feed Methods

getFeedUrl
String
Returns the feed URL
setFeedUrl
void
Sets the feed URL

Parent Channel Methods

getParentChannelName
String
Returns the parent channel name
setParentChannelName
void
Sets the parent channel name
getParentChannelUrl
String
Returns the parent channel URL
setParentChannelUrl
void
Sets the parent channel URL
getParentChannelAvatars
List<Image>
Returns the parent channel avatars
setParentChannelAvatars
void
Sets the parent channel avatars

Tab Methods

getTabs
List<ListLinkHandler>
Returns the list of channel tabs
setTabs
void
Sets the channel tabs

Tag Methods

getTags
List<String>
Returns the list of channel tags
setTags
void
Sets the channel tags

Donation Methods

Returns the array of donation links
Sets the donation links

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 channel 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.channel.ChannelInfo;
import org.schabi.newpipe.extractor.Image;

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

// Extract channel information
ChannelInfo channelInfo = ChannelInfo.getInfo("https://www.youtube.com/c/example");

// Access channel properties
String channelName = channelInfo.getName();
long subscriberCount = channelInfo.getSubscriberCount();
boolean isVerified = channelInfo.isVerified();
String description = channelInfo.getDescription();

// Get channel visuals
List<Image> avatars = channelInfo.getAvatars();
List<Image> banners = channelInfo.getBanners();

// Access channel tabs
List<ListLinkHandler> tabs = channelInfo.getTabs();
for (ListLinkHandler tab : tabs) {
    System.out.println("Tab: " + tab.getUrl());
}

// Get parent channel info (for sub-channels)
String parentName = channelInfo.getParentChannelName();
if (parentName != null) {
    System.out.println("Parent channel: " + parentName);
}

Build docs developers (and LLMs) love