Class NonMusicClient
java.lang.Object
dev.lavalink.youtube.clients.skeleton.NonMusicClient
- All Implemented Interfaces:
Client
- Direct Known Subclasses:
StreamingNonMusicClient
The base class for a client that is used for everything except music.youtube.com.
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.lavalink.youtube.clients.skeleton.Client
Client.PlayabilityStatus -
Field Summary
FieldsFields 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, 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 @Nullable com.sedmelluq.discord.lavaplayer.track.AudioTrackextractAudioTrack(@NotNull com.sedmelluq.discord.lavaplayer.tools.JsonBrowser json, @NotNull YoutubeAudioSourceManager source) protected @NotNull com.sedmelluq.discord.lavaplayer.tools.JsonBrowserextractMixPlaylistData(@NotNull com.sedmelluq.discord.lavaplayer.tools.JsonBrowser json) protected @Nullable StringextractPlaylistContinuationToken(@NotNull com.sedmelluq.discord.lavaplayer.tools.JsonBrowser videoList) protected @NotNull com.sedmelluq.discord.lavaplayer.tools.JsonBrowserextractPlaylistContinuationVideos(@NotNull com.sedmelluq.discord.lavaplayer.tools.JsonBrowser continuationJson) protected @Nullable StringextractPlaylistError(@NotNull com.sedmelluq.discord.lavaplayer.tools.JsonBrowser json) protected @Nullable StringextractPlaylistName(@NotNull com.sedmelluq.discord.lavaplayer.tools.JsonBrowser json) protected voidextractPlaylistTracks(@NotNull com.sedmelluq.discord.lavaplayer.tools.JsonBrowser json, @NotNull List<com.sedmelluq.discord.lavaplayer.track.AudioTrack> tracks, @NotNull YoutubeAudioSourceManager source) protected @NotNull com.sedmelluq.discord.lavaplayer.tools.JsonBrowserextractPlaylistVideoList(@NotNull com.sedmelluq.discord.lavaplayer.tools.JsonBrowser json) protected @NotNull List<com.sedmelluq.discord.lavaplayer.track.AudioTrack>extractSearchResults(@NotNull YoutubeAudioSourceManager source, @NotNull com.sedmelluq.discord.lavaplayer.tools.JsonBrowser json) protected abstract @NotNull ClientConfiggetBaseClientConfig(@NotNull com.sedmelluq.discord.lavaplayer.tools.io.HttpInterface httpInterface) Retrieves a base client config payload to be used for requests.protected @NotNull com.sedmelluq.discord.lavaplayer.tools.JsonBrowserloadJsonResponse(@NotNull com.sedmelluq.discord.lavaplayer.tools.io.HttpInterface httpInterface, @NotNull org.apache.http.client.methods.HttpPost request, @NotNull String context) 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.protected @NotNull com.sedmelluq.discord.lavaplayer.tools.JsonBrowserloadMixResult(@NotNull com.sedmelluq.discord.lavaplayer.tools.io.HttpInterface httpInterface, @NotNull String mixId, @Nullable String selectedVideoId) 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.protected @NotNull com.sedmelluq.discord.lavaplayer.tools.JsonBrowserloadPlaylistResult(@NotNull com.sedmelluq.discord.lavaplayer.tools.io.HttpInterface httpInterface, @NotNull String playlistId) 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.protected @NotNull com.sedmelluq.discord.lavaplayer.tools.JsonBrowserloadSearchResults(@NotNull com.sedmelluq.discord.lavaplayer.tools.io.HttpInterface httpInterface, @NotNull String searchQuery) protected @NotNull com.sedmelluq.discord.lavaplayer.tools.JsonBrowserloadTrackInfoFromInnertube(@NotNull YoutubeAudioSourceManager source, @NotNull com.sedmelluq.discord.lavaplayer.tools.io.HttpInterface httpInterface, @NotNull String videoId, @Nullable Client.PlayabilityStatus status) 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 playlistPageCount) Methods 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, getPlayabilityStatus, getPlayerParams, getUnplayableReason, loadFormats, supportsFormatLoading
-
Field Details
-
WEB_PLAYER_PARAMS
-
MOBILE_PLAYER_PARAMS
-
playlistPageCount
protected int playlistPageCount
-
-
Constructor Details
-
NonMusicClient
public NonMusicClient()
-
-
Method Details
-
getBaseClientConfig
@NotNull protected abstract @NotNull ClientConfig getBaseClientConfig(@NotNull @NotNull com.sedmelluq.discord.lavaplayer.tools.io.HttpInterface httpInterface) Retrieves a base client config payload to be used for requests.- Parameters:
httpInterface- The HTTP interface to use for fetching a config, if applicable.- Returns:
- A client configuration.
-
loadJsonResponse
@NotNull protected @NotNull com.sedmelluq.discord.lavaplayer.tools.JsonBrowser loadJsonResponse(@NotNull @NotNull com.sedmelluq.discord.lavaplayer.tools.io.HttpInterface httpInterface, @NotNull @NotNull org.apache.http.client.methods.HttpPost request, @NotNull @NotNull String context) throws IOException - Throws:
IOException
-
loadTrackInfoFromInnertube
@NotNull protected @NotNull com.sedmelluq.discord.lavaplayer.tools.JsonBrowser loadTrackInfoFromInnertube(@NotNull @NotNull YoutubeAudioSourceManager source, @NotNull @NotNull com.sedmelluq.discord.lavaplayer.tools.io.HttpInterface httpInterface, @NotNull @NotNull String videoId, @Nullable @Nullable Client.PlayabilityStatus status) throws CannotBeLoaded, IOException - Throws:
CannotBeLoadedIOException
-
loadSearchResults
@NotNull protected @NotNull com.sedmelluq.discord.lavaplayer.tools.JsonBrowser loadSearchResults(@NotNull @NotNull com.sedmelluq.discord.lavaplayer.tools.io.HttpInterface httpInterface, @NotNull @NotNull String searchQuery) -
extractSearchResults
@NotNull protected @NotNull List<com.sedmelluq.discord.lavaplayer.track.AudioTrack> extractSearchResults(@NotNull @NotNull YoutubeAudioSourceManager source, @NotNull @NotNull com.sedmelluq.discord.lavaplayer.tools.JsonBrowser json) -
loadMixResult
-
extractMixPlaylistData
@NotNull protected @NotNull com.sedmelluq.discord.lavaplayer.tools.JsonBrowser extractMixPlaylistData(@NotNull @NotNull com.sedmelluq.discord.lavaplayer.tools.JsonBrowser json) -
loadPlaylistResult
@NotNull protected @NotNull com.sedmelluq.discord.lavaplayer.tools.JsonBrowser loadPlaylistResult(@NotNull @NotNull com.sedmelluq.discord.lavaplayer.tools.io.HttpInterface httpInterface, @NotNull @NotNull String playlistId) -
extractPlaylistError
@Nullable protected @Nullable String extractPlaylistError(@NotNull @NotNull com.sedmelluq.discord.lavaplayer.tools.JsonBrowser json) -
extractPlaylistName
@Nullable protected @Nullable String extractPlaylistName(@NotNull @NotNull com.sedmelluq.discord.lavaplayer.tools.JsonBrowser json) -
extractPlaylistVideoList
@NotNull protected @NotNull com.sedmelluq.discord.lavaplayer.tools.JsonBrowser extractPlaylistVideoList(@NotNull @NotNull com.sedmelluq.discord.lavaplayer.tools.JsonBrowser json) -
extractPlaylistContinuationToken
@Nullable protected @Nullable String extractPlaylistContinuationToken(@NotNull @NotNull com.sedmelluq.discord.lavaplayer.tools.JsonBrowser videoList) -
extractPlaylistContinuationVideos
@NotNull protected @NotNull com.sedmelluq.discord.lavaplayer.tools.JsonBrowser extractPlaylistContinuationVideos(@NotNull @NotNull com.sedmelluq.discord.lavaplayer.tools.JsonBrowser continuationJson) -
extractPlaylistTracks
protected void extractPlaylistTracks(@NotNull @NotNull com.sedmelluq.discord.lavaplayer.tools.JsonBrowser json, @NotNull @NotNull List<com.sedmelluq.discord.lavaplayer.track.AudioTrack> tracks, @NotNull @NotNull YoutubeAudioSourceManager source) -
extractAudioTrack
@Nullable protected @Nullable com.sedmelluq.discord.lavaplayer.track.AudioTrack extractAudioTrack(@NotNull @NotNull com.sedmelluq.discord.lavaplayer.tools.JsonBrowser json, @NotNull @NotNull YoutubeAudioSourceManager source) -
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 playlistPageCount) - Specified by:
setPlaylistPageCountin interfaceClient
-
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) throws CannotBeLoaded, IOException Description copied from interface:ClientLoads a single video.- Specified by:
loadVideoin 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.- Returns:
- An AudioItem.
- Throws:
CannotBeLoaded- If a video doesn't exist etc.IOException
-
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.
-
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.
-