instagram-private-api: `preLoginFlow()`: POST .../msisdn_header_bootstrap/ - 302 Found

Bug Report

Form

Requirements

  • I’ve searched the Issues
  • I’ve read the basic concepts
  • I’m using the latest version
  • I’ve debugged my code using the DEBUG variable.

Platform

  • I’m using Node.js version 15.8.0

Description

When I run my app, the login method (see below) is executed. Unfortunately, this fails with the error POST /api/v1/accounts/msisdn_header_bootstrap/ - 302 Found.
To find the problematic part in my code, I attached catch statements to the respective method calls. As it turned out, it is the method preLoginFlow() that throws the said error.

Code

async function login(username, password) {
    try {
        await ig.simulate.preLoginFlow();
        await ig.account.login(username, password);
        process.nextTick(() => ig.simulate.postLoginFlow());
        return true;
    } catch (error) {
        console.error('login =>', error.message);
        return false;
    }
}

Error and Output

> DEBUG='ig:*' node server.js

{"level": "info", "timestamp": "2021-04-23T06:25:21.796Z", "message": "Api running on port 3001"}
  ig:request Requesting POST /api/v1/attribution/log_attribution/ +0ms
  ig:request Requesting POST /api/v1/launcher/sync/ +2s
  ig:request Requesting POST /api/v1/accounts/read_msisdn_header/ +317ms
  ig:state Could not find ds_user_id +0ms
  ig:request Requesting POST /api/v1/qe/sync/ +458ms
  ig:request Requesting POST /api/v1/accounts/msisdn_header_bootstrap/ +461ms
  ig:request Request POST /api/v1/accounts/msisdn_header_bootstrap/ failed:  +433ms
login => POST /api/v1/accounts/msisdn_header_bootstrap/ - 302 Found; 

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 6
  • Comments: 15 (3 by maintainers)

Commits related to this issue

Most upvoted comments

Hey! On my side, I’ve removed the preloginflow code (it’s not obrigatory)

What can I do about this problem? @Nerixyz

Just started getting this out of no where too. Nothing changed to my code.

Just started getting this error again today