Class MusicClient
java.lang.Object
dev.lavalink.youtube.clients.skeleton.MusicClient
- All Implemented Interfaces:
Client
- Direct Known Subclasses:
Music
The base class for a client that can be used with music.youtube.com.
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.lavalink.youtube.clients.skeleton.Client
Client.PlayabilityStatus -
Field Summary
Fields inherited from interface dev.lavalink.youtube.clients.skeleton.Client
API_BASE_URL, BROWSE_URL, MUSIC_API_BASE_URL, MUSIC_SEARCH_PARAMS, MUSIC_SEARCH_URL, NEXT_URL, OAUTH_CLIENT_ATTRIBUTE, PLAYER_URL, SEARCH_PARAMS, SEARCH_URL, WATCH_URL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanHandleRequest(@NotNull String identifier) Returns a boolean determining whether this client can be used to handle requests for the given identifier.protected com.sedmelluq.discord.lavaplayer.tools.JsonBrowserextractSearchResultTrackJson(@NotNull com.sedmelluq.discord.lavaplayer.tools.JsonBrowser json) protected @NotNull List<com.sedmelluq.discord.lavaplayer.track.AudioTrack>extractSearchResultTracks(@NotNull YoutubeAudioSourceManager source, @NotNull com.sedmelluq.discord.lavaplayer.tools.JsonBrowser json) protected abstract @NotNull ClientConfiggetBaseClientConfig(@NotNull com.sedmelluq.discord.lavaplayer.tools.io.HttpInterface httpInterface) protected com.sedmelluq.discord.lavaplayer.tools.JsonBrowsergetMusicSearchResult(@NotNull com.sedmelluq.discord.lavaplayer.tools.io.HttpInterface httpInterface, @NotNull String searchQuery) loadFormats(@NotNull YoutubeAudioSourceManager source, @NotNull com.sedmelluq.discord.lavaplayer.tools.io.HttpInterface httpInterface, @NotNull String videoId) Loads streaming formats for a video.com.sedmelluq.discord.lavaplayer.track.AudioItemloadMix(@NotNull YoutubeAudioSourceManager source, @NotNull com.sedmelluq.discord.lavaplayer.tools.io.HttpInterface httpInterface, @NotNull String mixId, @Nullable String selectedVideoId) Loads a mix playlist.com.sedmelluq.discord.lavaplayer.track.AudioItemloadPlaylist(@NotNull YoutubeAudioSourceManager source, @NotNull com.sedmelluq.discord.lavaplayer.tools.io.HttpInterface httpInterface, @NotNull String playlistId, @Nullable String selectedVideoId) Loads a playlist.com.sedmelluq.discord.lavaplayer.track.AudioItemloadSearch(@NotNull YoutubeAudioSourceManager source, @NotNull com.sedmelluq.discord.lavaplayer.tools.io.HttpInterface httpInterface, @NotNull String searchQuery) Loads search results for a query.com.sedmelluq.discord.lavaplayer.track.AudioItemloadSearchMusic(@NotNull YoutubeAudioSourceManager source, @NotNull com.sedmelluq.discord.lavaplayer.tools.io.HttpInterface httpInterface, @NotNull String searchQuery) Loads search results for a query.com.sedmelluq.discord.lavaplayer.track.AudioItemloadVideo(@NotNull YoutubeAudioSourceManager source, @NotNull com.sedmelluq.discord.lavaplayer.tools.io.HttpInterface httpInterface, @NotNull String videoId) Loads a single video.voidsetPlaylistPageCount(int count) booleanMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.lavalink.youtube.clients.skeleton.Client
buildAudioTrack, findSelectedTrack, getIdentifier, getOptions, getPlayabilityStatus, getPlayerParams, getUnplayableReason, isEmbedded, requirePlayerScript, supportsOAuth, transformPlaybackUri
-
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
Description copied from interface:ClientReturns a boolean determining whether this client can be used to handle requests for the given identifier.- Specified by:
canHandleRequestin interfaceClient- 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:
setPlaylistPageCountin interfaceClient
-
supportsFormatLoading
public boolean supportsFormatLoading()- Specified by:
supportsFormatLoadingin interfaceClient- 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:ClientLoads search results for a query.- Specified by:
loadSearchMusicin interfaceClient- 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:ClientLoads streaming formats for a video.- Specified by:
loadFormatsin interfaceClient- 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:ClientLoads a single video. -
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:ClientLoads search results for a query.- Specified by:
loadSearchin interfaceClient- 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:ClientLoads a mix playlist. -
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:ClientLoads a playlist.- Specified by:
loadPlaylistin interfaceClient- 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.
-