| Crates.io | youtube_dl |
| lib.rs | youtube_dl |
| version | 0.10.0 |
| created_at | 2019-08-09 18:10:10.761537+00 |
| updated_at | 2024-04-16 18:40:41.985551+00 |
| description | Runs yt-dlp and parses its JSON output. |
| homepage | https://github.com/GyrosOfWar/youtube-dl-rs |
| repository | https://github.com/GyrosOfWar/youtube-dl-rs |
| max_upload_size | |
| id | 155415 |
| size | 93,850 |
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(())
async variants of the run, run_raw and download_to methods.download_yt_dlp method and YoutubeDlFetcher struct to download the yt-dlp executable with the given TLS backend used for reqwest.