Skip to main content

Overview

The ChannelExtractor class extracts information about channels or content creators from streaming services. It extends the base Extractor class and provides methods to retrieve channel metadata, avatars, banners, and available tabs. Package: org.schabi.newpipe.extractor.channel Extends: Extractor

Constructor

service
StreamingService
required
The streaming service this extractor belongs to
The list link handler containing URL information for this channel

Constants

UNKNOWN_SUBSCRIBER_COUNT
long
default:"-1"
Constant returned when subscriber count is unavailable

Base Methods (Inherited from Extractor)

getId()

public String getId() throws ParsingException
Returns the unique identifier for this channel.
return
String
The channel’s unique ID

getName()

public abstract String getName() throws ParsingException
Returns the name of the channel.
return
String
The channel’s name

getUrl()

public String getUrl() throws ParsingException
Returns the cleaned URL for this channel.
return
String
The channel’s URL

getOriginalUrl()

public String getOriginalUrl() throws ParsingException
Returns the original URL as provided by the user.
return
String
The original URL

getBaseUrl()

public String getBaseUrl() throws ParsingException
Returns the base URL of the service.
return
String
The base URL

fetchPage()

public void fetchPage() throws IOException, ExtractionException
Fetches the channel page content. Must be called before accessing other data methods.

getService()

public StreamingService getService()
Returns the streaming service this extractor belongs to.
return
StreamingService
The associated streaming service

getServiceId()

public int getServiceId()
Returns the numeric ID of the streaming service.
return
int
The service ID

Channel Information Methods

getAvatars()

public abstract List<Image> getAvatars() throws ParsingException
Returns the channel’s profile pictures/avatars.
return
List<Image>
List of avatar images in various resolutions

getBanners()

public abstract List<Image> getBanners() throws ParsingException
Returns the channel’s banner images.
return
List<Image>
List of banner images in various resolutions

getDescription()

public abstract String getDescription() throws ParsingException
Returns the channel description.
return
String
The channel’s description text

getSubscriberCount()

public abstract long getSubscriberCount() throws ParsingException
Returns the number of subscribers.
return
long
Subscriber count, or UNKNOWN_SUBSCRIBER_COUNT (-1) if unavailable

isVerified()

public abstract boolean isVerified() throws ParsingException
Returns whether the channel is verified by the service provider.
return
boolean
true if the channel is verified, false otherwise

getFeedUrl()

public abstract String getFeedUrl() throws ParsingException
Returns the RSS/Atom feed URL for the channel.
return
String
The feed URL, or empty string if unavailable

getTags()

public List<String> getTags() throws ParsingException
Returns the channel’s tags.
return
List<String>
List of tag strings, or empty list if unavailable

Parent Channel Methods

getParentChannelName()

public abstract String getParentChannelName() throws ParsingException
Returns the name of the parent channel (if this is a sub-channel).
return
String
Parent channel name, or empty string if not applicable

getParentChannelUrl()

public abstract String getParentChannelUrl() throws ParsingException
Returns the URL of the parent channel.
return
String
Parent channel URL, or empty string if not applicable

getParentChannelAvatars()

public abstract List<Image> getParentChannelAvatars() throws ParsingException
Returns the parent channel’s avatar images.
return
List<Image>
List of parent channel avatars, or empty list if not applicable

Tab Navigation Methods

getTabs()

public abstract List<ListLinkHandler> getTabs() throws ParsingException
Returns the available tabs for the channel (e.g., Videos, Playlists, Community).
return
List<ListLinkHandler>
List of tab link handlers representing available channel sections

Localization Methods

forceLocalization()

public void forceLocalization(Localization localization)
Forces a specific localization for this extractor.
localization
Localization
required
The localization to use

forceContentCountry()

public void forceContentCountry(ContentCountry contentCountry)
Forces a specific content country for this extractor.
contentCountry
ContentCountry
required
The content country to use

Usage Example

StreamingService service = NewPipe.getService("YouTube");
ChannelExtractor extractor = service.getChannelExtractor("https://youtube.com/c/ChannelName");

// Fetch the page first
extractor.fetchPage();

// Get channel information
String name = extractor.getName();
String description = extractor.getDescription();
long subscribers = extractor.getSubscriberCount();
boolean verified = extractor.isVerified();

// Get images
List<Image> avatars = extractor.getAvatars();
List<Image> banners = extractor.getBanners();

// Get available tabs
List<ListLinkHandler> tabs = extractor.getTabs();
for (ListLinkHandler tab : tabs) {
    System.out.println("Tab: " + tab.getContentFilters());
}

Notes

  • Always call fetchPage() before accessing any channel data
  • The getTabs() method returns link handlers that can be used with ChannelTabExtractor to retrieve tab contents
  • Some services may not support all features (e.g., parent channels, tags, feed URLs)
  • Image lists typically contain multiple resolutions of the same image

Build docs developers (and LLMs) love