public abstract class StreamExtractor extends Extractor
Modifier and Type | Class and Description |
---|---|
static class |
StreamExtractor.Privacy |
Modifier and Type | Field and Description |
---|---|
static int |
NO_AGE_LIMIT |
static long |
UNKNOWN_SUBSCRIBER_COUNT |
Constructor and Description |
---|
StreamExtractor(StreamingService service,
LinkHandler linkHandler) |
Modifier and Type | Method and Description |
---|---|
int |
getAgeLimit()
Get the age limit.
|
abstract List<AudioStream> |
getAudioStreams()
This should return a list of available
AudioStream s. |
String |
getCategory()
The name of the category of the stream.
|
String |
getDashMpdUrl()
Get the dash mpd url.
|
Description |
getDescription()
This is the stream description.
|
long |
getDislikeCount()
The amount of dislikes a video/audio stream got.
|
String |
getErrorMessage()
Should analyse the webpage's document and extracts any error message there might be.
|
List<Frameset> |
getFrames()
Should return a list of Frameset object that contains preview of stream frames
|
String |
getHlsUrl()
I am not sure if this is in use, and how this is used.
|
String |
getHost()
The host of the stream (Eg.
|
Locale |
getLanguageInfo()
The locale language of the stream.
|
long |
getLength()
This should return the length of a video in seconds.
|
String |
getLicence()
The name of the licence of the stream.
|
long |
getLikeCount()
The amount of likes a video/audio stream got.
|
List<MetaInfo> |
getMetaInfo()
Meta information about the stream.
|
StreamExtractor.Privacy |
getPrivacy()
The privacy of the stream (Eg.
|
InfoItemsCollector<? extends InfoItem,? extends InfoItemExtractor> |
getRelatedItems()
Should return a list of streams related to the current handled.
|
StreamInfoItemsCollector |
getRelatedStreams()
Deprecated.
Use
getRelatedItems() . May be removed in a future version. |
List<StreamSegment> |
getStreamSegments()
The list of stream segments by timestamps for the stream.
|
abstract StreamType |
getStreamType()
Get the
StreamType . |
String |
getSubChannelAvatarUrl()
The url to the image file/profile picture/avatar of the sub-channel of the stream.
|
String |
getSubChannelName()
The name of the sub-channel of the stream.
|
String |
getSubChannelUrl()
The Url to the page of the sub-channel of the stream.
|
List<SubtitlesStream> |
getSubtitles(MediaFormat format)
This will return a list of available
SubtitlesStream s given by a specific type. |
List<SubtitlesStream> |
getSubtitlesDefault()
This will return a list of available
SubtitlesStream s. |
String |
getSupportInfo()
The support information of the stream.
|
List<String> |
getTags()
The list of tags of the stream.
|
String |
getTextualUploadDate()
The original textual date provided by the service.
|
abstract String |
getThumbnailUrl()
This will return the url to the thumbnail of the stream.
|
long |
getTimeStamp()
If the url you are currently handling contains a time stamp/seek, you can return the
position it represents here.
|
protected long |
getTimestampSeconds(String regexPattern)
Override this function if the format of timestamp in the url is not the same format as that
from youtube.
|
DateWrapper |
getUploadDate()
A more general
Calendar instance set to the date provided by the service.Implementations usually will just parse the date returned from the getTextualUploadDate() . |
String |
getUploaderAvatarUrl()
The url to the image file/profile picture/avatar of the creator/uploader of the stream.
|
abstract String |
getUploaderName()
The name of the creator/uploader of the stream.
|
long |
getUploaderSubscriberCount()
The subscriber count of the uploader.
|
abstract String |
getUploaderUrl()
The Url to the page of the creator/uploader of the stream.
|
abstract List<VideoStream> |
getVideoOnlyStreams()
This should return a list of available
VideoStream s. |
abstract List<VideoStream> |
getVideoStreams()
This should return a list of available
VideoStream s. |
long |
getViewCount()
The count of how many people have watched the video/listened to the audio stream.
|
boolean |
isUploaderVerified()
Whether the uploader has been verified by the service's provider.
|
assertPageFetched, fetchPage, forceContentCountry, forceLocalization, getBaseUrl, getDownloader, getExtractorContentCountry, getExtractorLocalization, getId, getLinkHandler, getName, getOriginalUrl, getService, getServiceId, getTimeAgoParser, getUrl, isPageFetched, onFetchPage
public static final int NO_AGE_LIMIT
public static final long UNKNOWN_SUBSCRIBER_COUNT
public StreamExtractor(StreamingService service, LinkHandler linkHandler)
@Nullable public String getTextualUploadDate() throws ParsingException
getUploadDate()
isn't provided by the service, or it fails for some reason.
If the stream is a live stream, null
should be returned.
null
.ParsingException
- if there is an error in the extractiongetUploadDate()
@Nullable public DateWrapper getUploadDate() throws ParsingException
Calendar
instance set to the date provided by the service.getTextualUploadDate()
.
If the stream is a live stream, null
should be returned.
null
.ParsingException
- if there is an error in the extraction
or the extracted date couldn't be parsed.getTextualUploadDate()
@Nonnull public abstract String getThumbnailUrl() throws ParsingException
ParsingException
@Nonnull public Description getDescription() throws ParsingException
Description.EMPTY_DESCRIPTION
if the
description is empty.ParsingException
public int getAgeLimit() throws ParsingException
ParsingException
- if an error occurs while parsingpublic long getLength() throws ParsingException
ParsingException
public long getTimeStamp() throws ParsingException
ParsingException
public long getViewCount() throws ParsingException
ParsingException
public long getLikeCount() throws ParsingException
ParsingException
public long getDislikeCount() throws ParsingException
ParsingException
@Nonnull public abstract String getUploaderUrl() throws ParsingException
ChannelExtractor
, so be sure to implement that one before you return a value here,
otherwise NewPipe will crash if one selects this url.ParsingException
@Nonnull public abstract String getUploaderName() throws ParsingException
ParsingException
public boolean isUploaderVerified() throws ParsingException
false
.ParsingException
public long getUploaderSubscriberCount() throws ParsingException
-1
.ParsingException
@Nonnull public String getUploaderAvatarUrl() throws ParsingException
ParsingException
@Nonnull public String getSubChannelUrl() throws ParsingException
ChannelExtractor
, so be sure to implement that one before you return a value here,
otherwise NewPipe will crash if one selects this url.ParsingException
@Nonnull public String getSubChannelName() throws ParsingException
ParsingException
@Nonnull public String getSubChannelAvatarUrl() throws ParsingException
ParsingException
@Nonnull public String getDashMpdUrl() throws ParsingException
ParsingException
- if an error occurs while reading@Nonnull public String getHlsUrl() throws ParsingException
ParsingException
public abstract List<AudioStream> getAudioStreams() throws IOException, ExtractionException
AudioStream
s.
You can also return null or an empty list, however be aware that if you don't return anything
in getVideoStreams(), getVideoOnlyStreams() and getDashMpdUrl() either the Collector will
handle this as a failed extraction procedure.IOException
ExtractionException
public abstract List<VideoStream> getVideoStreams() throws IOException, ExtractionException
VideoStream
s.
Be aware this is the list of video streams which do contain an audio stream.
You can also return null or an empty list, however be aware that if you don't return anything
in getAudioStreams(), getVideoOnlyStreams() and getDashMpdUrl() either the Collector will
handle this as a failed extraction procedure.IOException
ExtractionException
public abstract List<VideoStream> getVideoOnlyStreams() throws IOException, ExtractionException
VideoStream
s.
Be aware this is the list of video streams which do NOT contain an audio stream.
You can also return null or an empty list, however be aware that if you don't return anything
in getAudioStreams(), getVideoStreams() and getDashMpdUrl() either the Collector will handle
this as a failed extraction procedure.IOException
ExtractionException
@Nonnull public List<SubtitlesStream> getSubtitlesDefault() throws IOException, ExtractionException
SubtitlesStream
s.
If no subtitles are available an empty list can be returned.IOException
ExtractionException
@Nonnull public List<SubtitlesStream> getSubtitles(MediaFormat format) throws IOException, ExtractionException
SubtitlesStream
s given by a specific type.
If no subtitles in that specific format are available an empty list can be returned.format
- the media format by which the subtitles should be filteredIOException
ExtractionException
public abstract StreamType getStreamType() throws ParsingException
StreamType
.ParsingException
@Nullable public InfoItemsCollector<? extends InfoItem,? extends InfoItemExtractor> getRelatedItems() throws IOException, ExtractionException
null
.IOException
ExtractionException
@Deprecated @Nullable public StreamInfoItemsCollector getRelatedStreams() throws IOException, ExtractionException
getRelatedItems()
. May be removed in a future version.getRelatedItems()
if it is a
StreamInfoItemsCollector
, null
otherwiseIOException
ExtractionException
@Nonnull public List<Frameset> getFrames() throws ExtractionException
ExtractionException
public String getErrorMessage()
null
if there is no error message.protected long getTimestampSeconds(String regexPattern) throws ParsingException
ParsingException
@Nonnull public String getHost() throws ParsingException
ParsingException
public StreamExtractor.Privacy getPrivacy() throws ParsingException
ParsingException
@Nonnull public String getCategory() throws ParsingException
ParsingException
@Nonnull public String getLicence() throws ParsingException
ParsingException
@Nullable public Locale getLanguageInfo() throws ParsingException
null
.ParsingException
@Nonnull public List<String> getTags() throws ParsingException
ParsingException
@Nonnull public String getSupportInfo() throws ParsingException
ParsingException
@Nonnull public List<StreamSegment> getStreamSegments() throws ParsingException
ParsingException
@Nonnull public List<MetaInfo> getMetaInfo() throws ParsingException
This can be information about the stream creator (e.g. if the creator is a public broadcaster) or further information on the topic (e.g. hints that the video might contain conspiracy theories or contains information about a current health situation like the Covid-19 pandemic).
The meta information often contains links to external sources like Wikipedia or the WHO.ParsingException