@@ -220,6 +220,15 @@ of efficacy. You can instruct `youtube-source` to use OAuth with the following:
220220> This method may also trigger ratelimit errors if used in a high traffic environment.
221221> USE WITH CAUTION!
222222
223+ > [!NOTE]
224+ > You may need to set your log level for `dev.lavalink.youtube.http.YoutubeOauth2Handler` to `INFO`, to see additional information
225+ > within your terminal regarding completing the OAuth flow.
226+
227+ > [!NOTE]
228+ > If you do not have a refresh token, then do not supply one. The source will output your refresh token into your terminal upon
229+ > successfully completing the OAuth flow at least **once**. If you do not see your token, you may need to configure your
230+ > logging (see above note).
231+
223232# ## Lavaplayer
224233` ` ` java
225234YoutubeAudioSourceManager source = new YoutubeAudioSourceManager();
@@ -234,8 +243,6 @@ source.useOauth2(null, false);
234243source.useOauth2("your refresh token", true);
235244```
236245
237- <!-- TODO document rest routes -->
238-
239246### Lavalink
240247``` yaml
241248plugins :
@@ -245,14 +252,15 @@ plugins:
245252 # setting "enabled: true" is the bare minimum to get OAuth working.
246253 enabled : true
247254
248- # you may optionally set your refresh token if you have one, which skips the OAuth flow entirely .
249- # once you have completed the oauth flow at least once, you should see your refresh token within your
250- # lavalink logs, which can be used here .
251- refreshToken : " your refresh token, only supply this if you have one! "
255+ # if you have a refresh token, you may set it below (make sure to uncomment the line to apply it) .
256+ # setting a valid refresh token will skip the OAuth flow entirely. See above note on how to retrieve
257+ # your refreshToken .
258+ # refreshToken: "paste your refresh token here if applicable "
252259
253- # Set this if you don't want the OAuth flow to be triggered, if you intend to supply a refresh token
254- # later on via REST routes. Initialization is skipped automatically if a valid refresh token is supplied.
255- skipInitialization : true
260+ # Set this if you don't want the OAuth flow to be triggered, if you intend to supply a refresh token later.
261+ # Initialization is skipped automatically if a valid refresh token is supplied. Leave this commented if you're
262+ # completing the OAuth flow for the first time/do not have a refresh token.
263+ # skipInitialization: true
256264```
257265
258266## Using a ` poToken `
@@ -285,8 +293,36 @@ plugins:
285293
286294> [!NOTE]
287295> A ` poToken` is not a silver bullet, and currently it only applies to requests made via the `WEB` client.
288- >
289- > At the time of writing, the most effective method for working around automated request blocking is to use IPv6 rotation.
296+
297+ # # REST routes (`plugin` only)
298+ ` POST` ` /youtube`
299+
300+ Body :
301+ ` ` ` json
302+ {
303+ "refreshToken": "your new refresh token",
304+ "skipInitialization": true
305+ }
306+ ` ` `
307+
308+ Response :
309+ ` 204 - No Content`
310+
311+ ` GET` ` /youtube`
312+
313+ Response :
314+
315+ If the YouTube source is not enabled :
316+ ` 400 - Bad Request`
317+
318+ Otherwise :
319+ ` ` ` json
320+ {
321+ "refreshToken": "your current refresh token, or null"
322+ }
323+ ` ` `
324+
325+
290326
291327# # Migration from Lavaplayer's built-in YouTube source
292328
0 commit comments