<commit_before>﻿using System;
using System.Text.RegularExpressions;
using Azuria.Utilities.ErrorHandling;
using JetBrains.Annotations;

namespace Azuria.Utilities.Net
{
    internal static class CloudflareSolver
    {
        #region

        internal static ProxerResult<string> Solve([NotNull] string response, [NotNull] Uri originalUri)
        {
            try
            {
                string lWierdVarMatch = new Regex("var\\s*?t,r,a,f,\\s?(\\S+?;)").Match(response).Groups[1].Value;
                string lWierdVar = lWierdVarMatch.Split('=')[0];
                string lWierdEquasion =
                    new Regex($"({lWierdVar}\\S+?);a.value = parseInt").Match(response).Groups[1].Value;
                string lScript = "var " + lWierdVarMatch + lWierdEquasion;
                int lCloudflareAnswer = Convert.ToInt32(JsEval.Eval(lScript)) + originalUri.Host.Length;

                string lChallengeId = new Regex("name=\"jschl_vc\" value=\"(\\w+)\"").Match(response).Groups[1].Value;
                string lChallengePass = new Regex("name=\"pass\" value=\"(.+?)\"").Match(response).Groups[1].Value;

                if (string.IsNullOrEmpty(lChallengeId.Trim()) || string.IsNullOrEmpty(lChallengePass.Trim()) ||
                    lCloudflareAnswer == int.MinValue)
                    return new ProxerResult<string>(new Exception[0]);

                return
                    new ProxerResult<string>(
                        $"jschl_vc={lChallengeId}&pass={lChallengePass}&jschl_answer={lCloudflareAnswer}");
            }
            catch
            {
                return new ProxerResult<string>(new Exception[0]);
            }
        }

        #endregion
    }
}<commit_msg>Fix CloudflareSolver<commit_after>﻿using System;
using System.Text.RegularExpressions;
using Azuria.Utilities.ErrorHandling;
using JetBrains.Annotations;

namespace Azuria.Utilities.Net
{
    internal static class CloudflareSolver
    {
        #region

        internal static ProxerResult<string> Solve([NotNull] string response, [NotNull] Uri originalUri)
        {
            try
            {
                GroupCollection lWierdEquasion =
                    new Regex(@"(var s, t, o, p[\S\s]+?};)[\S\s]+?(zyrziLd[\S\s]+?)a\.value = parseInt[\S\s]+?;").Match(
                        response).Groups;
                string lScript = "var " + lWierdEquasion[1] + lWierdEquasion[2];
                int lCloudflareAnswer = Convert.ToInt32(JsEval.Eval(lScript)) + originalUri.Host.Length;

                string lChallengeId = new Regex("name=\"jschl_vc\" value=\"(\\w+)\"").Match(response).Groups[1].Value;
                string lChallengePass = new Regex("name=\"pass\" value=\"(.+?)\"").Match(response).Groups[1].Value;

                if (string.IsNullOrEmpty(lChallengeId.Trim()) || string.IsNullOrEmpty(lChallengePass.Trim()) ||
                    lCloudflareAnswer == int.MinValue)
                    return new ProxerResult<string>(new Exception[0]);

                return
                    new ProxerResult<string>(
                        $"jschl_vc={lChallengeId}&pass={lChallengePass}&jschl_answer={lCloudflareAnswer}");
            }
            catch
            {
                return new ProxerResult<string>(new Exception[0]);
            }
        }

        #endregion
    }
}
{'fraction_non_alphanumeric': 0.13341346153846154, 'fraction_numerical': 0.005108173076923077, 'mean_word_length': 2.111214953271028, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6801918', 'n_tokens_mistral': 1035, 'n_tokens_neox': 961, 'n_words': 149}