lavalink-devs / Lavalink

Standalone audio sending node based on Lavaplayer.
https://lavalink.dev/
MIT License
1.59k stars 672 forks source link

Sometime error track with 302 response #646

Closed phamleduy04 closed 2 years ago

phamleduy04 commented 2 years ago

Description

I tried to play a song with a GTTS link

Version info

Client used: my own fork of erela.js

Output of java -version:

I use the docker version (fredboat/lavalink:master)
022-04-09 01:06:02.612  INFO 1 --- [   XNIO-1 I/O-1] lavalink.server.io.SocketServer          : {"op":"play","guildId":"776995466302062633","track":"QAABPwIADVVua25vd24gdGl0bGUADlVua25vd24gYXJ0aXN0f/////////8Af2h0dHBzOi8vdHJhbnNsYXRlLmdvb2dsZS5jb20vdHJhbnNsYXRlX3R0cz9pZT1VVEYtOCZxPTclMjA1JnRsPXZpLVZOJnRvdGFsPTEmaWR4PTAmdGV4dGxlbj0zJmNsaWVudD10dy1vYiZwcmV2PWlucHV0JnR0c3NwZWVkPTEBAQB/aHR0cHM6Ly90cmFuc2xhdGUuZ29vZ2xlLmNvbS90cmFuc2xhdGVfdHRzP2llPVVURi04JnE9NyUyMDUmdGw9dmktVk4mdG90YWw9MSZpZHg9MCZ0ZXh0bGVuPTMmY2xpZW50PXR3LW9iJnByZXY9aW5wdXQmdHRzc3BlZWQ9MQAEaHR0cAADbXAzAAAAAAAAAAA="}
2022-04-09 01:06:02.869 ERROR 1 --- [k-1-thread-1265] c.s.d.l.t.p.LocalAudioTrackExecutor      : Error in playback of https://translate.google.com/translate_tts?ie=UTF-8&q=7%205&tl=vi-VN&total=1&idx=0&textlen=3&client=tw-ob&prev=input&ttsspeed=1
com.sedmelluq.discord.lavaplayer.tools.FriendlyException: Something broke when playing the track.
    at com.sedmelluq.discord.lavaplayer.tools.ExceptionTools.wrapUnfriendlyExceptions(ExceptionTools.java:44) ~[lavaplayer-fork-1.3.96.jar!/:na]
    at com.sedmelluq.discord.lavaplayer.track.playback.LocalAudioTrackExecutor.execute(LocalAudioTrackExecutor.java:116) ~[lavaplayer-fork-1.3.96.jar!/:na]
    at com.sedmelluq.discord.lavaplayer.player.DefaultAudioPlayerManager.lambda$executeTrack$1(DefaultAudioPlayerManager.java:348) ~[lavaplayer-fork-1.3.96.jar!/:na]
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
    at java.base/java.lang.Thread.run(Thread.java:830) ~[na:na]
    Suppressed: com.sedmelluq.discord.lavaplayer.tools.exception.EnvironmentInformation: 
  lavaplayer.version: 1.3.96-original
  os.arch: amd64
  os.name: Linux
  os.version: 5.4.0-107-generic
  java.vendor: Azul Systems, Inc.
  java.version: 13.0.2
  java.runtime.version: 13.0.2+6-MTS
  java.vm.version: 13.0.2+6-MTS
