my user id is correct, my password is too. My code was working last week, suddenly stopped working. This is what happens when i try to send a challenge request, without sending a challenge request i get 400 error challenge required Any ideas whats going on here?
My code:
const sendIGChallengeRequest = async () => {
await ig.challenge.auto(true); // Requesting sms-code or click "It was me" button
console.log(ig.state.checkpoint);
const { code } = await inquirer.prompt([
{
message: 'Enter code',
name: 'code',
type: 'input'
}
]);
await ig.challenge.sendSecurityCode(code);
};
const igLogin = async (): Promise<void> => {
ig.state.generateDevice(process.env.IG_USERNAME);
// login with credentials
try {
await ig.account.login(process.env.IG_USERNAME, process.env.ID_PASSWORD);
} catch (err) {
sendIGChallengeRequest();
}
// The same as preLoginFlow()
// Optionally wrap it to process.nextTick so we dont need to wait ending of this bunch of requests
process.nextTick(() => ig.simulate.postLoginFlow());
};
Error trace:
(node:75468) UnhandledPromiseRejectionWarning: IgCookieNotFoundError: Cookie "ds_user_id" not found
at State.extractCookieValue (/Users/matthewpengelly/Documents/batcave/instagram-saved-downloader/node_modules/instagram-private-api/src/core/state.ts:151:13)
at State.get cookieUserId [as cookieUserId] (/Users/matthewpengelly/Documents/batcave/instagram-saved-downloader/node_modules/instagram-private-api/src/core/state.ts:132:17)
at SimulateService.facebookOta (/Users/matthewpengelly/Documents/batcave/instagram-saved-downloader/node_modules/instagram-private-api/src/services/simulate.service.ts:80:35)
at /Users/matthewpengelly/Documents/batcave/instagram-saved-downloader/node_modules/instagram-private-api/src/services/simulate.service.ts:44:18
at Bluebird.map.request (/Users/matthewpengelly/Documents/batcave/instagram-saved-downloader/node_modules/instagram-private-api/src/services/simulate.service.ts:60:45)
From previous event:
my user id is correct, my password is too. My code was working last week, suddenly stopped working. This is what happens when i try to send a challenge request, without sending a challenge request i get
400 error challenge required
Any ideas whats going on here?My code:
Error trace: