node-ytdl-core: Invalid regular expression: missing /

Since 1 or 2 hours, all videos passed on ytdl-core return this “Invalid regular expression” error

Stack trace:

evalmachine.<anonymous>:11
"mfZru","cfYAzm",1897615910,414154674,"IluoVc5",null,1,"XsmT",-659785013,577478260,-419211961,1087899650,/,,[/,913,/](,)};Wka(ncode);
                                                                                                         ^

SyntaxError: Invalid regular expression: missing /
    at new Script (node:vm:100:7)
    at exports.decipherFormats (D:\Documents\GitHub\ReAllToMP3\node_modules\ytdl-core\lib\sig.js:116:51)
    at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Promise.all (index 0)
    at async exports.getInfo (D:\Documents\GitHub\ReAllToMP3\node_modules\ytdl-core\lib\info.js:401:17)

ytdl-core version: 4.11.0

Edit: Temporary fix linked here: https://github.com/fent/node-ytdl-core/issues/1110#issuecomment-1219856316

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 35
  • Comments: 45 (7 by maintainers)

Most upvoted comments

They’re at it again, it stopped working just today.

Today I’m get the same error again : Invalid regular expression: missing /

🎉 This issue has been resolved in version 4.11.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

This error message just sudenly changed… yesterday it was the invalid regex, now it’s something new:

evalmachine.<anonymous>:24
c[72],c[6]),(0,c[85])(c[11]),(0,c[41])(c[39],c[28],(0,c[66])()),(0,c[78])(c[Math.pow(6,2)+122+-119],c[new Date("Wednesday December 31 1969 19:00:1
4 CDT")/1E3])}catch(d){(0<c[0]||(((0,c[80])(c[60],c[88]),c[80])(c[21],c[88]),0))&&(0,c[17])((0,c[70])(c[6]),c[78],c[88],c[12])}try{2<c[91]&&(1<c[5
3]?(0,c[17])((0,c[80])(c[82],c[6]),c[78],c[39],c[5]):((0,c[45])(c[49],c[88]),c[78])(c[88],c[86])),(0,c[17])((0,c[85])(c[31]),c[41],c[88],c[75],(0,
c[35])())}catch(d){}};Wka(ncode);




                    ^

SyntaxError: Missing catch or finally after try
    at new Script (node:vm:100:7)
    at Object.exports.decipherFormats (D:\JS\revolt butler\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 (D:\JS\revolt butler\node_modules\ytdl-core\lib\info.js:401:17)

@GreepTheSheep Good stuff! I took the fix one step further and did a Pull Request so we can get this fix in. GreepTheSheep this PR is just that one commit u had for the fork

PR waiting for approval…anyone know who has PR approval/merge rights? PR: https://github.com/fent/node-ytdl-core/pull/1111

Okay I am trying to figure out the problem but this is my first time working with the source code of this project and with the youtube cipher algorithm so it’s taking a while anyways I’ve narrowed the problem down to a problem with evaluating nTransformScript because the code returned from youtube is for some reason broken, that’s the conclusion I reached

@austinharms I went into package.json changed the version to “ytdl-core”: “4.10.0”

deleted my node modules and ran yarn (yarn for me)

I’m back!

Holy shit I was about to wipe my system because this week I had some pc malware issues I solved. But when in doubt CHECK the GITHUB! I was that close…thanks to everyone for the comments…

I skew front-end but hoping devs solve the issue!

If you need to use it rn and don’t want to/can’t tinker inside module downgrade to version 4.10.0 npm command: npm i ytld-core@4.10.0 only versions 4.10.1+ gave me this error during testing

Found a fix: #1111

Same solution as the previous regex errors.

Made a fork of the temporary fix here: https://github.com/GreepTheSheep/node-ytdl-core

You can add it on your package.json with npm npm i ytdl-core@https://github.com/GreepTheSheep/node-ytdl-core

@WaqasIbrahim sent via email

@dskaiser82 Thank you, your fix works. ytdl-core@4.10.0 seems to be working while ytdl-core@4.11.0 seems to have a problem with dependences.