NopeCHALLC / nopecha-nodejs

Automated CAPTCHA solver for Node.js.
MIT License
918 stars 3 forks source link

HTTP 409 (Conflict) hcaptcha error. #3

Closed oyunvfg closed 7 months ago

oyunvfg commented 9 months ago

c# windows forms

private async void nopecatpchatken_Click(object sender, EventArgs e) { string apiKey = "I'm Api Key"; // API anahtarınızı buraya ekleyin string siteKey = "ab803303-ac41-41aa-9be1-7b4e01b91e2c"; string apiUrl = "https://api.nopecha.com/token";

    // hCaptcha request
    using (HttpClient client = new HttpClient())
    {
        var requestContent = new
        {
            type = "hcaptcha",
            sitekey = siteKey,
            url = "https://nopecha.com/demo/hcaptcha#hard",
            key = apiKey
        };

        var response = await client.PostAsJsonAsync(apiUrl, requestContent);

        if (response.IsSuccessStatusCode)
        {
            var responseData = await response.Content.ReadAsAsync<dynamic>();
            string job_id = responseData.data;

            // hCaptcha HTTP 409 ERROR
            var tokenResponse = await client.GetStringAsync($"{apiUrl}?key={apiKey}&id={job_id}");
            var hCaptchaToken = tokenResponse.Trim();

           nopecaptchatext.Text = $"hCaptcha Token: {hCaptchaToken}";
        }
        else
        {
            nopecaptchatext.Text =  $"Error: {response.StatusCode} - {response.ReasonPhrase}";
        }
    }
}
NopeCHALLC commented 7 months ago

You are sending a POST request to upload the hCaptcha job, which returns the ID of this job.

The solution for this job is retrieved with a GET request with the ID from the POST request.

Please refer to the API documentation for more information.