Package org.schabi.newpipe.extractor
Class Extractor
- java.lang.Object
-
- org.schabi.newpipe.extractor.Extractor
-
- Direct Known Subclasses:
ChannelExtractor
,ListExtractor
,StreamExtractor
public abstract class Extractor extends java.lang.Object
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Extractor(StreamingService service, LinkHandler linkHandler)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
assertPageFetched()
void
fetchPage()
Fetch the current page.void
forceContentCountry(ContentCountry contentCountry)
void
forceLocalization(Localization localization)
java.lang.String
getBaseUrl()
Downloader
getDownloader()
ContentCountry
getExtractorContentCountry()
Localization
getExtractorLocalization()
java.lang.String
getId()
LinkHandler
getLinkHandler()
abstract java.lang.String
getName()
Get the namejava.lang.String
getOriginalUrl()
StreamingService
getService()
int
getServiceId()
TimeAgoParser
getTimeAgoParser()
java.lang.String
getUrl()
protected boolean
isPageFetched()
abstract void
onFetchPage(Downloader downloader)
Fetch the current page.
-
-
-
Constructor Detail
-
Extractor
protected Extractor(StreamingService service, LinkHandler linkHandler)
-
-
Method Detail
-
getLinkHandler
@Nonnull public LinkHandler getLinkHandler()
- Returns:
- The
LinkHandler
of the current extractor object (e.g. a ChannelExtractor should return a channel url handler).
-
fetchPage
public void fetchPage() throws java.io.IOException, ExtractionException
Fetch the current page.- Throws:
java.io.IOException
- if the page can not be loadedExtractionException
- if the pages content is not understood
-
assertPageFetched
protected void assertPageFetched()
-
isPageFetched
protected boolean isPageFetched()
-
onFetchPage
public abstract void onFetchPage(@Nonnull Downloader downloader) throws java.io.IOException, ExtractionException
Fetch the current page.- Parameters:
downloader
- the downloader to use- Throws:
java.io.IOException
- if the page can not be loadedExtractionException
- if the pages content is not understood
-
getId
@Nonnull public java.lang.String getId() throws ParsingException
- Throws:
ParsingException
-
getName
@Nonnull public abstract java.lang.String getName() throws ParsingException
Get the name- Returns:
- the name
- Throws:
ParsingException
- if the name cannot be extracted
-
getOriginalUrl
@Nonnull public java.lang.String getOriginalUrl() throws ParsingException
- Throws:
ParsingException
-
getUrl
@Nonnull public java.lang.String getUrl() throws ParsingException
- Throws:
ParsingException
-
getBaseUrl
@Nonnull public java.lang.String getBaseUrl() throws ParsingException
- Throws:
ParsingException
-
getService
@Nonnull public StreamingService getService()
-
getServiceId
public int getServiceId()
-
getDownloader
public Downloader getDownloader()
-
forceLocalization
public void forceLocalization(Localization localization)
-
forceContentCountry
public void forceContentCountry(ContentCountry contentCountry)
-
getExtractorLocalization
@Nonnull public Localization getExtractorLocalization()
-
getExtractorContentCountry
@Nonnull public ContentCountry getExtractorContentCountry()
-
getTimeAgoParser
@Nonnull public TimeAgoParser getTimeAgoParser()
-
-