M
M
Maxim Valerievich2015-04-10 00:59:34
In contact with
Maxim Valerievich, 2015-04-10 00:59:34

How to pass captcha in execute VK API request?

Hello. Please help, I have the following query:

function getAudio(now) {
      var query = tracks[now].artist + " " + tracks[now].name;
      var code = 'var res = '
        + 'API.audio.search({ "q": "'+query+'", "captcha_sid": 543689123460, "captcha_key": "qdzsx"});'
        + 'return res;';
      VK.Api.call("execute", {code: code}, function(data) {
        if (data.response) {
          if ( now <= tracks.length() ) {
            setTimeout(function() { getAudio(++now); }, 333);
          } else {
            console.log('Все обработано!!! Ура!');
          }
        }
      });
    }

So, after ~ 100 requests, a captcha crashes, and as you can see above, I tried to send a request with the parameters of this captcha, but the captcha comes back in response only with a different seed. How to submit captcha correctly?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Maxim Valerievich, 2015-04-17
@S-anches

In short, VK support answered that everything should work. When I get back to finalizing the application, I will check it again in more detail.

X
X-, 2015-09-11
NoNAME @XNoNAME

Have you solved the problem?

D
dr_mamaev, 2020-12-31
@dr_mamaev

Maybe the response with the error code does not come inside the execute method, but directly to your data variable? And it is necessary to call the "execute" method with the parameters "code", "captcha_sid" and "captcha_key"? It would be nice to sort this out.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question