rustypipe/downloader
2025-04-03 11:08:18 +00:00
..
src chore(deps): update rust crate rand to 0.9.0 2025-04-03 11:08:18 +00:00
tests fix: ensure downloader futures are send 2025-01-29 02:07:18 +01:00
Cargo.toml update smartcrop2 to v0.4.0, remove black borders from album covers 2025-03-04 22:38:01 +01:00
CHANGELOG.md chore(release): release rustypipe-downloader v0.3.1 2025-02-26 19:45:43 +01:00
README.md chore: add docs badge to README 2024-11-25 15:27:33 +01:00

RustyPipe Downloader

Current crates.io version License Docs CI status

The downloader is a companion crate for RustyPipe that allows for easy and fast downloading of video and audio files.

Features

  • Fast download of streams, bypassing YouTube's throttling
  • Join video and audio streams using ffmpeg
  • Indicatif support to show download progress bars (enable indicatif feature to use)
  • Tag audio files with title, album, artist, date, description and album cover (enable audiotag feature to use)
  • Album covers are automatically cropped using smartcrop to ensure they are square

How to use

For the downloader to work, you need to have ffmpeg installed on your system. If your ffmpeg binary is located at a non-standard path, you can configure the location using [DownloaderBuilder::ffmpeg].

At first you have to instantiate and configure the downloader using either [Downloader::new] or the [DownloaderBuilder].

Then you can build a new download query with a video ID, stream filter and destination path and finally download the video.

use rustypipe::param::StreamFilter;
use rustypipe_downloader::DownloaderBuilder;

let dl = DownloaderBuilder::new()
    .audio_tag()
    .crop_cover()
    .build();

let filter_audio = StreamFilter::new().no_video();
dl.id("eRsGyueVLvQ").stream_filter(filter_audio).to_file("audio.opus").download().await;

let filter_video = StreamFilter::new().video_max_res(720);
dl.id("eRsGyueVLvQ").stream_filter(filter_video).to_file("video.mp4").download().await;