public class PeertubeSearchExtractor extends SearchExtractor
SearchExtractor.NothingFoundException
ListExtractor.InfoItemsPage<T extends InfoItem>
ITEM_COUNT_INFINITE, ITEM_COUNT_MORE_THAN_100, ITEM_COUNT_UNKNOWN
Constructor and Description |
---|
PeertubeSearchExtractor(StreamingService service,
SearchQueryHandler linkHandler) |
PeertubeSearchExtractor(StreamingService service,
SearchQueryHandler linkHandler,
boolean sepia) |
Modifier and Type | Method and Description |
---|---|
ListExtractor.InfoItemsPage<InfoItem> |
getInitialPage()
A
InfoItemsPage corresponding to the initial page
where the items are from the initial request and the nextPage relative to it. |
List<MetaInfo> |
getMetaInfo()
Meta information about the search query.
|
ListExtractor.InfoItemsPage<InfoItem> |
getPage(Page page)
Get a list of items corresponding to the specific requested page.
|
String |
getSearchSuggestion()
The search suggestion provided by the service.
|
boolean |
isCorrectedSearch()
Tell if the search was corrected by the service (if it's not exactly the search you typed).
|
void |
onFetchPage(Downloader downloader)
Fetch the current page.
|
getLinkHandler, getName, getSearchString
assertPageFetched, fetchPage, forceContentCountry, forceLocalization, getBaseUrl, getDownloader, getExtractorContentCountry, getExtractorLocalization, getId, getOriginalUrl, getService, getServiceId, getTimeAgoParser, getUrl, isPageFetched
public PeertubeSearchExtractor(StreamingService service, SearchQueryHandler linkHandler)
public PeertubeSearchExtractor(StreamingService service, SearchQueryHandler linkHandler, boolean sepia)
@Nonnull public String getSearchSuggestion()
SearchExtractor
This method also returns the corrected query if
SearchExtractor.isCorrectedSearch()
is true.
getSearchSuggestion
in class SearchExtractor
public boolean isCorrectedSearch()
SearchExtractor
Example: on YouTube, if you search for "pewdeipie", it will give you results for "pewdiepie", then isCorrectedSearch should return true.
isCorrectedSearch
in class SearchExtractor
@Nonnull public List<MetaInfo> getMetaInfo()
SearchExtractor
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.
getMetaInfo
in class SearchExtractor
public ListExtractor.InfoItemsPage<InfoItem> getInitialPage() throws IOException, ExtractionException
ListExtractor
InfoItemsPage
corresponding to the initial page
where the items are from the initial request and the nextPage relative to it.getInitialPage
in class ListExtractor<InfoItem>
ListExtractor.InfoItemsPage
corresponding to the initial pageIOException
ExtractionException
public ListExtractor.InfoItemsPage<InfoItem> getPage(Page page) throws IOException, ExtractionException
ListExtractor
getPage
in class ListExtractor<InfoItem>
page
- any page got from the exclusive implementation of the list extractorListExtractor.InfoItemsPage
corresponding to the requested pageIOException
ExtractionException
ListExtractor.InfoItemsPage.getNextPage()
public void onFetchPage(@Nonnull Downloader downloader) throws IOException, ExtractionException
Extractor
onFetchPage
in class Extractor
downloader
- the downloader to useIOException
- if the page can not be loadedExtractionException
- if the pages content is not understood