### Add snapsave-parser to Cargo.toml Source: https://github.com/desiders/snapsave-parser/blob/master/README.md Add the snapsave-parser and tokio dependencies to your Cargo.toml file to use the library. Tokio is used for the asynchronous runtime in the examples. ```toml [dependencies] snapsave-parser = "0.1" tokio = { version = "1", features = ["macros", "rt-multi-thread"] } ``` -------------------------------- ### JSON Result Shape Example Source: https://github.com/desiders/snapsave-parser/blob/master/README.md The data returned by the download method serializes to a JSON structure matching snapsave.app's media shape. It includes URLs, thumbnails, and media types. ```json { "media": [ { "url": "https://d.rapidcdn.app/v2?token=…", "thumbnail": "https://d.rapidcdn.app/thumb?token=…", "type": "video" } ] } ``` -------------------------------- ### Basic Usage: Download Instagram Media Source: https://github.com/desiders/snapsave-parser/blob/master/README.md Construct a SnapSave instance and use its download method to get media URLs from an Instagram post. The result is processed to print media types and URLs. ```rust use snapsave_parser::SnapSave; #[tokio::main] async fn main() -> Result<(), snapsave_parser::Error> { let snap = SnapSave::new()?; match snap.download("https://www.instagram.com/p/C51YHfWJwHK/", None).await { Ok(data) => { for media in data.media { println!("{:?} -> {}", media.r#type, media.url.unwrap_or_default()); } } Err(error) => eprintln!("failed: {error}"), } Ok(()) } ``` -------------------------------- ### Development Commands Source: https://github.com/desiders/snapsave-parser/blob/master/README.md Run development tasks such as code formatting, linting, and testing using the provided 'just' commands. Integration tests hit the live snapsave.app service. ```sh just fmt # cargo +nightly fmt --all just lint # cargo clippy --all-features -- -W clippy::pedantic just test # cargo test (offline unit tests) just test-integration # cargo test -- --ignored (hits snapsave.app) ``` -------------------------------- ### Configure Proxy for SnapSave Source: https://github.com/desiders/snapsave-parser/blob/master/README.md Initialize SnapSave with proxy support by providing the proxy URL during construction. Supports HTTP, HTTPS, and SOCKS5 proxies. ```rust use snapsave_parser::SnapSave; let snap = SnapSave::with_proxy("socks5://127.0.0.1:1080")?; ``` -------------------------------- ### Configure Download Options Source: https://github.com/desiders/snapsave-parser/blob/master/README.md Customize download behavior by providing SnapSaveDownloaderOptions. Options include retries, retry delay, and user agent override. ```rust use snapsave_parser::SnapSaveDownloaderOptions; let options = SnapSaveDownloaderOptions { retry: Some(3), // extra attempts on failure (default: 1) retry_delay: Some(500), // ms between attempts (default: 500) user_agent: None, // override the default UA (per request) }; // snap.download("https://www.facebook.com/watch?v=1234567890123456", Some(options)).await; ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.