Closed gohoski closed 4 months ago
Now it works much faster than the previous commit.
Just wanted to ask — why the data is being downloaded by 9 MB chunks?
downloads that aren't chunked seem to be throttled serverside. also, did you set the thing as draft?
for future ref: this change was applied in https://github.com/ftde0/yt2009/commit/55faf2e1246f5716d5db3423ce45dbab124da3f8, albeit some other things had to be made, so the pull won't be marked as merged.
The current code writes the video data to a Buffer variable and then writes its contents to disk. This causes problems while downloading a long video on small amounts of RAM, since everything is first being written on RAM, and on systems with slow drive speed.
My new proposed code uses streaming, which writes the data directly to disk. This reduces the amount of consumed RAM and CPU.