lavalink-devs / youtube-source

A rewritten YouTube source manager for Lavaplayer.
MIT License
138 stars 19 forks source link

Support OAuth2 Account Integration #33

Closed devoxin closed 1 month ago

devoxin commented 2 months ago

This PR implements support for linking accounts via OAuth2.

By acting as a TV client, we can request users input a code into the official device linking webpage which grants us an access token and a refresh token, which with the former, can be dispatched with requests effectively serving as a replacement to the original source manager's account authentication system. The entire process is done without any external hosted services so security is vastly improved, and this relies on the OAuth flow provided by YT/Google.

The downside to this system is it requires users to keep track of refresh tokens, or authorize youtube-source on every launch. There are facilities provided to fetch and set refresh tokens to allow for some form of persistence.

This PR requires a few finer details to be worked out, notably:

The basic functionality of this PR has been tested, and account authentication does work, with authorization headers being appended onto relevant requests. Testing has not been done to ensure the success of token refreshing as of yet. I also cannot confirm whether providing authentication alleviates any current issues such as "Sign in to confirm you're not a bot" or accessing age restricted videos that the embedded TV client does not provide access to.

A big, or rather, VERY BIG disclaimer to this PR is to use with caution. DO NOT use your main account(s).

ghost commented 2 months ago

Hello,

I wanted to write an issue but maybe this pull request will resolve the problem.

I'm just wondering if this PR is related to the " {'message': 'This video requires login.', 'severity': 'common', 'cause': 'com.sedmelluq.discord.lavaplayer.tools.FriendlyException: This video requires login.'} " error.

Thanks for your answer.

devoxin commented 2 months ago

It should, as well as Sign in to confirm you're not a bot. But I should ask — are you trying to play an age restricted video? If so, do you have the TV client enabled?

ghost commented 2 months ago

I get this error with every video I try to play, restricted or not. Everything was working fine like 3 days ago I think, but I yesterday noticed that it does not work anymore.

To be sure I don't tell wrong stuff, I'm going to provide my configuration :

server:
  port: 2333
  address: 127.0.0.1
lavalink:
  plugins:
    - dependency: "dev.lavalink.youtube:youtube-plugin:1.4.0"
      snapshot: false
  server:
    password: "youshallnotpass"
    sources:
      youtube: false
      bandcamp: true
      soundcloud: true
      twitch: true
      vimeo: true
      http: false
      local: false
plugins:
  youtube:
    enabled: true # Whether this source can be used.
    allowSearch: true # Whether "ytsearch:" and "ytmsearch:" can be used.
    allowDirectVideoIds: true # Whether just video IDs can match. If false, only complete URLs will be loaded.
    allowDirectPlaylistIds: true # Whether just playlist IDs can match. If false, only complete URLs will be loaded.
    # The clients to use for track loading. See below for a list of valid clients.
    # Clients are queried in the order they are given (so the first client is queried first and so on...)
    clients:
      - MUSIC
      - ANDROID
      - WEB
    # You can configure individual clients with the following.
    # Any options or clients left unspecified will use their default values,
    # which enables everything for all clients.
    WEB: # names are specified as they are written below under "Available Clients".
      # This will disable using the WEB client for video playback.
      playback: false
    TVHTML5EMBEDDED:
      # The below config disables everything except playback for this client.
      playlistLoading: false # Disables loading of playlists and mixes for this client.
      videoLoading: false # Disables loading of videos for this client (playback is still allowed).
      searching: false # Disables the ability to search for videos for this client.
devoxin commented 2 months ago

Why are you using ANDROID? Why did you disable WEB?

ghost commented 2 months ago

I don't remember, that was working fine before. I removed the Android thing and enabled Web, but I still get the same error.

devoxin commented 2 months ago

Again, are you using the TV client?

ghost commented 2 months ago

Sorry, I forgot to mention that I also enabled the TV client.

devoxin commented 2 months ago

Join the discord server for further support then. This PR is the wrong place for this

ghost commented 2 months ago

Just tested this PR, seems to fix "sign in to confirm you are not a robot" on a Hetzner node and the 403 errors I was getting on my locally hosted node. I don't even have to have IPv6 rotation on. Thank you for this, you are genuinely a lifesaver. I was having so much trouble with the 403 errors.

makarasty commented 2 months ago

I'm having the same problem, Sign in to confirm you're not a bot. This pull request doesn't fix it

2024-08-05T08:57:29.840Z  INFO 1 --- [Lavalink] [main] lavalink.server.Launcher                 : Starting Launcher v4.0.7 using Java 21.0.3 with PID 1 (/home/container/Lavalink.jar started by ? in /home/container)
2024-08-05T08:57:29.844Z  INFO 1 --- [Lavalink] [main] lavalink.server.Launcher                 : No active profile set, falling back to 1 default profile: "default"
2024-08-05T08:57:30.616Z  INFO 1 --- [Lavalink] [main] l.server.bootstrap.PluginManager         : Found plugin 'DuncteBot-plugin' version 1.7.0
2024-08-05T08:57:30.617Z  INFO 1 --- [Lavalink] [main] l.server.bootstrap.PluginManager         : Found plugin 'youtube-plugin' version 9e234eb0ef4e4c926ffd3a76ae78ae3102c1dbb5
2024-08-05T08:57:30.617Z  INFO 1 --- [Lavalink] [main] l.server.bootstrap.PluginManager         : Found plugin 'lavasrc-plugin' version 4.2.0
2024-08-05T08:57:30.625Z  INFO 1 --- [Lavalink] [main] l.server.bootstrap.PluginManager         : Loaded skybot-lavalink-plugin-1.7.0.jar (4 classes)
2024-08-05T08:57:30.639Z  INFO 1 --- [Lavalink] [main] l.server.bootstrap.PluginManager         : Loaded youtube-plugin-9e234eb0ef4e4c926ffd3a76ae78ae3102c1dbb5.jar (12 classes)
2024-08-05T08:57:30.704Z  INFO 1 --- [Lavalink] [main] l.server.bootstrap.PluginManager         : Loaded lavasrc-plugin-4.2.0.jar (131 classes)
2024-08-05T08:57:30.818Z  INFO 1 --- [Lavalink] [main] lavalink.server.Launcher                 : Started Launcher in 1.38 seconds (process running for 1.78)
2024-08-05T08:57:30.871Z  INFO 1 --- [Lavalink] [main] lavalink.server.Launcher                 : 

       .   _                  _ _       _    __ _ _
      /\\ | | __ ___   ____ _| (_)_ __ | | __\ \ \ \
     ( ( )| |/ _` \ \ / / _` | | | '_ \| |/ / \ \ \ \
      \\/ | | (_| |\ V / (_| | | | | | |   <   ) ) ) )
       '  |_|\__,_| \_/ \__,_|_|_|_| |_|_|\_\ / / / /
    =========================================/_/_/_/

    Version:        4.0.7
    Build time:     08.07.2024 22:14:17 UTC
    Branch          HEAD
    Commit:         93102f8
    Commit time:    08.07.2024 21:49:02 UTC
    JVM:            21.0.3
    Lavaplayer      2.2.1

2024-08-05T08:57:30.877Z  INFO 1 --- [Lavalink] [main] lavalink.server.Launcher                 : No active profile set, falling back to 1 default profile: "default"
2024-08-05T08:57:31.416Z  WARN 1 --- [Lavalink] [main] io.undertow.websockets.jsr               : UT026010: Buffer pool was not set on WebSocketDeploymentInfo, the default pool will be used
2024-08-05T08:57:31.431Z  INFO 1 --- [Lavalink] [main] io.undertow.servlet                      : Initializing Spring embedded WebApplicationContext
2024-08-05T08:57:31.432Z  INFO 1 --- [Lavalink] [main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 550 ms
2024-08-05T08:57:31.512Z  INFO 1 --- [Lavalink] [main] c.g.t.lavasrc.plugin.LavaSrcPlugin       : Loading LavaSrc plugin...
2024-08-05T08:57:31.639Z  INFO 1 --- [Lavalink] [main] c.s.d.l.tools.GarbageCollectionMonitor   : GC monitoring enabled, reporting results every 2 minutes.
2024-08-05T08:57:31.956Z  INFO 1 --- [Lavalink] [main] c.d.lavalinkplugin.DuncteBotInjector     : Registering getyarn audio source manager
2024-08-05T08:57:31.960Z  INFO 1 --- [Lavalink] [main] c.d.lavalinkplugin.DuncteBotInjector     : Registering clypit audio source manager
2024-08-05T08:57:31.961Z  INFO 1 --- [Lavalink] [main] c.d.lavalinkplugin.DuncteBotInjector     : Registering OC Remix audio source manager
2024-08-05T08:57:31.965Z  INFO 1 --- [Lavalink] [main] c.d.lavalinkplugin.DuncteBotInjector     : Registering TikTok audio source manager
2024-08-05T08:57:31.968Z  INFO 1 --- [Lavalink] [main] c.d.lavalinkplugin.DuncteBotInjector     : Registering Mixcloud audio source manager
2024-08-05T08:57:31.969Z  INFO 1 --- [Lavalink] [main] c.d.lavalinkplugin.DuncteBotInjector     : Registering Soundgasm audio source manager
2024-08-05T08:57:32.002Z  INFO 1 --- [Lavalink] [main] d.l.youtube.plugin.YoutubePluginLoader   : YouTube source initialised with clients: WEB, ANDROID_TESTSUITE, TVHTML5_SIMPLY_EMBEDDED_PLAYER 
2024-08-05T08:57:32.002Z  INFO 1 --- [Lavalink] [main] c.g.t.lavasrc.plugin.LavaSrcPlugin       : Registering Spotify audio source manager...
2024-08-05T08:57:32.002Z  INFO 1 --- [Lavalink] [main] c.g.t.lavasrc.plugin.LavaSrcPlugin       : Registering Apple Music audio source manager...
2024-08-05T08:57:32.002Z  INFO 1 --- [Lavalink] [main] c.g.t.lavasrc.plugin.LavaSrcPlugin       : Registering Deezer audio source manager...
2024-08-05T08:57:32.002Z  INFO 1 --- [Lavalink] [main] c.g.t.lavasrc.plugin.LavaSrcPlugin       : Registering Yandex Music audio source manager...
2024-08-05T08:57:32.115Z  INFO 1 --- [Lavalink] [main] l.server.config.KoeConfiguration         : OS: LINUX, Arch: X86_64
2024-08-05T08:57:32.115Z  INFO 1 --- [Lavalink] [main] l.server.config.KoeConfiguration         : Enabling JDA-NAS
2024-08-05T08:57:32.117Z  INFO 1 --- [Lavalink] [main] c.s.l.c.natives.NativeLibraryLoader      : Native library udpqueue: loading with filter null
2024-08-05T08:57:32.121Z  INFO 1 --- [Lavalink] [main] c.s.l.c.natives.NativeLibraryLoader      : Native library udpqueue: successfully loaded.
2024-08-05T08:57:32.166Z  WARN 1 --- [Lavalink] [main] l.server.config.SentryConfiguration      : Turning off sentry
2024-08-05T08:57:32.398Z  INFO 1 --- [Lavalink] [main] io.undertow                              : starting server: Undertow - 2.3.13.Final
2024-08-05T08:57:32.406Z  INFO 1 --- [Lavalink] [main] org.xnio                                 : XNIO version 3.8.8.Final
2024-08-05T08:57:32.414Z  INFO 1 --- [Lavalink] [main] org.xnio.nio                             : XNIO NIO Implementation Version 3.8.8.Final
2024-08-05T08:57:32.508Z  INFO 1 --- [Lavalink] [main] org.jboss.threads                        : JBoss Threads version 3.5.0.Final
2024-08-05T08:57:32.560Z  INFO 1 --- [Lavalink] [main] o.s.b.w.e.undertow.UndertowWebServer     : Undertow started on port 28637 (http) with context path '/'
2024-08-05T08:57:32.564Z  INFO 1 --- [Lavalink] [main] lavalink.server.Launcher                 : Started Launcher in 1.74 seconds (process running for 3.526)
2024-08-05T08:57:32.565Z  INFO 1 --- [Lavalink] [main] lavalink.server.Launcher                 : Lavalink is ready to accept connections.
2024-08-05T08:57:46.761Z  INFO 1 --- [Lavalink] [XNIO-1 task-2] io.undertow.servlet                      : Initializing Spring DispatcherServlet 'dispatcherServlet'
2024-08-05T08:57:46.761Z  INFO 1 --- [Lavalink] [XNIO-1 task-2] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
2024-08-05T08:57:46.763Z  INFO 1 --- [Lavalink] [XNIO-1 task-2] o.s.web.servlet.DispatcherServlet        : Completed initialization in 1 ms
2024-08-05T08:57:46.794Z  INFO 1 --- [Lavalink] [XNIO-1 task-2] l.server.io.HandshakeInterceptorImpl     : Incoming connection from /91.211.133.108:17575
2024-08-05T08:57:46.811Z  INFO 1 --- [Lavalink] [XNIO-1 task-2] l.server.io.RequestLoggingFilter         : GET /v4/websocket, client=91.211.133.108
2024-08-05T08:57:46.845Z  INFO 1 --- [Lavalink] [XNIO-1 task-2] lavalink.server.io.SocketServer          : Connection successfully established from shoukakubot/4.0.1 (https://github.com/shipgirlproject/Shoukaku.git)
2024-08-05T08:57:53.656Z  INFO 1 --- [Lavalink] [XNIO-1 task-2] l.server.io.RequestLoggingFilter         : PATCH /v4/sessions/15e03zio0l5yde0o/players/785107327413911592?noReplace=false, client=91.211.133.108, payload={"voice":{"token":"61e991006a1a7efa","endpoint":"russia5995.discord.media:443","sessionId":"ca9a04c884d1a8d95add5be46568c8c5"}}
2024-08-05T08:57:53.711Z  INFO 1 --- [Lavalink] [XNIO-1 task-2] l.server.io.RequestLoggingFilter         : PATCH /v4/sessions/15e03zio0l5yde0o/players/785107327413911592?noReplace=false, client=91.211.133.108, payload={"volume":4}
2024-08-05T08:57:53.715Z  INFO 1 --- [Lavalink] [XNIO-1 task-3] l.server.io.RequestLoggingFilter         : GET /v4/sessions/15e03zio0l5yde0o/players, client=91.211.133.108
2024-08-05T08:57:53.748Z  INFO 1 --- [Lavalink] [XNIO-1 task-3] l.server.player.AudioLoaderRestHandler   : Got request to load for identifier "https://youtu.be/ckIndfjP1vw"
2024-08-05T08:57:54.353Z ERROR 1 --- [Lavalink] [XNIO-1 task-3] lavalink.server.player.AudioLoader       : Load failed

com.sedmelluq.discord.lavaplayer.tools.FriendlyException: Sign in to confirm you’re not a bot
    at dev.lavalink.youtube.clients.skeleton.Client.getPlayabilityStatus(Client.java:74) ~[youtube-plugin-9e234eb0ef4e4c926ffd3a76ae78ae3102c1dbb5.jar!/:na]
    at dev.lavalink.youtube.clients.skeleton.NonMusicClient.loadTrackInfoFromInnertube(NonMusicClient.java:98) ~[youtube-plugin-9e234eb0ef4e4c926ffd3a76ae78ae3102c1dbb5.jar!/:na]
    at dev.lavalink.youtube.clients.skeleton.NonMusicClient.loadVideo(NonMusicClient.java:318) ~[youtube-plugin-9e234eb0ef4e4c926ffd3a76ae78ae3102c1dbb5.jar!/:na]
    at dev.lavalink.youtube.YoutubeAudioSourceManager.lambda$routeFromVideoId$6(YoutubeAudioSourceManager.java:331) ~[youtube-plugin-9e234eb0ef4e4c926ffd3a76ae78ae3102c1dbb5.jar!/:na]
    at dev.lavalink.youtube.YoutubeAudioSourceManager.loadItemOnce(YoutubeAudioSourceManager.java:207) ~[youtube-plugin-9e234eb0ef4e4c926ffd3a76ae78ae3102c1dbb5.jar!/:na]
    at dev.lavalink.youtube.YoutubeAudioSourceManager.loadItem(YoutubeAudioSourceManager.java:173) ~[youtube-plugin-9e234eb0ef4e4c926ffd3a76ae78ae3102c1dbb5.jar!/:na]
    at com.sedmelluq.discord.lavaplayer.player.DefaultAudioPlayerManager.checkSourcesForItemOnce(DefaultAudioPlayerManager.java:442) ~[lavaplayer-2.2.1.jar!/:na]
    at com.sedmelluq.discord.lavaplayer.player.DefaultAudioPlayerManager.checkSourcesForItem(DefaultAudioPlayerManager.java:423) ~[lavaplayer-2.2.1.jar!/:na]
    at com.sedmelluq.discord.lavaplayer.player.DefaultAudioPlayerManager.loadItemSync(DefaultAudioPlayerManager.java:154) ~[lavaplayer-2.2.1.jar!/:na]
    at com.sedmelluq.discord.lavaplayer.player.DefaultAudioPlayerManager.loadItemSync(DefaultAudioPlayerManager.java:167) ~[lavaplayer-2.2.1.jar!/:na]
    at com.sedmelluq.discord.lavaplayer.player.AudioPlayerManager.loadItemSync(AudioPlayerManager.java:103) ~[lavaplayer-2.2.1.jar!/:na]
    at lavalink.server.player.AudioLoader.load(AudioLoader.kt:56) ~[classes!/:4.0.7]
    at lavalink.server.player.AudioLoaderRestHandler.loadTracks(AudioLoaderRestHandler.kt:56) ~[classes!/:4.0.7]
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) ~[na:na]
    at java.base/java.lang.reflect.Method.invoke(Method.java:580) ~[na:na]
    at kotlin.reflect.jvm.internal.calls.CallerImpl$Method.callMethod(CallerImpl.kt:97) ~[kotlin-reflect-2.0.0.jar!/:2.0.0-release-341]
    at kotlin.reflect.jvm.internal.calls.CallerImpl$Method$Instance.call(CallerImpl.kt:113) ~[kotlin-reflect-2.0.0.jar!/:2.0.0-release-341]
    at kotlin.reflect.jvm.internal.KCallableImpl.callDefaultMethod$kotlin_reflection(KCallableImpl.kt:207) ~[kotlin-reflect-2.0.0.jar!/:2.0.0-release-341]
    at kotlin.reflect.jvm.internal.KCallableImpl.callBy(KCallableImpl.kt:112) ~[kotlin-reflect-2.0.0.jar!/:2.0.0-release-341]
    at org.springframework.web.method.support.InvocableHandlerMethod$KotlinDelegate.invokeFunction(InvocableHandlerMethod.java:334) ~[spring-web-6.1.9.jar!/:6.1.9]
    at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:252) ~[spring-web-6.1.9.jar!/:6.1.9]
    at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:188) ~[spring-web-6.1.9.jar!/:6.1.9]
    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:118) ~[spring-webmvc-6.1.8.jar!/:6.1.8]
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:926) ~[spring-webmvc-6.1.8.jar!/:6.1.8]
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:831) ~[spring-webmvc-6.1.8.jar!/:6.1.8]
    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-6.1.8.jar!/:6.1.8]
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1089) ~[spring-webmvc-6.1.8.jar!/:6.1.8]
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:979) ~[spring-webmvc-6.1.8.jar!/:6.1.8]
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1014) ~[spring-webmvc-6.1.8.jar!/:6.1.8]
    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:903) ~[spring-webmvc-6.1.8.jar!/:6.1.8]
    at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:527) ~[jakarta.servlet-api-6.0.0.jar!/:6.0.0]
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:885) ~[spring-webmvc-6.1.8.jar!/:6.1.8]
    at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:614) ~[jakarta.servlet-api-6.0.0.jar!/:6.0.0]
    at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74) ~[undertow-servlet-2.3.13.Final.jar!/:2.3.13.Final]
    at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129) ~[undertow-servlet-2.3.13.Final.jar!/:2.3.13.Final]
    at org.springframework.web.filter.AbstractRequestLoggingFilter.doFilterInternal(AbstractRequestLoggingFilter.java:289) ~[spring-web-6.1.9.jar!/:6.1.9]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.1.9.jar!/:6.1.9]
    at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:67) ~[undertow-servlet-2.3.13.Final.jar!/:2.3.13.Final]
    at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-2.3.13.Final.jar!/:2.3.13.Final]
    at lavalink.server.io.ResponseHeaderFilter.doFilterInternal(ResponseHeaderFilter.kt:17) ~[classes!/:4.0.7]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.1.9.jar!/:6.1.9]
    at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:67) ~[undertow-servlet-2.3.13.Final.jar!/:2.3.13.Final]
    at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-2.3.13.Final.jar!/:2.3.13.Final]
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-6.1.9.jar!/:6.1.9]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.1.9.jar!/:6.1.9]
    at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:67) ~[undertow-servlet-2.3.13.Final.jar!/:2.3.13.Final]
    at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-2.3.13.Final.jar!/:2.3.13.Final]
    at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84) ~[undertow-servlet-2.3.13.Final.jar!/:2.3.13.Final]
    at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62) ~[undertow-servlet-2.3.13.Final.jar!/:2.3.13.Final]
    at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68) ~[undertow-servlet-2.3.13.Final.jar!/:2.3.13.Final]
    at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) ~[undertow-servlet-2.3.13.Final.jar!/:2.3.13.Final]
    at io.undertow.servlet.handlers.RedirectDirHandler.handleRequest(RedirectDirHandler.java:68) ~[undertow-servlet-2.3.13.Final.jar!/:2.3.13.Final]
    at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:117) ~[undertow-servlet-2.3.13.Final.jar!/:2.3.13.Final]
    at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57) ~[undertow-servlet-2.3.13.Final.jar!/:2.3.13.Final]
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) ~[undertow-core-2.3.13.Final.jar!/:2.3.13.Final]
    at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46) ~[undertow-core-2.3.13.Final.jar!/:2.3.13.Final]
    at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64) ~[undertow-servlet-2.3.13.Final.jar!/:2.3.13.Final]
    at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60) ~[undertow-core-2.3.13.Final.jar!/:2.3.13.Final]
    at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77) ~[undertow-servlet-2.3.13.Final.jar!/:2.3.13.Final]
    at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43) ~[undertow-core-2.3.13.Final.jar!/:2.3.13.Final]
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) ~[undertow-core-2.3.13.Final.jar!/:2.3.13.Final]
    at io.undertow.servlet.handlers.SendErrorPageHandler.handleRequest(SendErrorPageHandler.java:52) ~[undertow-servlet-2.3.13.Final.jar!/:2.3.13.Final]
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) ~[undertow-core-2.3.13.Final.jar!/:2.3.13.Final]
    at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:276) ~[undertow-servlet-2.3.13.Final.jar!/:2.3.13.Final]
    at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135) ~[undertow-servlet-2.3.13.Final.jar!/:2.3.13.Final]
    at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:132) ~[undertow-servlet-2.3.13.Final.jar!/:2.3.13.Final]
    at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48) ~[undertow-servlet-2.3.13.Final.jar!/:2.3.13.Final]
    at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43) ~[undertow-servlet-2.3.13.Final.jar!/:2.3.13.Final]
    at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:256) ~[undertow-servlet-2.3.13.Final.jar!/:2.3.13.Final]
    at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:101) ~[undertow-servlet-2.3.13.Final.jar!/:2.3.13.Final]
    at io.undertow.server.Connectors.executeRootHandler(Connectors.java:393) ~[undertow-core-2.3.13.Final.jar!/:2.3.13.Final]
    at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:859) ~[undertow-core-2.3.13.Final.jar!/:2.3.13.Final]
    at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18) ~[jboss-threads-3.5.0.Final.jar!/:3.5.0.Final]
    at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513) ~[jboss-threads-3.5.0.Final.jar!/:3.5.0.Final]
    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1538) ~[jboss-threads-3.5.0.Final.jar!/:3.5.0.Final]
    at org.xnio.XnioWorker$WorkerThreadFactory$1$1.run(XnioWorker.java:1282) ~[xnio-api-3.8.8.Final.jar!/:3.8.8.Final]
    at java.base/java.lang.Thread.run(Thread.java:1583) ~[na:na]

