Cog-Creators / Lavalink-Jars

Repository for hosting Lavalink Jarfiles for Red-DiscordBot.
Apache License 2.0
59 stars 8 forks source link

403 Forbidden on Youtube track queueing #16

Open TheBwevin opened 2 days ago

TheBwevin commented 2 days ago

Hello, I've had this issue in the past and fixed it by modifying my application.yml file.

Issue seems to be back again, no changes made really, it was working fine just a couple days ago. (since July)

lavalink.jar up to date (25th august release) Red up to date (3.5.13)

It randomly returns the 403 error on some songs, but not all.

Any ideas on what could be causing this ?

Here's my Application.yml:

plugins:
  youtube:
    enabled: true
    allowSearch: true
    allowDirectVideoIds: true
    allowDirectPlaylistIds: true
    clients:
      - MUSIC
      - WEB
      - ANDROID_TESTSUITE
      - TVHTML5EMBEDDED
      - ANDROID_LITE
      - MEDIA_CONNECT
      - IOS
    WEB:
      playback: true
    TVHTML5EMBEDDED:
      playlistLoading: false
      videoLoading: false
      searching: false
lavalink:
  plugins:
  - dependency: dev.lavalink.youtube:youtube-plugin:1.8.3
    repository: https://maven.lavalink.dev/releases
  server:
    bufferDurationMs: 400
    frameBufferDurationMs: 1000
    gc-warnings: true
    password: penis
    playerUpdateInterval: 1
    soundcloudSearchEnabled: true
    sources:
      bandcamp: true
      http: true
      local: true
      soundcloud: true
      twitch: false
      vimeo: true
      youtube: false
    youtubePlaylistLoadLimit: 100
    youtubeSearchEnabled: true
logging:
  file:
    path: ./logs/
  level:
    lavalink: INFO
    root: INFO
  logback:
    rollingpolicy:
      max-history: 15
      max-size: 10MB
metrics:
  prometheus:
    enabled: false
    endpoint: /metrics
sentry:
  dsn: ''
  environment: ''
server:
  address: localhost
  port: 2333

And Here's is my servers log:

