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 YoutubeDl;
let output = new
.socket_timeout
.run
.unwrap;
let title = output.into_single_video.unwrap.title;
println!;
Or, if you want to it to run asynchronously (enable the feature tokio):
let output = new
.socket_timeout
.run_async
.await?;
let title = output.into_single_video.unwrap.title;
println!;
Ok
Feature flags
- tokio: Enables the
asyncvariants of therun,run_rawanddownload_tomethods. - downloader-native-tls / downloader-rustls-tls: Enables the
download_yt_dlpmethod andYoutubeDlFetcherstruct to download theyt-dlpexecutable with the given TLS backend used for reqwest.