Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/devyatsu/rusty-dl

Rust crate for downloading various content types like YouTube/Tweets videos and more.
https://github.com/devyatsu/rusty-dl

Last synced: about 14 hours ago
JSON representation

Rust crate for downloading various content types like YouTube/Tweets videos and more.

Awesome Lists containing this project

README

        

# rusty_dl

[![LICENSE](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
[![crates.io Version](https://img.shields.io/crates/v/rusty_dl.svg)](https://crates.io/crates/rusty_dl)
![Minimum rustc version](https://img.shields.io/badge/rustc-1.70.0+-lightgray.svg)

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

- [x] Add features to download content to specific directories
- [x] Implement functions to retrieve metadata on downloaded media
- [x] Allow users to specify whether spaces in file names should be replaced by underscores
- [x] Add support for downloading images-only or videos-only from tweets
- [x] Add support for downloading playlists on youtube (only the 100 videos coming first)
- [x] 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

```bash
cargo add rusty_dl
```

- Use the crate in a synchronous environment

```rust
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

```rust
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](/examples/)

## 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](./LICENSE).