17 releases (9 breaking)

0.10.0 Apr 16, 2024
0.9.0 Aug 20, 2023
0.8.1 May 20, 2023
0.8.0 Jan 22, 2023
0.1.1 Aug 9, 2019

#34 in Video

Download history 213/week @ 2024-07-19 462/week @ 2024-07-26 254/week @ 2024-08-02 296/week @ 2024-08-09 212/week @ 2024-08-16 207/week @ 2024-08-23 264/week @ 2024-08-30 243/week @ 2024-09-06 203/week @ 2024-09-13 312/week @ 2024-09-20 342/week @ 2024-09-27 245/week @ 2024-10-04 216/week @ 2024-10-11 246/week @ 2024-10-18 181/week @ 2024-10-25 179/week @ 2024-11-01

851 downloads per month
Used in 2 crates

MIT/Apache

55KB
1.5K SLoC

youtube-dl-rs

Crates.io

NOTE: The name for this library is a bit misleading, it currently does not support youtube-dl as its development seems to be very slow recently, it does support yt-dlp, which has diverged from youtube-dl in some ways, but sees a lot more development.

Runs yt-dlp and parses its JSON output. Example:

use youtube_dl::YoutubeDl;

let output = YoutubeDl::new("https://www.youtube.com/watch?v=VFbhKZFzbzk")
  .socket_timeout("15")
  .run()
  .unwrap();
let title = output.into_single_video().unwrap().title;
println!("Video title: {}", title);

Or, if you want to it to run asynchronously (enable the feature tokio):

let output = YoutubeDl::new("https://www.youtube.com/watch?v=VFbhKZFzbzk")
    .socket_timeout("15")
    .run_async()
    .await?;
let title = output.into_single_video().unwrap().title;
println!("Video title: {}", title);
Ok(())

Feature flags

  • tokio: Enables the async variants of the run, run_raw and download_to methods.
  • downloader-native-tls / downloader-rustls-tls: Enables the download_yt_dlp method and YoutubeDlFetcher struct to download the yt-dlp executable with the given TLS backend used for reqwest.

Dependencies

~0.8–12MB
~137K SLoC