1
votes

At last week ytdl has broken. I didn't change anything in my code. But now is outputing "could not find player config"

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

Who's know how to fix it? Or does ytdl have analogues?

EDIT : When i try to use ytdl's function, that responding to me "could not find player config". Few days ago, that function does work, but after npm install that doesn't I'm using that for music bot on discordjs

1
"Does not work anymore" is not enough information, nor have you provided enough context or code to help you out. We need to know what your intended behavior isElitezen
@Elitezen has editedIhor

1 Answers

2
votes

I had the same error, I don't know what's caused it, but what I did was uninstall it and reinstall it, now it works fine. Use:

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