rusty_ytdl

crates.io Released API docs

Youtube downloading module. Written with pure Rust.

Usage

```rust,ignore use rustyytdl::info::getinfo; use rustyytdl::utils::chooseformat; use rusty_ytdl::structs::VideoOptions;

[tokio::main]

async fn main() { let videourl = "https://www.youtube.com/watch?v=FZ8BxMU3BYc"; // FZ8BxMU3BYc works too! let videoinfo = getinfo(videourl).await; // Also works with live videos!!

println!("{:#?}",videoinfo); /* VideoInfo { ... videodetails: VideoDetails, formats: Vec, related_videos: Vec } */

let videooptions = VideoOptions::default(); let format = chooseformat(&videoinfo.unwrap().formats,&videooptions);

// Get a format by VideoOptions filter parameter println!("{:#?}",format); } ```

Limitations

rusty-ytdl cannot download videos that fall into the following

Generated download links are valid for 6 hours, and may only be downloadable from the same IP address.

Installation

bash cargo add rusty_ytdl

Or add the following to your Cargo.toml file:

toml [dependencies] rusty_ytdl = "0.1.0"