RARBG TorrentAPI

A Rust wrapper for RARBG TorrentAPI
Report bug ยท Request feature

Table of contents

Description

This Rust module allows easy interaction with RARBG TorrentAPI.

In particular, it allows to list or search torrents and to export them to a magnet file.

Quick start

Add this to your Cargo.toml: toml [dependencies] rarbg_api = "0.3.0"

Examples

```rust extern crate rarbg_api;

use rarbgapi::apiparametersbuilder::ApiParametersBuilder; use rarbgapi::RarBgApi; use rarbgapi::limit::Limit; use rarbgapi::category::Category; use rarbgapi::sortby::SortBy;

fn main() { let mut api = RarBgApi::new("myappid"); let parameters = ApiParametersBuilder::new() .limit(Limit::TwentyFive) .categories(vec![Category::TvUhdEpisodes, Category::TvHdEpisodes, Category::TvEpisodes]) .sortby(SortBy::Seeders) .build(); let result = api.list(Some(&parameters)); match result { // Export all torrents found in the current directory. // Each file contains a magnet link that can be add in your Bittorrent client. Ok(result) => result.torrents().iter().foreach(|t| println!("Torrent exported to '{}'.", t.export(".").unwrap())), Err(reason) => println!("{}", reason.error()) } } rust extern crate rarbg_api;

use rarbgapi::apiparametersbuilder::ApiParametersBuilder; use rarbgapi::RarBgApi; use rarbgapi::limit::Limit; use rarbgapi::category::Category; use rarbgapi::sortby::SortBy;

fn main() { let mut api = RarBgApi::new("myappid"); let parameters = ApiParametersBuilder::new() .limit(Limit::TwentyFive) .categories(vec![Category::TvUhdEpisodes, Category::TvHdEpisodes, Category::TvEpisodes]) .sortby(SortBy::Seeders) .build(); let result = api.search("Rick and Morty", Some(&parameters)); match result { // Export all torrents found in the current directory. // Each file contains a magnet link that can be add in your Bittorrent client. Ok(result) => result.torrents().iter().take(1).foreach(|t| println!("Torrent exported to '{}'.", t.export(".").unwrap())), Err(reason) => println!("{}", reason.error()) } } ```

Bugs and feature requests

Have a bug or a feature request? Please first search for existing and closed issues. If your problem or idea is not addressed yet, please open a new issue.

Contributing

Contributions are welcome!

Contributors

Disclaimer

Downloading content that you (don't) have might be illegal in your country.

This is an unofficial rust package.