Sha256: c1267de4efa146305e9bd1acb98fc4e3e0836958fceaaab504ff9f58f8fdb201

Contents?: true

Size: 799 Bytes

Versions: 4

Compression:

Stored size: 799 Bytes

Contents

module AntiCaptcha
  class GeetestSolution < AntiCaptcha::Solution
    attr_accessor :v3, :v4

    def initialize(task_result = nil)
      super

      if task_result
        solution = task_result.api_result['solution']

        if solution['pass_token']
          @v4 = {
            'captcha_id'     => solution['captcha_id'],
            'lot_number'     => solution['lot_number'],
            'pass_token'     => solution['pass_token'],
            'gen_time'       => solution['gen_time'],
            'captcha_output' => solution['captcha_output'],
          }

        else
          @v3 = {
            'challenge' => solution['challenge'],
            'validate'  => solution['validate'],
            'seccode'   => solution['seccode'],
          }
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
anti_captcha-2.6.1 lib/anti_captcha/models/geetest_solution.rb
anti_captcha-2.6.0 lib/anti_captcha/models/geetest_solution.rb
anti_captcha-2.5.0 lib/anti_captcha/models/geetest_solution.rb
anti_captcha-2.4.0 lib/anti_captcha/models/geetest_solution.rb