Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Could not extract functions #1318

Open
NabiKAZ opened this issue Dec 11, 2024 · 16 comments
Open

Error: Could not extract functions #1318

NabiKAZ opened this issue Dec 11, 2024 · 16 comments

Comments

@NabiKAZ
Copy link

NabiKAZ commented Dec 11, 2024

The code that was working until yesterday suddenly gives this error:

C:\Nabi\notpixel\node_modules\ytdl-core\lib\sig.js:20
    throw Error('Could not extract functions');
          ^

Error: Could not extract functions
    at C:\Nabi\notpixel\node_modules\ytdl-core\lib\sig.js:20:11
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Emitted 'error' event on PassThrough instance at:
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Node.js v20.18.0
@Dari-Enmanuel-Garcia
Copy link

I have the same problem

@GuilhermeCanoa
Copy link

GuilhermeCanoa commented Dec 12, 2024

same issue here! i guess youtube changed something...

@planet-bluto
Copy link

That seems like a new bug that's showed up in the package and the general consensus for now seems to be to try the @distube/ytdl-core package instead.

You can install it in place of ytdl-core like this

npm uninstall ytdl-core && npm i ytdl-core@npm:@distube/ytdl-core

@ghooms
Copy link

ghooms commented Dec 12, 2024

planet-bluto's solution worked for me

@NabiKAZ
Copy link
Author

NabiKAZ commented Dec 22, 2024

Of course, the suggested option https://github.com/distubejs/ytdl-core is also good. But I migrated to https://github.com/foxesdocode/yt-dlp-wrap to have a closer connection with the yt-dlp parent program and not get bugs again. It also supports cookies jar file.

@planet-bluto
Copy link

In my project, I ended up using both- one for getting info (ytdl) and one for fetching audio data (yt-dlp)- so that's a totally valid solution. I don't remember if there was really a way to get metadata with just yt-dlp, but I didn't look into it because I didn't want to completely replace all the instances in which I did use ytdl

@ahmednabik
Copy link

I was getting this same error but fortunately stumbled upon this thread via search and the forked library worked. Good job to the guy maintaining the fork (the original ytdl-core hasn't been updated in a year)

@dharmendra9503
Copy link

I have same problem.

@dharmendra9503
Copy link

@planet-bluto Solution Worked for me.

@kumargaf
Copy link

kumargaf commented Jan 5, 2025

It was able to download mp4 but video is not opening

@EmilioMaestro
Copy link

Thanks @planet-bluto

npm i ytdl-core@npm:@distube/ytdl-core

Solved the problem.

@nethan-k
Copy link

nethan-k commented Jan 15, 2025

I am getting a typescript error with @planet-bluto solution.
File '<path>/node_modules/ytdl-core/typings/index.d.ts' is not a module.
Does anybody know how I can fix this?

@Anas12312
Copy link

I am getting a typescript error with @planet-bluto solution. File '<path>/node_modules/ytdl-core/typings/index.d.ts' is not a module. Does anybody know how I can fix this?

Same problem

@bobby-rust
Copy link

I am getting a typescript error with @planet-bluto solution. File '<path>/node_modules/ytdl-core/typings/index.d.ts' is not a module. Does anybody know how I can fix this?

npm i @distube/ytdl-core@latest
and use
import ytdl from '@distube/ytdl-core';

@tbizze
Copy link

tbizze commented Feb 21, 2025

That seems like a new bug that's showed up in the package and the general consensus for now seems to be to try the @distube/ytdl-core package instead.

You can install it in place of ytdl-core like this

npm uninstall ytdl-core && npm i ytdl-core@npm:@distube/ytdl-core

@planet-bluto Thanks for the solution.
I was trying to use it for the first time and had the same error, and this solution worked!

Note: to get the video information on YouTube I had to change the code, as it is in the repository @distube/ytdl-core

@Ky-Wilson
Copy link

That seems like a new bug that's showed up in the package and the general consensus for now seems to be to try the @distube/ytdl-core package instead.

You can install it in place of ytdl-core like this

npm uninstall ytdl-core && npm i ytdl-core@npm:@distube/ytdl-core

it's working thk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests