javascriptnode.jsyoutube-apiytdl

ytdl-core stopped downloading youtube videos - I get invalid or unexpected token


I used ytdl-core for downloading youtube videos but now it stopped working after 2 months when I run my app

SyntaxError: Invalid or unexpected token
    at new Script (node:vm:94:7)
    at exports.decipherFormats (C:\Users\DELL\OneDrive\Desktop\4)youAdderBackendcopy\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 (C:\Users\DELL\OneDrive\Desktop\4)youAdderBackendcopy\node_modules\ytdl-core\lib\info.js:401:17)        
Emitted 'error' event on PassThrough instance at:
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Node.js v20.3.0
[nodemon] app crashed - waiting for file changes before starting...

Solution

  • It's a new "bug" in the core library, specifically in sig.js .
    Here you can find some workarounds, putting the library back into normal operation