instagram-web-api
instagram-web-api copied to clipboard
UnhandledPromiseRejectionWarning: StatusCodeError: 400
I get this error every time im trying to upload a post:
"{"debug_info":{"retriable":false,"type":"ProcessingFailedError","message":"Request processing failed"}}"
at new StatusCodeError (C:\Users\GamerStop_\Desktop\univors.github.io\node_modules\request-promise-core\lib\errors.js:32:15)
at Request.plumbing.callback (C:\Users\GamerStop_\Desktop\univors.github.io\node_modules\request-promise-core\lib\plumbing.js:104:33)
at Request.RP$callback [as callback] (C:\Users\GamerStop\Desktop\univors.github.io\node_modules\request-promise-core\lib\plumbing.js:46:31)
at Request.self.callback (C:\Users\GamerStop_\Desktop\univors.github.io\node_modules\request\request.js:185:22)
at Request.emit (events.js:314:20)
at Request.
The upload code:
const username = "xxx"
const password = "xxx"
const client = new Instagram({ username, password })
;(async () => {
await client.login()
const { media } = await client.uploadPhoto({ photo: "https://upload.wikimedia.org/wikipedia/commons/2/2f/Baby.tux.sit-800x800.png", caption: 'testing', post: 'feed' })
console.log(`https://www.instagram.com/p/${media.code}/`)
})()
Are you sure your credentials are correct ? If so, you can try to pass tests of the library (in the test
folder) with AVA.
Having the same issue.
This method allow only JPEG images.