jlobos / instagram-web-api

🤳 Instagram Private Web API client for Node
https://npmjs.com/instagram-web-api
MIT License
1.12k stars 186 forks source link

Instagram ignores subscription request #237

Open SenQ77 opened 3 years ago

SenQ77 commented 3 years ago

The problem is that the bot stops subscribing when it reaches a number approximately equal to 40. Here is the code:

        await client.login()
        while (test.length <= 1440) {
            await client.getFollowers({
                userId: id,
                first: 50,
                after: cur
            }).then(followers => {
                followers.data.forEach(function (value) {
                    test.push(value.id);
                });
            })
            console.log(test.length)
        }

        function rand(min, max) {
            return (max - min) * Math.random() + min
        }

        setInterval(() => {
            for (let i = 0; i < 10; i++) {
                setTimeout(function () {
                    let data = new Date(),
                        h = data.getHours(),
                        m = data.getMinutes(),
                        s = data.getSeconds()
                    client.follow({ userId: `${test[p++]}` })
                    console.log(`${p}\nID - ${test[p]}\nDate - ${h < 10 ? `0${h}` : h}:${m < 10 ? `0${m}` : m}:${s < 10 ? `0${s}` : s}\n`)
                }, (Math.floor(Math.random() * 3000) + 1000) * i);
            }
        }, rand(600000, 800000))
MonsieurBibo commented 3 years ago

No idea, it might be IG detecting "malicious" activities.