Closed DKertson16 closed 4 years ago
Why are you using nextTick?
@niedfelj Want to know what is the difference between using nextTick and not
Having the same issue. Does anyone have a solution or a way to workaround this?
i have same issue. i don't login instagram via app and web instagram.
This issue still exists. Hopefully someone has a solution
This issue still exists. Hopefully someone has a solution
Could you paste the challenge data (error.response.body
) here? There are different challenges out there and some require different requests.
@Nerixyz Here ya go:
{ message: 'challenge_required', challenge: { url: 'https://i.instagram.com/challenge/22727428120/BeUNWGs83Y/', api_path: '/challenge/22727428120/BeUNWGs83Y/', hide_webview_header: true, lock: false, logout: false, native_flow: false }, status: 'fail' }
I think it's worth noting that I don't get a error code 500 from their server; I get code 400 instead.
IgCheckpointError: POST /api/v1/challenge/reset/22727428120/M4XOzNpLlY/ - 400 Bad Request; challenge_required
However, I am following the example given as well. It fails at await ig.challenge.auto(true)
Code;
Bluebird.try(async () => {
const auth = await ig.account.login(process.env.IG_USERNAME, process.env.IG_PASSWORD);
console.log(auth);
}).catch(IgCheckpointError, async () => {
console.log(ig.state.checkpoint); // Checkpoint info here
await ig.challenge.auto(true); // Requesting sms-code or click "It was me" button
console.log(ig.state.checkpoint); // Challenge info here
const { code } = await inquirer.prompt([
{
type: 'input',
name: 'code',
message: 'Enter code',
},
]);
console.log(await ig.challenge.sendSecurityCode(code));
});
hide_webview_header: true, native_flow: false
This is a web challenge. It isn't handled by the "native" API. Instead, a webview is created and the challenge is processed there. However, you can emulate this. I don't know if my way is still correct, but it should work (there's a lot of stuff logged to the console): https://gist.github.com/Nerixyz/7f65bc19e5e666865a2682fb509a5d83 Maybe you don't need to change the password (the response will be very short), then just end the script and login again.
This thread has been inactive for a long time now, so it will be closed. If this is still an issue, reopen it.
So I've looked through all the issues and examples and I still cannot get this to work so sorry if I am missing something simple. I am successfully able to login with two of my accounts with no challenges necessary, but I get IgCheckpointError on a friend's account that I am trying to use. I am using a third party proxy with all of my requests. My code looks like so:
As you can see I have commented out the sendSecurityCode part of it because I am not receiving a code and the ig.state.checkpoint is null at that point. I have tried with and without the security code part and nothing seems to work, and I usually get 'Unhandled rejection IgResponseError: POST /api/v1/challenge/reset/3662491500/iOHcynqQAa/ - 500 Internal Server Error;'