From 8c39c9e475e5bfd85da144215e717e2de1dd300f Mon Sep 17 00:00:00 2001 From: Nikolaj Olsson Date: Wed, 22 Jan 2025 17:06:51 +0100 Subject: [PATCH] More retry --- src/ui/Forms/Tts/TextToSpeech.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ui/Forms/Tts/TextToSpeech.cs b/src/ui/Forms/Tts/TextToSpeech.cs index 7c7a94ae7..da501bd8b 100644 --- a/src/ui/Forms/Tts/TextToSpeech.cs +++ b/src/ui/Forms/Tts/TextToSpeech.cs @@ -1179,6 +1179,12 @@ namespace Nikse.SubtitleEdit.Forms.Tts result = httpClient.PostAsync(url, content, CancellationToken.None).Result; } + if ((int)result.StatusCode == 429) + { + Task.Delay(2707).Wait(); + result = httpClient.PostAsync(url, content, CancellationToken.None).Result; + } + var bytes = result.Content.ReadAsByteArrayAsync().Result; if (!result.IsSuccessStatusCode)