Skip to content

Commit

Permalink
Revert "fix: set YoutubeOauth2Handler#enabled to true if refresh toke…
Browse files Browse the repository at this point in the history
…n is provided"

This reverts commit d5daa4c.
  • Loading branch information
Apehum committed Aug 23, 2024
1 parent d5daa4c commit cb97fb5
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions src/main/kotlin/su/plo/voice/discs/PlasmoAudioPlayerManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import su.plo.voice.lavaplayer.libs.com.sedmelluq.discord.lavaplayer.source.vime
import su.plo.voice.lavaplayer.libs.com.sedmelluq.discord.lavaplayer.tools.FriendlyException
import su.plo.voice.lavaplayer.libs.com.sedmelluq.discord.lavaplayer.track.*
import su.plo.voice.lavaplayer.libs.dev.lavalink.youtube.YoutubeAudioSourceManager
import su.plo.voice.lavaplayer.libs.dev.lavalink.youtube.http.YoutubeOauth2Handler
import java.io.File
import java.net.URI
import java.util.concurrent.CompletableFuture
Expand Down Expand Up @@ -142,19 +141,6 @@ class PlasmoAudioPlayerManager(
?.readText()
?.trim()
source.useOauth2(refreshToken, false)

if (refreshToken != null) {
// todo: token validation is not implemented yet,
// so for now I just forcibly set enabled to true in YoutubeOauth2Handler

val oauth2HandlerField = YoutubeAudioSourceManager::class.java.getDeclaredField("oauth2Handler")
oauth2HandlerField.isAccessible = true
val oauth2Handler = oauth2HandlerField.get(source) as YoutubeOauth2Handler

val enabledField = YoutubeOauth2Handler::class.java.getDeclaredField("enabled")
enabledField.isAccessible = true
enabledField.set(oauth2Handler, true)
}
}
}
)
Expand Down

0 comments on commit cb97fb5

Please sign in to comment.