New: (FlareSolverr) DDOS Guard Support

(based on Flaresolverr b62c203f96222602964a291b845e4d16c1a0d43a)
pull/825/head
bakerboy448 3 years ago
parent 9c816e6e35
commit 7faa939af3

@ -70,7 +70,7 @@ namespace NzbDrone.Core.IndexerProxies.FlareSolverr
InjectCookies(newRequest, result);
//Request again with User-Agent and Cookies from Flaresolvrr
//Request again with User-Agent and Cookies from Flaresolverr
var finalResponse = _httpClient.Execute(newRequest);
return finalResponse;
@ -82,9 +82,25 @@ namespace NzbDrone.Core.IndexerProxies.FlareSolverr
if (response.StatusCode.Equals(HttpStatusCode.ServiceUnavailable) ||
response.StatusCode.Equals(HttpStatusCode.Forbidden))
{
// check response headers
return response.Headers.Any(i =>
i.Key != null && i.Key.ToLower() == "server" && CloudflareServerNames.Contains(i.Value.ToLower()));
{
// check response headers for CloudFlare
if (response.Headers.Any(i =>
i.Key != null && i.Key.ToLower() == "server" && CloudflareServerNames.Contains(i.Value.ToLower())))
{
return true;
}
return false;
}
}
// detect Custom CloudFlare/DDOS Guard - HTTP will likely return 200 so we do this outside of checking the code
if (response.Headers.Any(i =>
i.Key != null && i.Key.ToLower() == "Accept-Encoding,User-Agent") &&
response.Headers.ContentType.ToString() == "" &&
response.Content.ToLower().Contains("ddos"))
{
return true;
}
return false;

Loading…
Cancel
Save