rusty_ytdl
rusty_ytdl copied to clipboard
Feature request: Implement `futures::Stream` for NonLiveStream and LiveStream.
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);