subzeroid / instagrapi

🔥 The fastest and powerful Python library for Instagram Private API 2024
https://hikerapi.com/p/bkXQlaVe
MIT License
4.21k stars 667 forks source link

[BUG] follow_user gives "We restrict certain activity to protect our community." #1311

Closed DylanJWolf closed 1 year ago

DylanJWolf commented 1 year ago

Describe the bug I receive the following error when using the follow_user method: We restrict certain activity to protect our community.

To Reproduce from instagrapi import Client

cl = Client() cl.load_settings("session.json") cl.login("myaccount", "mypassword") userid = cl.user_id_from_username("geeks_for_geeks") cl.user_follow(userid)

Traceback Traceback (most recent call last): File "C:\Users\dylan\PycharmProjects\pythonProject\main.py", line 7, in cl.user_follow(userid) File "C:\Users\dylan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\instagrapi\mixins\user.py", line 814, in user_follow result = self.private_request(f"friendships/create/{user_id}/", data) File "C:\Users\dylan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\instagrapi\mixins\private.py", line 484, in private_request raise e File "C:\Users\dylan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\instagrapi\mixins\private.py", line 469, in private_request self._send_private_request(endpoint, **kwargs) File "C:\Users\dylan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\instagrapi\mixins\private.py", line 367, in _send_private_request raise FeedbackRequired( instagrapi.exceptions.FeedbackRequired: feedback_required: We restrict certain activity to protect our community.

Expected behavior I expected to be able to follow the user geeks_for_geeks.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

birdhouses commented 1 year ago

This is not an issue with the bot. This is because Instagram is blocking you from preforming this action. You should try to use a proxy, limit your requests, try making the request with a different account. If you decide to use proxies, I recommend getting the expensive ones because I've had some headaches from using the cheaper ones. Instagram probably blacklisted a few of them.

Do your own research though, I can't say exactly which proxies to buy to guarantee good results. Hope this helps!

nebula0225 commented 1 year ago

It is Instagram's ban not instagrapi's problem

tajbowness commented 1 year ago

Limit your requests, set a timer between each. cl = Client(request_timeout=7) will set a 7 second timer between each action, follow, like etc. The goal is to not let Instagram think your bot otherwise this happens, be slow as a regular user.

Liking 100 posts in a minute or any other unrealistic actions will put your account at risk. You probably know that but...

Also, Instagram has daily/hourly limits for things like liking, following, commenting. I believe you can follow 120 people a day, and ppl recommend only following 10 ppl an hour. Although people that try the follow 4 follow method on their own without a bot and just by hand will reach the daily limit within the hour so i'm unsure if there is an hourly limit or if it's just a precaution to take to avoid Instagrams suspicion. Let me know if this helps!

claell commented 1 year ago

BTW: Is cl = Client(request_timeout=7) doing something different from cl.delay_range = [1, 3] (apart from the random range of the second command)?