gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-04 12:29:00 28 4
gpt4 key购买 nike

当我尝试在 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 需要更新才能使用它。

关于node.js - 我在 ytdl-core 包上收到 404 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68100855/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com