Crates.io | tosho-kmkc |
lib.rs | tosho-kmkc |
version | 0.5.0 |
source | src |
created_at | 2024-02-14 10:52:10.764077 |
updated_at | 2024-08-13 08:41:29.141454 |
description | An asynchronous client of KM API by KC. |
homepage | https://tosho.dev |
repository | https://github.com/noaione/tosho-mango |
max_upload_size | |
id | 1139733 |
size | 113,844 |
A minimal asynchronous client for the KM API by KC.
The following crate is used by the tosho
app.
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]);
}
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.
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.
This project is licensed with MIT License (LICENSE or http://opensource.org/licenses/MIT)