#manga #api #api-client #red #library #platform #bean

tosho-rbean

An asynchronous client for 小豆 (Red Bean)

4 releases

0.1.3 Mar 20, 2024
0.1.2 Feb 28, 2024
0.1.1 Feb 23, 2024
0.1.0 Feb 22, 2024

#972 in Web programming

Download history 255/week @ 2024-02-18 238/week @ 2024-02-25 14/week @ 2024-03-03 16/week @ 2024-03-10 175/week @ 2024-03-17 5/week @ 2024-03-24 18/week @ 2024-03-31

215 downloads per month
Used in tosho

MIT license

65KB
1K SLoC

tosho-rbean

crates.io version

A minimal asynchronous client for 小豆 (Red Bean) API.

The following crate is used by the tosho app.

Usage

Download the tosho app, or you can utilize this crate like any other Rust crate:

use tosho_rbean::{RBClient, RBConfig, RBPlatform};

#[tokio::main]
async fn main() {
    let config = RBConfig {
        token: "123".to_string(),
        refresh_token: "abcxyz".to_string(),
        platform: RBPlatform::Android,
    };
    let mut client = RBClient::new(config);
    // Refresh token
    client.refresh_token().await.unwrap();
    let user = client.get_user().await.unwrap();
    println!("{:?}", user);
}

Authentication

The following sources only have one method of authentication, and that method uses your email and password.

$ tosho rb auth email password --help

Or, if you use the crates:

use tosho_rbean::{RBClient, RBPlatform};

#[tokio::main]
async fn main() {
    let login_results = RBClient::login("email@test.com", "mypassword", RBPlatform::Android).await.unwrap();
    println!("{:?}", login_results);
}

Disclaimer

This project is designed as an experiment and to create a local copy for personal use. These tools will not circumvent any paywall, and you will need to purchase and own each chapter with your own account to be able to make your own local copy.

We're not responsible if your account got deactivated.

License

This project is licensed with MIT License (LICENSE or http://opensource.org/licenses/MIT)

Dependencies

~7–22MB
~311K SLoC