node-ytdl-core: Unable to retrieve video metadata
Stack trace:
Error: Error parsing info: Unable to retrieve video metadata
at getWatchPage (/home/csanad/SektorMusicEris/node_modules/ytdl-core/lib/info.js:77:13)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async exports.getBasicInfo (/home/csanad/SektorMusicEris/node_modules/ytdl-core/lib/info.js:86:22)
at async Map.getOrSet (/home/csanad/SektorMusicEris/node_modules/ytdl-core/lib/cache.js:24:19)
at async exports.getInfo (/home/csanad/SektorMusicEris/node_modules/ytdl-core/lib/info.js:210:14)
at async Map.getOrSet (/home/csanad/SektorMusicEris/node_modules/ytdl-core/lib/cache.js:24:19)
Code snippet:
serverQueue.connection.play(ytdl(song.url, {
filter: "audioonly",
quality: "highestaudio"
})
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 10
- Comments: 50 (3 by maintainers)
I think i fixed the issue. I was accidentally using
ytdl-core-discord
instead ofytdl-core
as well. Make sure you are using the correct package.ytdl-core-discord
is usingytdl-core
but is more unstable. So, here’s my solution path:Eventually you’ll have to fix parts of your code too. (I had to fix some stuff with opus) Hope this helps.
Rolled back to 4.0.3 to fix issue. Works fine for now. (discord.js + ytdl-core). Are you sure that you rollbacked correctly?
I wish you find a great fix for yourself
Heyo guys!
I think I found some solution, which is simply updating dependencies. I used ‘npm uninstall discord.js opusscript ytdl-core’ then did ‘npm install discord.js opusscript ytdl-core’ and now my bot seems to work fine again - lets hope this will last long…
Apparently, ytdl-core went from v4.0.0 to v4.0.3 to even v4.1.0. Meanwhile, discord.js went from v12.4.1 to v12.5.1 for me. Opusscript remained v0.0.7 after all. Updated opusscript nonetheless because it’s part of the entire thing.
This method worked perfectly for me.
your stack trace shows ytdl-core-discord using their own version of ytdl-core