dilame / instagram-private-api

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

Because I get an error when I run a loop to keep commenting #1486

Open Danilo-Pinto opened 3 years ago

Danilo-Pinto commented 3 years ago

I'm getting a login error, I would like to understand why?

my code:

const { urlSegmentToInstagramId } = require('instagram-id-to-url-segment');
const {IgApiClient} = require('instagram-private-api');

const data = {
    username,
    password,
    uri:urlSegmentToInstagramId('code of the post')
}

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

(
    async() => {

        await ig.account.login(data.username,data.password);

        setInterval(
            async () =>{
                await ig.media.comment({mediaId:data.uri,text:'Hey Hey'});
            },
            10000
        );
    }
)()

code error:

IgResponseError: POST /api/v1/accounts/login/ - 400 Bad Request; Please wait a few minutes before you try again
MevlanaErtugrulAcikgoz commented 3 years ago

I get the same error. Is there anyone who can help?