lavalink-devs / youtube-source

A rewritten YouTube source manager for Lavaplayer.
MIT License
161 stars 27 forks source link

Invalid status code for player api response: 400 #48

Closed lmoadeck-Lunity closed 2 months ago

lmoadeck-Lunity commented 2 months ago

Basic Troubleshooting

Version of youtube-source

1.7.2

The search query, URL, playlist or video ID that triggered the issue

https://youtube.com/playlist?list=PLqnE-iULDu90iQXBUPvSHT3F83C6CwhYM&si=H-wSwnnetS_A10S0

Code Example

snippit of application.yml

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
      - WEB
      - WEBEMBEDDED
      - ANDROID_TESTSUITE
      - ANDROID_MUSIC
      - TVHTML5EMBEDDED
      - ANDROID_LITE
      - MEDIA_CONNECT
      - IOS
      # This secure your lavalink is working and playing music if you used this two things below.
    oauth:
      enabled: true # IF YOU RUN YOUR LAVALINK CHECK YOUR CONSOLE AND CLICK THE GOOGLE.COM/DEVICES LINK AND THERE IS A CODE THAT YOU NEED TO PUT IN TO THE GOOGLE AND USE A BURNER ACCOUNT OR ALT ACCOUNT THERE IS A POSSIBLE CHANGE YOU CAN GET BANNED FROM GOOGLE OR YOUTUBE SO JUST USE A BURNER ACCOUNT IN CASE.
        # if you have a refresh token, you may set it below (make sure to uncomment the line to apply it).
      # setting a valid refresh token will skip the OAuth flow entirely. See above note on how to retrieve
      # your refreshToken.
      refreshToken: "mine"

      # Set this if you don't want the OAuth flow to be triggered, if you intend to supply a refresh token later.
      # Initialization is skipped automatically if a valid refresh token is supplied. Leave this commented if you're
      # completing the OAuth flow for the first time/do not have a refresh token.
      # skipInitialization: true
    pot:
        token: "mine" # THIS REQUIRE INSTALLING https://github.com/iv-org/youtube-trusted-session-generator THIS IS A PYTHON FILE INSTALL THE REQUIREMENTS AND RUN PYTON INDEX FILE AND AFTER RUNNING YOU WILL RECIVE AND TOKEN AND VISTOR DATA AND PASTE IT BELOW.
        visitorData: "my"

It is confimed that my refresh token is valid.

Exception and Stacktrace

logfile:

2024-09-12T22:11:07.704+08:00  INFO 4360 --- [Lavalink] [XNIO-1 I/O-1] lavalink.server.io.SocketServer          : Connection closed from /127.0.0.1:49848 with id 8ejrt00lbhowifxf -- CloseStatus[code=1006, reason=]
2024-09-12T22:11:19.475+08:00  INFO 4360 --- [Lavalink] [XNIO-1 task-2] l.server.io.HandshakeInterceptorImpl     : Incoming connection from /127.0.0.1:49878
2024-09-12T22:11:19.479+08:00  INFO 4360 --- [Lavalink] [XNIO-1 task-2] l.server.io.RequestLoggingFilter         : GET /v4/websocket, client=127.0.0.1
2024-09-12T22:11:19.483+08:00  INFO 4360 --- [Lavalink] [XNIO-1 task-2] lavalink.server.io.SocketServer          : Connection successfully established from Voicelink/1.4
2024-09-12T22:11:19.490+08:00  INFO 4360 --- [Lavalink] [XNIO-1 task-2] l.server.io.RequestLoggingFilter         : GET /v4/info, client=127.0.0.1
2024-09-12T22:11:24.573+08:00  INFO 4360 --- [Lavalink] [XNIO-1 task-2] l.server.io.RequestLoggingFilter         : PATCH /v4/sessions/4qp9mgw2qokdlje8/players/988727669459927050, client=127.0.0.1, payload={"voice": {"token": "b7001b77996c1258", "endpoint": "hongkong11045.discord.media:443", "sessionId": "713a65ca4c4f3e18c6462485ddd35ce4"}}
2024-09-12T22:11:24.752+08:00  INFO 4360 --- [Lavalink] [XNIO-1 task-2] l.server.player.AudioLoaderRestHandler   : Got request to load for identifier "https://youtube.com/playlist?list=PLqnE-iULDu90iQXBUPvSHT3F83C6CwhYM&si=H-wSwnnetS_A10S0"
2024-09-12T22:11:25.016+08:00  INFO 4360 --- [Lavalink] [XNIO-1 task-2] lavalink.server.player.AudioLoader       : Loaded playlist 百佳音樂 全集
2024-09-12T22:11:25.025+08:00  INFO 4360 --- [Lavalink] [XNIO-1 task-2] l.server.io.RequestLoggingFilter         : GET /v4/loadtracks?identifier=https://youtube.com/playlist?list%3DPLqnE-iULDu90iQXBUPvSHT3F83C6CwhYM%26si%3DH-wSwnnetS_A10S0, client=127.0.0.1
2024-09-12T22:11:25.407+08:00  INFO 4360 --- [Lavalink] [XNIO-1 task-2] l.server.io.RequestLoggingFilter         : PATCH /v4/sessions/4qp9mgw2qokdlje8/players/988727669459927050?noReplace=False, client=127.0.0.1, payload={"encodedTrack": "QAAA5QMAS+WOn+eJiOeZvuS9s+mfs+aogiAoMDEpIC8gRmxpZ2h0IFRvIEZyZWVkb20gLyBPcmlnaW5hbCBQYXJrblNob3AgTXVzaWMgKDAxKQAMUE9QIFVQIE1VU0lDAAAAAAACkEAAC2J6aXlzd0M2cXNnAAEAK2h0dHBzOi8vd3d3LnlvdXR1YmUuY29tL3dhdGNoP3Y9YnppeXN3QzZxc2cBADBodHRwczovL2kueXRpbWcuY29tL3ZpL2J6aXlzd0M2cXNnL21xZGVmYXVsdC5qcGcAAAd5b3V0dWJlAAAAAAAAAAA=", "position": "0"}
2024-09-12T22:11:25.430+08:00 ERROR 4360 --- [Lavalink] [lava-daemon-pool-playback-1-thread-1] c.s.d.l.t.p.LocalAudioTrackExecutor      : Error in playback of bziyswC6qsg

