Undici fetch is slow because webstreams suck #473
Replies: 3 comments 4 replies
-
YouTube.js can run on node, deno and web browsers, so yes everyone not running it inside node would be opposed. You can pass your own fetch function into Innertube.create, so you can use whatever http backend you want, as long as you can return the appropriate response from your custom function. |
Beta Was this translation helpful? Give feedback.
-
That would be unfortunate. Pytube and every other OS YT library isn't as good. :) I might be able to extend the InnerTube class for now and import the decipher functionality to get the download URL then write undici/request response handlers. |
Beta Was this translation helpful? Give feedback.
-
In case anyone else is interested, this works and is much faster 👍🏼
|
Beta Was this translation helpful? Give feedback.
-
In version 1.4.5 which used, Axios/http, I was able to run 40 node worker threads with proxies to download videos with this library. We benchmarked 100k video downloads in about 8 hours.
Since Undici/fetch was incorporated into the project we noticed a major change in download speeds. 40 node workers is out. It throws errors, had to bring it down to 16. At 16 it took over 48 hours to download just to get 2k videos. The body takes forever to read, it timesout and very unstable.
Undici/request is 10x faster.
See: nodejs/undici#2014
This is a server based library, it cannot run in a web client there really was not need to use fetch/readablestreams. Any one opposed to ditching
fetch
and usingrequests
?Beta Was this translation helpful? Give feedback.
All reactions