2024-11-14 22:20:54.131  INFO 8376 --- [  XNIO-1 task-1] lavalink.server.io.SocketServer          : Connection successfully established from Red-Lavalink/0.11.0
2024-11-14 22:20:54.153  INFO 8376 --- [   XNIO-1 I/O-3] lavalink.server.io.SocketServer          : {"op": "configureResuming", "key": "Red-Core-Audio-994072056549363732-gamerz2", "timeout": 60}
2024-11-14 22:20:54.154  WARN 8376 --- [   XNIO-1 I/O-3] lavalink.server.io.WebSocketHandler      : Sending websocket commands to Lavalink has been deprecated and will be removed in API version 4. API version 3 will be removed in Lavalink 5. Please use the new REST endpoints instead.
2024-11-14 22:20:54.156  INFO 8376 --- [   XNIO-1 I/O-3] lavalink.server.io.SocketServer          : {"op": "configureResuming", "key": "Red-Core-Audio-887761039226187797-Gamerz", "timeout": 60}
2024-11-14 22:20:54.156  WARN 8376 --- [   XNIO-1 I/O-3] lavalink.server.io.WebSocketHandler      : Sending websocket commands to Lavalink has been deprecated and will be removed in API version 4. API version 3 will be removed in Lavalink 5. Please use the new REST endpoints instead.
2024-11-14 22:21:07.375  INFO 8376 --- [   XNIO-1 I/O-3] lavalink.server.io.SocketServer          : {"op": "voiceUpdate", "guildId": "247928585720037386", "sessionId": "29f9b815e3669ed12b10ad2cd8e1903f", "event": {"token": "4caeb494fc8445ed", "guild_id": "247928585720037386", "endpoint": "newark1297.discord.media:443"}}
2024-11-14 22:21:07.944  INFO 8376 --- [   XNIO-1 I/O-3] lavalink.server.io.SocketServer          : {"op": "play", "guildId": "247928585720037386", "track": "QAAAmQIAO1N0cmF5IEZyb20gVGhlIFBhdGggLSBOZWVkZnVsIFRoaW5ncyBbT2ZmaWNpYWwgTXVzaWMgVmlkZW9dAARVTkZEAAAAAAADtTgAC0EzVGZmUlBGMDZVAAEAK2h0dHBzOi8vd3d3LnlvdXR1YmUuY29tL3dhdGNoP3Y9QTNUZmZSUEYwNlUAB3lvdXR1YmUAAAAAAAAAAA==", "noReplace": false, "startTime": "0", "pause": false}
2024-11-14 22:21:09.592  INFO 8376 --- [back-1-thread-1] d.l.y.http.YoutubeAccessTokenTracker     : Updating YouTube visitor id succeeded, new one is CgtrX01jWEJjcHV4Zyil_Nq5BjIKCgJDQRIEGgAgODoMCAEg-p76mtfEr5tn, next update will be after 600 seconds.
2024-11-14 22:21:10.575  INFO 8376 --- [back-1-thread-1] c.s.l.c.natives.NativeLibraryLoader      : Native library libmpg123-0: loading with filter com.sedmelluq.discord.lavaplayer.natives.ConnectorNativeLibLoader$$Lambda$873/0x000001683d7eccc0@e624fb1
2024-11-14 22:21:10.596  INFO 8376 --- [back-1-thread-1] c.s.l.c.natives.NativeLibraryLoader      : Native library libmpg123-0: successfully loaded.
2024-11-14 22:21:10.598  INFO 8376 --- [back-1-thread-1] c.s.l.c.natives.NativeLibraryLoader      : Native library connector: loading with filter null
2024-11-14 22:21:10.666  INFO 8376 --- [back-1-thread-1] c.s.l.c.natives.NativeLibraryLoader      : Native library connector: successfully loaded.
2024-11-14 22:21:29.497  INFO 8376 --- [   XNIO-1 I/O-3] lavalink.server.io.SocketServer          : {"op": "play", "guildId": "247928585720037386", "track": "QAAAiAIAKlN0cmF5IEZyb20gVGhlIFBhdGggLSBNYXkgWW91IExpdmUgRm9yZXZlcgAEVU5GRAAAAAAAAv2gAAtodEMzR3NQalJWWQABACtodHRwczovL3d3dy55b3V0dWJlLmNvbS93YXRjaD92PWh0QzNHc1BqUlZZAAd5b3V0dWJlAAAAAAAAAAA=", "noReplace": false, "startTime": "0", "pause": false}
2024-11-14 22:21:30.104 ERROR 8376 --- [back-1-thread-1] c.s.d.l.t.p.LocalAudioTrackExecutor      : Error in playback of htC3GsPjRVY

com.sedmelluq.discord.lavaplayer.tools.FriendlyException: Something broke when playing the track.
        at com.sedmelluq.discord.lavaplayer.tools.ExceptionTools.wrapUnfriendlyExceptions(ExceptionTools.java:45) ~[lavaplayer-1.5.4.jar!/:na]
        at com.sedmelluq.discord.lavaplayer.track.playback.LocalAudioTrackExecutor.execute(LocalAudioTrackExecutor.java:113) ~[lavaplayer-1.5.4.jar!/:na]
        at com.sedmelluq.discord.lavaplayer.player.DefaultAudioPlayerManager.lambda$executeTrack$1(DefaultAudioPlayerManager.java:324) ~[lavaplayer-1.5.4.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:1623) ~[na:na]
        Suppressed: com.sedmelluq.discord.lavaplayer.tools.exception.EnvironmentInformation:
  lavaplayer.version: 1.5.4
  os.arch: amd64
  os.name: Windows 10
  os.version: 10.0
  java.vendor: Oracle Corporation
  java.version: 20.0.2
  java.runtime.version: 20.0.2+9-78
  java.vm.version: 20.0.2+9-78
