rusty_ytdl icon indicating copy to clipboard operation
rusty_ytdl copied to clipboard

Feature request: Implement `futures::Stream` for NonLiveStream and LiveStream.

Open nick42d opened this issue 6 months ago • 0 comments

Hi there, my main use case is a music player - youtui. I am currently using the rusty_ytdl::Stream trait to be able to provide progress updates whilst downloads are in progress. However I thought it could be nice to implement the futures::Steam trait to enable the use of the adaptors in futures::StreamExt. Example below of a pattern that this could enable.

use futures::StreamExt;

let stream = ... // code to create stream
let song = stream
    .enumerate()
    .map(|(idx, chunk)| {
        println!("Downloaded chunk {idx}!");
        chunk
    }).collect::<Vec<_>>().await;
play(song);

nick42d avatar Aug 07 '24 08:08 nick42d