Class YoutubeSearchExtractor
- java.lang.Object
-
- org.schabi.newpipe.extractor.Extractor
-
- org.schabi.newpipe.extractor.ListExtractor<InfoItem>
-
- org.schabi.newpipe.extractor.search.SearchExtractor
-
- org.schabi.newpipe.extractor.services.youtube.extractors.YoutubeSearchExtractor
-
public class YoutubeSearchExtractor extends SearchExtractor
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.schabi.newpipe.extractor.search.SearchExtractor
SearchExtractor.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 YoutubeSearchExtractor(StreamingService service, SearchQueryHandler linkHandler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ListExtractor.InfoItemsPage<InfoItem>getInitialPage()AInfoItemsPagecorresponding to the initial page where the items are from the initial request and the nextPage relative to it.java.util.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.java.lang.StringgetSearchSuggestion()The search suggestion provided by the service.java.lang.StringgetUrl()booleanisCorrectedSearch()Tell if the search was corrected by the service (if it's not exactly the search you typed).voidonFetchPage(Downloader downloader)Fetch the current page.-
Methods inherited from class org.schabi.newpipe.extractor.search.SearchExtractor
getLinkHandler, getName, getSearchString
-
Methods inherited from class org.schabi.newpipe.extractor.Extractor
assertPageFetched, fetchPage, forceContentCountry, forceLocalization, getBaseUrl, getDownloader, getExtractorContentCountry, getExtractorLocalization, getId, getOriginalUrl, getService, getServiceId, getTimeAgoParser, isPageFetched
-
-
-
-
Constructor Detail
-
YoutubeSearchExtractor
public YoutubeSearchExtractor(StreamingService service, SearchQueryHandler linkHandler)
-
-
Method Detail
-
onFetchPage
public void onFetchPage(@Nonnull Downloader downloader) throws java.io.IOException, ExtractionExceptionDescription copied from class:ExtractorFetch the current page.- Specified by:
onFetchPagein classExtractor- Parameters:
downloader- the downloader to use- Throws:
java.io.IOException- if the page can not be loadedExtractionException- if the pages content is not understood
-
getUrl
@Nonnull public java.lang.String getUrl() throws ParsingException- Overrides:
getUrlin classExtractor- Throws:
ParsingException
-
getSearchSuggestion
@Nonnull public java.lang.String getSearchSuggestion() throws ParsingExceptionDescription copied from class:SearchExtractorThe search suggestion provided by the service.This method also returns the corrected query if
SearchExtractor.isCorrectedSearch()is true.- Specified by:
getSearchSuggestionin classSearchExtractor- Returns:
- a suggestion to another query, the corrected query, or an empty String.
- Throws:
ParsingException
-
isCorrectedSearch
public boolean isCorrectedSearch()
Description copied from class:SearchExtractorTell 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.
- Specified by:
isCorrectedSearchin classSearchExtractor- Returns:
- whether the results comes from a corrected query or not.
-
getMetaInfo
@Nonnull public java.util.List<MetaInfo> getMetaInfo() throws ParsingException
Description copied from class:SearchExtractorMeta 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.
- Specified by:
getMetaInfoin classSearchExtractor- Returns:
- additional meta information about the search query
- Throws:
ParsingException
-
getInitialPage
@Nonnull public ListExtractor.InfoItemsPage<InfoItem> getInitialPage() throws java.io.IOException, ExtractionException
Description copied from class:ListExtractorAInfoItemsPagecorresponding to the initial page where the items are from the initial request and the nextPage relative to it.- Specified by:
getInitialPagein classListExtractor<InfoItem>- Returns:
- a
ListExtractor.InfoItemsPagecorresponding to the initial page - Throws:
java.io.IOExceptionExtractionException
-
getPage
public ListExtractor.InfoItemsPage<InfoItem> getPage(Page page) throws java.io.IOException, ExtractionException
Description copied from class:ListExtractorGet a list of items corresponding to the specific requested page.- Specified by:
getPagein classListExtractor<InfoItem>- Parameters:
page- any page got from the exclusive implementation of the list extractor- Returns:
- a
ListExtractor.InfoItemsPagecorresponding to the requested page - Throws:
java.io.IOExceptionExtractionException- See Also:
ListExtractor.InfoItemsPage.getNextPage()
-
-