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

crash on add followers as besties - 'feedback_required' #1811

Open
gameszaum opened this issue Jan 13, 2025 · 0 comments
Open

crash on add followers as besties - 'feedback_required' #1811

gameszaum opened this issue Jan 13, 2025 · 0 comments
Labels
question unconfirmed This issue hasn't been read/confirmed/accepted by an admin

Comments

@gameszaum
Copy link

Question

I made a simple application to add all my followers on the close friends, it worked on the beggining and already added 1300 followers as besties, but suddenly starts failing and I want to know how can I fix and improve this.

Ps: I implemented the 'batchCooldown' after crash on the first time.

        const ig = new IgApiClient();

        console.log("Generating device...");

        ig.state.generateDevice(process.env.IG_USERNAME as string);

        console.log("Logging in...");

        (async () => {
            await ig.account.login(process.env.IG_USERNAME as string, process.env.IG_PASSWORD as string);

            console.log("Logged in, fetching followers...");

            const followersFeed = ig.feed.accountFollowers(ig.state.cookieUserId);
            const followers = (await this.getAllItemsFromFeed(followersFeed));

            console.log(`Fetched ${followers.length} followers, adding as besties...`);
            console.log(" ")

            const batchSize = 5;
            let i = 0;
            let max = followers.length;
            let batchCooldown = 0;

            while (i < max) {
                if (batchCooldown >= 1000) {
                    batchCooldown = 0;

                    console.log("Batch cooldown reached, waiting 10 minutes...");

                    await new Promise(resolve => setTimeout(resolve, 600000));
                }
                const batch = followers.slice(i, i + batchSize);
                const pks = batch.map(follower => follower.pk);

                await ig.friendship.setBesties({ add: pks });

                const time = Math.round(Math.random() * 5000) + 1000;
                await new Promise(resolve => setTimeout(resolve, time));

                i += batchSize;
                batchCooldown += 1;
                console.log(`Added batch of ${batchSize} followers as besties. Progress: ${Math.min(i, max)}/${max} - (${Math.round(Math.min(i, max) / max * 100)}%)`);
            }
            console.log("Process ended, all followers were added as besties. 🎉");
        })();

I don't know whats 'feedback_required' means.

IgResponseError: GET /api/v1/friendships/61038176888/followers/?order=default&query=&enable_groups=true - 400 Bad Request; feedback_required
    at Request.handleResponseError (/home/container/node_modules/instagram-private-api/dist/core/request.js:126:16)
    at Request.send (/home/container/node_modules/instagram-private-api/dist/core/request.js:54:28)
    at async AccountFollowersFeed.request (/home/container/node_modules/instagram-private-api/dist/feeds/account-followers.feed.js:28:26)
    at async AccountFollowersFeed.items (/home/container/node_modules/instagram-private-api/dist/feeds/account-followers.feed.js:42:22) { tags: [ 'Error', 'UnhandledRejection' ] }
@gameszaum gameszaum added question unconfirmed This issue hasn't been read/confirmed/accepted by an admin labels Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question unconfirmed This issue hasn't been read/confirmed/accepted by an admin
Projects
None yet
Development

No branches or pull requests

1 participant