Open eduardommelo opened 1 year ago
u too
Me too
I downgraded to 4.10.0 using npm i ytdl-core@4.1.0
and it is working but download speeds are significantly slower. Hopefully this can get patched soon.
I downgraded to 4.10.0 using
npm i ytdl-core@4.1.0
and it is working but download speeds are significantly slower. Hopefully this can get patched soon.
Note: This bug is tied to the getInfo()
function called in ^4.11.5
Me too 😪
I’m getting the same error as well
@ChristopherFrydryck - that speed issue was resolved in a later PR: https://github.com/fent/node-ytdl-core/issues/1240 Could be helpful if you want to fork and have a working version
https://github.com/fent/node-ytdl-core/issues/1240 seems to be running very slow as well.
I’m getting the same error as well
I downgraded to 4.10.0 npm i ytdl-core@4.10.0, and it's working fine. hope can help who urgently to using.
error evalmachine.<anonymous>:426 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); ^^^^^^^^^^^^^^^^ SyntaxError: Invalid or unexpected token at new Script (node:vm:100:7) at Object.exports.decipherFormats (/root/site/api/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 (/root/site/api/node_modules/ytdl-core/lib/info.js:401:17) error evalmachine.<anonymous>:426 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); ^^^^^^^^^^^^^^^^ SyntaxError: Invalid or unexpected token at new Script (node:vm:100:7) at Object.exports.decipherFormats (/root/site/api/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 (/root/site/api/node_modules/ytdl-core/lib/info.js:401:17) error evalmachine.<anonymous>:426 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);
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
Facing the same issue!
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);
^^^^^^^^^^^^^^^^
SyntaxError: Invalid or unexpected token
at new Script (node:vm:100:7)
at exports.decipherFormats (/.../node_modules/ytdl-core/lib/sig.js:116:51)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Promise.all (index 0)
at async exports.getInfo (/.../node_modules/ytdl-core/lib/info.js:401:17)
Although I solved this issue by downgrading to 4.10.0 it is working but download speeds are slower.
This bug is connected to the getInfo() function called in ^4.11.5
in lib/sig.js file and lib/info.js.
Hopefully, this gets fixed soon.
error evalmachine.<anonymous>:426 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); ^^^^^^^^^^^^^^^^ SyntaxError: Invalid or unexpected token at new Script (node:vm:100:7) at Object.exports.decipherFormats (/root/site/api/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 (/root/site/api/node_modules/ytdl-core/lib/info.js:401:17) error evalmachine.<anonymous>:426 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); ^^^^^^^^^^^^^^^^ SyntaxError: Invalid or unexpected token at new Script (node:vm:100:7) at Object.exports.decipherFormats (/root/site/api/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 (/root/site/api/node_modules/ytdl-core/lib/info.js:401:17) error evalmachine.<anonymous>:426 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);
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
Yes this solved it. Thanks a lot 😊
error evalmachine.<anonymous>:426 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); ^^^^^^^^^^^^^^^^ SyntaxError: Invalid or unexpected token at new Script (node:vm:100:7) at Object.exports.decipherFormats (/root/site/api/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 (/root/site/api/node_modules/ytdl-core/lib/info.js:401:17) error evalmachine.<anonymous>:426 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); ^^^^^^^^^^^^^^^^ SyntaxError: Invalid or unexpected token at new Script (node:vm:100:7) at Object.exports.decipherFormats (/root/site/api/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 (/root/site/api/node_modules/ytdl-core/lib/info.js:401:17) error evalmachine.<anonymous>:426 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);
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
thanks for the solution, now it works fine