我在 ytdl-core 包上收到 404 错误

I am getting 404 error on ytdl-core package

当我尝试在 ytdl-core 中从 YouTube 提取音乐时,控制台出现 404 错误。此错误来自 miniget 包。 ytdl-core 正在使用 miniget。

代码:

ytdl("https://www.youtube.com/watch?v=" + stream.id);

控制台:

(node:16438) UnhandledPromiseRejectionWarning: Error: Status code: 404
    at ClientRequest.<anonymous> (/rbd/pnpm-volume/59a3a74b-3917-4637-83d3-08984c5b8ec9/node_modules/.registry.npmjs.org/miniget/4.2.1/node_modules/miniget/dist/index.js:210:27)
    at Object.onceWrapper (events.js:284:20)
    at ClientRequest.emit (events.js:196:13)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:565:23)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:116:17)
    at TLSSocket.socketOnData (_http_client.js:452:22)
    at TLSSocket.emit (events.js:196:13)
    at addChunk (_stream_readable.js:290:12)
    at readableAddChunk (_stream_readable.js:271:11)
    at TLSSocket.Readable.push (_stream_readable.js:226:10)
(node:16438) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)

如何解决?

https://github.com/fent/node-ytdl-core/issues/939#issuecomment-866241199

Youtube 已更新 API,据我所知,ytdl 需要更新才能使用它。