Using 2Captcha in 9Hits Viewer 2.3.2

daniel

Administrator
Staff member
VIP
Joined
Feb 23, 2018
Messages
225
Reaction score
35
Achievement
Hi, since 9Hits Viewer 2.3.2, 2Captcha API has been integrated. To use 2Captcha, firstly you have to create an account at 2Captcha
:) Ref for daniel
:( None ref
;) Thumb up our application on 2Captcha

The bypass captcha would be available for VIP members only, but currently it's also available for PREMIUM members. The viewer has now support 3 functions to work with 2Captcha:
  • GetImageByXpath(xpath, frameUrlRegex)
  • _2CaptchaSolve(params, timeout)
  • _2CaptchaReportBad(key, captchaId)

GetImageByXpath: returned an image in base64 formart. xpath is the xpath of the target image, and frameUrlRegex is the url regular expression of target frame. leave null if the image was in main frame.

_2CaptchaSolve function has 2 arguments
- params: The 2Captcha API params
- timeout: Set timeout for the action

=> Examples of usage:
Image Captcha:
+ method must be 'base64'
+ json must be 1
+ key and body are required
JavaScript:
//Get the image in base64 encoded
var capt = await GetImageByXpath('//*[@id="CAPTCHA"]');

//Call 2Captcha API and wait for result
var result = await _2CaptchaSolve({
    'key' : 'YOUR_OWN_2CAPTCHA_APY_KEY',
    'method' : 'base64',
    'json' : 1,
    'body': capt
});

ReCaptcha v2:
+ method must be 'userrecaptcha'
+ json must be 1
+ key and googlekey and pageurl are required
JavaScript:
//Get recaptcha data from the target website (assuming we are in main frame)
var sitekey = await GetAttribute('//*[@class=\"g-recaptcha\"]', 'data-sitekey');
var pageUrl = await EvaluateScript('window.location.href');

var result = await _2CaptchaSolve({
    'key' : 'YOUR_OWN_2CAPTCHA_APY_KEY',
    'method' : 'userrecaptcha',
    'json' : 1,
    'googlekey': sitekey,
    'pageurl' : pageUrl
}, 300);
Other captcha type?: Hmm, I just have tested with image and recaptcha, with other type of captcha that supported by 2Captcha, just try to grab the input for API, and call _2CaptchaSolve function with appropriate parameters.

Return result: The _2CaptchaSolve will return an object like this
if failed
JSON:
{status:0, request:'Some Error Message'}
or if success
JSON:
{status:1, request:'Answer From 2Captcha', captchaId:123456789}
Base on the returned result, you can now use other macros functions to continue your process (filling the answer, submit form, etc). If you can determined that the answer from 2Captcha was incorrect, you may call _2CaptchaReportBad to tell them that the captcha answer was incorrect. Please careful when use this function because if you report too much correct answers as incorrect, your account may got trouble with them.

Ok, now is the show time:

Demo for Image captcha
JavaScript:
await Delay(15000);
var capt = await GetImageByXpath('//*[@id="CAPTCHA"]');

var result = await _2CaptchaSolve({
    'key' : 'YOUR_OWN_2CAPTCHA_APY_KEY',
    'method' : 'base64',
    'json' : 1,
    'body': capt
});

//Alert(JSON.stringify(result));

await Delay(10000);
SetById("securityCode", "value", result.request);
await Delay(1000);
ClickById("Submit Form");
await Delay(10000);
var incorect = await EvaluateScript('document.getElementsByClassName("title")[0].innerText.startsWith("Incor")');
if(incorect && result && result.captchaId)
{
    _2CaptchaReportBad('YOUR_OWN_2CAPTCHA_APY_KEY', result.captchaId);
}
Demo for Recaptcha v2
JavaScript:
await Delay(5000);
var sitekey = await GetAttribute('//*[@class=\"g-recaptcha\"]', 'data-sitekey');
var pageUrl = await EvaluateScript('window.location.href');

var result = await _2CaptchaSolve({
    'key' : 'YOUR_OWN_2CAPTCHA_APY_KEY',
    'method' : 'userrecaptcha',
    'json' : 1,
    'googlekey': sitekey,
    'pageurl' : pageUrl
}, 300);

//Alert(JSON.stringify(result));

SetById("g-recaptcha-response", "text", result.request);
await Delay(1000);
ClickById("recaptcha-demo-submit");
await Delay(5000);
var incorect = await EvaluateScript('document.getElementsByClassName("recaptcha-error").length>0');
if(incorect && result && result.captchaId)
{
    _2CaptchaReportBad('YOUR_OWN_2CAPTCHA_APY_KEY', result.captchaId);
}
It's hard for you ? do not hesitate to ask help from me. I'm always ready to help you for free !
- Daniel -
 
Last edited:

daniel

Administrator
Staff member
VIP
Joined
Feb 23, 2018
Messages
225
Reaction score
35
Achievement
midofxpro post_id=270 time=1525952498 user_id=75 said:
thinks @Daniel your the best
Thank midofxpro for being a part of 9Hits too ;)
 

Vargas

New Member
Joined
Feb 26, 2018
Messages
133
Reaction score
1
Age
30
Location
127.0.0.1
mahmoudh7 post_id=2301 time=1563914133 user_id=391 said:
The truth is that I did not understand the explanation
You have subscribed to 2captcha
What is the next step?
I want to skip the captcha site getsurl

you lose 3$ to earn 4$
wheere is the profit
Cpm low asf
 

Pr0XiM

New Member
VIP
Joined
Aug 29, 2019
Messages
16
Reaction score
1
Achievement
Hi! I can't get captcha to work on http://mix2link.com/v8Gqw8e, I set my KEy API but it still doesn't work. Please help me!
 

Evgeny_Volin

New Member
VIP
Joined
Jan 28, 2021
Messages
36
Reaction score
0
Achievement
Friends, can someone say the captcha works? It is a Captcha.
Mine is very modern, it has new pictures, questions. It didn't work for me!
Right here https://tii.ai/qlyWR3oE

I registered for 2 captchas, entered my API KEY twice
in this code -
Some action takes place and I am redirected to a site that provides these short links, which gives advertising and pays.
But the short link does not pass!

await Delay(5000);
var sitekey = await GetAttribute('//*[@class=\"g-recaptcha\"]', 'data-sitekey');
var pageUrl = await EvaluateScript('window.location.href');

var result = await _2CaptchaSolve({
'key' : 'YOUR_OWN_2CAPTCHA_APY_KEY',
'method' : 'userrecaptcha',
'json' : 1,
'googlekey': sitekey,
'pageurl' : pageUrl
}, 300);

//Alert(JSON.stringify(result));

SetById("g-recaptcha-response", "text", result.request);
await Delay(1000);
ClickById("recaptcha-demo-submit");
await Delay(5000);
var incorect = await EvaluateScript('document.getElementsByClassName("recaptcha-error").length>0');
if(incorect && result && result.captchaId)
{
_2CaptchaReportBad('YOUR_OWN_2CAPTCHA_APY_KEY', result.captchaId);
}
 
Last edited:

About us

  • Our community has been around for many years and pride ourselves on offering unbiased, critical discussion among people of all different backgrounds. We are working every day to make sure our community is one of the best.

Quick Navigation

User Menu