fent / node-ytdl-core

YouTube video downloader in javascript.
MIT License
4.54k stars 803 forks source link

SyntaxError: Invalid or unexpected token #1251

Open tnluan opened 1 year ago

tnluan commented 1 year ago

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:

eduardommelo commented 1 year ago

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

Garima-sharma814 commented 1 year ago

I fixed this issue by downgrading to 4.10.0 by using npm i ytdl-core@4.10.0

helloworld9912 commented 1 year ago

I fixed this issue by downgrading to 4.10.0 by using npm i ytdl-core@4.10.0

Worked for me too ! waiting the PR to be approved

priyam-raj commented 1 year ago

ytdl-core@4.10.0

This worked for me.

ashwaniappsq commented 1 year ago

I fixed this issue by downgrading to 4.10.0 by using npm i ytdl-core@4.10.0

This worked for me. but download speed is very low

luccabassoli commented 1 year ago

I fixed this issue by downgrading to 4.10.0 by using npm i ytdl-core@4.10.0

This worked for me.

It didn't work for me either.

fpsone commented 1 year ago

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

timfong888 commented 1 year ago

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