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

I use ig.media,delete but it respond 400 #1781

Open
4 tasks
letterpaulsand opened this issue May 21, 2024 · 0 comments
Open
4 tasks

I use ig.media,delete but it respond 400 #1781

letterpaulsand opened this issue May 21, 2024 · 0 comments
Labels
bug unconfirmed This issue hasn't been read/confirmed/accepted by an admin

Comments

@letterpaulsand
Copy link

letterpaulsand commented May 21, 2024

Bug Report

Form

Put an [x] if you meet the condition, else leave [ ].

Requirements

Output

It print this

/opt/render/project/src/node_modules/instagram-private-api/dist/core/request.js:126
        return new errors_1.IgResponseError(response);
               ^
IgResponseError: POST /api/v1/media/my media id/only_me/ - 400 Bad Request; could not hide
    at Request.handleResponseError (/opt/render/project/src/node_modules/instagram-private-api/dist/core/request.js:126:16)
    at Request.send (/opt/render/project/src/node_modules/instagram-private-api/dist/core/request.js:54:28)
    at async MediaRepository.onlyMe (/opt/render/project/src/node_modules/instagram-private-api/dist/repositories/media.repository.js:465:26)
    at async deleteInsta (file:///opt/render/project/src/main.js:196:5)
    at async loadData (file:///opt/render/project/src/main.js:83:9)
    at async Timeout._onTimeout (file:///opt/render/project/src/main.js:115:9)

Code

I am very sure the login is successful

const deleteInsta = async (mediaId) => {
    const ig = new IgApiClient();
    ig.state.generateDevice(process.env.IG_USERNAME);
    ig.request.end$.subscribe(async () => {
        const serialized = await ig.state.serialize();
        delete serialized.constants;
        await fakeSave(serialized);
    });
    if (await fakeExists()) {
        await ig.state.deserialize(await fakeLoad());
    } else {
        await ig.account.login(process.env.IG_USERNAME, process.env.IG_PASSWORD);
    }
    await ig.media.onlyMe(mediaId)
}
@letterpaulsand letterpaulsand added bug unconfirmed This issue hasn't been read/confirmed/accepted by an admin labels May 21, 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