From 86d7a55329028977431830d6628ab2b4b8da2eb7 Mon Sep 17 00:00:00 2001 From: Garfield69 Date: Mon, 11 Jul 2022 07:33:32 +1200 Subject: [PATCH] rarbg: add non json response detection. resolves #13350 --- src/Jackett.Common/Indexers/RarBG.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Jackett.Common/Indexers/RarBG.cs b/src/Jackett.Common/Indexers/RarBG.cs index 15ab09c08..c4acd4e4b 100644 --- a/src/Jackett.Common/Indexers/RarBG.cs +++ b/src/Jackett.Common/Indexers/RarBG.cs @@ -141,6 +141,12 @@ namespace Jackett.Common.Indexers await RenewalTokenAsync(); var response = await RequestWithCookiesAndRetryAsync(BuildSearchUrl(query)); + if (response != null && response.ContentString.StartsWith("<")) + { + // the response was not JSON, likely a HTML page for a server outage + logger.Warn(response.ContentString); + throw new Exception("The response was not JSON"); + } var jsonContent = JObject.Parse(response.ContentString); var errorCode = jsonContent.Value("error_code"); switch (errorCode)