CAPTCHAFORUM
Administrator
imagetyperzapi is a super easy to use bypass captcha API wrapper for imagetyperz.com captcha service
Installation
gem "imagetyperzapi", :git => "git://github.com/imagetyperz-api/imagetyperz-api-ruby.git"
or
git clone https://github.com/imagetyperz-api/imagetyperz-api-ruby
Usage
Simply require the module, set the auth details and start using the captcha service:
load "lib/imagetyperzapi.rb"
Set access_token for authentication:
# grab token from https://imagetyperz.com
access_token = "your_access_token"
ita = ImageTyperzAPI.new(access_token)
Once you've set your authentication details, you can start using the API.
Get balance
balance = ita.account_balance # get balance
puts "Account balance: #{balance}" # print balance
Solving
For solving a captcha, it's a two step process:
- submit captcha details - returns an ID
- use ID to check it's progress - and get solution when solved.
For getting the response, same method is used for all types.
Image captcha
captcha_id = ita.submit_image(image_path = 'captcha.jpg')
(with optional parameters)
captcha_id = ita.solve_captcha(image_path = 'captcha.jpg', is_case_sensitive = true, is_math = true, is_phrase = true, digits_only = false, letters_only = true, min_length = 2, max_length = 5)
ID is used to retrieve solution when solved.
Observation It works with URL instead of image file too.
reCAPTCHA
For recaptcha submission there are two things that are required.
- page_url (required)
- site_key (required)
- type (optional, defaults to 1 if not given)
- 1 - v2
- 2 - invisible
- 3 - v3
- 4 - enterprise v2
- 5 - enterprise v3
- v3_min_score - minimum score to target for v3 recaptcha - optional
- v3_action - action parameter to use for v3 recaptcha - optional
- proxy - proxy to use when solving recaptcha, eg. 12.34.56.78:1234 or 12.34.56.78:1234:userassword - optional
- user_agent - useragent to use when solve recaptcha - optional
- data-s - extra parameter used in solving recaptcha - optional
- cookie_input - cookies used in solving reCAPTCHA - - optional
Code:
d = {}
d['page_url'] = 'https://your-site.com'
d['sitekey'] = '7LrGJmcUABBAALFtIb_FxC0LXm_GwOLyJAfbbUCL'
# d['type'] = 3 # optional, defaults to 1
# d['v3_min_score'] = 0.3 # min score to target when solving v3 - optional
# d['v3_action'] = 'homepage' # action to use when solving v3 - optional
# d['proxy'] = '126.45.34.53:123' # - HTTP proxy - optional
# d['user_agent'] = 'Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0' # optional
# d['data-s'] = 'recaptcha data-s value' # optional
# d['cookie_input'] = 'a=b;c=d' # optional
captcha_id = ita.submit_recaptcha d
ID will be used to retrieve the g-response, once workers have completed the captcha. This takes somewhere between 10-80 seconds.
Check Retrieve response
Documentation https://github.com/imagetyperz-api/imagetyperz-api-ruby