Can't use callback on google recaptcha v2

Discussions and Tech Support related to the iMacros Firefox Add-on, including the built-in Javascript scripting interface for playing .js files.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
Pucca
Posts: 8
Joined: Fri Jan 15, 2016 10:31 am

Can't use callback on google recaptcha v2

Post by Pucca » Sun Jun 10, 2018 2:35 am

I'm trying to use the callback function on google recaptcha v2 since it has no submit button but i get the error:
ReferenceError: grecaptcha_cfg is not defined, line 51 (Error code: -991)

I'm using this guide from https://2captcha.com/2captcha-api#callback

Code: Select all

var solve = "CODE:";
solve += "TAB T=1" + "\n";
solve += "SET !EXTRACT_TEST_POPUP NO" + "\n";
solve += "SET !ERRORIGNORE YES" + "\n";
solve += "WAIT SECONDS=0.5" + "\n";
solve += "SET !TIMEOUT_PAGE 60" + "\n";
solve += "TAG POS=1 TYPE=TEXTAREA FORM=ID:* ATTR=CLASS:g-recaptcha-response EXTRACT=TXT" + "\n";
solve += "SET k {{!EXTRACT}}" + "\n";
solve += "SET !EXTRACT NULL" + "\n";
solve += "TAG POS=2 TYPE=IFRAME ATTR=* EXTRACT=HTM" + "\n";

var solve2 = "CODE:";
solve2 += "TAB T=1" + "\n";
solve2 += "SET api_key \"1abc234de56fab7c89012d34e56fa7b8\"" + "\n";
solve2 += "TAB OPEN" + "\n";
solve2 += "TAB T=2" + "\n";
solve2 += "URL GOTO=http://127.0.0.3/in.php?key={{api_key}}&method=userrecaptcha&googlekey={{sitekey}}&pageurl=http://omegle.com" + "\n";
solve2 += "WAIT SECONDS=1" + "\n";
solve2 += "TAG POS=1 TYPE=* ATTR=TXT:* EXTRACT=TXT" + "\n";
solve2 += "SET captid EVAL(\"var s=\\\"{{!EXTRACT}}\\\"; s.split(' ')[0].split('|')[1]\")" + "\n";

var solve3 = "CODE:";
solve3 += "SET api_key \"1abc234de56fab7c89012d34e56fa7b8\"" + "\n";
solve3 += "URL GOTO= http://127.0.0.3/res.php?key={{api_key}}&action=get&id={{capid}}" + "\n";
solve3 += "WAIT SECONDS=120" + "\n";
solve3 += "REFRESH" + "\n";
solve3 += "WAIT SECONDS=1" + "\n";
solve3 += "TAG POS=1 TYPE=* ATTR=TXT:* EXTRACT=TXT" + "\n";

var solve4 = "CODE:";
solve4 += "TAB CLOSE" + "\n";
solve4 += "TAB T=1" + "\n";
solve4 += "TAG POS=1 TYPE=TEXTAREA FORM=ID:g-recaptcha-response* ATTR=CLASS:g-recaptcha-response CONTENT={{answer}}" + "\n";

iimPlay(solve);
var s= iimGetLastExtract();
var sitekey=s.match(/k=([^&]*)/i)[1];

iimSet("sitekey", sitekey); 
iimPlay(solve2);
var c = iimGetLastExtract();
var capid = c.split(' ')[0].split('|')[1];

iimSet("capid", capid);
iimPlay(solve3);
var a = iimGetLastExtract();
var answer = a.split(' ')[0].split('|')[1];

iimSet("answer", answer); 
iimPlay(solve4);
grecaptcha_cfg.clients[0].ba.l.callback;
grecaptcha_cfg.clients[1].ba.l.callback;
grecaptcha_cfg.clients[2].ba.l.callback;
Can someone help me fix my code?

Firefox 55.0.2
Imacros Firefox 9.0.3
Windows 10 Home
chivracq
Posts: 8929
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Can't use callback on google recaptcha v2

Post by chivracq » Sun Jun 10, 2018 3:44 am

Pucca wrote:I'm trying to use the callback function on google recaptcha v2 since it has no submit button but i get the error:
ReferenceError: grecaptcha_cfg is not defined, line 51 (Error code: -991)

I'm using this guide from https://2captcha.com/2captcha-api#callback

Code: Select all

