From 694440bd29641223b929c310e74d930854df99f2 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 11 Sep 2023 17:42:03 -0700 Subject: [PATCH] use wget to download maps --- src/main.rs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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;