dilame / instagram-private-api

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

IgResponseError: POST /api/v1/qe/sync/ - 302 Found #1329

Open michaelkoo3232 opened 3 years ago

michaelkoo3232 commented 3 years ago

Bug Report

Read the Notes and fill out the form.

Notes

Your issue will be closed if you violate any rule below.

Form

Put an [x] if you meet the condition, else leave [ ].

Requirements

Description

I am trying to login with a username and password. It works in the past. But after I pm2 restart once and it continue to show this error when I try to log in.

YOUR DESCRIPTION HERE

Code

Add a meaningful section of your code here. If you are using TypeScript replace js with typescript.

async function login(username, password) {
  console.log(username);
  console.log(password);
  try {
    const id = uuidv4();
    console.log(typeof id);
    await ig.state.generateDevice('uuidv4');
    await ig.simulate.preLoginFlow();
    const loggedInUser = await ig.account.login(username, password);
    await ig.simulate.postLoginFlow();
    // console.log('loggedInUser:');
    return loggedInUser;
  } catch (err) {
    // console.log('error');
    console.log(err);
    throw err;
  }
}

Error and Output

If you've got an error put it here. You can get the stacktrace in the most environments using Error.stack (MDN Docs).

IgResponseError: POST /api/v1/qe/sync/ - 302 Found;
    at Request.handleResponseError (/root/ig-dm/node_modules/instagram-private-api/dist/core/request.js:125:16)
    at Request.send (/root/ig-dm/node_modules/instagram-private-api/dist/core/request.js:53:28)
    at async QeRepository.sync (/root/ig-dm/node_modules/instagram-private-api/dist/repositories/qe.repository.js:28:26)
    at async AccountRepository.login (/root/ig-dm/node_modules/instagram-private-api/dist/repositories/account.repository.js:13:13)
    at async login (/root/ig-dm/routes/users.js:168:26)
wkibbler commented 3 years ago

I am having the same problem, I assume its a rate limit issue. Did you ever find a solution?

itsmemz53 commented 3 years ago

I am also having same intermittently while running the script for aws instance.

michaelkoo3232 commented 3 years ago

I am having the same problem, I assume its a rate limit issue. Did you ever find a solution?

No, I did not find the solution. I just deploy the application to other machine. Initially It was deployed on a vultr VPS, now is a AWS instance

bayungrh commented 3 years ago

i have the same issue, is there a solution?

fabiandiez commented 3 years ago

I have the same issue. Everything works fine locally though.

alihajiloo commented 2 years ago

i have same issue

ctle-vn commented 2 years ago

Same issue, local server works but fails upon AWS EC2 instance. Any resolution for this?

sreza78 commented 2 years ago

same here

xetrics commented 2 years ago

Issue appears to be across all hosting providers

sousaakira commented 2 years ago

Has this problem already been resolved?

rafaelgdn commented 2 years ago

Any updates?

19h commented 2 years ago

You can't use a script on a VPS. Instagram is blocking it. Workaround: use ig.state.serialize to dump the credentials et al. on your local machine and then load it on the VPS using ig.state.deserialize. Only the login procedures are blocked by Instagram.