From 2d5a90ae31f0adcd6e0ff81be3c171da476767fb Mon Sep 17 00:00:00 2001 From: kaso17 Date: Tue, 4 Sep 2018 19:30:48 +0200 Subject: [PATCH] BaseIndexer: add cloudflare ReCaptcha detection --- src/Jackett.Common/Indexers/BaseIndexer.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Jackett.Common/Indexers/BaseIndexer.cs b/src/Jackett.Common/Indexers/BaseIndexer.cs index 7ec14993a..09bd47ac2 100644 --- a/src/Jackett.Common/Indexers/BaseIndexer.cs +++ b/src/Jackett.Common/Indexers/BaseIndexer.cs @@ -575,6 +575,11 @@ namespace Jackett.Common.Indexers { throw new Exception("Request to " + response.Request.Url + " failed (Error " + response.Status + ") - The tracker seems to be down."); } + + if (response.Status == System.Net.HttpStatusCode.Forbidden && response.Content.Contains("Please complete the security check to access")) + { + throw new Exception("Request to " + response.Request.Url + " failed (Error " + response.Status + ") - The page is protected by an Cloudflare reCaptcha. The page is in aggressive DDoS mitigation mode or your IP might be blacklisted (e.g. in case of shared VPN IPs). There's no easy way of making it usable with Jackett."); + } } protected async Task FollowIfRedirect(WebClientStringResult response, string referrer = null, string overrideRedirectUrl = null, string overrideCookies = null, bool accumulateCookies = false)