A collection of additional Lavaplayer Audio Source Managers and Lavalink Plugin.
- Spotify* playlists/albums/songs/artists(top tracks)/search results
- Apple Music* playlists/albums/songs/artists/search results(Big thx to ryan5453 for helping me)
- Deezer playlists/albums/songs/artists/search results(Big thx to ryan5453 and melike2d for helping me)
- Yandex Music playlists/albums/songs/artists/podcasts/search results(Thx to AgutinVBoy for implementing it)
*tracks are searched & played via YouTube or other configurable sources
Replace x.y.z with the latest version number
repositories {
maven {
url "https://jitpack.io"
}
}
dependencies {
implementation "com.github.TopiSenpai.LavaSrc:lavasrc:x.y.z"
}
<repositories>
<repository>
<id>jitpack</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.github.TopiSenpai.LavaSrc</groupId>
<artifactId>lavasrc</artifactId>
<version>x.y.z</version>
</dependency>
</dependencies>
For all supported urls and queries see here
To get a Spotify clientId & clientSecret you must go here and create a new application.
AudioPlayerManager playerManager = new DefaultAudioPlayerManager();
// create a new SpotifySourceManager with the default providers, clientId, clientSecret, countryCode and AudioPlayerManager and register it
playerManager.registerSourceManager(new SpotifySourceManager(null, clientId, clientSecret, countryCode, playerManager));
AudioPlayerManager playerManager = new DefaultAudioPlayerManager();
// create a new AppleMusicSourceManager with the standard providers, countrycode and AudioPlayerManager and register it
playerManager.registerSourceManager(new AppleMusicSourceManager(null, "us", playerManager));
AudioPlayerManager playerManager = new DefaultAudioPlayerManager();
// create a new DeezerSourceManager with the master decryption key and register it
playerManager.registerSourceManager(new DeezerSourceManager("...");
How to get access token
- (Optional) Open DevTools in your browser and on the Network tab enable trotlining.
- Go to https://oauth.yandex.ru/authorize?response_type=token&client_id=23cabbbdc6cd418abb4b39c32c41195d
- Authorize and grant access
- The browser will redirect to the address like
https://music.yandex.ru/#access_token=AQAAAAAYc***&token_type=bearer&expires_in=31535645
. Very quickly there will be a redirect to another page, so you need to have time to copy the link. - Your accessToken, what is after
access_token
.
Token expires in 1 year. You can get a new one by repeating the steps above.
Yandex Music is very location-dependent. You should either have a premium subscription or be located in one of the following countries:
- Azerbaijan
- Armenia
- Belarus
- Georgia
- Kazakhstan
- Kyrgyzstan
- Moldova
- Russia
- Tajikistan
- Turkmenistan
- Uzbekistan
Else you will only have access to podcasts.
AudioPlayerManager playerManager = new DefaultAudioPlayerManager();
// create a new YandexMusicSourceManager with the access token and register it
playerManager.registerSourceManager(new YandexMusicSourceManager("...");
This plugin requires Lavalink v3.6.0
or greater
To install this plugin either download the latest release and place it into your plugins
folder or add the following into your application.yml
Lavalink supports plugins only in v3.5 and above
Replace x.y.z with the latest version number
lavalink:
plugins:
- dependency: "com.github.TopiSenpai.LavaSrc:lavasrc-plugin:x.y.z"
repository: "https://jitpack.io"
For all supported urls and queries see here
For an application.yml
example see here
To get your Spotify clientId & clientSecret go here & then copy them into your application.yml
like the following.
To get your Yandex Music access token go here
(YES plugins
IS AT ROOT IN THE YAML)
plugins:
lavasrc:
providers: # Custom providers for track loading. This is the default
- "ytsearch:\"%ISRC%\"" # Will be ignored if track does not have an ISRC. See https://en.wikipedia.org/wiki/International_Standard_Recording_Code
- "ytsearch:%QUERY%" # Will be used if track has no ISRC or no track could be found for the ISRC
# - "dzisrc:%ISRC%" # Deezer ISRC provider
# - "scsearch:%QUERY%" you can add multiple other fallback sources here
sources:
spotify: true # Enable Spotify source
applemusic: true # Enable Apple Music source
deezer: true # Enable Deezer source
yandexmusic: true # Enable Yandex Music source
spotify:
clientId: "your client id"
clientSecret: "your client secret"
countryCode: "US" # the country code you want to use for filtering the artists top tracks. See https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
applemusic:
countryCode: "US" # the country code you want to use for filtering the artists top tracks and language. See https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
mediaAPIToken: "..." # Can be used to bypass the auto token fetching which is likely to break again in the future
deezer:
masterDecryptionKey: "your master decryption key" # the master key used for decrypting the deezer tracks. (yes this is not here you need to get it from somewhere else)
yandexmusic:
accessToken: "your access token" # the token used for accessing the yandex music api. See https://github.com/TopiSenpai/LavaSrc#yandex-music
spsearch:animals architects
sprec:seed_artists=3ZztVuWxHzNpl0THurTFCv,4MzJMcHQBl9SIYSjwWn8QW&seed_genres=metalcore&seed_tracks=5ofoB8PFmocBXFBEWVb6Vz,6I5zXzSDByTEmYZ7ePVQeB
(check out Spotify Recommendations Docs for the full query parameter list)- https://open.spotify.com/track/0eG08cBeKk0mzykKjw4hcQ
- https://open.spotify.com/album/7qemUq4n71awwVPOaX7jw4
- https://open.spotify.com/playlist/7HAO9R9v203gkaPAgknOMp
- https://open.spotify.com/artist/3ZztVuWxHzNpl0THurTFCv
amsearch:animals architects
- https://music.apple.com/cy/album/animals/1533388849?i=1533388859
- https://music.apple.com/cy/album/for-those-that-wish-to-exist/1533388849
- https://music.apple.com/us/playlist/architects-essentials/pl.40e568c609ae4b1eba58b6e89f4cd6a5
- https://music.apple.com/cy/artist/architects/182821355
dzsearch:animals architects
dzisrc:USEP42058010
- https://deezer.page.link/U6BTQ2Q1KpmNt2yh8
- https://www.deezer.com/track/1090538082
- https://www.deezer.com/album/175537082
- https://www.deezer.com/playlist/8164349742
- https://www.deezer.com/artist/159126
ymsearch:animals architects
- https://music.yandex.ru/album/13886032/track/71663565
- https://music.yandex.ru/album/13886032
- https://music.yandex.ru/users/yamusic-bestsongs/playlists/701626
- https://music.yandex.ru/artist/701626