【问题标题】:YTDL-CORE doesn't work anymore "could not find player config"YTDL-CORE 不再工作“找不到播放器配置”
【发布时间】:2020-10-31 00:12:03
【问题描述】:

上周 ytdl 中断了。我没有更改代码中的任何内容。但是现在正在输出“找不到播放器配置”

async function Play(connection,message)
{
  try {
    message.channel.send(`**${queue[0].title}** ${data.startMusicMsg}\n${queue[0].url}`)
    dispatcher = connection
    .play(await ytdlD(queue[0].url), {type:'opus', filter: 'audioonly',maxRedirects: 2,range:{start: 10355705, end: 12452856}})
    .on("finish",()=>{
        queue.shift()
        fs.writeFile('./data/queue.json',JSON.stringify(queue),'utf8',(err) => {if (err) console.log(err);}) 
        if(queue[0]!=null)
        {
            Play(connection,message)
        }
        else
        {
            message.channel.send(`**${data.queueEndMsg}**`)
            if(message.guild.me.voice.channel!=null) message.guild.me.voice.channel.leave()  
        }
    })
  } catch (error) {
    console.log(error)
  }
}

谁知道如何解决它?或者 ytdl 有类似物吗?

编辑: 当我尝试使用 ytdl 的功能时,响应我“找不到播放器配置”。几天前,该功能确实有效,但在 npm install 之后却没有 我在 discordjs 上将它用于音乐机器人

【问题讨论】:

  • “不再工作”信息不够,您也没有提供足够的上下文或代码来帮助您。我们需要知道您的预期行为是什么

标签: javascript node.js discord.js


【解决方案1】:

我有同样的错误,我不知道是什么原因造成的,但我所做的是卸载它并重新安装它,现在它可以正常工作了。使用:

npm uninstall ytdl-core
npm uninstall ytdl-core-discord
npm install ytdl-core
npm install ytdl-core-discord

【讨论】:

    猜你喜欢
    • 2018-07-27
    • 1970-01-01
    • 2020-03-31
    • 2018-12-21
    • 2015-09-20
    • 2018-05-09
    • 1970-01-01
    • 2023-04-05
    • 2018-04-13
    相关资源
    最近更新 更多