public abstract class Extractor extends Object
Modifier | Constructor and Description |
---|---|
protected |
Extractor(StreamingService service,
LinkHandler linkHandler) |
Modifier and Type | Method and Description |
---|---|
protected void |
assertPageFetched() |
void |
fetchPage()
Fetch the current page.
|
void |
forceContentCountry(ContentCountry contentCountry) |
void |
forceLocalization(Localization localization) |
String |
getBaseUrl() |
Downloader |
getDownloader() |
ContentCountry |
getExtractorContentCountry() |
Localization |
getExtractorLocalization() |
String |
getId() |
LinkHandler |
getLinkHandler() |
abstract String |
getName()
Get the name
|
String |
getOriginalUrl() |
StreamingService |
getService() |
int |
getServiceId() |
TimeAgoParser |
getTimeAgoParser() |
String |
getUrl() |
protected boolean |
isPageFetched() |
abstract void |
onFetchPage(Downloader downloader)
Fetch the current page.
|
protected Extractor(StreamingService service, LinkHandler linkHandler)
@Nonnull public LinkHandler getLinkHandler()
LinkHandler
of the current extractor object (e.g. a ChannelExtractor
should return a channel url handler).public void fetchPage() throws IOException, ExtractionException
IOException
- if the page can not be loadedExtractionException
- if the pages content is not understoodprotected void assertPageFetched()
protected boolean isPageFetched()
public abstract void onFetchPage(@Nonnull Downloader downloader) throws IOException, ExtractionException
downloader
- the downloader to useIOException
- if the page can not be loadedExtractionException
- if the pages content is not understood@Nonnull public String getId() throws ParsingException
ParsingException
@Nonnull public abstract String getName() throws ParsingException
ParsingException
- if the name cannot be extracted@Nonnull public String getOriginalUrl() throws ParsingException
ParsingException
@Nonnull public String getUrl() throws ParsingException
ParsingException
@Nonnull public String getBaseUrl() throws ParsingException
ParsingException
@Nonnull public StreamingService getService()
public int getServiceId()
public Downloader getDownloader()
public void forceLocalization(Localization localization)
public void forceContentCountry(ContentCountry contentCountry)
@Nonnull public Localization getExtractorLocalization()
@Nonnull public ContentCountry getExtractorContentCountry()
@Nonnull public TimeAgoParser getTimeAgoParser()