Giter Site home page Giter Site logo

anti_captcha's Issues

Proxy Recaptcha Task fails due to incorrect nesting of proxy options

Just noticed that a Proxy Recaptcha task fails, with the following error from AntiCaptcha

ID: 24 | CODE: ERROR_INCORRECT_SESSION_DATA | Some of the required values for successive user emulation are missing. Missing property 'proxyAddress'

Had a look, it's because the params request has the details nested at the root level of the JSON payload, whereas if you look at the specs it should be nested in the task element.

https://anticaptcha.atlassian.net/wiki/spaces/API/pages/5079089/NoCaptchaTask+Google+Recaptcha+puzzle+solving

WHAT IT GENERATES

{
  "clientKey": "dce6bcbb1a728ea8d871de6d169a2057",
  "task": {
    "type": "NoCaptchaTask",
    "websiteURL": "http://mywebsite.com/recaptcha/test.php",
    "websiteKey": "6Lc_aCMTAAAAABx7u2N0D1XnVbI_v6ZdbM6rYf16",
  },
  "proxyType": "http",
  "proxyAddress": "8.8.8.8",
  "proxyPort": 8080,
  "proxyLogin": "proxyLoginHere",
  "proxyPassword": "proxyPasswordHere",
  "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36"
}

WHAT IT SHOULD GENERATE

{
    "clientKey":"dce6bcbb1a728ea8d871de6d169a2057",
    "task":
        {
            "type":"NoCaptchaTask",
            "websiteURL":"http://mywebsite.com/recaptcha/test.php",
            "websiteKey":"6Lc_aCMTAAAAABx7u2N0D1XnVbI_v6ZdbM6rYf16",
            "proxyType":"http",
            "proxyAddress":"8.8.8.8",
            "proxyPort":8080,
            "proxyLogin":"proxyLoginHere",
            "proxyPassword":"proxyPasswordHere",
            "userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36"
        }
}

Tested the simple fix, which is in the Client.

lib/anti_captcha/client.rb

if PROXYABLE_TASKS.include?(type)
  if proxy.nil?
    args[:task][:type] += 'Proxyless'
  else
    args.merge!(
      proxyType:     proxy[:proxy_type],
      proxyAddress:  proxy[:proxy_address],
      proxyPort:     proxy[:proxy_port],
      proxyLogin:    proxy[:proxy_login],
      proxyPassword: proxy[:proxy_password],
      userAgent:     proxy[:user_agent],
    )
  end
end

BECOMES

if PROXYABLE_TASKS.include?(type)
  if proxy.nil?
    args[:task][:type] += 'Proxyless'
  else
    args[:task].merge!(
      proxyType:     proxy[:proxy_type],
      proxyAddress:  proxy[:proxy_address],
      proxyPort:     proxy[:proxy_port],
      proxyLogin:    proxy[:proxy_login],
      proxyPassword: proxy[:proxy_password],
      userAgent:     proxy[:user_agent],
    )
  end
end

Support FunCaptcha

It would be nice if this supported FunCaptcha or allowed passing any captcha type.

Support hCaptcha

It would be good if there was also support for this type of captcha.

Can we change a time for Timeout?

Hi, thank you for your gem, looks very good, but sometimes I have error "Caused by Net::ReadTimeout: Net::ReadTimeout"

Can we change TImeout for a little bit longer because some time is not enough time to get a response from anti-captcha service?

Thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.