download version history
This commit is contained in:
parent
54ca5520b7
commit
1712e0c7e3
21
src/main.rs
21
src/main.rs
@ -169,17 +169,30 @@ fn read_readable(mut readable:impl Read)->AResult<Vec<u8>>{
|
|||||||
Ok(contents)
|
Ok(contents)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const BHOP_PLACEID:u64=252877716;
|
||||||
|
|
||||||
async fn download_list(cookie:String,asset_id_file_map:AssetIDFileMap)->AResult<()>{
|
async fn download_list(cookie:String,asset_id_file_map:AssetIDFileMap)->AResult<()>{
|
||||||
let client=reqwest::Client::new();
|
let client=reqwest::Client::new();
|
||||||
futures::stream::iter(asset_id_file_map)
|
futures::stream::iter(1..=1006)
|
||||||
.map(|(asset_id,file)|{
|
.map(|version_id|{
|
||||||
let client=&client;
|
let client=&client;
|
||||||
let cookie=cookie.as_str();
|
let cookie=cookie.as_str();
|
||||||
async move{
|
async move{
|
||||||
let resp=client.get(format!("https://assetdelivery.roblox.com/v1/asset/?ID={}",asset_id))
|
let mut url=reqwest::Url::parse("https://assetdelivery.roblox.com/v1/asset/")?;
|
||||||
|
//url borrow scope
|
||||||
|
{
|
||||||
|
let mut query=url.query_pairs_mut();//borrow here
|
||||||
|
query.append_pair("ID",BHOP_PLACEID.to_string().as_str());
|
||||||
|
query.append_pair("version",version_id.to_string().as_str());
|
||||||
|
}
|
||||||
|
println!("url={}",url);
|
||||||
|
let resp=client.get(url)
|
||||||
.header("Cookie",cookie)
|
.header("Cookie",cookie)
|
||||||
.send().await?;
|
.send().await?;
|
||||||
Ok((file,resp.bytes().await?))
|
|
||||||
|
let mut path=std::path::PathBuf::new();
|
||||||
|
path.set_file_name(BHOP_PLACEID.to_string()+"_v"+version_id.to_string().as_str()+".rbxl");
|
||||||
|
Ok((path,resp.bytes().await?))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.buffer_unordered(CONCURRENT_REQUESTS)
|
.buffer_unordered(CONCURRENT_REQUESTS)
|
||||||
|
Loading…
Reference in New Issue
Block a user