-
Notifications
You must be signed in to change notification settings - Fork 723
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
MinigetError: Status Code 403 #932
Comments
Me too |
me too 😔 |
|
nope . |
did some testing a while back... |
Hey , yes this might be the problem , becouse happen to me when I play a long playlist |
@TimeForANinja |
Any updates? I'm getting this error quite constantly, the most problematic part is that it crashes the whole application, you can try to reproduce it in my FelicityBot repository, right now I changed the ytdl dependency to ytdl-discord, but this problem continues regardless. I can get this error quite constantly using this playlist that I created to "stress-test", so it is the same video over and over again. Error: Status code: 403
at ClientRequest.<anonymous> (/home/akat/projetos/FelicityBot/node_modules/miniget/src/index.ts:258:17)
at Object.onceWrapper (events.js:482:26)
at ClientRequest.emit (events.js:375:28)
at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:647:27)
at HTTPParser.parserOnHeadersComplete (_http_common.js:126:17)
at HTTPParser.execute (<anonymous>)
at TLSSocket.socketOnData (_http_client.js:515:22)
at TLSSocket.emit (events.js:375:28)
at addChunk (internal/streams/readable.js:290:12)
at readableAddChunk (internal/streams/readable.js:265:9)
[ERROR] 14:49:49 Error: Status code: 403 |
I made a way to not crash my bot for anyone that needs it. the thing is that: const stream = await ytdl(url, {
quality: 'highestaudio',
filter: 'audioonly',
requestOptions: {
headers: {
cookie: process.env.YOUTUBE_LOGIN_COOKIE,
},
},
});
const audioResource = createAudioResource(stream, {
inputType: StreamType.Opus,
});
this.player.play(audioResource); when you play this stream no try catch can catch the error because the stream is asynchronous what I did is this, after the play method: const funcao = stream.listeners('error')[2];
stream.removeListener('error', funcao);
stream.on('error', (err) => {
try {
throw new Error();
} catch {
stream.destroy();
console.log(err);
}
}); This removes the last listener that the stream have, which is the one that breaks our bot, then add our own listener to handle that error. You could remove all error listeners too. This is the best I could came up with for now. |
any updates? I'm getting this error randomly and it's very frustrating. I've read here that it could be because of fetching the info some time before it actually gets used but I don't really understand how can that affect me as I only fetch video URLs in this format: |
I am getting this same error with my discord music bot, last time it crashed it was playing a looped song and crashed about 40 minutes into replaying the looped song. However other times it will crash first time playing anything. Gonna try adding own error listeners to not crash it |
I'm also getting this error on random videos |
Same here 😢 |
Same problem here. |
Just got the same error :( |
Still don't know how to bypass this without making my discord bot stop playing. |
You can listen for the player error event, inside check if the error contains the 403 code and if so, try playing again the song. Sometimes it doesn't return the same error, other times you have to try playing the song like 4 times until it plays without the error. You can also play the song using youtube-dl after the error. |
it's not work.. currently I only getting 403 error. Can't play music..
|
Apparently this is a youtube related problem, I don't think devs can fix this, sure there is a workaround, but it's the right way? |
should be fixed with #1022 |
any update? i still got this error |
Still getting the same error: Anyupdate? |
any update? i still got this error when i run on firebase cloud function |
For some videos the stream will error out with this.
The last stream this occurred with was for this video https://www.youtube.com/watch?v=3_V_2BFWahc
MinigetError: Status code: 403
2021-06-03T03:07:10.828678436Z at ClientRequest. (/home/site/wwwroot/node_modules/miniget/dist/index.js:210:27)
2021-06-03T03:07:10.828685936Z at Object.onceWrapper (events.js:422:26)
2021-06-03T03:07:10.828690636Z at ClientRequest.emit (events.js:315:20)
2021-06-03T03:07:10.828695736Z at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:641:27)
2021-06-03T03:07:10.828700736Z at HTTPParser.parserOnHeadersComplete (_http_common.js:126:17)
2021-06-03T03:07:10.828721136Z at HTTPParser.execute ()
2021-06-03T03:07:10.828726036Z at TLSSocket.socketOnData (_http_client.js:509:22)
2021-06-03T03:07:10.828730036Z at TLSSocket.emit (events.js:315:20)
2021-06-03T03:07:10.828733836Z at addChunk (_stream_readable.js:309:12)
2021-06-03T03:07:10.828737836Z at readableAddChunk (_stream_readable.js:284:9) {
2021-06-03T03:07:10.828741836Z statusCode: 403
2021-06-03T03:07:10.828745736Z }
I'm also just calling ytdl like this to get the stream
It seems to happen randomly and I can't seem to reproduce the error. I'm on the latest version though and it seems there was an older thread #417 but that was closed a while ago
The text was updated successfully, but these errors were encountered: