public abstract class SearchExtractor extends ListExtractor<InfoItem>
Modifier and Type | Class and Description |
---|---|
static class |
SearchExtractor.NothingFoundException |
ListExtractor.InfoItemsPage<T extends InfoItem>
ITEM_COUNT_INFINITE, ITEM_COUNT_MORE_THAN_100, ITEM_COUNT_UNKNOWN
Constructor and Description |
---|
SearchExtractor(StreamingService service,
SearchQueryHandler linkHandler) |
Modifier and Type | Method and Description |
---|---|
SearchQueryHandler |
getLinkHandler() |
abstract List<MetaInfo> |
getMetaInfo()
Meta information about the search query.
|
String |
getName()
Get the name
|
String |
getSearchString() |
abstract String |
getSearchSuggestion()
The search suggestion provided by the service.
|
abstract boolean |
isCorrectedSearch()
Tell if the search was corrected by the service (if it's not exactly the search you typed).
|
getInitialPage, getPage
assertPageFetched, fetchPage, forceContentCountry, forceLocalization, getBaseUrl, getDownloader, getExtractorContentCountry, getExtractorLocalization, getId, getOriginalUrl, getService, getServiceId, getTimeAgoParser, getUrl, isPageFetched, onFetchPage
public SearchExtractor(StreamingService service, SearchQueryHandler linkHandler)
public String getSearchString()
@Nonnull public abstract String getSearchSuggestion() throws ParsingException
This method also returns the corrected query if
isCorrectedSearch()
is true.
ParsingException
@Nonnull public SearchQueryHandler getLinkHandler()
getLinkHandler
in class ListExtractor<InfoItem>
LinkHandler
of the current extractor object (e.g. a ChannelExtractor
should return a channel url handler).public abstract boolean isCorrectedSearch() throws ParsingException
Example: on YouTube, if you search for "pewdeipie", it will give you results for "pewdiepie", then isCorrectedSearch should return true.
ParsingException
@Nonnull public abstract List<MetaInfo> getMetaInfo() throws ParsingException
Example: on YouTube, if you search for "Covid-19", there is a box with information from the WHO about Covid-19 and a link to the WHO's website.
ParsingException