Skip to main content

Crate ytd_rs

Crate ytd_rs 

Source
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§

error

Structs§

VideoInfo
A structured representation of video metadata extracted via –dump-json.
YtDlp
The main builder for configuring and running yt-dlp.
YtDlpChild
A running yt-dlp process that allows streaming standard output (useful for progress bars).
YtDlpResult
Represents the output of a yt-dlp execution.
YtDlpStream
A running yt-dlp process that streams raw media bytes directly to standard output.

Type Aliases§

Result