diff --git a/src/Snap.Hutao.Deployment.Runtime/Snap.Hutao.Deployment.Runtime.nuspec b/src/Snap.Hutao.Deployment.Runtime/Snap.Hutao.Deployment.Runtime.nuspec index 7376b98..f71330c 100644 --- a/src/Snap.Hutao.Deployment.Runtime/Snap.Hutao.Deployment.Runtime.nuspec +++ b/src/Snap.Hutao.Deployment.Runtime/Snap.Hutao.Deployment.Runtime.nuspec @@ -2,7 +2,7 @@ Snap.Hutao.Deployment.Runtime - 1.16.1 + 1.16.2 DGP Studio true false diff --git a/src/Snap.Hutao.Deployment.Runtime/Snap.Hutao.Deployment.exe b/src/Snap.Hutao.Deployment.Runtime/Snap.Hutao.Deployment.exe index d7f4d01..4b19385 100644 Binary files a/src/Snap.Hutao.Deployment.Runtime/Snap.Hutao.Deployment.exe and b/src/Snap.Hutao.Deployment.Runtime/Snap.Hutao.Deployment.exe differ diff --git a/src/Snap.Hutao.Deployment/Invocation.cs b/src/Snap.Hutao.Deployment/Invocation.cs index c40caa9..614186f 100644 --- a/src/Snap.Hutao.Deployment/Invocation.cs +++ b/src/Snap.Hutao.Deployment/Invocation.cs @@ -23,7 +23,7 @@ internal static partial class Invocation ArgumentException.ThrowIfNullOrEmpty(path); Console.WriteLine($""" - Snap Hutao Deployment Tool [1.16.1] + Snap Hutao Deployment Tool [1.16.2] PackagePath: {path} FamilyName: {name} ------------------------------------------------------------ diff --git a/src/Snap.Hutao.Deployment/Package.cs b/src/Snap.Hutao.Deployment/Package.cs index b1eda56..ccee90d 100644 --- a/src/Snap.Hutao.Deployment/Package.cs +++ b/src/Snap.Hutao.Deployment/Package.cs @@ -34,20 +34,23 @@ internal static class Package public static async Task DownloadPackageAsync(string packagePath) { - using (HttpClient httpClient = new()) + using (HttpClientHandler handler = new() { UseCookies = false }) { - HttpShardCopyWorkerOptions options = new() + using (HttpClient httpClient = new(handler)) { - HttpClient = httpClient, - SourceUrl = "https://api.snapgenshin.com/patch/hutao/download", - DestinationFilePath = packagePath, - StatusFactory = (bytesRead, totalBytes) => new DownloadStatus(bytesRead, totalBytes), - }; + HttpShardCopyWorkerOptions options = new() + { + HttpClient = httpClient, + SourceUrl = "https://api.snapgenshin.com/patch/hutao/download", + DestinationFilePath = packagePath, + StatusFactory = (bytesRead, totalBytes) => new DownloadStatus(bytesRead, totalBytes), + }; - using (HttpShardCopyWorker worker = await HttpShardCopyWorker.CreateAsync(options).ConfigureAwait(false)) - { - Progress progress = new(ConsoleWriteProgress); - await worker.CopyAsync(progress).ConfigureAwait(false); + using (HttpShardCopyWorker worker = await HttpShardCopyWorker.CreateAsync(options).ConfigureAwait(false)) + { + Progress progress = new(ConsoleWriteProgress); + await worker.CopyAsync(progress).ConfigureAwait(false); + } } }