use crate::structs; extern crate serde_json; pub async fn get_sauce_info(client: reqwest::Client, sauce: i32) -> Result { let mut uri = String::from("https://nhentai.net/api/gallery/"); uri.push_str(&sauce.to_string()); let resp = client.get(&uri) .send() .await?; Ok(serde_json::from_str(&resp.text().await?).unwrap()) } pub async fn get_search_info(client: reqwest::Client, search_query: &str) -> Result { let uri = "https://nhentai.net/api/galleries/search"; let resp = client.get(uri) .query(&[("query", search_query)]) .send() .await?; Ok(serde_json::from_str(&resp.text().await?).unwrap()) }