Expand description
Async wrapper for yt-dlp
§Example
use ytd_rs::YtDlp;
use std::path::PathBuf;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let path = PathBuf::from("./download");
let ytd = YtDlp::new("https://www.youtube.com/watch?v=uTO0KnDsVH0")
.output_dir(path)
.arg("--quiet")
.arg_with("--output", "%(title).90s.%(ext)s");
let result = ytd.download().await?;
println!("Download complete: {}", result.output());
Ok(())
}Modules§
Structs§
- Video
Info - A structured representation of video metadata extracted via –dump-json.
- YtDlp
- The main builder for configuring and running yt-dlp.
- YtDlp
Child - A running yt-dlp process that allows streaming standard output (useful for progress bars).
- YtDlp
Result - Represents the output of a yt-dlp execution.
- YtDlp
Stream - A running yt-dlp process that streams raw media bytes directly to standard output.