Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnhandledPromiseRejectionWarning: StatusCodeError: 403 - "{\"message\":\"login_required\",\"status\":\"fail\"}" #268

Open
Deivesilvaka opened this issue Aug 26, 2021 · 6 comments

Comments

@Deivesilvaka
Copy link

(node:16500) UnhandledPromiseRejectionWarning: StatusCodeError: 403 - "{"message":"login_required","status":"fail"}"
at new StatusCodeError (C:\Users\luidavidas\Desktop\Case - Instagram\node_modules\request-promise-core\lib\errors.js:32:15)
at Request.plumbing.callback (C:\Users\luidavidas\Desktop\Case - Instagram\node_modules\request-promise-core\lib\plumbing.js:104:33)
at Request.RP$callback [as _callback] (C:\Users\luidavidas\Desktop\Case - Instagram\node_modules\request-promise-core\lib\plumbing.js:46:31)
at Request.self.callback (C:\Users\luidavidas\Desktop\Case - Instagram\node_modules\request\request.js:185:22)
at Request.emit (events.js:400:28)
at Request. (C:\Users\luidavidas\Desktop\Case - Instagram\node_modules\request\request.js:1154:10)
at Request.emit (events.js:400:28)
at IncomingMessage. (C:\Users\luidavidas\Desktop\Case - Instagram\node_modules\request\request.js:1076:12)
at Object.onceWrapper (events.js:519:28)
at IncomingMessage.emit (events.js:412:35)
(Use node --trace-warnings ... to show where the warning was created)
(node:16500) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:16500) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

@Deivesilvaka
Copy link
Author

I've already logged in, but this error still gives.

@yogipw
Copy link

yogipw commented Sep 2, 2021

Same

@RasmonT
Copy link

RasmonT commented Sep 13, 2021

Try this for authentication

index.js

const Instagram = require('instagram-web-api')
const dotenv = require('dotenv');
dotenv.config({ path: './process.env' });
const username = process.env.IGUSERNAME
const password = process.env.IGPASSWORD
 
const IGclient = new Instagram({ username, password })
 
IGclient
  .login()
  .then(() => {
    IGclient
      .getProfile()
      .then(console.log)
  })

put this to process.env in your directory:

IGUSERNAME=YOURINSTAGRAMUSERNAME
IGPASSWORD=YOURINSTAGRAMPASSWORD

it will return your instagram data.

@Sirius3615
Copy link

Same issue, I trued getting profile and it returns me an undefined value in the console.

@Sirius3615
Copy link

Figured it out, I forgot I changed Instagram username and didn't update it in my .env file. 😝

@fulviocesile
Copy link

same also for me or better it work for some time and after 10/15 times I got the error 403. If I wait some hours/days it works again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants