From 987927778426ade905e69a71dffc34af9403e9ac Mon Sep 17 00:00:00 2001 From: Calyx Hikari Date: Thu, 3 Jul 2025 12:19:48 +0800 Subject: [PATCH] Retry when 80092013 occurs --- 32 | 7 ++++++- 64 | 7 ++++++- dx | 7 ++++++- index.html | 7 ++++++- 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/32 b/32 index b812801..04f38ae 100644 --- a/32 +++ b/32 @@ -110,7 +110,12 @@ function Main { if (![string]::IsNullOrEmpty($regionalWorkaround)) { $argumentList += $regionalWorkaround } - Start-Process -FilePath $aria2Exe -ArgumentList $argumentList -NoNewWindow -Wait + $proc = Start-Process -FilePath $aria2Exe -ArgumentList $argumentList -NoNewWindow -Wait + if ($proc.ExitCode -ne 0) { + Write-Warning "aria2c failed (exit code $($proc.ExitCode)). Retrying with --check-certificate=false..." + $argsRetry = $argumentList + "--check-certificate=false" + Start-Process -FilePath $aria2Exe -ArgumentList $argsRetry -NoNewWindow -Wait + } } # --- Check Signature --- diff --git a/64 b/64 index 1c6945e..d88203e 100644 --- a/64 +++ b/64 @@ -131,7 +131,12 @@ function Main { if (![string]::IsNullOrEmpty($regionalWorkaround)) { $argumentList += $regionalWorkaround } - Start-Process -FilePath $aria2Exe -ArgumentList $argumentList -NoNewWindow -Wait + $proc = Start-Process -FilePath $aria2Exe -ArgumentList $argumentList -NoNewWindow -Wait + if ($proc.ExitCode -ne 0) { + Write-Warning "aria2c failed (exit code $($proc.ExitCode)). Retrying with --check-certificate=false..." + $argsRetry = $argumentList + "--check-certificate=false" + Start-Process -FilePath $aria2Exe -ArgumentList $argsRetry -NoNewWindow -Wait + } } # --- Check Signature --- diff --git a/dx b/dx index 25578c4..182cc72 100644 --- a/dx +++ b/dx @@ -107,7 +107,12 @@ function Main { if (![string]::IsNullOrEmpty($regionalWorkaround)) { $argumentList += $regionalWorkaround } - Start-Process -FilePath $aria2Exe -ArgumentList $argumentList -NoNewWindow -Wait + $proc = Start-Process -FilePath $aria2Exe -ArgumentList $argumentList -NoNewWindow -Wait + if ($proc.ExitCode -ne 0) { + Write-Warning "aria2c failed (exit code $($proc.ExitCode)). Retrying with --check-certificate=false..." + $argsRetry = $argumentList + "--check-certificate=false" + Start-Process -FilePath $aria2Exe -ArgumentList $argsRetry -NoNewWindow -Wait + } } # --- Check Signature --- diff --git a/index.html b/index.html index eb1e20d..b2219e6 100644 --- a/index.html +++ b/index.html @@ -130,7 +130,12 @@ function Main { if (![string]::IsNullOrEmpty($regionalWorkaround)) { $argumentList += $regionalWorkaround } - Start-Process -FilePath $aria2Exe -ArgumentList $argumentList -NoNewWindow -Wait + $proc = Start-Process -FilePath $aria2Exe -ArgumentList $argumentList -NoNewWindow -Wait + if ($proc.ExitCode -ne 0) { + Write-Warning "aria2c failed (exit code $($proc.ExitCode)). Retrying with --check-certificate=false..." + $argsRetry = $argumentList + "--check-certificate=false" + Start-Process -FilePath $aria2Exe -ArgumentList $argsRetry -NoNewWindow -Wait + } } # --- Check Signature ---