如何使用 ytdl 和 opusscript 修复此错误?

问题描述

我尝试在以下代码中运行我的不和谐机器人:

var info = await YTDL.getInfo(this.#channels.getMusic(guild).link,{lang: "ru"});
var format = YTDL.chooseFormat(info.formats,{quality: "highestaudio"});
this.#channels.getMusic(guild).name = this.#getName(info);
info.formats = [format];

var connection = this.#getConnection(guild);
if(connection == null)
    return;

var dispatcher = connection.play(YTDL.downloadFromInfo(info),{type: "webm/opus",bitrate: format.audioBitrate,volume: guild.volume*this.#settings.volume});

this.#channels.changeMusic(guild,1);

//this.#channel.getAnnouncment(guild).infoEmbed();

return new Promise((resolve,reject) => dispatcher.on("finish",resolve));

出现这个错误

***some trash in error***
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
Error: Did not find the EBML tag at the start of the stream
    at WebmDemuxer._readTag (C:\Works\Bots\Bots\node_modules\prism-media\src\core\WebmBase.js:106:18)
    at WebmDemuxer._transform (C:\Works\Bots\Bots\node_modules\prism-media\src\core\WebmBase.js:45:21)
    at WebmDemuxer.Transform._read (_stream_transform.js:205:10)
    at WebmDemuxer.Transform._write (_stream_transform.js:193:12)
    at writeOrBuffer (_stream_writable.js:352:12)
    at WebmDemuxer.Writable.write (_stream_writable.js:303:10)
    at Passthrough.ondata (_stream_readable.js:719:22)
    at Passthrough.emit (events.js:315:20)
    at addChunk (_stream_readable.js:309:12)
    at readableAddChunk (_stream_readable.js:284:9)

我尝试播放其他音乐视频。部分有效,但经过实验后没有任何效果。一段时间后,它再次起作用。也许我在这代码中搞错了?
如何解决

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)