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
The streaming service this extractor belongs to
The list link handler containing URL information for this channel
Constants
Constant returned when subscriber count is unavailable
getId()
public String getId() throws ParsingException
Returns the unique identifier for this channel.
getName()
public abstract String getName() throws ParsingException
Returns the name of the channel.
getUrl()
public String getUrl() throws ParsingException
Returns the cleaned URL for this channel.
getOriginalUrl()
public String getOriginalUrl() throws ParsingException
Returns the original URL as provided by the user.
getBaseUrl()
public String getBaseUrl() throws ParsingException
Returns the base URL of the service.
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.
The associated streaming service
getServiceId()
public int getServiceId()
Returns the numeric ID of the streaming service.
getAvatars()
public abstract List<Image> getAvatars() throws ParsingException
Returns the channel’s profile pictures/avatars.
List of avatar images in various resolutions
getBanners()
public abstract List<Image> getBanners() throws ParsingException
Returns the channel’s banner images.
List of banner images in various resolutions
getDescription()
public abstract String getDescription() throws ParsingException
Returns the channel description.
The channel’s description text
getSubscriberCount()
public abstract long getSubscriberCount() throws ParsingException
Returns the number of subscribers.
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.
true if the channel is verified, false otherwise
getFeedUrl()
public abstract String getFeedUrl() throws ParsingException
Returns the RSS/Atom feed URL for the channel.
The feed URL, or empty string if unavailable
public List<String> getTags() throws ParsingException
Returns the channel’s tags.
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).
Parent channel name, or empty string if not applicable
getParentChannelUrl()
public abstract String getParentChannelUrl() throws ParsingException
Returns the URL of the parent channel.
Parent channel URL, or empty string if not applicable
getParentChannelAvatars()
public abstract List<Image> getParentChannelAvatars() throws ParsingException
Returns the parent channel’s avatar images.
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).
List of tab link handlers representing available channel sections
Localization Methods
forceLocalization()
public void forceLocalization(Localization localization)
Forces a specific localization for this extractor.
forceContentCountry()
public void forceContentCountry(ContentCountry contentCountry)
Forces a specific content country for this extractor.
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