lib/zero_captcha/client.rb
# Decode the text from an image (i.e. solve a captcha).
#
# @param [Hash] options Options hash.
# @option options [String]  :url   URL of the image to be decoded.
# @option options [String]  :path  File path of the image to be decoded.
# @option options [File]    :file  File instance with image to be decoded.
# @option options [String]  :raw   Binary content of the image to be
#                                  decoded.
# @option options [String]  :raw64 Binary content encoded in base64 of the
#                                  image to be decoded.
#
# @return [ZeroCaptcha::Captcha] The captcha (with solution) if an error
#                                is not raised.
#
Decode the text from an image .
Decode the text from an image .
def decode!(options = {})
      raw64   = load_captcha(options)
      solver  = options[:solver]
      response = request(solver, :multipart, image64: raw64)
      captcha = ZeroCaptcha::Captcha.new(response)
      fail(ZeroCaptcha::IncorrectSolution) unless captcha.correct?
      captcha
    end
def decode! ( options = { } ) raw64 = load_captcha ( options ) solver = options [ :solver ] response = request ( solver , :multipart , image64 : raw64 ) captcha = ZeroCaptcha :: Captcha . new ( response ) fail ( ZeroCaptcha :: IncorrectSolution ) unless captcha . correct? captcha end
Decode the text from an image (i.e.
Decode the text from an image ( i . e .
The captcha (with solution) if an error is not raised.
The captcha ( with solution ) if an error is not raised .
ZeroCaptcha::Captcha
options
:raw64 Binary content encoded in base64 of the image to be decoded.
: raw64 Binary content encoded in base64 of the image to be decoded .
options Options hash.
options Options hash .