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:
parent
84f3811ce7
commit
86d7a55329
1 changed files with 6 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue