Compare commits

...

2 Commits

View File

@ -341,7 +341,13 @@ async fn download_list(cookie:String,asset_id_file_map:AssetIDFileMap)->AResult<
.buffer_unordered(CONCURRENT_REQUESTS) .buffer_unordered(CONCURRENT_REQUESTS)
.for_each(|b:AResult<_>|async{ .for_each(|b:AResult<_>|async{
match b{ match b{
Ok((dest,data))=>{ Ok((mut dest,data))=>{
//known file types
match &data[0..4]{
b"<rob"=>dest.set_extension("rbxm"),
b"\x89PNG"=>dest.set_extension("png"),
_=>false,
};
match tokio::fs::write(dest,data).await{ match tokio::fs::write(dest,data).await{
Err(e)=>eprintln!("fs error: {}",e), Err(e)=>eprintln!("fs error: {}",e),
_=>(), _=>(),