evobot icon indicating copy to clipboard operation
evobot copied to clipboard

Bug: SyntaxError when trying to send a YouTube link to the bot

Open salut-c-leo opened this issue 2 years ago • 4 comments

Describe the bug When I try to bring the bot in a voicecall with !p [youtube link], the bot sends a message saying an error happened during the execution of the command. Looking at the logs, these errors come up:

Aug 11 22:18:27 [server] npm[6010]: evalmachine.<anonymous>:339
Aug 11 22:18:27 [server] npm[6010]: rma=function(a,b,c,d){var e=null;switch(b){case "JSON":try{var f=c.responseText}catch(h){throw d=Error("Error reading responseText"),d.params=a,bu(d),h;}a=c.getResponseHeader("Content-Type")||"";f&&0<=a.indexOf("json")&&(")]};Yka(ncode);
Aug 11 22:18:27 [server] npm[6010]:

                   ^^^^^^^^^^^^^^^^
Aug 11 22:18:27 [server] npm[6010]: SyntaxError: Invalid or unexpected token
Aug 11 22:18:27 [server] npm[6010]:     at new Script (node:vm:100:7)
Aug 11 22:18:27 [server] npm[6010]:     at Object.exports.decipherFormats (/home/user/evobot/node_modules/ytdl-core/lib/sig.js:116:51)
Aug 11 22:18:27 [server] npm[6010]:     at processTicksAndRejections (node:internal/process/task_queues:95:5)
Aug 11 22:18:27 [server] npm[6010]:     at async Promise.all (index 0)
Aug 11 22:18:27 [server] npm[6010]:     at async exports.getInfo (/home/user/evobot/node_modules/ytdl-core/lib/info.js:401:17)

How To Reproduce Steps to reproduce the behavior:

  1. Send a youtube link to the bot.
  2. Bot throws an error and doesn't play the video.

Expected behavior The bot should play the video.

Environment (add if possible)

  • Node.js version: 18.7.0
  • Evobot version: commit 3a83f3d

salut-c-leo avatar Aug 11 '22 20:08 salut-c-leo

Can confirm I am also affected by this error.

rma=function(a,b,c,d){var e=null;switch(b){case "JSON":try{var f=c.responseText}catch(h){throw d=Error("Error reading responseText"),d.params=a,bu(d),h;}a=c.getResponseHeader("Content-Type")||"";f&&0<=a.indexOf("json")&&(")]};Yka(ncode);
2022-08-11T20:50:15.815774+00:00 app[worker.1]:                                                                                                                                                                                                                              ^^^^^^^^^^^^^^^^
2022-08-11T20:50:15.815774+00:00 app[worker.1]: 
2022-08-11T20:50:15.815775+00:00 app[worker.1]: SyntaxError: Invalid or unexpected token
2022-08-11T20:50:15.815775+00:00 app[worker.1]:     at new Script (node:vm:100:7)

nikosszzz avatar Aug 11 '22 20:08 nikosszzz

i dont know where to add the API

SmaDababaXor avatar Aug 11 '22 21:08 SmaDababaXor

Resolved for me now. Could have been a short YouTube issue with YTDL.

nikosszzz avatar Aug 12 '22 20:08 nikosszzz

There was an issue with ytdl-core name resolution yesterday around noon. Fortunately, the problem was resolved a few hours ago

MatchaOnMuffins avatar Aug 13 '22 02:08 MatchaOnMuffins

Same problem today, tried the last version of evobot and same...

razeNFR avatar Aug 18 '22 14:08 razeNFR

36ef0c282b6557f338843f3c79ee9e6a90205f3a

Reinstall your npm packages to get the fix

eritislami avatar Aug 21 '22 14:08 eritislami