5 releases

0.3.4 Mar 20, 2024
0.3.3 Feb 28, 2024
0.3.2 Feb 22, 2024
0.3.1 Feb 17, 2024
0.3.0 Feb 14, 2024

#466 in Web programming

Download history 275/week @ 2024-02-14 155/week @ 2024-02-21 168/week @ 2024-02-28 6/week @ 2024-03-06 6/week @ 2024-03-13 180/week @ 2024-03-20 7/week @ 2024-03-27 14/week @ 2024-04-03

208 downloads per month
Used in tosho

MIT license

115KB
2K SLoC

tosho-kmkc

crates.io version

A minimal asynchronous client for the KM API by KC.

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_kmkc::{KMClient, KMConfig, KMConfigMobile, KMConfigMobilePlatform};

#[tokio::main]
async fn main() {
    let config = KMConfigMobile {
        user_id: "123".to_string(),
        hash_key: "abcxyz".to_string(),
        platform: KMConfigMobilePlatform::Android,
    };

    let client = KMClient::new(KMConfig::Mobile(config));

    let manga = client.get_titles(vec![10007]).await.unwrap();
    println!("{:?}", manga[0]);
}

Authentication

The following source has many kinds of authentication methods:

  • auth: Experimental login system with email + password.
  • auth-mobile: Login by providing user ID and key.
  • auth-web: Login by providing a Netscape Cookies file.
  • auth-adapt: Convert a web authentication into mobile authentication.

For the easiest method, use the auth command and then auth-adapt to obtain the mobile version.

$ tosho km auth email password -t web

Alternatively, if you only want the mobile version:

$ tosho km auth email password -t android
$ tosho km auth email password -t ios

Or, if you use this crates as library:

use tosho_kmkc::{KMClient, KMConfigMobilePlatform};

#[tokio::main]
async fn main() {
    let login_res = KMClient::login("test@mail.com", "mypassword", None).await.unwrap();
    // Or, with mobile platform
    let login_res = KMClient::login("test@mail.com", "mypassword", Some(KMConfigMobilePlatform::Android)).await.unwrap();
}

There is no significant difference between Android and iOS.

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

~21–36MB
~419K SLoC