Caused by: java.io.IOException: Invalid status code for player api response: 403
        at com.sedmelluq.discord.lavaplayer.tools.io.HttpClientTools.assertSuccessWithContent(HttpClientTools.java:154) ~[lavaplayer-1.5.4.jar!/:na]
        at dev.lavalink.youtube.clients.skeleton.NonMusicClient.loadJsonResponse(NonMusicClient.java:67) ~[jar:file:C:\Lavalink\.\plugins\youtube-plugin-1.8.3.jar!/:na]
        at dev.lavalink.youtube.clients.skeleton.NonMusicClient.loadTrackInfoFromInnertube(NonMusicClient.java:107) ~[jar:file:C:\Lavalink\.\plugins\youtube-plugin-1.8.3.jar!/:na]
        at dev.lavalink.youtube.clients.skeleton.StreamingNonMusicClient.loadFormats(StreamingNonMusicClient.java:35) ~[jar:file:C:\Lavalink\.\plugins\youtube-plugin-1.8.3.jar!/:na]
        at dev.lavalink.youtube.track.YoutubeAudioTrack.loadBestFormatWithUrl(YoutubeAudioTrack.java:193) ~[jar:file:C:\Lavalink\.\plugins\youtube-plugin-1.8.3.jar!/:na]
        at dev.lavalink.youtube.track.YoutubeAudioTrack.processWithClient(YoutubeAudioTrack.java:119) ~[jar:file:C:\Lavalink\.\plugins\youtube-plugin-1.8.3.jar!/:na]
        at dev.lavalink.youtube.track.YoutubeAudioTrack.process(YoutubeAudioTrack.java:72) ~[jar:file:C:\Lavalink\.\plugins\youtube-plugin-1.8.3.jar!/:na]
        at com.sedmelluq.discord.lavaplayer.track.playback.LocalAudioTrackExecutor.execute(LocalAudioTrackExecutor.java:101) ~[lavaplayer-1.5.4.jar!/:na]
        ... 4 common frames omitted

2024-11-14 22:21:30.346  INFO 8376 --- [   XNIO-1 I/O-3] lavalink.server.io.SocketServer          : {"op": "play", "guildId": "247928585720037386", "track": "QAAAjgIAMFN0cmF5IEZyb20gVGhlIFBhdGggLSBJSUkgW09mZmljaWFsIE11c2ljIFZpZGVvXQAEVU5GRAAAAAAAA9CQAAsycmxJYXYyUlNEMAABACtodHRwczovL3d3dy55b3V0dWJlLmNvbS93YXRjaD92PTJybElhdjJSU0QwAAd5b3V0dWJlAAAAAAAAAAA=", "noReplace": false, "startTime": "0", "pause": false}
2024-11-14 22:21:31.051 ERROR 8376 --- [back-1-thread-1] c.s.d.l.t.p.LocalAudioTrackExecutor      : Error in playback of 2rlIav2RSD0
Space-Gate commented 1 day ago

I have the exact same problem, with same lavalink 3.7.13 and youtube-plugin 1.8.3 version or lower... Also my machine only has ipv4 activated. so no ipv6 rotating. Maybe this is causing the error also.

aikaterna commented 1 day ago

Since you are both commenting on the Lavalink.jar repository and not in a Red-DiscordBot issue, I'm going to answer this as if you are managing your own Lavalink node. You need to update the yt source plugin to 1.8.3 and take a look at the sources you are using in your application.yml. Currently I'm testing with:

    clients:
      - MUSIC
      - WEB
      - WEBEMBEDDED
      - ANDROID_TESTSUITE
      - TVHTML5EMBEDDED
      - MEDIA_CONNECT
      - IOS

If this message isn't informative for you or you don't understand what to do with this information and you are a Red-DiscordBot user, you should wait until there is a new Red version which will include the changes I'm describing here.

TheBwevin commented 1 day ago

Thanks for the reply to both of you.

Yes I am running a lavalink node on which two disctinct Redbots instance connect to.

I was using the following sources:

 clients:
      - MUSIC
      - WEB
      - ANDROID_TESTSUITE
      - TVHTML5EMBEDDED
      - ANDROID_LITE
      - MEDIA_CONNECT
      - IOS

I've updated my application.yml with the same exact sources as you've indicated to test, and once again you've found the issue @aikaterna.

I am guessing either ANDROID_LITE or MEDIA_CONNECT was causing the issue?

Or simply adding WEBEMBEDDED fixed it?

I can't really confirm.

I've tested 2-3 albums that were returning 403 on some songs and everything seems to be working fine now.

Thanks once again!

**Edit: After testing some Youtube videos, most of them work except for a channel in particular so far, not exactly sure why. Error 403 again.