Class MusicClient

java.lang.Object
dev.lavalink.youtube.clients.skeleton.MusicClient
All Implemented Interfaces:
Client
Direct Known Subclasses:
Music

public abstract class MusicClient extends Object implements Client
The base class for a client that can be used with music.youtube.com.
  • Constructor Details

    • MusicClient

      public MusicClient()
  • Method Details

    • getBaseClientConfig

      @NotNull protected abstract @NotNull ClientConfig getBaseClientConfig(@NotNull @NotNull com.sedmelluq.discord.lavaplayer.tools.io.HttpInterface httpInterface)
    • getMusicSearchResult

      protected com.sedmelluq.discord.lavaplayer.tools.JsonBrowser getMusicSearchResult(@NotNull @NotNull com.sedmelluq.discord.lavaplayer.tools.io.HttpInterface httpInterface, @NotNull @NotNull String searchQuery)
    • extractSearchResultTrackJson

      protected com.sedmelluq.discord.lavaplayer.tools.JsonBrowser extractSearchResultTrackJson(@NotNull @NotNull com.sedmelluq.discord.lavaplayer.tools.JsonBrowser json)
    • extractSearchResultTracks

      @NotNull protected @NotNull List<com.sedmelluq.discord.lavaplayer.track.AudioTrack> extractSearchResultTracks(@NotNull @NotNull YoutubeAudioSourceManager source, @NotNull @NotNull com.sedmelluq.discord.lavaplayer.tools.JsonBrowser json)
    • canHandleRequest

      public boolean canHandleRequest(@NotNull @NotNull String identifier)
      Description copied from interface: Client
      Returns a boolean determining whether this client can be used to handle requests for the given identifier.
      Specified by:
      canHandleRequest in interface Client
      Parameters:
      identifier - The resource identifier. Could be an arbitrary string or a URL.
      Returns:
      True, if this client can handle the request.
    • setPlaylistPageCount

      public void setPlaylistPageCount(int count)
      Specified by:
      setPlaylistPageCount in interface Client
    • supportsFormatLoading

      public boolean supportsFormatLoading()
      Specified by:
      supportsFormatLoading in interface Client
      Returns:
      True, if this client can be used for loading playback URLs.
    • loadSearchMusic

      public com.sedmelluq.discord.lavaplayer.track.AudioItem loadSearchMusic(@NotNull @NotNull YoutubeAudioSourceManager source, @NotNull @NotNull com.sedmelluq.discord.lavaplayer.tools.io.HttpInterface httpInterface, @NotNull @NotNull String searchQuery)
      Description copied from interface: Client
      Loads search results for a query.
      Specified by:
      loadSearchMusic in interface Client
      Parameters:
      source - The source manager responsible for this client.
      httpInterface - The interface to use for requests.
      searchQuery - The search query.
      Returns:
      An AudioItem.
    • loadFormats

      public TrackFormats loadFormats(@NotNull @NotNull YoutubeAudioSourceManager source, @NotNull @NotNull com.sedmelluq.discord.lavaplayer.tools.io.HttpInterface httpInterface, @NotNull @NotNull String videoId)
      Description copied from interface: Client
      Loads streaming formats for a video.
      Specified by:
      loadFormats in interface Client
      Parameters:
      source - The source manager responsible for this client.
      httpInterface - The interface to use for requests.
      videoId - The ID of the video to load formats for.
    • loadVideo

      public com.sedmelluq.discord.lavaplayer.track.AudioItem loadVideo(@NotNull @NotNull YoutubeAudioSourceManager source, @NotNull @NotNull com.sedmelluq.discord.lavaplayer.tools.io.HttpInterface httpInterface, @NotNull @NotNull String videoId)
      Description copied from interface: Client
      Loads a single video.
      Specified by:
      loadVideo in interface Client
      Parameters:
      source - The source manager responsible for this client.
      httpInterface - The interface to use for requests.
      videoId - The ID of the video to load.
      Returns:
      An AudioItem.
    • loadSearch

      public com.sedmelluq.discord.lavaplayer.track.AudioItem loadSearch(@NotNull @NotNull YoutubeAudioSourceManager source, @NotNull @NotNull com.sedmelluq.discord.lavaplayer.tools.io.HttpInterface httpInterface, @NotNull @NotNull String searchQuery)
      Description copied from interface: Client
      Loads search results for a query.
      Specified by:
      loadSearch in interface Client
      Parameters:
      source - The source manager responsible for this client.
      httpInterface - The interface to use for requests.
      searchQuery - The search query.
      Returns:
      An AudioItem.
    • loadMix

      public com.sedmelluq.discord.lavaplayer.track.AudioItem loadMix(@NotNull @NotNull YoutubeAudioSourceManager source, @NotNull @NotNull com.sedmelluq.discord.lavaplayer.tools.io.HttpInterface httpInterface, @NotNull @NotNull String mixId, @Nullable @Nullable String selectedVideoId)
      Description copied from interface: Client
      Loads a mix playlist.
      Specified by:
      loadMix in interface Client
      Parameters:
      source - The source manager responsible for this client.
      httpInterface - The interface to use for requests.
      mixId - The ID of the mix.
      Returns:
      An AudioItem.
    • loadPlaylist

      public com.sedmelluq.discord.lavaplayer.track.AudioItem loadPlaylist(@NotNull @NotNull YoutubeAudioSourceManager source, @NotNull @NotNull com.sedmelluq.discord.lavaplayer.tools.io.HttpInterface httpInterface, @NotNull @NotNull String playlistId, @Nullable @Nullable String selectedVideoId)
      Description copied from interface: Client
      Loads a playlist.
      Specified by:
      loadPlaylist in interface Client
      Parameters:
      source - The source manager responsible for this client.
      httpInterface - The interface to use for requests.
      playlistId - The ID of the playlist.
      Returns:
      An AudioItem.