microlinkhq / youtube-dl-exec

A simple Node.js wrapper for youtube-dl/yt-dlp.
MIT License
423 stars 75 forks source link

fix: post-install should fail on error #191

Closed miraclx closed 6 months ago

miraclx commented 6 months ago

Fixes #190.

Weird observation, failure cases always take a minimum of 30s. I guess simple-get is not keeping things as simple as it should.

I'll investigate that if I get the time.

miraclx commented 6 months ago

So I looked into it, seems it's caused by the DNS lookup not being cancellable, so even with req.abort called on error, node still waits for the lookup to complete.

Filed an upstream issue - https://github.com/feross/simple-get/issues/84

Kikobeats commented 6 months ago

@miraclx Thanks for this. Can you drop simple-get and just the builtin fetch in Node.js? 🙂

miraclx commented 6 months ago

Wasn't that stabilized in Node v21?

https://nodejs.org/en/blog/announcements/v21-release-announce#notable-changes

Kikobeats commented 6 months ago

@miraclx fetch is stable since v18, it's safe to be used https://nodejs.org/dist/latest-v18.x/docs/api/globals.html#fetch

miraclx commented 6 months ago

Closing in favor of #192