node-ytdl-core icon indicating copy to clipboard operation
node-ytdl-core copied to clipboard

Error: Could not extract functions

Open NabiKAZ opened this issue 1 year ago • 28 comments

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

NabiKAZ avatar Dec 11 '24 09:12 NabiKAZ

I have the same problem

Dari-Enmanuel-Garcia avatar Dec 12 '24 00:12 Dari-Enmanuel-Garcia

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

GuilhermeCanoa avatar Dec 12 '24 03:12 GuilhermeCanoa

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 avatar Dec 12 '24 15:12 planet-bluto

planet-bluto's solution worked for me

ghooms avatar Dec 12 '24 18:12 ghooms

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.

NabiKAZ avatar Dec 22 '24 10:12 NabiKAZ

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

planet-bluto avatar Dec 22 '24 18:12 planet-bluto

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)

ahmednabik avatar Dec 29 '24 11:12 ahmednabik

I have same problem.

dharmendra9503 avatar Dec 30 '24 19:12 dharmendra9503

@planet-bluto Solution Worked for me.

dharmendra9503 avatar Dec 30 '24 19:12 dharmendra9503

It was able to download mp4 but video is not opening

kumargaf avatar Jan 05 '25 17:01 kumargaf

Thanks @planet-bluto

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

Solved the problem.

EmilioMaestro avatar Jan 05 '25 22:01 EmilioMaestro

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?

nethan-k avatar Jan 15 '25 23:01 nethan-k

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

Anas12312 avatar Jan 20 '25 22:01 Anas12312

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';

bobby-rust avatar Feb 04 '25 03:02 bobby-rust

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

tbizze avatar Feb 21 '25 12:02 tbizze

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

Ky-Wilson avatar Feb 22 '25 21:02 Ky-Wilson

Solution from @planet-bluto worked fine for me

Csasaka19 avatar Mar 03 '25 14:03 Csasaka19

Solution from @planet-bluto worked fine for me

hugohugo130 avatar Mar 06 '25 05:03 hugohugo130

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

This worked for me!

plflanagan avatar Apr 10 '25 02:04 plflanagan

@planet-bluto Thanks! its work for me.

lalitshirsath008 avatar May 12 '25 06:05 lalitshirsath008

Thanks @planet-bluto it worked

bileyassein avatar Jul 17 '25 16:07 bileyassein

Thanks @planet-bluto Thanks! its work for me.

AswinKaruppiah avatar Aug 03 '25 17:08 AswinKaruppiah

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';

Great, this works for me

Omarkhodjaev avatar Aug 23 '25 14:08 Omarkhodjaev

@planet-bluto's solution works, but only on Windows, on Debian I'm getting this error then:

webidl.is.File = webidl.util.MakeTypeAssertion(File)
                                               ^

ReferenceError: File is not defined
    at Object.<anonymous> (.../node_modules/undici/lib/web/webidl/index.js:531:48)
    at Module._compile (node:internal/modules/cjs/loader:1364:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1422:10)
    at Module.load (node:internal/modules/cjs/loader:1203:32)
    at Module._load (node:internal/modules/cjs/loader:1019:12)
    at Module.require (node:internal/modules/cjs/loader:1231:19)
    at require (node:internal/modules/helpers:177:18)
    at Object.<anonymous> (.../test/node_modules/undici/lib/web/fetch/util.js:12:20)
    at Module._compile (node:internal/modules/cjs/loader:1364:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1422:10)

Node.js v18.20.4

matyas095 avatar Sep 13 '25 07:09 matyas095

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, Does this solution still work with @distube/ytdl-core version 4.16.12? The last time I tried using it(last week) for downloading media it generated two 17***-player.js files without any successful download.

smarko-web avatar Oct 07 '25 19:10 smarko-web

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

i get this error: MinigetError: Status code: 403 what can i do now???

BDT-4248 avatar Oct 16 '25 09:10 BDT-4248

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

i get this error: MinigetError: Status code: 403 what can i do now???

Same question here

smarko-web avatar Oct 16 '25 13:10 smarko-web