From 77cbb73291582a418359d4d753500df0072fe1a7 Mon Sep 17 00:00:00 2001 From: Vort Date: Mon, 15 Jan 2024 19:01:27 +0200 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=BE=D0=BF=D1=8B=D1=82=D0=BA=D0=B0=20?= =?UTF-8?q?=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=B8=D1=82=D1=8C=20=D0=BA?= =?UTF-8?q?=D1=80=D0=B5=D1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PetScan.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/PetScan.cs b/PetScan.cs index d1fb137..4853244 100644 --- a/PetScan.cs +++ b/PetScan.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Net; using System.Text; +using System.Threading; namespace WikiTasks { @@ -35,6 +36,8 @@ class PetScanResult1 { [JsonProperty(PropertyName = "*")] public PetScanResult2[] Unk; + [JsonProperty(PropertyName = "error")] + public string Error; } class PetScan : Api @@ -163,10 +166,14 @@ public static PetScanEntry[] Query(params string[] additionalParameters) { continue; } - break; + var petScanResult = JsonConvert.DeserializeObject(json); + if (petScanResult.Error == "No result for source categories") + { + Thread.Sleep(60000); + continue; + } + return petScanResult.Unk[0].Unk.Entries; } - var petScanResult = JsonConvert.DeserializeObject(json); - return petScanResult.Unk[0].Unk.Entries; } } }