From 938315cebd193487d8f10fc728e22dc5b55554d3 Mon Sep 17 00:00:00 2001 From: Diego Heras Date: Wed, 4 Nov 2020 23:01:58 +0100 Subject: [PATCH] core: remove legacy cloudflare code (#10110) --- src/Jackett.Common/Utils/BrowserUtil.cs | 35 ++----------------- src/Jackett.Common/Utils/Clients/WebClient.cs | 2 -- 2 files changed, 2 insertions(+), 35 deletions(-) diff --git a/src/Jackett.Common/Utils/BrowserUtil.cs b/src/Jackett.Common/Utils/BrowserUtil.cs index 24ffce888..d6008981f 100644 --- a/src/Jackett.Common/Utils/BrowserUtil.cs +++ b/src/Jackett.Common/Utils/BrowserUtil.cs @@ -1,45 +1,14 @@ using System; -using System.Text.RegularExpressions; namespace Jackett.Common.Utils { public static class BrowserUtil { - // When updating these make sure they are not detected by the incapsula bot detection engine (e.g. kickasstorrent indexer) + // When updating these make sure they are not detected by the incapsula bot detection engine + // (e.g. kickasstorrent indexer) public static string ChromeUserAgent => Environment.OSVersion.Platform == PlatformID.Unix ? "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36" : "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36"; - // This can be used to decode e-mail addresses protected by cloudflare - public static string DecodeCloudFlareProtectedEmail(string input) - { - var key = Convert.ToInt32(input.Substring(0, 2), 16); - var result = ""; - for (var i = 2; i < input.Length - 1; i += 2) - { - var hexChar = input.Substring(i, 2); - var intChar = Convert.ToInt32(hexChar, 16) ^ key; - var strChar = Convert.ToChar(intChar); - result += strChar; - } - return result; - } - - // decode cloudflare protected emails in a HTML document - public static string DecodeCloudFlareProtectedEmailFromHTML(string html) - { - var CFEMailRegex = new Regex("\\[email protected\\]<\\/span>