1
0
Fork 0
mirror of https://github.com/Jackett/Jackett synced 2025-03-11 22:52:58 +00:00

rarbg: add non json response detection. resolves #13350

This commit is contained in:
Garfield69 2022-07-11 07:33:32 +12:00
parent 84f3811ce7
commit 86d7a55329

View file

@ -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<int>("error_code");
switch (errorCode)