instagram-web-api icon indicating copy to clipboard operation
instagram-web-api copied to clipboard

UnhandledPromiseRejectionWarning: StatusCodeError: 400

Open jonathann403 opened this issue 3 years ago • 3 comments

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. (C:\Users\GamerStop_\Desktop\univors.github.io\node_modules\request\request.js:1154:10) at Request.emit (events.js:314:20) at IncomingMessage. (C:\Users\GamerStop_\Desktop\univors.github.io\node_modules\request\request.js:1076:12) at Object.onceWrapper (events.js:420:28) at IncomingMessage.emit (events.js:326:22) at endReadableNT (_stream_readable.js:1244:12) at processTicksAndRejections (internal/process/task_queues.js:80:21)

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}/`)

})()

jonathann403 avatar Mar 28 '21 09:03 jonathann403

Are you sure your credentials are correct ? If so, you can try to pass tests of the library (in the test folder) with AVA.

MonsieurBibo avatar Mar 28 '21 10:03 MonsieurBibo

Having the same issue.

iltommi1995 avatar Mar 28 '21 12:03 iltommi1995

This method allow only JPEG images.

codexJoin avatar Apr 01 '21 12:04 codexJoin