|
24 | 24 | TIKTOK_ENDPOINT = 'http://captchatypers.com/captchaapi/UploadTikTokCaptchaUser.ashx'
|
25 | 25 | FUNCAPTCHA_ENDPOINT = 'http://captchatypers.com/captchaapi/UploadFunCaptcha.ashx'
|
26 | 26 | TASK_ENDPOINT = 'http://captchatypers.com/captchaapi/UploadCaptchaTask.ashx'
|
| 27 | +TASK_PUSH_ENDPOINT = 'http://captchatypers.com/CaptchaAPI/SaveCaptchaPush.ashx' |
27 | 28 |
|
28 | 29 | CAPTCHA_ENDPOINT_CONTENT_TOKEN = '/Forms/UploadFileAndGetTextNEWToken.ashx'
|
29 | 30 | CAPTCHA_ENDPOINT_URL_TOKEN = '/Forms/FileUploadAndGetTextCaptchaURLToken.ashx'
|
@@ -557,6 +558,38 @@ def account_balance
|
557 | 558 | return "$#{response_text}" # all good, return
|
558 | 559 | end
|
559 | 560 |
|
| 561 | + # set captcha bad |
| 562 | + def task_push_variables(captcha_id, variables) |
| 563 | + data = { |
| 564 | + "action": "GETTEXT", |
| 565 | + "captchaid": captcha_id.to_s, |
| 566 | + "pushVariables": JSON.generate(variables) |
| 567 | + } |
| 568 | + |
| 569 | + if !@_username.empty? |
| 570 | + data["username"] = @_username |
| 571 | + data["password"] = @_password |
| 572 | + else |
| 573 | + data["token"] = @_access_token |
| 574 | + end |
| 575 | + url = TASK_PUSH_ENDPOINT |
| 576 | + |
| 577 | + # make request |
| 578 | + http = Net::HTTP.new(ROOT_DOMAIN, 80) |
| 579 | + http.read_timeout = @_timeout |
| 580 | + req = Net::HTTP::Post.new(url, @_headers) |
| 581 | + res = http.request(req, URI.encode_www_form(data)) |
| 582 | + response_text = res.body # get response body |
| 583 | + |
| 584 | + # check if error |
| 585 | + if response_text.include?("ERROR:") |
| 586 | + response_err = response_text.split('ERROR:')[1].strip # get only the |
| 587 | + @_error = response_err |
| 588 | + raise @_error |
| 589 | + end |
| 590 | + response_text # all good, return |
| 591 | + end |
| 592 | + |
560 | 593 | # set captcha bad
|
561 | 594 | def set_captcha_bad(captcha_id)
|
562 | 595 | data = {
|
|
0 commit comments