markokajzer / discord-soundbot

A Soundboard Bot for Discord
MIT License
191 stars 68 forks source link

Cannot add sounds from youtube video's #168

Open cooletijdgast opened 1 year ago

cooletijdgast commented 1 year ago

Whenever I try to do !add \<name> \<link> it doesn't work and I get this error message in the logs;

SyntaxError: Missing catch or finally after try
    at new Script (node:vm:100:7)
    at Object.exports.decipherFormats (/app/node_modules/ytdl-core/lib/sig.js:116:51)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Promise.all (index 0)
    at async exports.getInfo (/app/node_modules/ytdl-core/lib/info.js:401:17)
Emitted 'error' event on PassThrough instance at:
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
error Command failed with exit code 1.
evalmachine.<anonymous>:25
[])||(0,c[2])((0,c[45])((0,c[25])(c[21],c[55],(0,c[11])()),c[2],(0,c[86])(c[55],c[53]),c[13],c[77],c[27]),c[52],c[62],c[74]),1==c[43]&&((0,c[45])((0,c[2])((0,c[13])(c[65+Math.pow(3,2)%391],c[85]),c[78],c[35],c[68]),c[2],((0,c[76])(c[3],c[77]),c[40])(c[77]),c[40],c[87]),1)||(((((0,c[13])(c[87],c[65]),c[52])(c[46],c[Math.pow(5,3)%149+-51]),c[47])(c[63],c[1]),c[62])(c[50],c[18]),c[28])(c[56],c[50])};lma(ncode);

I first got an error saying:

 WARNING: ytdl-core is out of date! Update with "npm install ytdl-core@latest".

I updated the package but still doesn't work. Adding sounds with the mp3 file still works.

cooletijdgast commented 1 year ago

I fixed the issue. Before I updated all the packages with npm update, but that caused for only more problems. So now I manually changed the version of ytld-core to 4.11.3 and then created a new docker image, in which the adding via youtube links does work.

markokajzer commented 1 year ago

Thanks for the hint. I'll update ytdl-core and we need to make sure to get notified of new versions so we can upgrade consistently.

markokajzer commented 1 year ago

Upgraded ytdl-core to 4.11.4 and confirmed downloading works by running !add doh https://www.youtube.com/watch?v=OCmuATH2yzo

Let me know if anything else is fishy.

MatWise commented 2 months ago

Seems like the yt download is broken again. Could you update the dependencies?

markokajzer commented 4 days ago

you know what was also broken? the dependabot task to automatically update ytdl-core 💀

I put package-ecosystem: "npm" when the project was using yarn 💀 💀 💀

I'll bump the version after a few other tasks, like switching to npm instead of yarn 👍

markokajzer commented 4 days ago

Although... the only version update is from July 2023 (see https://github.com/fent/node-ytdl-core/pull/1242), whereas this was reported in April.

i'll upgrade the version and see if this fixes anything