mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
rarbg: add non json response detection. resolves #13350
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user