Skip to content

[fork] A youtube-dl wrapper for Rust with improved performance

Notifications You must be signed in to change notification settings

jbruechert/youtube-dl-rs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

youtube-dl-rs-pyo3

Differences from upstream

This fork embeds python to run yt-dlp. This makes subsequent runs a lot faster. However it is incompatible with the downloader feature, which makes this not upstreamable.

Original README

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.

About

[fork] A youtube-dl wrapper for Rust with improved performance

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 100.0%