URL Audio Resource Streaming Stopped Working
idk whats going on so maybe one of you can help... my bot has been broken for a few months I thought it was broken because of the URL changes but no URL seems to work only local files
it says it started playing and immediately stops
I don't hear anything though
14 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!it seems like the bot gives up immediately when the audio player enters the buffer state
My work run for now is to use axios to download the file before playback to a temp dir and then it plays perfectly fine every single time
The code, please
I have the code with the workarround but I can write a simplified new bot demonstrating the issue
it just seems to happen with the URL as a resource... something that used to work
I had an issue that for some reason streams would abort randomly on URL
& FFmpeg give errors
So my fix was to create a PassThrough stream
Manually write & end & handle errors
And pass that stream to djs
In the case of https only, making a https.get and passing the req/res worked
I used to be able to pass the URL directly to create audio resource before version 16
Ehh, passing streams is more reliable
Working for me thanks :maitre38Poutiblagueur:
:blobguns:
:maitre38Leocheers:
I am unsure why this happens, may be something to their internal code
Yeah that's what I thought because that's happening only on linux, on windows that works perfectly fine
True? Weird (I don't use Windows, so never saw it working)
Well, this is a good workaround at least
Yep