node-ytdl-core icon indicating copy to clipboard operation
node-ytdl-core copied to clipboard

SyntaxError: Invalid or unexpected token

Open tnluan opened this issue 1 year ago • 8 comments

2023-09-07 03:22 +00:00: 2023-09-07 03:22 +00:00: SyntaxError: Invalid or unexpected token 2023-09-07 03:22 +00:00: at new Script (vm.js:102:7) 2023-09-07 03:22 +00:00: at exports.decipherFormats (/root/api/source/node_modules/ytdl-core/lib/sig.js:116:51) 2023-09-07 03:22 +00:00: at runMicrotasks () 2023-09-07 03:22 +00:00: at processTicksAndRejections (internal/process/task_queues.js:95:5) 2023-09-07 03:22 +00:00: at async /root/api/source/server/boot/root.js:25:20 2023-09-07 03:22 +00:00: evalmachine.:426 2023-09-07 03:22 +00:00: Ama=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,oC(d),h;}a=c.getResponseHeader("Content-Type")||"";f&&0<=a.indexOf("json")&&(")]};Ila(ncode); 2023-09-07 03:22 +00:00: ^^^^^^^^^^^^^^^^ 2023-09-07 03:22 +00:00:

tnluan avatar Sep 07 '23 03:09 tnluan

I solve the problem by updating the sig.js code by this Pr that I had already done https://github.com/khlevon/node-ytdl-core/blob/fix/youtube-issue-2/lib/sig.js

PR https://github.com/fent/node-ytdl-core/pull/1217

eduardommelo avatar Sep 07 '23 03:09 eduardommelo

I fixed this issue by downgrading to 4.10.0 by using npm i [email protected]

Garima-sharma814 avatar Sep 07 '23 07:09 Garima-sharma814

I fixed this issue by downgrading to 4.10.0 by using npm i [email protected]

Worked for me too ! waiting the PR to be approved

helloworld9912 avatar Sep 07 '23 09:09 helloworld9912

[email protected]

This worked for me.

priyam-raj avatar Sep 07 '23 11:09 priyam-raj

I fixed this issue by downgrading to 4.10.0 by using npm i [email protected]

This worked for me. but download speed is very low

ashwaniappsq avatar Sep 08 '23 07:09 ashwaniappsq

I fixed this issue by downgrading to 4.10.0 by using npm i [email protected]

This worked for me.

It didn't work for me either.

luccabassoli avatar Sep 09 '23 14:09 luccabassoli

This worked for me. but download speed is very low

This solution should solve your download bottleneck problem: https://github.com/fent/node-ytdl-core/issues/1252#issuecomment-1734429635

fpsone avatar Sep 25 '23 20:09 fpsone

Thanks @Garima-sharma814 it seems to be working (I am hitting a timeout but that could be due to the workload)....

timfong888 avatar Nov 15 '23 05:11 timfong888