mirror of
https://jihulab.com/DGP-Studio/Snap.Hutao.Deployment.git
synced 2025-11-19 21:08:45 +08:00
Compare commits
3 Commits
feat/corru
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5947280fe3 | ||
|
|
4ca20b57e3 | ||
|
|
b81ef222bd |
@@ -2,7 +2,7 @@
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>Snap.Hutao.Deployment.Runtime</id>
|
||||
<version>1.16.1</version>
|
||||
<version>1.16.3</version>
|
||||
<authors>DGP Studio</authors>
|
||||
<developmentDependency>true</developmentDependency>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
|
||||
Binary file not shown.
@@ -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.3]
|
||||
PackagePath: {path}
|
||||
FamilyName: {name}
|
||||
------------------------------------------------------------
|
||||
|
||||
@@ -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<DownloadStatus> 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<DownloadStatus> options = new()
|
||||
{
|
||||
HttpClient = httpClient,
|
||||
SourceUrl = "https://api.snapgenshin.com/patch/hutao/download",
|
||||
DestinationFilePath = packagePath,
|
||||
StatusFactory = (bytesRead, totalBytes) => new DownloadStatus(bytesRead, totalBytes),
|
||||
};
|
||||
|
||||
using (HttpShardCopyWorker<DownloadStatus> worker = await HttpShardCopyWorker<DownloadStatus>.CreateAsync(options).ConfigureAwait(false))
|
||||
{
|
||||
Progress<DownloadStatus> progress = new(ConsoleWriteProgress);
|
||||
await worker.CopyAsync(progress).ConfigureAwait(false);
|
||||
using (HttpShardCopyWorker<DownloadStatus> worker = await HttpShardCopyWorker<DownloadStatus>.CreateAsync(options).ConfigureAwait(false))
|
||||
{
|
||||
Progress<DownloadStatus> progress = new(ConsoleWriteProgress);
|
||||
await worker.CopyAsync(progress).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user