Crate gpapi

source ·
Expand description

A library for interacting with the Google Play API.

§Getting Started

To interact with the API, first you’ll have to obtain an OAuth token by visiting the Google embedded setup page and opening the browser debugging console, logging in, and looking for the oauth_token cookie being set on your browser. It will be present in the last requests being made and start with “oauth2_4/”. Copy this value. It can only be used once, in order to obtain the aas_token, which can be used subsequently. To obtain this token:

use gpapi::Gpapi;

#[tokio::main]
async fn main() {
    let mut api = Gpapi::new("ad_g3_pro", &email);
    api.request_aas_token(oauth_token).await.unwrap();
    println!("{:?}", api.get_aas_token());
}

Now, you can begin interacting with the API by initializing it setting the aas_token and logging in.

use gpapi::Gpapi;

#[tokio::main]
async fn main() {
    let mut api = Gpapi::new("px_7a", &email);
    api.set_aas_token(aas_token);
    api.login().await.unwrap();
    // do something
}

From here, you can get package details, get the info to download a package, or use the library to download it.

let details = api.details("com.instagram.android").await;
println!("{:?}", details);

let download_info = api.get_download_info("com.instagram.android", None).await;
println!("{:?}", download_info);

api.download("com.instagram.android", None, true, true, &Path::new("/tmp/testing"), None).await;

Modules§

Structs§