New: CloudFlare Detection Improvements & DDOS Guard Support

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

@ -63,9 +63,23 @@ namespace NzbDrone.Core.Http.CloudFlare
private bool IsCloudflareProtected(HttpResponse response)
{
// check response headers for cloudflare
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;
}
// detect Custom CloudFlare/DDOS Guard
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