lavalink-devs/youtube-source

Not success status code: 403

Closed this issue · 10 comments

spring.log

2024-06-15T15:39:25.925+02:00 ERROR 93724 --- [lava-daemon-pool-playback-1-thread-52] c.s.d.l.t.p.LocalAudioTrackExecutor      : Error in playback of 1prZ0pr6XoRCxcrC3MCL0M

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.0.jar!/:na]
	at com.sedmelluq.discord.lavaplayer.track.playback.LocalAudioTrackExecutor.execute(LocalAudioTrackExecutor.java:121) ~[lavaplayer-2.2.0.jar!/:na]
	at com.sedmelluq.discord.lavaplayer.player.DefaultAudioPlayerManager.lambda$executeTrack$2(DefaultAudioPlayerManager.java:330) ~[lavaplayer-2.2.0.jar!/:na]
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[na:na]
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[na:na]
	at java.base/java.lang.Thread.run(Thread.java:840) ~[na:na]
Caused by: java.lang.RuntimeException: Not success status code: 403
	at com.sedmelluq.discord.lavaplayer.tools.io.PersistentHttpStream.validateStatusCode(PersistentHttpStream.java:88) ~[lavaplayer-2.2.0.jar!/:na]
	at com.sedmelluq.discord.lavaplayer.tools.io.PersistentHttpStream.attemptConnect(PersistentHttpStream.java:124) ~[lavaplayer-2.2.0.jar!/:na]
	at com.sedmelluq.discord.lavaplayer.tools.io.PersistentHttpStream.connect(PersistentHttpStream.java:106) ~[lavaplayer-2.2.0.jar!/:na]
	at com.sedmelluq.discord.lavaplayer.tools.io.PersistentHttpStream.internalRead(PersistentHttpStream.java:158) ~[lavaplayer-2.2.0.jar!/:na]
	at com.sedmelluq.discord.lavaplayer.tools.io.PersistentHttpStream.read(PersistentHttpStream.java:174) ~[lavaplayer-2.2.0.jar!/:na]
	at java.base/java.io.DataInputStream.readUnsignedByte(DataInputStream.java:288) ~[na:na]
	at java.base/java.io.DataInputStream.readByte(DataInputStream.java:268) ~[na:na]
	at com.sedmelluq.discord.lavaplayer.container.matroska.format.MatroskaEbmlReader.readEbmlInteger(MatroskaEbmlReader.java:39) ~[lavaplayer-2.2.0.jar!/:na]
	at com.sedmelluq.discord.lavaplayer.container.matroska.format.MatroskaFileReader.readNextElement(MatroskaFileReader.java:46) ~[lavaplayer-2.2.0.jar!/:na]
	at com.sedmelluq.discord.lavaplayer.container.matroska.MatroskaStreamingFile.readFile(MatroskaStreamingFile.java:93) ~[lavaplayer-2.2.0.jar!/:na]
	at com.sedmelluq.discord.lavaplayer.container.matroska.MatroskaAudioTrack.loadMatroskaFile(MatroskaAudioTrack.java:52) ~[lavaplayer-2.2.0.jar!/:na]
	at com.sedmelluq.discord.lavaplayer.container.matroska.MatroskaAudioTrack.process(MatroskaAudioTrack.java:35) ~[lavaplayer-2.2.0.jar!/:na]
	at com.sedmelluq.discord.lavaplayer.track.DelegatedAudioTrack.processDelegate(DelegatedAudioTrack.java:25) ~[lavaplayer-2.2.0.jar!/:na]
	at dev.lavalink.youtube.track.YoutubeAudioTrack.processStatic(YoutubeAudioTrack.java:148) ~[youtube-plugin-1.3.0.jar!/:na]
	at dev.lavalink.youtube.track.YoutubeAudioTrack.processWithClient(YoutubeAudioTrack.java:116) ~[youtube-plugin-1.3.0.jar!/:na]
	at dev.lavalink.youtube.track.YoutubeAudioTrack.process(YoutubeAudioTrack.java:71) ~[youtube-plugin-1.3.0.jar!/:na]
	at com.sedmelluq.discord.lavaplayer.track.DelegatedAudioTrack.processDelegate(DelegatedAudioTrack.java:25) ~[lavaplayer-2.2.0.jar!/:na]
	at com.github.topi314.lavasrc.mirror.MirroringAudioTrack.process(MirroringAudioTrack.java:55) ~[lavasrc-plugin-4.1.1.jar!/:na]
	at com.sedmelluq.discord.lavaplayer.track.playback.LocalAudioTrackExecutor.execute(LocalAudioTrackExecutor.java:109) ~[lavaplayer-2.2.0.jar!/:na]
	... 4 common frames omitted

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.

lavalink:
  plugins:
    - dependency: "dev.lavalink.youtube:youtube-plugin:1.3.0"
      snapshot: false # set to true if you want to use snapshot builds (see below)
  server:
    sources:
      youtube: false
   

I randomly get a null return sometimes and when I restart LavaLink, it seems to pick up the music that previously returned an error.

Add more clients for more resilience.

Also you have a client config for TVHTML5 but it isn't even registered...

I've also just seen that you have playback disabled for the WEB client, so requests are being routed through the ANDROID client which is broken with no known fix.

Do not blindly copy the client config if you do not know what it does. I would advise removing it.

If something and disabled it is not usable so it should not create a problem on the operation

but so I did not understand what I should keep for a classic use

image
this area is for default use if I understood correctly?

No I'm referring to the client-specific configs where you can adjust what each client will handle. You appear to have blindly copied the demo config from the README without understanding what it does.

No I'm referring to the client-specific configs where you can adjust what each client will handle. You appear to have blindly copied the demo config from the README without understanding what it does.

Honestly yes because initially at the beginning of the plugin it worked and there was no mention that some area was there for advanced uses

image this area is for default use if I understood correctly?

Only this area and therefore useful for conventional use without going into more advanced use then?

No I'm referring to the client-specific configs where you can adjust what each client will handle. You appear to have blindly copied the demo config from the README without understanding what it does.

Honestly yes because initially at the beginning of the plugin it worked and there was no mention that some area was there for advanced uses

When I wrote it I anticipated users reading the attached comments and reading to see what the configs do. They're only there for illustration purposes, to demonstrate what can be done should someone want more granular control over what each client does/handles.

At the beginning of the plugin, ANDROID worked. It no longer does. Also, the plugin didn't support client-specific configs which meant that disabling playback for individual clients wasn't possible, hence why everything seemingly worked.

The best advice I can give when it comes to software and the configuration of, is to not touch/use anything you aren't familiar with to avoid such mishaps. I have improved the comments surrounding the configuration feature to hopefully avoid situations like these going forward

image
I made the changes you tell me, despite that I still have the same error feedback "Not success status code: 403"

Add more clients for more resilience.

You did not do this.