Skip to main content

instapi360_cloud/
lib.rs

1//! # instapi360-cloud
2//!
3//! Async, platform-agnostic client for the Insta360 cloud: authenticate, list
4//! cloud media, and download **original** camera files (Ace Pro 2 `.insv`/
5//! `.mp4`, X5 dual-lens `.insv`) for local editing.
6//!
7//! Design constraints (this crate is meant to cross-compile to Android):
8//! - TLS via `rustls` only (no OpenSSL/native-tls in the dependency graph).
9//! - No filesystem assumptions in the core: downloads write to a caller-owned
10//!   `AsyncWrite`; session persistence is a caller-provided [`SessionStore`].
11//!
12//! ## Status
13//! Authentication is the session token alone — no request signing for
14//! list/download. Import a token once and the session renews itself via
15//! [`Client::refresh`] (the API mints a fresh token from the current one, so no
16//! separate refresh token is needed). Credential login is reCAPTCHA-gated and
17//! not implemented here.
18//!
19//! ## Quick start
20//! ```no_run
21//! # async fn run() -> instapi360_cloud::Result<()> {
22//! use instapi360_cloud::{Client, ClientConfig, Region, Session, PageCursor};
23//! let client = Client::new(ClientConfig::windows(Region::Global))?;
24//! let session = Session::from_token("<captured X-User-Token>");
25//! let page = client.list_media(&session, PageCursor::first(50)).await?;
26//! for m in &page.items {
27//!     println!("{} ({} bytes, {} parts)", m.name, m.size_original, m.parts.len());
28//! }
29//! # Ok(()) }
30//! ```
31
32mod client;
33mod config;
34mod download;
35mod error;
36mod model;
37mod session;
38mod signing;
39
40pub use client::{jwt_exp, session_token_exp, Client};
41pub use config::{ClientConfig, Platform, Region};
42pub use download::ProgressSink;
43pub use error::{Error, Result};
44pub use model::{Envelope, FilePart, Media, MediaId, MediaKind, MediaPage, PageCursor, Profile};
45pub use session::{Session, SessionStore};
46pub use signing::{Signature, Signer};