Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid regular expression: missing / #1110

Closed
GreepTheSheep opened this issue Aug 18, 2022 · 45 comments · Fixed by #1126
Closed

Invalid regular expression: missing / #1110

GreepTheSheep opened this issue Aug 18, 2022 · 45 comments · Fixed by #1126
Labels

Comments

@GreepTheSheep
Copy link

GreepTheSheep commented Aug 18, 2022

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: #1110 (comment)

@Mikecerc
Copy link

I'm having the same problem as well. Receiving the same error as above. Everything worked fine yesterday.

@cchen028
Copy link

Experiencing same issue, getting identical stack trace as well.

@MohamedMontasser03
Copy link

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

@TaylorDuck72
Copy link

Still having same problem

@austinharms
Copy link

this solved it for me
#1108 (comment)

@Hakunek
Copy link

Hakunek commented Aug 18, 2022

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

@austinharms
Copy link

austinharms commented Aug 18, 2022

I also had the issue on version 4.10.0, and 4.9.? (I can't remember the last digit)
apparently I screwed up the downgrade when testing the different versions

@MohamedMontasser03
Copy link

this solved it for me #1108 (comment)

Not sure if that's the proper solution or not but it does work

@MidSpike
Copy link

Can reproduce: with almost all videos that I test with:

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

SyntaxError: Invalid regular expression: missing /

@PowerBuxoK
Copy link

same problem with any video

"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 Object.exports.decipherFormats (C:\DiscordBots\Botik_v2.0\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 (C:\DiscordBots\Botik_v2.0\node_modules\ytdl-core\lib\info.js:401:17)

Node.js v17.5.0```

@dskaiser82
Copy link

dskaiser82 commented Aug 18, 2022

@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!

@dskaiser82
Copy link

dskaiser82 commented Aug 18, 2022

But if we know 4.10.0 works, then we know that the PR that came after introduced a bug....so whats the PR for 4.10.1?

@dskaiser82
Copy link

@dsnsgithub on 4.10.0 its slow but downloading but will test audio when its up

@dsnsgithub
Copy link

@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.

@dskaiser82
Copy link

@dsnsgithub Good! Yean I have audio working fine too on the video below....but did take a longer than normal....I want to test another vid to see if speeds can be faster....but for now I'll take this band aid fix

https://www.youtube.com/watch?v=moiS5zDIuPM

@dskaiser82
Copy link

Yeah I think this version is slower than before, but I do like to do highest Audio, Highest Video

@gatecrasher777
Copy link
Contributor

Last week it was closing braces in strings. To confuse parsers.
This week YouTube have thrown some regex into their code spaghetti.

@WaqasIbrahim
Copy link
Contributor

Can anyone please attach base.js file that has this issue because I can't reproduce this on my end.

@gatecrasher777
Copy link
Contributor

@WaqasIbrahim sent via email

@danielsss
Copy link

I've got the same issue +1

@gatecrasher777
Copy link
Contributor

Needs exports.cutAfterJSON in util.js to skip over regex.

When it encounters

/,,[/,913,/](,)}/

as an array value in base.js it sees the } as the end of the n code function that is being parsed. So evaluation breaks.

@WaqasIbrahim
Copy link
Contributor

I just tested ncode extraction on a file @gatecrasher777 sent. The solution I suggested in the closed issue: #1108 (comment) still works.

@aymenitc
Copy link

I just tested ncode extraction on a file @gatecrasher777 sent. The solution I suggested in the closed issue: #1108 (comment) still works.

this fix is working for me 100%

@arinmodi
Copy link

downgrading the version decreases the singnificat download spped, how can i solve that ?

@CuteSkyler
Copy link

For some reason, I kept getting HTTPError [FetchError]: request to https://discord.com/api/v7/channels/[channelid]/messages failed, reason: read ECONNRESET in the new update, if it is of any help. Downgrading to ytdl-core@4.10.0 fixed it for me.

@dskaiser82
Copy link

@arinmodi Thats the state I chose, degraded version but MUCH slower download speeds.....no PR's in yet for the fix right?

@GreepTheSheep
Copy link
Author

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

@dskaiser82
Copy link

dskaiser82 commented Aug 18, 2022

@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: #1111

@LeGeek01
Copy link

same problem with any videos, I have the latest version of ytdl-core

@gatecrasher777
Copy link
Contributor

PR waiting for approval....anyone know who has PR approval/merge rights? PR: #1111

@TimeForANinja

@LeGeek01
Copy link

downgrading to 4.10.0 solved the problem for me! Waiting for a new version...

@nukeop
Copy link

nukeop commented Aug 18, 2022

Let me know if I can throw a few bucks the maintainers' way, they're doing God's work.

@ShadowLp174
Copy link

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)

@dskaiser82
Copy link

PR: #1111

We have some approvals but this is the blocker:
"First-time contributors need a maintainer to approve running workflows. Learn more.
1 successful check"

Who is a maintainer?

@ShadowLp174
Copy link

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)

Wanted to add that this can too be fixed by downgrading to 4.10.0

@gatecrasher777
Copy link
Contributor

Downgrading to 4.10.0 will mean the N transform gracefully fails. Everything will work, but downloads will be throttled.

@github-actions
Copy link

🎉 This issue has been resolved in version 4.11.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@nukeop
Copy link

nukeop commented Sep 1, 2022

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

@aymenitc
Copy link

aymenitc commented Sep 1, 2022

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

@MidSpike
Copy link

MidSpike commented Sep 1, 2022

Trace: evalmachine.<anonymous>:13
-1929233002,b,/,][};Xka(ncode);
              ^

SyntaxError: Invalid regular expression: missing /
    at new Script (node:vm:100:7)
    at Object.exports.decipherFormats (C:\hi-there-github\node_modules\ytdl-core\lib\sig.js:116:51)

@ThatGuyJacobee
Copy link

Same here receiving since about yesterday 10pm UK time:

Invalid regular expression: missing /

@aymenitc
Copy link

aymenitc commented Sep 1, 2022

Found a fix: #1111

Same solution as the previous regex errors.

@LeGeek01
Copy link

LeGeek01 commented Sep 1, 2022

yes the error come's back

@LeGeek01
Copy link

LeGeek01 commented Sep 1, 2022

and downgrading to 4.10.0 solved the problem, again

@nukeop
Copy link

nukeop commented Sep 1, 2022

Is it throttled though?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet