Youtube downloading module written with pure Rust. Download videos blazing-fast without getting stuck on Youtube download speed (Downloads 20MB video files in just 10 seconds!)
```rust,ignore use rustyytdl::info::download; use rustyytdl::structs::DownloadOptions;
async fn main() {
let videourl = "https://www.youtube.com/watch?v=FZ8BxMU3BYc"; // FZ8BxMU3BYc works too!
let videobuffer: Vec
// Do what you want whit video buffer vector println!("{:#?}",video_buffer); } ```
or get only video informations
```rust,ignore use rustyytdl::info::getinfo; use rustyytdl::utils::chooseformat; use rusty_ytdl::structs::VideoOptions;
async fn main() { let videourl = "https://www.youtube.com/watch?v=FZ8BxMU3BYc"; // FZ8BxMU3BYc works too! let videoinfo = getinfo(videourl,None).await; // Also works with live videos!!
println!("{:#?}",videoinfo);
/*
VideoInfo {
...
videodetails: VideoDetails,
formats: Vec
let videooptions = VideoOptions::default(); let format = chooseformat(&videoinfo.unwrap().formats,&videooptions);
// Get a format by VideoOptions filter parameter println!("{:#?}",format); } ```
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.
bash
cargo add rusty_ytdl
Or add the following to your Cargo.toml
file:
toml
[dependencies]
rusty_ytdl = "0.1.0"