Skip to content

Commit 94b3755

Browse files
added hCaptcha
1 parent 57e6eec commit 94b3755

File tree

2 files changed

+26
-6
lines changed

2 files changed

+26
-6
lines changed

example.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def test_api
2828
# submit to server and get the id
2929

3030
d = {}
31-
d['page_url'] = 'page_url_here' # adding --capy to the end of this, will make captcha be a capy captcha instead of reCAPTCHA
31+
d['page_url'] = 'page_url_here' # add --capy or --hcaptcha at the end, to submit capy or hCaptcha
3232
d['sitekey'] = 'sitekey_here'
3333
# d['type'] = 3 # optional, defaults to 1
3434
# d['v3_min_score'] = 0.3 # min score to target when solving v3 - optional

readme.md

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,33 @@ puts geetest_response
138138

139139
Response will look like this: `{'challenge': '...', 'validate': '...', 'seccode': '...'}`
140140

141-
## Capy
141+
## Capy & hCaptcha
142142

143-
This captcha requires a `page_url` and `sitekey` in order to be solved by our system.
144-
Currently, in order to solve a capy captcha, you'll have to use the reCAPTCHA methods and only add `--capy` at the end of the `page_url`.
145-
Having that up, our system will pick it up as capy. Once workers have solved it, you'll have to use the reCAPTCHA retrieve endpoint, to get the response.
143+
This are two different captcha types, but both are similar to reCAPTCHA. They require a `pageurl` and `sitekey` for solving. hCaptcha is the newest one.
146144

147-
**E.g** Original page url - `https://mysite.com`, capy page url `https://mysite.com--capy`
145+
### IMPORTANT
146+
For this two captcha types, the reCAPTCHA methods are used (explained above), except that there's one small difference.
147+
148+
The `pageurl` parameter should have at the end of it `--capy` added for Capy captcha and `--hcaptcha` for the hCaptcha. This instructs our system it's a capy or hCaptcha. It will be changed in the future, to have it's own endpoints.
149+
150+
For example, if you were to have the `pageurl` = `https://mysite.com` you would send it as `https://mysite.com--capy` if it's capy or `https://mysite.com--hcaptcha` for hCaptcha. Both require a sitekey too, which is sent as reCAPTCHA sitekey, and response is received as reCAPTCHA response, once again using the reCAPTCHA method.
151+
152+
#### Example
153+
```ruby
154+
d = {}
155+
d['page_url'] = 'domain.com--capy' # add --capy or --hcaptcha at the end, to submit capy or hCaptcha
156+
d['sitekey'] = 'sitekey_here'
157+
captcha_id = ita.submit_recaptcha d
158+
159+
puts "Waiting for Capy to be solved ..."
160+
while ita.in_progress captcha_id # while it"s still in progress
161+
sleep 10 # sleep for 10 seconds
162+
end
163+
164+
# get the response and print it
165+
solution = ita.retrieve_recaptcha captcha_id # retrieve response
166+
puts "Capy response: #{solution}"
167+
```
148168

149169
## Other methods/variables
150170

0 commit comments

Comments
 (0)