-
Notifications
You must be signed in to change notification settings - Fork 804
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Status code: 416 #659
Comments
I've seen this a few times. but have yet to be able to consistently get it myself. |
I've noticed fiddling with the highWaterMark value can prevent it for me, though it causes other issues. |
Yeah using lower highWaterMark values causes 416 for me but using higher values prevents it. I haven't seen any 416 after increasing it. |
if you're passing a |
tried with a 1024kb highWaterMark, but I still have the issue |
still with 1024kb, every videos with a length above 5-6 mins drop around 1 or 2 minutes before the end |
I'm making a music discord bot, and this is a very annoying issue. I'm having it with about half of all the songs I play. The music jumps around, and then throws this error. This is my code. let dispatcher = connection.play(ytdl(url, {filter: "audioonly"})); What I'm reading here, is that this is a range issue, but I'm not using any custom range, so ytdl-core does this by itself. Is there maybe a way that I can force it to use a lower range, so my music bot just stays working? Edit: I went as far back as version
Second edit: I was thinking, there can only be two reasons, because I never had problems before, and I even tried the same version.
|
ytdl-core uses miniget to download videos. it has a feature for retrying to download a video with a ranged request if the connection drops halfway. I'm guessing the error lies somewhere around there. |
I had a similar issue. My problem was that i close the writestream, to which i pipe the download, in the 'finish' event. Maybe it could help someone. And i'm using 8mb highwaterMark and got problems till now. |
for those that keep getting this error, can you log the requests miniget makes? just add a |
for those that get the error, do you know what formats it happens on? another thing you can try, there was recently a change that chunks downloads for certain formats, you can try enabling that for all formats and see if you still get the error. to enable it, change this line to const shouldBeChunked = true; |
Hi, I have exactly the same problem : I put the "console.log(url)" as you asked for : Then I played a 5:40 youtube song with this link : https://www.youtube.com/watch?v=zUwEIt9ez7M The first log output is :
After some time the console output that with the crash at the end :
The "const shouldBeChunked = true;" line doesn't fix the problem. |
Hey, there! const onRequestError = (err, statusCode) => {
// if (!retryRequest({ err, statusCode })) {
// stream.emit('error', err);
// }
}; |
Also having a problem with this. Now I am adding an error listener onto the stream object attached to the broadcasters -the same one that is attached a working finish listener- and it isn't even catching. It just logs that there is an uncaught 416.
I just manually told the stream to emit an error and nothing happend at all. edit: Yep, I switched from ytdl-core-discord back to ytdl-core and it emitted an error when it was supposed to. |
same error
|
I have the same error
|
I think everyone knows that there is an issue and that it affects many people. Should we create an issue at miniget or is this something ytdl-core needs to fix? |
let's keep this open here for now until we figure out the cause |
is there another lib that does the same as ytdl? |
same issue
|
I fixed this problem by using: ytdl(url, { highWaterMark: 1 << 25 }) I hope this helps. |
its not really a (good)fix as it makes resources(dl, ram, cpu) go brrrrr |
Does this mean that the highwatermark is the final fix? |
fixed on latest, not due to |
Still having this issue. Would like to see a fix, but I'm using highwatermark for now. |
I'm also getting this error: |
@fent @Frontesque @wawahuy |
I have latest ytdl-core
`events.js:287
throw er; // Unhandled 'error' event
^
Error: Status code: 416
at ClientRequest. (E:\KrzysBot\node_modules\discord-ytdl-core\node_modules\miniget\dist\index.js:157:27)
at Object.onceWrapper (events.js:417:26)
at ClientRequest.emit (events.js:310:20)
at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:596:27)
at HTTPParser.parserOnHeadersComplete (_http_common.js:119:17)
at TLSSocket.socketOnData (_http_client.js:469:22)
at TLSSocket.emit (events.js:310:20)
at addChunk (_stream_readable.js:286:12)
at readableAddChunk (_stream_readable.js:268:9)
at TLSSocket.Readable.push (_stream_readable.js:209:10)
Emitted 'error' event on PassThrough instance at:
at PassThrough. (E:\KrzysBot\node_modules\discord-ytdl-core\node_modules\ytdl-core\lib\index.js:137:14)
at PassThrough.emit (events.js:310:20)
at ClientRequest. (E:\KrzysBot\node_modules\discord-ytdl-core\node_modules\miniget\dist\index.js:162:28)
at Object.onceWrapper (events.js:417:26)
[... lines matching original stack trace ...]
at addChunk (_stream_readable.js:286:12)
[nodemon] app crashed - waiting for file changes before starting...`
The text was updated successfully, but these errors were encountered: