Skip to content

Commit e1cb147

Browse files
added hcaptcha enterprise extra parameters
1 parent 022fae7 commit e1cb147

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

hcaptcha.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ def test_api
1818
d['pageurl'] = 'https://your-site.com'
1919
d['sitekey'] = '1c7062c7-cae6-4e12-96fb-303fbec7fe4f'
2020
# d['invisible'] = '1' # if invisible hcaptcha - optional
21+
22+
# extra parameters, useful for enterprise
23+
# submit userAgent from requests too, when this is used
24+
# d['HcaptchaEnterprise'] = {'rqdata': 'take value from web requests'}
25+
2126
# d['proxy'] = '126.45.34.53:123' # - HTTP proxy - optional
2227
# d['user_agent'] = 'Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0' # optional
2328
captcha_id = ita.submit_hcaptcha d

lib/imagetyperzapi.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,11 @@ def submit_hcaptcha(d)
376376

377377
url = HCAPTCHA_ENDPOINT
378378

379+
# proxy
380+
if d.key? 'HcaptchaEnterprise'
381+
d['HcaptchaEnterprise'] = JSON.generate(d['HcaptchaEnterprise'])
382+
end
383+
379384
# affiliate id
380385
if @_affiliateid.to_s != '0'
381386
d["affiliateid"] = @_affiliateid.to_s

0 commit comments

Comments
 (0)