Skip to content

Commit

Permalink
rarbg: add non json response detection. resolves #13350
Browse files Browse the repository at this point in the history
  • Loading branch information
garfield69 committed Jul 10, 2022
1 parent 84f3811 commit 86d7a55
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Jackett.Common/Indexers/RarBG.cs
Expand Up @@ -141,6 +141,12 @@ private async Task<IEnumerable<ReleaseInfo>> PerformQueryWithRetry(TorznabQuery
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)
Expand Down

0 comments on commit 86d7a55

Please sign in to comment.