jimbuck / pully

A simple CLI and library for downloading high quality YouTube videos!
https://www.npmjs.com/package/pully
MIT License
187 stars 19 forks source link

Piping the download? #37

Closed NeuronButter closed 4 years ago

NeuronButter commented 4 years ago

Is there a current way where Pully will provide a way to use .pipe()? Couldn't find anything in README.md. Thanks!

jimbuck commented 4 years ago

Currently no since it needs to pipe the audio and video into ffmpeg.

I know it's less than ideal, but you can just read the path once the download completes:

const { path, format, duration } = await pully.download(options);
console.log(path);     // Path to the downloaded file.

You can get a filestream and pipe that where you'd like, then just delete the file when the pipe closes.

The download logic could change in the future, I will look into exposing a stream if it is possible.

NeuronButter commented 4 years ago

Ok thanks for that. How would I implement a server for Pully then?

jimbuck commented 4 years ago

I started down that path a bit, but didn't really get a chance to complete it: https://github.com/jimbuck/pully-svc