Class SearchExtractor

Direct Known Subclasses:
BandcampSearchExtractor, MediaCCCSearchExtractor, PeertubeSearchExtractor, SoundcloudSearchExtractor, YoutubeMusicSearchExtractor, YoutubeSearchExtractor

public abstract class SearchExtractor extends ListExtractor<InfoItem>
  • Constructor Details

  • Method Details

    • getSearchString

      public String getSearchString()
    • getSearchSuggestion

      @Nonnull public abstract String getSearchSuggestion() throws ParsingException
      The 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:
      getLinkHandler in class ListExtractor<InfoItem>
      Returns:
      The LinkHandler of the current extractor object (e.g. a ChannelExtractor should return a channel url handler).
    • getName

      @Nonnull public String getName()
      Description copied from class: Extractor
      Get the name
      Specified by:
      getName in class Extractor
      Returns:
      the name
    • isCorrectedSearch

      public abstract boolean isCorrectedSearch() throws ParsingException
      Tell 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 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