Class SearchExtractor
- java.lang.Object
-
- org.schabi.newpipe.extractor.Extractor
-
- org.schabi.newpipe.extractor.ListExtractor<InfoItem>
-
- org.schabi.newpipe.extractor.search.SearchExtractor
-
- Direct Known Subclasses:
BandcampSearchExtractor,MediaCCCSearchExtractor,PeertubeSearchExtractor,SoundcloudSearchExtractor,YoutubeMusicSearchExtractor,YoutubeSearchExtractor
public abstract class SearchExtractor extends ListExtractor<InfoItem>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSearchExtractor.NothingFoundException-
Nested classes/interfaces inherited from class org.schabi.newpipe.extractor.ListExtractor
ListExtractor.InfoItemsPage<T extends InfoItem>
-
-
Field Summary
-
Fields inherited from class org.schabi.newpipe.extractor.ListExtractor
ITEM_COUNT_INFINITE, ITEM_COUNT_MORE_THAN_100, ITEM_COUNT_UNKNOWN
-
-
Constructor Summary
Constructors Constructor Description SearchExtractor(StreamingService service, SearchQueryHandler linkHandler)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description SearchQueryHandlergetLinkHandler()abstract java.util.List<MetaInfo>getMetaInfo()Meta information about the search query.java.lang.StringgetName()Get the namejava.lang.StringgetSearchString()abstract java.lang.StringgetSearchSuggestion()The search suggestion provided by the service.abstract booleanisCorrectedSearch()Tell if the search was corrected by the service (if it's not exactly the search you typed).-
Methods inherited from class org.schabi.newpipe.extractor.ListExtractor
getInitialPage, getPage
-
Methods inherited from class org.schabi.newpipe.extractor.Extractor
assertPageFetched, fetchPage, forceContentCountry, forceLocalization, getBaseUrl, getDownloader, getExtractorContentCountry, getExtractorLocalization, getId, getOriginalUrl, getService, getServiceId, getTimeAgoParser, getUrl, isPageFetched, onFetchPage
-
-
-
-
Constructor Detail
-
SearchExtractor
public SearchExtractor(StreamingService service, SearchQueryHandler linkHandler)
-
-
Method Detail
-
getSearchString
public java.lang.String getSearchString()
-
getSearchSuggestion
@Nonnull public abstract java.lang.String getSearchSuggestion() throws ParsingExceptionThe search suggestion provided by the service.This method also returns the corrected query if
isCorrectedSearch()is true.- Returns:
- a suggestion to another query, the corrected query, or an empty String.
- Throws:
ParsingException
-
getLinkHandler
@Nonnull public SearchQueryHandler getLinkHandler()
- Overrides:
getLinkHandlerin classListExtractor<InfoItem>- Returns:
- The
LinkHandlerof the current extractor object (e.g. a ChannelExtractor should return a channel url handler).
-
getName
@Nonnull public java.lang.String getName()
Description copied from class:ExtractorGet the name
-
isCorrectedSearch
public abstract boolean isCorrectedSearch() throws ParsingExceptionTell if the search was corrected by the service (if it's not exactly the search you typed).Example: on YouTube, if you search for "pewdeipie", it will give you results for "pewdiepie", then isCorrectedSearch should return true.
- Returns:
- whether the results comes from a corrected query or not.
- Throws:
ParsingException
-
getMetaInfo
@Nonnull public abstract java.util.List<MetaInfo> getMetaInfo() throws ParsingException
Meta information about the search query.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.
- Returns:
- additional meta information about the search query
- Throws:
ParsingException
-
-