com.sedmelluq.discord.lavaplayer.tools.FriendlyException: Something broke when playing the track.
    at com.sedmelluq.discord.lavaplayer.tools.ExceptionTools.wrapUnfriendlyExceptions(ExceptionTools.java:45) ~[lavaplayer-2.2.1.jar!/:na]
    at com.sedmelluq.discord.lavaplayer.track.playback.LocalAudioTrackExecutor.execute(LocalAudioTrackExecutor.java:121) ~[lavaplayer-2.2.1.jar!/:na]
    at com.sedmelluq.discord.lavaplayer.player.DefaultAudioPlayerManager.lambda$executeTrack$2(DefaultAudioPlayerManager.java:339) ~[lavaplayer-2.2.1.jar!/:na]
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[na:na]
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[na:na]
    at java.base/java.lang.Thread.run(Thread.java:1570) ~[na:na]
Caused by: java.io.IOException: Invalid status code for player api response: 400
    at com.sedmelluq.discord.lavaplayer.tools.io.HttpClientTools.assertSuccessWithContent(HttpClientTools.java:154) ~[lavaplayer-2.2.1.jar!/:na]
    at dev.lavalink.youtube.clients.skeleton.NonMusicClient.loadJsonResponse(NonMusicClient.java:58) ~[jar:file:C:\LavalinkServer\.\plugins\youtube-plugin-1.7.2.jar!/:na]
    at dev.lavalink.youtube.clients.skeleton.NonMusicClient.loadTrackInfoFromInnertube(NonMusicClient.java:97) ~[jar:file:C:\LavalinkServer\.\plugins\youtube-plugin-1.7.2.jar!/:na]
    at dev.lavalink.youtube.clients.skeleton.StreamingNonMusicClient.loadFormats(StreamingNonMusicClient.java:35) ~[jar:file:C:\LavalinkServer\.\plugins\youtube-plugin-1.7.2.jar!/:na]
    at dev.lavalink.youtube.track.YoutubeAudioTrack.loadBestFormatWithUrl(YoutubeAudioTrack.java:188) ~[jar:file:C:\LavalinkServer\.\plugins\youtube-plugin-1.7.2.jar!/:na]
    at dev.lavalink.youtube.track.YoutubeAudioTrack.processWithClient(YoutubeAudioTrack.java:114) ~[jar:file:C:\LavalinkServer\.\plugins\youtube-plugin-1.7.2.jar!/:na]
    at dev.lavalink.youtube.track.YoutubeAudioTrack.process(YoutubeAudioTrack.java:72) ~[jar:file:C:\LavalinkServer\.\plugins\youtube-plugin-1.7.2.jar!/:na]
    at com.sedmelluq.discord.lavaplayer.track.playback.LocalAudioTrackExecutor.execute(LocalAudioTrackExecutor.java:109) ~[lavaplayer-2.2.1.jar!/:na]
    ... 4 common frames omitted
dazzypark commented 2 months ago

I'm not sure, but try disabling the "pot" setting.

lmoadeck-Lunity commented 2 months ago

Thanks! it worked flawlessly :shades: