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

400 Bad Request; Uploaded image asset creation failed pm POST /api/v1/media/configure/ #1790

Open
5 of 6 tasks
tchesa opened this issue Jul 25, 2024 · 0 comments
Open
5 of 6 tasks
Labels
bug unconfirmed This issue hasn't been read/confirmed/accepted by an admin

Comments

@tchesa
Copy link

tchesa commented Jul 25, 2024

Bug Report

Form

Requirements

Platform

  • I'm using Node.js version 22.4.0
  • I'm using electron

Description

I'm trying to make a simple test logging in and uploading a photo, but I'm getting the error below:

Code

import { IgApiClient } from "instagram-private-api";
import credentials from "./credentials.json";
import { readFileSync } from "fs";

const ig = new IgApiClient();
ig.state.generateDevice(credentials.playwrightTestInstagram.username);

(async () => {
  const loggedInUser = await ig.account.login(
    credentials.playwrightTestInstagram.username,
    credentials.playwrightTestInstagram.password
  );

  console.log("loggedInUser", loggedInUser);

  const photo = readFileSync("./skyline.jpeg");

  const publishResult = await ig.publish.photo({
    file: photo,
    caption: "Test photo",
  });

  console.log("publishResult", publishResult);
})();

Error and Output

Request: Requesting POST /api/v1/media/configure/
Request: Request POST /api/v1/media/configure/ failed: {"message":"Uploaded image asset creation failed","status":"fail"}
IgResponseError: POST /api/v1/media/configure/ - 400 Bad Request; Uploaded image asset creation failed
    at Request.handleResponseError (/Users/tchesa/repositories/tchesa/xoxo/node_modules/instagram-private-api/src/core/request.ts:173:4)
    at Request.send (/Users/tchesa/repositories/tchesa/xoxo/node_modules/instagram-private-api/src/core/request.ts:83:24)
    at async MediaRepository.configure (/Users/tchesa/repositories/tchesa/xoxo/node_modules/instagram-private-api/src/repositories/media.repository.ts:359:15)
    at async PublishService.photo (/Users/tchesa/repositories/tchesa/xoxo/node_modules/instagram-private-api/src/services/publish.service.ts:154:21)
@tchesa tchesa added bug unconfirmed This issue hasn't been read/confirmed/accepted by an admin labels Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unconfirmed This issue hasn't been read/confirmed/accepted by an admin
Projects
None yet
Development

No branches or pull requests

1 participant