Caused by: java.lang.RuntimeException: Not success status code: 302
    at com.sedmelluq.discord.lavaplayer.tools.io.PersistentHttpStream.validateStatusCode(PersistentHttpStream.java:87) ~[lavaplayer-fork-1.3.96.jar!/:na]
    at com.sedmelluq.discord.lavaplayer.tools.io.PersistentHttpStream.attemptConnect(PersistentHttpStream.java:116) ~[lavaplayer-fork-1.3.96.jar!/:na]
    at com.sedmelluq.discord.lavaplayer.tools.io.PersistentHttpStream.connect(PersistentHttpStream.java:105) ~[lavaplayer-fork-1.3.96.jar!/:na]
    at com.sedmelluq.discord.lavaplayer.tools.io.PersistentHttpStream.internalRead(PersistentHttpStream.java:170) ~[lavaplayer-fork-1.3.96.jar!/:na]
    at com.sedmelluq.discord.lavaplayer.tools.io.PersistentHttpStream.read(PersistentHttpStream.java:186) ~[lavaplayer-fork-1.3.96.jar!/:na]
    at java.base/java.io.DataInputStream.readFully(DataInputStream.java:200) ~[na:na]
    at com.sedmelluq.discord.lavaplayer.container.mp3.Mp3TrackProvider.skipIdv3Tags(Mp3TrackProvider.java:194) ~[lavaplayer-fork-1.3.96.jar!/:na]
    at com.sedmelluq.discord.lavaplayer.container.mp3.Mp3TrackProvider.parseHeaders(Mp3TrackProvider.java:75) ~[lavaplayer-fork-1.3.96.jar!/:na]
    at com.sedmelluq.discord.lavaplayer.container.mp3.Mp3AudioTrack.process(Mp3AudioTrack.java:33) ~[lavaplayer-fork-1.3.96.jar!/:na]
    at com.sedmelluq.discord.lavaplayer.track.DelegatedAudioTrack.processDelegate(DelegatedAudioTrack.java:25) ~[lavaplayer-fork-1.3.96.jar!/:na]
    at com.sedmelluq.discord.lavaplayer.source.http.HttpAudioTrack.process(HttpAudioTrack.java:53) ~[lavaplayer-fork-1.3.96.jar!/:na]
    at com.sedmelluq.discord.lavaplayer.track.playback.LocalAudioTrackExecutor.execute(LocalAudioTrackExecutor.java:104) ~[lavaplayer-fork-1.3.96.jar!/:na]
    ... 4 common frames omitted
2022-04-09 01:06:02.870  INFO 1 --- [   XNIO-1 I/O-1] lavalink.server.io.SocketServer          : {"op":"stop","guildId":"776995466302062633"}
2022-04-09 01:06:06.452  INFO 1 --- [ XNIO-1 task-24] l.server.player.AudioLoaderRestHandler   : Got request to load for identifier "https://translate.google.com/translate_tts?ie=UTF-8&q=7%205&tl=vi-VN&total=1&idx=0&textlen=3&client=tw-ob&prev=input&ttsspeed=1"
2022-04-09 01:06:06.562  INFO 1 --- [ader-2-thread-1] lavalink.server.player.AudioLoader       : Loaded track Unknown title
2022-04-09 01:06:06.564  INFO 1 --- [   XNIO-1 I/O-1] lavalink.server.io.SocketServer          : {"op":"play","guildId":"776995466302062633","track":"QAABPwIADVVua25vd24gdGl0bGUADlVua25vd24gYXJ0aXN0f/////////8Af2h0dHBzOi8vdHJhbnNsYXRlLmdvb2dsZS5jb20vdHJhbnNsYXRlX3R0cz9pZT1VVEYtOCZxPTclMjA1JnRsPXZpLVZOJnRvdGFsPTEmaWR4PTAmdGV4dGxlbj0zJmNsaWVudD10dy1vYiZwcmV2PWlucHV0JnR0c3NwZWVkPTEBAQB/aHR0cHM6Ly90cmFuc2xhdGUuZ29vZ2xlLmNvbS90cmFuc2xhdGVfdHRzP2llPVVURi04JnE9NyUyMDUmdGw9dmktVk4mdG90YWw9MSZpZHg9MCZ0ZXh0bGVuPTMmY2xpZW50PXR3LW9iJnByZXY9aW5wdXQmdHRzc3BlZWQ9MQAEaHR0cAADbXAzAAAAAAAAAAA="}
2022-04-09 01:06:31.607  INFO 1 --- [   XNIO-1 I/O-3] lavalink.server.io.SocketServer          : {"op":"volume","guildId":"955836645838573619","volume":80}
freyacodes commented 2 years ago

302 is a redirect code. It means that lavaplayer doesn't handle redirects,, but you could try using the destination URL

phamleduy04 commented 2 years ago

I found out that returning 302 meaning lava link got rate limited by google and require to solve captcha

devoxin commented 2 years ago

This file format is handled by the HttpAudioSourceManager - a generic source manager for HTTP urls. There is no additional logic to handle website-specific blockades and the like. There is not much you can do other than to try and proxy requests.