diff --git a/LanguageBaseEnglish.xml b/LanguageBaseEnglish.xml index 1ba4c9f12..0432e37f3 100644 --- a/LanguageBaseEnglish.xml +++ b/LanguageBaseEnglish.xml @@ -2,7 +2,7 @@ Subtitle Edit - 4.0.9 + 4.0.10 Translated by Nikse en-US diff --git a/src/libse/AutoTranslate/DeepLTranslate.cs b/src/libse/AutoTranslate/DeepLTranslate.cs index a1a4dc2d4..231af3588 100644 --- a/src/libse/AutoTranslate/DeepLTranslate.cs +++ b/src/libse/AutoTranslate/DeepLTranslate.cs @@ -141,6 +141,20 @@ namespace Nikse.SubtitleEdit.Core.AutoTranslate var result = _client.PostAsync("/v2/translate", postContent, cancellationToken).Result; var resultContent = result.Content.ReadAsStringAsync().Result; + if (result.StatusCode == HttpStatusCode.ServiceUnavailable) + { + Task.Delay(555).Wait(); + result = _client.PostAsync("/v2/translate", postContent, cancellationToken).Result; + resultContent = result.Content.ReadAsStringAsync().Result; + } + + if (result.StatusCode == HttpStatusCode.ServiceUnavailable) + { + Task.Delay(1007).Wait(); + result = _client.PostAsync("/v2/translate", postContent, cancellationToken).Result; + resultContent = result.Content.ReadAsStringAsync().Result; + } + if (!result.IsSuccessStatusCode) { SeLogger.Error("DeepLTranslate error: " + resultContent); diff --git a/src/libse/AutoTranslate/DeepLXTranslate.cs b/src/libse/AutoTranslate/DeepLXTranslate.cs index 5daba0ecb..dda768595 100644 --- a/src/libse/AutoTranslate/DeepLXTranslate.cs +++ b/src/libse/AutoTranslate/DeepLXTranslate.cs @@ -57,6 +57,20 @@ namespace Nikse.SubtitleEdit.Core.AutoTranslate var result = _client.PostAsync("/v2/translate", postContent, cancellationToken).Result; var resultContent = result.Content.ReadAsStringAsync().Result; + if (result.StatusCode == HttpStatusCode.ServiceUnavailable) + { + Task.Delay(555).Wait(); + result = _client.PostAsync("/v2/translate", postContent, cancellationToken).Result; + resultContent = result.Content.ReadAsStringAsync().Result; + } + + if (result.StatusCode == HttpStatusCode.ServiceUnavailable) + { + Task.Delay(1007).Wait(); + result = _client.PostAsync("/v2/translate", postContent, cancellationToken).Result; + resultContent = result.Content.ReadAsStringAsync().Result; + } + if (!result.IsSuccessStatusCode) { SeLogger.Error("DeepLTranslate error: " + resultContent); diff --git a/winget/Nikse.SubtitleEdit.installer.yaml b/winget/Nikse.SubtitleEdit.installer.yaml index c297d6fa4..9e2e462f2 100644 --- a/winget/Nikse.SubtitleEdit.installer.yaml +++ b/winget/Nikse.SubtitleEdit.installer.yaml @@ -2,7 +2,7 @@ # yaml-language-server: $schema=https://aka.ms/winget-manifest.installer.1.6.0.schema.json PackageIdentifier: Nikse.SubtitleEdit -PackageVersion: 4.0.9.0 +PackageVersion: 4.0.10.0 InstallerType: inno FileExtensions: - srt @@ -23,8 +23,8 @@ FileExtensions: ProductCode: SubtitleEdit_is1 Installers: - Architecture: x64 - InstallerUrl: https://github.com/SubtitleEdit/subtitleedit/releases/download/4.0.9/SubtitleEdit-4.0.9-Setup.exe - InstallerSha256: F1DBC298F29AA28391977869B3955EE07CAF8622FF79C66046D6C90A4D6F77EA + InstallerUrl: https://github.com/SubtitleEdit/subtitleedit/releases/download/4.0.10/SubtitleEdit-4.0.10-Setup.exe + InstallerSha256: 1677D2E5DABB08EA76B4B32DBCDE302B395AD8D5A613AC34C4E582B3502CC66F ManifestType: installer ManifestVersion: 1.6.0 diff --git a/winget/Nikse.SubtitleEdit.locale.en-US.yaml b/winget/Nikse.SubtitleEdit.locale.en-US.yaml index 8b3829567..ae244da33 100644 --- a/winget/Nikse.SubtitleEdit.locale.en-US.yaml +++ b/winget/Nikse.SubtitleEdit.locale.en-US.yaml @@ -2,7 +2,7 @@ # yaml-language-server: $schema=https://aka.ms/winget-manifest.defaultLocale.1.6.0.schema.json PackageIdentifier: Nikse.SubtitleEdit -PackageVersion: 4.0.9.0 +PackageVersion: 4.0.10.0 PackageLocale: en-US Publisher: Nikse PublisherUrl: https://www.nikse.dk/ diff --git a/winget/Nikse.SubtitleEdit.yaml b/winget/Nikse.SubtitleEdit.yaml index ccdf3c72a..b664d1308 100644 --- a/winget/Nikse.SubtitleEdit.yaml +++ b/winget/Nikse.SubtitleEdit.yaml @@ -2,7 +2,7 @@ # yaml-language-server: $schema=https://aka.ms/winget-manifest.version.1.6.0.schema.json PackageIdentifier: Nikse.SubtitleEdit -PackageVersion: 4.0.9.0 +PackageVersion: 4.0.10.0 DefaultLocale: en-US ManifestType: version ManifestVersion: 1.6.0