Skip to content

Commit 66fa5ca

Browse files
committed
add example for native backend
1 parent 88215d6 commit 66fa5ca

File tree

4 files changed

+184
-2
lines changed

4 files changed

+184
-2
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,5 @@ bin/
3838
### Mac OS ###
3939
.DS_Store
4040

41-
application.yml
41+
logs/
42+
/application.yml
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
plugins:
2+
youtube:
3+
pot:
4+
token: 0123456789
5+
visitorData: 0123456789
6+
lavasrc:
7+
spotify:
8+
clientId: 0123456789
9+
clientSecret: 0123456789
10+
spDc: 0123456789
11+
deezer:
12+
masterDecryptionKey: 0123456789 # the master key used for decrypting the deezer tracks. (yes this is not here you need to get it from somewhere else)
13+
arl: "0123456789"
14+
tidal:
15+
countryCode: "DE" # the country code for accessing region-specific content on Tidal (ISO 3166-1 alpha-2).
16+
searchLimit: 6 # How many search results should be returned
17+
token: 0123456789 # the token used for accessing the tidal api. See https://github.com/topi314/LavaSrc#tidal
18+
19+
lavalink:
20+
server:
21+
password: "youshallnotpass2"

config/Lavalink/application.yml

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
server:
2+
port: 2333
3+
address: 0.0.0.0
4+
http2:
5+
enabled: true
6+
plugins:
7+
youtube:
8+
enabled: true
9+
pot:
10+
clients:
11+
- MUSIC
12+
- WEB
13+
- MWEB
14+
- ANDROID_VR
15+
- WEBEMBEDDED
16+
- TVHTML5EMBEDDED
17+
- IOS
18+
clientOptions:
19+
WEB:
20+
playback: true
21+
TVHTML5EMBEDDED:
22+
playlistLoading: false
23+
videoLoading: false
24+
searching: false
25+
lavasrc:
26+
providers: # Custom providers for track loading. This is the default
27+
- "dzisrc:%ISRC%"
28+
- "ytsearch:\"%ISRC%\""
29+
- "dzsearch:%QUERY%"
30+
- "ytmsearch:%QUERY%"
31+
- "ytsearch:%QUERY%"
32+
- "scsearch:%QUERY%"
33+
sources:
34+
spotify: true # Enable Spotify source
35+
applemusic: true # Enable Apple Music source
36+
deezer: true # Enable Deezer source
37+
yandexmusic: false # Enable Yandex Music source
38+
flowerytts: true
39+
youtube: true
40+
tidal: true
41+
lyrics-sources:
42+
spotify: true # Enable Spotify lyrics source
43+
deezer: true # Enable Deezer lyrics source
44+
youtube: true # Enable YouTube lyrics source
45+
yandexmusic: false # Enable Yandex Music lyrics source
46+
vkmusic: false # Enable Vk Music lyrics source
47+
spotify:
48+
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
49+
playlistLoadLimit: 2 # The number of pages at 100 tracks each
50+
albumLoadLimit: 2 # The number of pages at 50 tracks each
51+
applemusic:
52+
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
53+
mediaAPIToken: "" # Can be used to bypass the auto token fetching which is likely to break again in the future
54+
playlistLoadLimit: 2 # The number of pages at 300 tracks each
55+
albumLoadLimit: 2 # The number of pages at 300 tracks each
56+
deezer:
57+
formats: [ "FLAC", "MP3_320", "MP3_256", "MP3_128", "MP3_64", "AAC_64" ]
58+
flowerytts:
59+
voice: "Aad" # (case-sensitive) get default voice here https://flowery.pw/docs/flowery/tts-voices-v-1-tts-voices-get
60+
translate: false # whether to translate the text to the native language of voice
61+
silence: 0 # the silence parameter is in milliseconds. Range is 0 to 10000. The default is 0.
62+
speed: 1.0 # the speed parameter is a float between 0.5 and 10. The default is 1.0. (0.5 is half speed, 2.0 is double speed, etc.)
63+
audioFormat: "mp3" # supported formats are: mp3, ogg_opus, ogg_vorbis, aac, wav, and flac. Default format is mp3
64+
youtube:
65+
countryCode: "US"
66+
tidal:
67+
countryCode: "DE" # the country code for accessing region-specific content on Tidal (ISO 3166-1 alpha-2).
68+
searchLimit: 6 # How many search results should be returned
69+
lavalink:
70+
plugins:
71+
- dependency: "dev.lavalink.youtube:youtube-plugin:1.12.0"
72+
- dependency: "com.github.topi314.lavasrc:lavasrc-plugin:4.5.0"
73+
server:
74+
sources:
75+
# The default Youtube source is now deprecated and won't receive further updates. Please use https://github.com/lavalink-devs/youtube-source#plugin instead.
76+
youtube: false
77+
bandcamp: true
78+
soundcloud: true
79+
twitch: true
80+
vimeo: true
81+
nico: true
82+
http: true # warning: keeping HTTP enabled without a proxy configured could expose your server's IP address.
83+
local: false
84+
filters: # All filters are enabled by default
85+
volume: true
86+
equalizer: true
87+
karaoke: true
88+
timescale: true
89+
tremolo: true
90+
vibrato: true
91+
distortion: true
92+
rotation: true
93+
channelMix: true
94+
lowPass: true
95+
nonAllocatingFrameBuffer: false # Setting to true reduces the number of allocations made by each player at the expense of frame rebuilding (e.g. non-instantaneous volume changes)
96+
bufferDurationMs: 400 # The duration of the NAS buffer. Higher values fare better against longer GC pauses. Duration <= 0 to disable JDA-NAS. Minimum of 40ms, lower values may introduce pauses.
97+
frameBufferDurationMs: 5000 # How many milliseconds of audio to keep buffered
98+
opusEncodingQuality: 10 # Opus encoder quality. Valid values range from 0 to 10, where 10 is best quality but is the most expensive on the CPU.
99+
resamplingQuality: LOW # Quality of resampling operations. Valid values are LOW, MEDIUM and HIGH, where HIGH uses the most CPU.
100+
trackStuckThresholdMs: 10000 # The threshold for how long a track can be stuck. A track is stuck if does not return any audio data.
101+
useSeekGhosting: true # Seek ghosting is the effect where whilst a seek is in progress, the audio buffer is read from until empty, or until seek is ready.
102+
youtubePlaylistLoadLimit: 6 # Number of pages at 100 each
103+
playerUpdateInterval: 5 # How frequently to send player updates to clients, in seconds
104+
youtubeSearchEnabled: true
105+
soundcloudSearchEnabled: true
106+
gc-warnings: true
107+
#ratelimit:
108+
#ipBlocks: ["1.0.0.0/8", "..."] # list of ip blocks
109+
#excludedIps: ["...", "..."] # ips which should be explicit excluded from usage by lavalink
110+
#strategy: "RotateOnBan" # RotateOnBan | LoadBalance | NanoSwitch | RotatingNanoSwitch
111+
#searchTriggersFail: true # Whether a search 429 should trigger marking the ip as failing
112+
#retryLimit: -1 # -1 = use default lavaplayer value | 0 = infinity | >0 = retry will happen this numbers times
113+
#youtubeConfig: # Required for avoiding all age restrictions by YouTube, some restricted videos still can be played without.
114+
#email: "" # Email of Google account
115+
#password: "" # Password of Google account
116+
#httpConfig: # Useful for blocking bad-actors from ip-grabbing your music node and attacking it, this way only the http proxy will be attacked
117+
#proxyHost: "localhost" # Hostname of the proxy, (ip or domain)
118+
#proxyPort: 3128 # Proxy port, 3128 is the default for squidProxy
119+
#proxyUser: "" # Optional user for basic authentication fields, leave blank if you don't use basic auth
120+
#proxyPassword: "" # Password for basic authentication
121+
timeouts:
122+
connectTimeoutMs: 3000
123+
connectionRequestTimeoutMs: 3000
124+
socketTimeoutMs: 3000
125+
126+
metrics:
127+
prometheus:
128+
enabled: false
129+
endpoint: /metrics
130+
131+
sentry:
132+
dsn: ""
133+
environment: ""
134+
# tags:
135+
# some_key: some_value
136+
# another_key: another_value
137+
138+
logging:
139+
file:
140+
path: ./logs/
141+
142+
level:
143+
root: INFO
144+
lavalink: INFO
145+
146+
request:
147+
enabled: true
148+
includeClientInfo: true
149+
includeHeaders: false
150+
includeQueryString: true
151+
includePayload: true
152+
maxPayloadLength: 10000
153+
154+
logback:
155+
rollingpolicy:
156+
max-file-size: 1GB
157+
max-history: 30

example.application.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ spring:
2525
defaultLabel: main
2626
# See: https://docs.spring.io/spring-cloud-config/docs/current/reference/html/#_file_system_backend
2727
native:
28-
searchLocations: "file:config/{application"
28+
# when using the native backend, the searchLocations supports the following placeholders: {application}, {profile} & {label}
29+
# make sure to tell the lavalink config server a specific config location via spring.config.location=application.yml
30+
# or else it will try to load its own config from any subdirectory your lavalink server configs might be in
31+
searchLocations: "file:config/{application}"
2932

3033
server:
3134
port: 8888

0 commit comments

Comments
 (0)