dilame / instagram-private-api

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

400 Bad request - Trying to upload photo or album #1356

Open eileooo opened 3 years ago

eileooo commented 3 years ago

Requirements

Description

I'm trying to public a image or album but it's returning 400 Bad Request. (The file path is correct, I've checked!)

Code

ig.publish.photo({
    file: waitingFile,
    caption: waitingDescription
});

Error and Output

(node:3788) UnhandledPromiseRejectionWarning: IgResponseError: POST /rupload_igphoto/1610720084925_0_8828849218 - 400 Bad Request;
    at Request.handleResponseError (C:\Users\garci\Documents\Tecticias\bot_local\node_modules\instagram-private-api\dist\core\request.js:125:16)
    at Request.send (C:\Users\garci\Documents\Tecticias\bot_local\node_modules\instagram-private-api\dist\core\request.js:53:28)
    at async UploadRepository.photo (C:\Users\garci\Documents\Tecticias\bot_local\node_modules\instagram-private-api\dist\repositories\upload.repository.js:17:26)
    at async PublishService.photo (C:\Users\garci\Documents\Tecticias\bot_local\node_modules\instagram-private-api\dist\services\publish.service.js:79:31)
Nerixyz commented 3 years ago

What's the file type you're trying to upload? Only Jpeg files are supported by instagram.

eileooo commented 3 years ago

What's the file type you're trying to upload? Only Jpeg files are supported by instagram.

.jpg images only.

Nerixyz commented 3 years ago

Do you have a sample image?

abdulahkam commented 3 years ago

Hi, I am getting this error today. I can not upload photo anymore

This is the file that I upload https://drive.google.com/file/d/12BS-Jl9gZEdhdpR5YIkZa0-0CZHaU0iQ/view?usp=sharing

This is the error I got

Error: POST /api/v1/media/configure/ - 400 Bad Request; at Request.handleResponseError (D:\Projects\Electron\mairasecure\node_modules\instagram-private-api\dist\core\request.js:125) at Request.send (D:\Projects\Electron\mairasecure\node_modules\instagram-private-api\dist\core\request.js:53) at process._tickCallback (internal/process/next_tick.js:68)

The file is square and it's .jpeg

jonathann403 commented 3 years ago

Hi, I am getting this error today. I can not upload photo anymore

This is the file that I upload https://drive.google.com/file/d/12BS-Jl9gZEdhdpR5YIkZa0-0CZHaU0iQ/view?usp=sharing

This is the error I got

Error: POST /api/v1/media/configure/ - 400 Bad Request; at Request.handleResponseError (D:\Projects\Electron\mairasecure\node_modules\instagram-private-api\dist\core\request.js:125) at Request.send (D:\Projects\Electron\mairasecure\node_modules\instagram-private-api\dist\core\request.js:53) at process._tickCallback (internal/process/next_tick.js:68)

The file is square and it's .jpeg

same issue

Nerixyz commented 3 years ago

This is the file that I upload https://drive.google.com/file/d/12BS-Jl9gZEdhdpR5YIkZa0-0CZHaU0iQ/view?usp=sharing

I tried the file and it works fine. Make sure to always upload the right filetype (Use file image.jpg to test if it's a real jpeg).

igorurr commented 3 years ago

@eileooo @GamerStop @abdulahkam

use small size jpg images (for example 1696x1064) everything works at this size

https://user-images.githubusercontent.com/22846441/133135927-a69e57cf-375d-481a-9609-8e084ac236f1.jpg

@Nerixyz I have error for this image (size 6240x4160) https://user-images.githubusercontent.com/22846441/133138733-c45e5703-cddc-4895-8e06-acccbc64c76f.JPG