#download #youtube #twitter #media #medias

rusty_dl

A crate for downloading youtube videos, twitter medias (videos, images, gif) from tweets and files on the web

10 releases (6 stable)

1.0.8 Apr 21, 2024
1.0.2 Apr 20, 2024
0.2.1 Apr 8, 2024
0.1.0 Apr 7, 2024
0.0.1 Apr 7, 2024

#34 in Video

Download history 141/week @ 2024-04-01 218/week @ 2024-04-08 420/week @ 2024-04-15 217/week @ 2024-04-22

996 downloads per month
Used in rusty_dl_cli

MIT/Apache

105KB
2K SLoC

rusty_dl

LICENSE crates.io Version Minimum rustc version

Rusty_dl is a versatile crate designed for effortlessly fetching a wide range of content types, including YouTube videos, tweet media (such as videos, images, and gifs), and eventually various other media directly from the web.

Features

  • Download YouTube videos
  • Download tweet media (videos, images, gifs)
  • Download other media from the web (through url fetching)

Todo

In the Library

  • Add features to download content to specific directories
  • Implement functions to retrieve metadata on downloaded media
  • Allow users to specify whether spaces in file names should be replaced by underscores
  • Add support for downloading images-only or videos-only from tweets
  • Add support for downloading playlists on youtube (only the 100 videos coming first)
  • Add examples

Other

  • Create a CLI for easy downloading from the terminal
  • Develop a desktop application (using Tauri ?)
  • Build a web application for downloading media from the browser

Get started

  • Add the crate to your project
cargo add rusty_dl
  • Use the crate in a synchronous environment
use rusty_dl::prelude::{Downloader, YoutubeDownloader, DownloadError};

const URL: &str = "my_yt_video_link";

fn main() -> Result<(), DownloadError>  {
    let downloader = YoutubeDownloader::new(URL);

    downloader.blocking_download()
}
  • Use the crate in a tokio environment
use rusty_dl::prelude::{Downloader, YoutubeDownloader, DownloadError};

const URL: &str = "my_yt_video_link";

#[tokio::main]
async fn main() -> Result<(), DownloadError> {
    let downloader = YoutubeDownloader::new(URL);

    downloader.download().await
}

This crate also exports a TwitterDownloader and a ResourceDownloader which work the same way as presented up there.

See more in examples directory

Contributing

Contributions are welcome! Feel free to open issues or submit pull requests to help improve this library.

License

This project is licensed under the MIT License.

Dependencies

~34–49MB
~753K SLoC