var solve = "CODE:";
solve += "TAB T=1" + "\n";
solve += "SET !EXTRACT_TEST_POPUP NO" + "\n";
solve += "SET !ERRORIGNORE YES" + "\n";
solve += "WAIT SECONDS=0.5" + "\n";
solve += "SET !TIMEOUT_PAGE 60" + "\n";
solve += "TAG POS=1 TYPE=TEXTAREA FORM=ID:* ATTR=CLASS:g-recaptcha-response EXTRACT=TXT" + "\n";
solve += "SET k {{!EXTRACT}}" + "\n";
solve += "SET !EXTRACT NULL" + "\n";
solve += "TAG POS=2 TYPE=IFRAME ATTR=* EXTRACT=HTM" + "\n";

var solve2 = "CODE:";
solve2 += "TAB T=1" + "\n";
solve2 += "SET api_key \"1abc234de56fab7c89012d34e56fa7b8\"" + "\n";
solve2 += "TAB OPEN" + "\n";
solve2 += "TAB T=2" + "\n";
solve2 += "URL GOTO=http://127.0.0.3/in.php?key={{api_key}}&method=userrecaptcha&googlekey={{sitekey}}&pageurl=http://omegle.com" + "\n";
solve2 += "WAIT SECONDS=1" + "\n";
solve2 += "TAG POS=1 TYPE=* ATTR=TXT:* EXTRACT=TXT" + "\n";
solve2 += "SET captid EVAL(\"var s=\\\"{{!EXTRACT}}\\\"; s.split(' ')[0].split('|')[1]\")" + "\n";

var solve3 = "CODE:";
solve3 += "SET api_key \"1abc234de56fab7c89012d34e56fa7b8\"" + "\n";
solve3 += "URL GOTO= http://127.0.0.3/res.php?key={{api_key}}&action=get&id={{capid}}" + "\n";
solve3 += "WAIT SECONDS=120" + "\n";
solve3 += "REFRESH" + "\n";
solve3 += "WAIT SECONDS=1" + "\n";
solve3 += "TAG POS=1 TYPE=* ATTR=TXT:* EXTRACT=TXT" + "\n";

var solve4 = "CODE:";
solve4 += "TAB CLOSE" + "\n";
solve4 += "TAB T=1" + "\n";
solve4 += "TAG POS=1 TYPE=TEXTAREA FORM=ID:g-recaptcha-response* ATTR=CLASS:g-recaptcha-response CONTENT={{answer}}" + "\n";

iimPlay(solve);
var s= iimGetLastExtract();
var sitekey=s.match(/k=([^&]*)/i)[1];

iimSet("sitekey", sitekey); 
iimPlay(solve2);
var c = iimGetLastExtract();
var capid = c.split(' ')[0].split('|')[1];

iimSet("capid", capid);
iimPlay(solve3);
var a = iimGetLastExtract();
var answer = a.split(' ')[0].split('|')[1];

iimSet("answer", answer); 
iimPlay(solve4);
grecaptcha_cfg.clients[0].ba.l.callback;
grecaptcha_cfg.clients[1].ba.l.callback;
grecaptcha_cfg.clients[2].ba.l.callback;
Can someone help me fix my code?

Code: Select all

Firefox 55.0.2
Imacros Firefox 9.0.3
Windows 10 Home
Can't and won't be able to help you on this one, I never help for Captchas, ah-ah...! :oops:

>>>

But parallel Thread on SOF... (with more Info (except FCI not mentioned :roll: ) / Fuller Script):
- Imacros: Can't callback with recaptcha

>>>

But hum, @OP, maybe if you provided the same Quality on both Forums (=> FCI of SOF, and Full Script here), hum, and maybe what you've tried to find a Solution (here), I might still give a (mini-) "try"... ("mini', because I normally never help for Captchas..., but @thecodr2012 does, with more Expertise than me anyway, do like I say/suggest and you never know...! :idea: )

Hum..., and any chance you could spell "iMacros" a bit correctly on SOF...!? :idea:

(Hum, and you only have one Thread on SOF related to iMacros at the moment, but mention you FCI there as well each time you start a Thread related to iMacros, not only "here" because you know won't get an Answer otherwise, I check both (and more) Forums related to iMacros, and perfectly fine to post the same Qt on different Forums, as long as you provide the Qlt on all of them...)

>>>
Hum, mini-EDIT:
I might be a little bit harsh on you, you use our Forum very correctly..., you don't need to follow everything I said about SOF... (Not "my Mission" anyway to improve their Quality, ah-ah...! :wink: )
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
chivracq
Posts: 8929
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Can't use callback on google recaptcha v2

Post by chivracq » Sun Jun 10, 2018 2:12 pm

Hum, I had a look at your Script and this 'cfg' Object etc..., and I don't know really... as I don't do Captchas for myself, so I never had to "dig" into it..., (interesting Documentation Page btw), maybe you need to add some 'window' or 'document' to help locate that Object... :?
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
Post Reply