1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
use thiserror::Error; mod client; mod device; mod friendships; mod profile; mod users; pub use client::Client; pub use profile::Profile; #[cfg(test)] mod tests; const API_BASE_URL: &str = "https://i.instagram.com/api/v1"; const INSTAGRAM_SIGN_KEY: &str = "99e16edcca71d7c1f3fd74d447f6281bd5253a623000a55ed0b60014467a53b1"; #[derive(Error, Debug)] pub enum GoofyError { #[error("Generic HTTP error")] HttpError(#[from] reqwest::Error), #[error("Generic IO error")] IOError(#[from] std::io::Error), #[error("JSON error")] JSONError(#[from] serde_json::error::Error), #[error("API login failed with status code {0}")] LoginFailed(u16), #[error("API request failed with status code {0}")] ResponseNotSuccess(u16), }