diff --git a/src/main.rs b/src/main.rs index c76ddf6..23c504c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -62,7 +62,21 @@ fn get_scripts(dom:rbx_dom_weak::WeakDom) -> Vec{ } fn download(map_list: Vec) -> Result<(), Box>{ - unimplemented!() + let header=format!("Cookie: .ROBLOSECURITY={}",std::env::var("RBXCOOKIE")?); + let shared_args=&[ + "-q", + "--header", + header.as_str(), + "-O", + ]; + for map_id in map_list.iter() { + std::process::Command::new("wget") + .args(shared_args) + .arg(format!("maps/unprocessed/{}.rbxl",map_id)) + .arg(format!("https://assetdelivery.roblox.com/v1/asset/?ID={}",map_id)) + .spawn()?; + } + Ok(()) } fn scan() -> Result<(), Box>{ let mut id = 0u32;