Score:0

VPS Discord.js Music Bot 410 Error

xk flag

i trying download youtube video and i getting error 410 have someone idea how to fix that i using version 20.04

for downloading i using nodes

code:

    const fs = require('fs'); 
    const ytdl = require('ytdl-core');
    
    const stream = ytdl('https://www.youtube.com/watch?v=uVdEvxUlU0s', { filter: 'audioonly' }).pipe(fs.createWriteStream('video.mp3'));
    
    console.log('Starting Download');
    
    stream.on('data', chunk => {
      console.log('downloaded', chunk.length);
    });
    
    stream.on('error', err => {
      console.error(err);
    });
    
    stream.on('end', () => {
      console.log('Finished');
    });

Log:

Starting Download
/root/youtube/node_modules/miniget/dist/index.js:206
                let err = new Miniget.MinigetError(`Status code: ${res.statusCode}`, res.statusCode);
                          ^

MinigetError: Status code: 410
    at ClientRequest.<anonymous> (/root/youtube/node_modules/miniget/dist/index.js:206:27)
    at Object.onceWrapper (node:events:628:26)
    at ClientRequest.emit (node:events:513:28)
    at HTTPParser.parserOnIncomingClient (node:_http_client:701:27)
    at HTTPParser.parserOnHeadersComplete (node:_http_common:119:17)
    at TLSSocket.socketOnData (node:_http_client:542:22)
    at TLSSocket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:324:12)
    at readableAddChunk (node:internal/streams/readable:297:9)
    at Readable.push (node:internal/streams/readable:234:10)
Emitted 'error' event on PassThrough instance at:
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  statusCode: 410
}

Node.js v18.15.0
David avatar
cn flag
Did you look up HTTP 410 error? An educated guess is they are blocking your download.
Kubadesek avatar
xk flag
yes and i didint find nothing maybe i will tried request for change location or IP or i dont know
ru flag
HTTP 410 means "Gone" - to be interpreted as "The target resource you're fetching used to exist here, but is no longer here, and this is a permanent condition", Mozilla describes it as: "The HTTP 410 Gone client error response code indicates that access to the target resource is no longer available at the origin server and that this condition is likely to be permanent." (https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/410). I would suggest that whatever tool you're using to pull data from YouTube is busted, and you need to talk to the developer of the tool (MiniGet it seems) for help
David avatar
cn flag
You may find the info on this site interesting. https://multimedia.easeus.com/video-download/cant-download-youtube-videos.html#:~:text=According%20to%20YouTube's%20Terms%20and,the%20more%20ads%20they%20see.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.