Crate youtube_dl

source ·
Expand description


A crate for running and parsing the JSON output of youtube-dl. Example usage:

use youtube_dl::YoutubeDl;
let output = YoutubeDl::new("")



  • Exposes a function to download the latest version of youtube-dl/yt-dlp.
  • Structs to represent the output of youtube-dl. The definitions in this module are mostly auto-generated from the JSON output format of youtube-dl.


  • Specifies where to search, how many results to fetch and the query. The count defaults to 1, but can be changed with the with_count method.
  • A builder to create a youtube-dl command to execute.


  • Errors that can occur during executing youtube-dl or during parsing the output.
  • The search options currently supported by youtube-dl, and a custom option to allow specifying custom options, in case this library is outdated.
  • Data returned by YoutubeDl::run. Output can either be a single video or a playlist of videos.