Create a new RestClient
The settings to use
Immediately starts playing the specified video or playlist.
Important: Either videoId or playlistId or both have to be set. You can also set an url instead. Url is prioritized over videoId and playlistId
Caution: YouTube Music's UI will display a blank / broken player if both videoId
and playlistId
are provided but the video is not in the playlist or the playlist does not exist (anymore).
The data to change the video
ErrorOutput If something went wrong
Requests a code to exchange for a valid token.
ErrorOutput If something went wrong
Get the authentication token that is required to access the API.
You should save this token safely and set it either:
to set the token for further requests.
The code you got from the getAuthCode method
ErrorOutput If something went wrong
Get the metadata from the API
ErrorOutput If something went wrong
Get the playlists from the API
ErrorOutput If something went wrong
Get the state from the API
ErrorOutput If something went wrong
Mute the volume
ErrorOutput If something went wrong
Play the next song
ErrorOutput If something went wrong
Pause the current song
ErrorOutput If something went wrong
Play the current song
ErrorOutput If something went wrong
Play or pause the current song
ErrorOutput If something went wrong
Play a song from the queue
The index of the song to play
ErrorOutput If something went wrong
Play the previous song
ErrorOutput If something went wrong
Set the repeat mode
The repeat mode to set
ErrorOutput If something went wrong
The authentication token that is required to access the API. You should save this token safely. This method will also set the token in the settings itself.
The code you got from the requestCode method
ErrorOutput If something went wrong
Please use getAuthToken instead. This method will be removed in the next major version due to the confusing name and the side effect of automatically setting the token in the settings.
Requests a code to exchange for a valid token.
ErrorOutput If something went wrong
This is now an alias for getAuthCode. Use that instead because it's more descriptive. This method will be removed in the next major version.
Seek to a specific time
The time to seek to
ErrorOutput If something went wrong
Set the authentication token, so it can be used for further requests.
We recommend to use the setAuthToken method in the CompanionConnector class instead of this method because it sets the token for both clients and reconnects the socket client if the token changed.
The token to set
Set the volume
The volume to set the player to
ErrorOutput If something went wrong
Shuffle the queue
ErrorOutput If something went wrong
Toggle dislike
ErrorOutput If something went wrong
Toggle like
ErrorOutput If something went wrong
Unmute the volume
ErrorOutput If something went wrong
Decrease the volume
ErrorOutput If something went wrong
Increase the volume
ErrorOutput If something went wrong
A REST client to communicate with the companion servers REST API