Skip to content

Commit 1f5353b

Browse files
added FunCaptcha (Arkose Labs)
1 parent eda9c71 commit 1f5353b

File tree

3 files changed

+97
-3
lines changed

3 files changed

+97
-3
lines changed

Diff for: funcaptcha.rb

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/usr/bin/ruby
2+
3+
# Imagetypers API test
4+
load "lib/imagetyperzapi.rb"
5+
6+
def test_api
7+
# grab token from https://imagetyperz.com
8+
access_token = "your_access_token"
9+
ita = ImageTyperzAPI.new(access_token)
10+
11+
# check account balance
12+
balance = ita.account_balance # get balance
13+
puts "Account balance: #{balance}" # print balance
14+
15+
# submit image captcha, and check for solution
16+
puts "Waiting for captcha to be solved..."
17+
d = {}
18+
d['pageurl'] = 'https://your-site.com'
19+
d['sitekey'] = '11111111-1111-1111-1111-111111111111'
20+
d['surl'] = 'https://api.arkoselabs.com'
21+
# d['data'] = '{"a":"b"}' # optional, extra funcaptcha data in JSON format
22+
# d['proxy'] = '126.45.34.53:123' # optional - HTTP proxy - optional
23+
# d['user_agent'] = 'Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0' # optional
24+
captcha_id = ita.submit_funcaptcha d
25+
response = nil
26+
while response == nil
27+
sleep 10
28+
response = ita.retrieve_response captcha_id
29+
end
30+
puts "Response: #{response}"
31+
end
32+
33+
def main
34+
begin
35+
test_api
36+
rescue => details
37+
puts "[!] Error occured: #{details}"
38+
end
39+
end
40+
41+
main

Diff for: lib/imagetyperzapi.rb

+38
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
CAPY_ENDPOINT = 'http://captchatypers.com/captchaapi/UploadCapyCaptchaUser.ashx'
2222
HCAPTCHA_ENDPOINT = 'http://captchatypers.com/captchaapi/UploadHCaptchaUser.ashx'
2323
TIKTOK_ENDPOINT = 'http://captchatypers.com/captchaapi/UploadTikTokCaptchaUser.ashx'
24+
FUNCAPTCHA_ENDPOINT = 'http://captchatypers.com/captchaapi/UploadFunCaptcha.ashx'
2425

2526
CAPTCHA_ENDPOINT_CONTENT_TOKEN = '/Forms/UploadFileAndGetTextNEWToken.ashx'
2627
CAPTCHA_ENDPOINT_URL_TOKEN = '/Forms/FileUploadAndGetTextCaptchaURLToken.ashx'
@@ -364,6 +365,43 @@ def submit_hcaptcha(d)
364365
(JSON.parse response_text)[0]['CaptchaId']
365366
end
366367

368+
def submit_funcaptcha(d)
369+
d['action'] = 'UPLOADCAPTCHA'
370+
d['captchatype'] = '13'
371+
# user or token ?
372+
if !@_username.empty?
373+
d["username"] = @_username
374+
d["password"] = @_password
375+
else
376+
d["token"] = @_access_token
377+
end
378+
379+
url = FUNCAPTCHA_ENDPOINT
380+
381+
# affiliate id
382+
if @_affiliateid.to_s != '0'
383+
d["affiliateid"] = @_affiliateid.to_s
384+
end
385+
386+
# create url
387+
params = URI.encode_www_form(d)
388+
url = '%s?%s' % [url, params]
389+
390+
# make request
391+
uri = URI.parse(url)
392+
http = Net::HTTP.new(uri.host, uri.port)
393+
data = http.get(uri.request_uri)
394+
response_text = data.body
395+
396+
# check if error
397+
if response_text.include?("ERROR:")
398+
response_err = response_text.split('ERROR:')[1].strip() # get only the
399+
@_error = response_err
400+
raise @_error
401+
end
402+
(JSON.parse response_text)[0]['CaptchaId']
403+
end
404+
367405
def retrieve_response(captcha_id)
368406
# params
369407
data = {

Diff for: readme.md

+18-3
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ Optionally, you can send proxy and user_agent along.
122122

123123
### hCaptcha
124124

125-
Requires page_url and sitekey
125+
Requires pageurl and sitekey
126126

127127
```ruby
128128
d = {}
@@ -135,7 +135,7 @@ captcha_id = ita.submit_hcaptcha d
135135

136136
### Capy
137137

138-
Requires page_url and sitekey
138+
Requires pageurl and sitekey
139139

140140
```ruby
141141
d = {}
@@ -148,7 +148,7 @@ captcha_id = ita.submit_capy d
148148

149149
### Tiktok
150150

151-
Requires page_url cookie_input
151+
Requires pageurl and cookie_input
152152

153153
```ruby
154154
d = {}
@@ -160,6 +160,21 @@ d['cookie_input'] = 's_v_web_id:verify_kd6243o_fd449FX_FDGG_1x8E_8NiQ_fgrg9FEIJ3
160160
captcha_id = ita.submit_tiktok d
161161
```
162162

163+
### FunCaptcha
164+
165+
Requires pageurl, sitekey and surl (source URL)
166+
167+
```ruby
168+
d = {}
169+
d['pageurl'] = 'https://your-site.com'
170+
d['sitekey'] = '11111111-1111-1111-1111-111111111111'
171+
d['surl'] = 'https://api.arkoselabs.com'
172+
# d['data'] = '{"a":"b"}' # optional, extra funcaptcha data in JSON format
173+
# d['proxy'] = '126.45.34.53:123' # optional - HTTP proxy - optional
174+
# d['user_agent'] = 'Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0' # optional
175+
captcha_id = ita.submit_funcaptcha d
176+
```
177+
163178
## Retrieve response
164179

165180
Regardless of the captcha type (and method) used in submission of the captcha, this method is used

0 commit comments

Comments
 (0)