VPS Discord.js Music Bot Ошибка 410

Я пытаюсь загрузить видео с YouTube и получаю ошибку 410. Кто-нибудь знает, как это исправить? Я использую версию 20.04.

для загрузки я использую узлы

код:

          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');
    });

Бревно:

      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

0 ответов

Другие вопросы по тегам