dilame / instagram-private-api

NodeJS Instagram private API SDK. Written in TypeScript.
MIT License
5.93k stars 1.14k forks source link

IgNoCheckpointError on challenge.auto #1180

Closed endquote closed 3 years ago

endquote commented 4 years ago

My login flow is below. client.challenge.auto is returning a IgNoCheckpointError ("No checkpoint data available"). The library version is 1.40.1.

It's working ok for me for the same account on another machine. So it looks like I'm getting a challenge here, but am not able to get it to send a code.

const client = new IgApiClient();
client.state.generateDevice(auth.username);

try {
  await client.account.login(auth.username, auth.password);
  process.nextTick(async () => await client.simulate.postLoginFlow());
} catch (IgCheckpointError) {
  await client.challenge.auto(true); // error here
  if (!auth.code) {
   // tell the user to check email/text for a code
  } else {
    await client.challenge.sendSecurityCode(auth.code);
  }
}

await client.simulate.postLoginFlow();
Nerixyz commented 4 years ago

What's in the response of the error (error.response)? The checkpoint should contain the body sent by instagram (here).

endquote commented 4 years ago

Of course, now that I am try/catching that line to trap the error, the challenge has gone away. I turned on DEBUG="ig:*" and am logging that error, so I'll report if it reappears. Thank you for the reply.

krychaj5 commented 4 years ago

Of course, now that I am try/catching that line to trap the error, the challenge has gone away. I turned on DEBUG="ig:*" and am logging that error, so I'll report if it reappears. Thank you for the reply.

How do You get auth.code in Your example?

endquote commented 4 years ago

@krychaj5 My program exits when the auth fails, then the user runs it again with the code provided as a configuration argument or config file setting.

endquote commented 4 years ago

I had to restart my process after weeks of it running well, and am hitting this error. There is no error.response value.

This was on 1.40.1, but no change on 1.41.0.

It's working ok from my local dev machine, but not from the server I use in production, so maybe it's been blocked in some way.

Screen Shot 2020-07-18 at 3 06 13 PM

endquote commented 3 years ago

Haven't been seeing this recently.