14 releases (7 breaking)
0.8.1 | May 20, 2023 |
---|---|
0.8.0 | Jan 22, 2023 |
0.7.0 | Jan 5, 2022 |
0.6.3 | Sep 10, 2021 |
0.1.1 | Aug 9, 2019 |
#34 in Video
1,138 downloads per month
Used in 2 crates
42KB
1K
SLoC
youtube-dl-rs
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(())
Dependencies
~0.9–9MB
~170K SLoC