diff --git a/src/main.rs b/src/main.rs index 51fa16c..6a76fc5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -58,12 +58,12 @@ struct DownloadHistorySubcommand{ } #[derive(Args)] struct DownloadSubcommand{ - #[arg(long,group="api_key",required=true)] - api_key_literal:Option, - #[arg(long,group="api_key",required=true)] - api_key_envvar:Option, - #[arg(long,group="api_key",required=true)] - api_key_file:Option, + #[arg(long,group="cookie",required=true)] + cookie_literal:Option, + #[arg(long,group="cookie",required=true)] + cookie_envvar:Option, + #[arg(long,group="cookie",required=true)] + cookie_file:Option, #[arg(long)] output_folder:Option, #[arg(required=true)] @@ -358,10 +358,10 @@ async fn main()->AResult<()>{ Commands::Download(subcommand)=>{ let output_folder=subcommand.output_folder.unwrap_or_else(||std::env::current_dir().unwrap()); download_list( - api_key_from_args( - subcommand.api_key_literal, - subcommand.api_key_envvar, - subcommand.api_key_file, + cookie_from_args( + subcommand.cookie_literal, + subcommand.cookie_envvar, + subcommand.cookie_file, ).await?, subcommand.asset_ids.into_iter().map(|asset_id|{ let mut path=output_folder.clone(); @@ -645,13 +645,13 @@ async fn upload_place(config:UploadPlaceConfig)->AResult<()>{ Ok(()) } -async fn download_list(api_key:ApiKey,asset_id_file_map:AssetIDFileMap)->AResult<()>{ - let context=CloudContext::new(api_key); +async fn download_list(cookie:Cookie,asset_id_file_map:AssetIDFileMap)->AResult<()>{ + let context=CookieContext::new(cookie); futures::stream::iter(asset_id_file_map.into_iter() .map(|(asset_id,file)|{ let context=&context; async move{ - Ok((file,context.get_asset(rbx_asset::cloud::GetAssetRequest{asset_id,version:None}).await?)) + Ok((file,context.get_asset(rbx_asset::cookie::GetAssetRequest{asset_id,version:None}).await?)) } })) .buffer_unordered(CONCURRENT_REQUESTS)