2024-08-05T08:57:54.375Z  INFO 1 --- [Lavalink] [XNIO-1 task-3] l.server.io.RequestLoggingFilter         : GET /v4/loadtracks?identifier=https%3A%2F%2Fyoutu.be%2FckIndfjP1vw, client=91.211.133.108
devoxin commented 2 months ago

I'm not seeing any authorisation logs at all. Seems like a misconfiguration issue.

makarasty commented 2 months ago

what do I need to add to the configuration to make it work?

devoxin commented 2 months ago

This PR is missing an example configuration because I don't want to encourage the use of it at this moment in time. It's largely untested except for the absolute basics. If you can read code and figure out how the config should be formatted then by all means use it. But whilst I don't have the time to resume work on this PR, I will not be assisting users on setting it up nor will I be actively accepting or reviewing issue reports for it.

somboytiger commented 2 months ago

It seems that the issue with using IPv6 on Hetzner was only temporarily resolved. After using it with 30-50 players for 10 days, the problem 'Your limits will reset soon, usually within an hour.' followed."

ghost commented 2 months ago

what do I need to add to the configuration to make it work?

Change your dependency to look like this:

lavalink:
  plugins:
    - dependency: "dev.lavalink.youtube:youtube-plugin:9e234eb0ef4e4c926ffd3a76ae78ae3102c1dbb5" # This is the sha of the latest commit in this pr
      snapshot: true # due to it being a commit, enable snapshot (i think)

Add this line to your youtube config:

plugins:
  youtube:
    oauthConfig: 
      enabled: true # Default disabled

Launch Lavalink like normal and look at it's logs. Further instruction will be there.

For now, this works very well and solved all the problems I had with authorization errors. However, it is a very bare bones addition.

makarasty commented 2 months ago

I don't understand why this pr is not supported, if it solved my problems on one of the hosts on which Lavalink didn't work

devoxin commented 2 months ago

It's supported I'm just restricting the level of assistance I'm providing at this stage because I don't have the time to fix issues that pop up. Additionally, as I've only tested the bare minimum so far, I really do not want users reporting obvious bugs that stem from lack of extended testing. This puts pressure on me to push a fix when I'm not able to allocate time to do so. There's also the fact that people will quite happily use this PR without realising it's an in-dev thing. They should be aware of the risks of using an unfinished feature.

makarasty commented 2 months ago

Thanks for the clarification. I realize that in its current state PR is experimental and requires further testing. I am grateful for the progress that has been made and the resolution of my concerns. Your hard work is truly valuable and I respect your decision to limit support at this stage to avoid unnecessary pressure and misunderstandings.