-
Notifications
You must be signed in to change notification settings - Fork 805
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: 410 #985
Comments
Its seems that this error is similar too 404 error so you can simple try to use cookie . Also try to play this video https://www.youtube.com/watch?v=dmJefsOErr0 (is a age restricted video ) and reply here the results |
import { getURLVideoID, getInfo, validateURL, downloadFromInfo } from 'ytdl-core'
import yts from 'yt-search'
/*
Age restriction information is reported only after the error, if the restriction is active, I will never know that the error was
caused by the restriction.
*/
(async () => {
try {
const video = (await yts(search)).videos.slice(0, 3)[0]
const videoId = getURLVideoID('https://www.youtube.com/watch?v=dmJefsOErr0') // restricted video
const info = await getInfo(videoId) // The error happens on this line due to the age restriction
if (video.seconds > 300) {
msg.reply('Escolha outro vídeo, esse é muito grande.')
return
}
// this alert message about the age restriction
info.videoDetails.age_restricted && msg.reply('⚠️Aviso! Esse vídeo tem restrição de idade!')
console.log(info)
} catch (err) {
console.log(err) // output MinigetError Status code 410
}
})()
// https://www.youtube.com/watch?v=YVJijQIualA , an unrestricted video has the normal output like this:
author: {
id: 'UCxVxcprt9bqQQ-95sMLLRoQ',
name: 'Midas Music',
user: 'MidasBrasil',
channel_url: 'https://www.youtube.com/channel/UCxVxcprt9bqQQ-95sMLLRoQ',
external_channel_url: 'https://www.youtube.com/channel/UCxVxcprt9bqQQ-95sMLLRoQ',
user_url: 'http://www.youtube.com/user/MidasBrasil',
thumbnails: [Array],
verified: false,
subscriber_count: 3140000
},
isPrivate: false,
isUnpluggedCorpus: false,
isLiveContent: false,
media: {
song: 'O Sol',
category: 'Music',
category_url: 'https://music.youtube.com/',
artist: 'Vitor Kley',
'licensed to youtube by': 'UMPI, UNIAO BRASILEIRA DE EDITORAS DE MUSICA - UBEM, LatinAutorPerf, UMPG Publishing, BMI - Broadcast Music Inc., LatinAutor - UMPG, and 6 Music Rights Societies'
},
likes: 2527089,
dislikes: 86030,
age_restricted: false,
video_url: 'https://www.youtube.com/watch?v=YVJijQIualA',
storyboards: [ [Object], [Object], [Object] ],
chapters: [],
thumbnails: [ [Object], [Object], [Object], [Object], [Object] ]
},
|
Try to use cookie https://github.com/fent/node-ytdl-core/blob/master/example/cookies.js ( here official example ). Here an community example #980 (comment) |
Having the same issue. Happens with specific videos on certain devices. IE, locally, it's fine but on a Google Cloud Run instance, throws the error. |
I have the same issue. When I have to play an age restricted video my discord bot crashes. tried the cookie example but it still won't work. Can anybody please help. |
All the videos are returning me this error |
same here, with the example from README.md |
same here, any solution? |
also getting this error for many videos. Restarting my app will often resolve the issue, but I'm not sure what to do other than that. |
I get the error as well on an age-restricted video, even with all the cookies and identity tokens in place |
Yes. Restarting will often get the request working again which suggests it's a bug or missing feature. Can anyone investigate? @fent |
I also have the problem with age-restricted videos with the .getBasicInfo() function. The problem is, there is no way to check if they are age restricted because checking them will get you the error. You can prevent the crash with a try ... catch statement. |
If you guys just want to download the mp3 file only. Good luck! |
For anyone who needs a simple implementation of the above fallback solution, here is mine:
|
Still having this error. Seems to be kinda random for me, restarting the application often helps. I also have the error with the age restricted video. |
I'm getting this error when playing Youtube-music video. Also, inside ytdl-core/index.js returns status: 'UNPLAYABLE', |
Getting this issue randomly in my ec2 instance with aws.. no cookies or headers. |
@leon20121005 i switched my queue to a new redis instance and that got it working. seems like after a certain amount of requests could be youtube is rate limiting.. |
@nikolaigeorgie Well... I just added error handlings without changing its functionality and got it working too lol. |
switched to https://www.npmjs.com/package/youtube-dl-exec ... good alternative |
youtube-dl-exec package behaves much slower than this package.. sigh , oh miniget ... lol |
Could you tell me how you handled those errors please? I started getting this error last night and I can't fix it, I'm hosting my bot on Heroku |
@nicocespede i have no solution to this issue yet. i've switched to https://www.npmjs.com/package/youtube-dl-exec for now |
should be fixed with #1022 |
MinigetError: Status code: 410
at ClientRequest. (/app/node_modules/miniget/src/index.ts:257:19)
at Object.onceWrapper (events.js:520:26)
at ClientRequest.emit (events.js:400:28)
at ClientRequest.emit (domain.js:470:12)
at HTTPParser.parserOnIncomingClient (_http_client.js:647:27)
at HTTPParser.parserOnHeadersComplete (_http_common.js:126:17)
at TLSSocket.socketOnData (_http_client.js:515:22)
at TLSSocket.emit (events.js:400:28)
at TLSSocket.emit (domain.js:470:12)
at addChunk (internal/streams/readable.js:290:12) {
statusCode: 410
}
The text was updated successfully, but these errors were encountered: