Expand description
§instapi360-cloud
Async, platform-agnostic client for the Insta360 cloud: authenticate, list
cloud media, and download original camera files (Ace Pro 2 .insv/
.mp4, X5 dual-lens .insv) for local editing.
Design constraints (this crate is meant to cross-compile to Android):
- TLS via
rustlsonly (no OpenSSL/native-tls in the dependency graph). - No filesystem assumptions in the core: downloads write to a caller-owned
AsyncWrite; session persistence is a caller-providedSessionStore.
§Status
Authentication is the session token alone — no request signing for
list/download. Import a token once and the session renews itself via
Client::refresh (the API mints a fresh token from the current one, so no
separate refresh token is needed). Credential login is reCAPTCHA-gated and
not implemented here.
§Quick start
use instapi360_cloud::{Client, ClientConfig, Region, Session, PageCursor};
let client = Client::new(ClientConfig::windows(Region::Global))?;
let session = Session::from_token("<captured X-User-Token>");
let page = client.list_media(&session, PageCursor::first(50)).await?;
for m in &page.items {
println!("{} ({} bytes, {} parts)", m.name, m.size_original, m.parts.len());
}Structs§
- Client
- Async client for the Insta360 cloud API.
- Client
Config - Static client identity + request-signing material.
- Envelope
- Standard response envelope. Insta360 has used both
codeanderrCodeacross versions, and botherrInfo/msgfor the message; accept all. - File
Part - One downloadable file belonging to a
Media. For dual-lens 360 clips there are two of these. - Media
- A logical cloud media asset (may span multiple
FileParts). - MediaId
- Opaque identifier for a cloud media item.
- Media
Page - One page of a media listing plus the cursor to fetch the next page.
- Page
Cursor - Pagination request cursor.
- Profile
- Authenticated account profile (subset we need).
- Session
- The bearer material for authenticated requests.
- Signature
- A computed signature plus the nonce/timestamp that produced it, so the caller can attach all three to the request consistently.
- Signer
- Builds request signatures from the static
ClientConfigmaterial.
Enums§
- Error
- All failures the client can surface.
- Media
Kind - Kind of media, derived from the API’s
mediaType. - Platform
- The platform value sent in
x-insta360-platformand used to pick the client-identity constants. The desktop app sendswindows; a future Android build sendsandroid. - Region
- Cloud environment / region. The base host is region-selected; this user’s
desktop
startup.inireportedcurrent_area=OverSea→HOST_OPENAPI_INSTA360=openapi-g.insta360.com.
Traits§
- Progress
Sink - Progress callback:
(bytes_done, total_bytes_if_known). - Session
Store - Persistence for a
Session. Implementations decide where (file, keyring, Android secure storage). All methods are synchronous and cheap.
Functions§
- jwt_exp
- Decode a JWT’s
exp(unix seconds) without verifying the signature. - session_
token_ exp - If
tokenlooks like an Insta360 session token (a JWT whose payload carriesopenId), return itsexp(unix seconds). Used to pick the real session token out of arbitrary strings scraped from a browser session.
Type Aliases§
- Result
- Result alias used throughout the crate.