gpipipi
=======
a rust crate for the google play api
usage
-----
you get an oauth token by logging in into the [embedded setup page](https://accounts.google.com/EmbeddedSetup), opening the dev tools and then checking the network tab / application tab for the returned cookie. the token can only be used once, and the resulting aas token doesn't seem to expire
after getting the oauth token, you can convert it with the crate by running it as a binary like so:
```bash
TOKEN="..." EMAIL="..." cargo run --features binary
```
alternatively you can convert it manually:
```rust
let auth_client = gpipipi::OAuthRequest::new("TOKEN GOES HERE", "EMAIL GOES HERE");
let token = auth_client.fetch().await?;
```
after getting the aas token, you can now log in and start doing requests:
```rust
use gpipipi::{PropsMaps, Client, CategoryType, ReviewsFilter};
use futures_util::stream::TryStreamExt;
// props can come from anywhere, but some are included in this repo
const PROPS: &str = include_str!("example.properties");
let mut props_map = PropsMaps::parse_aurora_config(PROPS)?;
let arm_props = props_map.remove("arm").ok_or("No 'arm' device props!")?;
let client = Client::login(email, aas_token, arm_props).await?;
let categories = client.categories(CategoryType::Game).await?;
let details = client.details("com.roblox.client", None).await?;
let download_urls = client.downloads("com.roblox.client", Some(2036)).await?;
let single_search = client.search("robl", None).await?;
let single_search2 = client.search("robl", single_search.next_page).await?;
let mut search_stream = client.search_stream("robl");
while let Some(page) = search_stream.try_next().await? {
for item in page {
println!("Found app: {:?}", item.title);
}
}
let reviews = client.reviews("com.roblox.client", None).await?;
let reviews_page2 = client
.reviews("com.roblox.client", reviews.next_page)
.await?;
let mut reviews_stream =
client.reviews_stream("com.roblox.client", Some(ReviewsFilter::Newest));
while let Some(page) = reviews_stream.try_next().await? {
for review in page {
println!("Review: {:?} stars - {:?}", review.star_rating, review.comment);
}
}
```
credits
-------
- [**gplayapi**](https://gitlab.com/AuroraOSS/gplayapi)
- [**gpapi**](https://github.com/EFForg/rs-google-play/tree/master/gpapi)