fent / node-ytdl-core

YouTube video downloader in javascript.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SyntaxError: Invalid or unexpected token

tnluan opened this issue · 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:

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 #1217

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

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

ytdl-core@4.10.0

This worked for me.

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

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.

This worked for me. but download speed is very low

This solution should solve your download bottleneck problem: #1252 (comment)

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