Open VityaSchel opened 1 year ago
Here you can see that library uses "approve" endpoint:
So all you need to do is to add a method here:
Ah, of course, this library is dead and even if I wanted to do a PR, it would never be accepted by author who better add funding notice than fix bug. I wonder if python has patch-package like js or I'll have to go back to dinosaurs and make a fork, edit it, and then clone to my project
Here is a patch file if you know how to use it:
--- friendships.py 2022-09-17 19:43:02.000000000 +0400
+++ /venv/lib/python3.9/site-packages/instagram_private_api/endpoints/friendships.py 2022-09-17 19:43:26.000000000 +0400
@@ -356,6 +356,20 @@
params=params)
return res
+ def approve_user(self, user_id):
+ """
+ Approve a user's follow request.
+
+ :param user_id:
+ :return:
+ """
+ params = {'user_id': user_id, 'radio_type': self.radio_type}
+ params.update(self.authenticated_params)
+ res = self._call_api(
+ 'friendships/approve/{user_id!s}/'.format(**{'user_id': user_id}),
+ params=params)
+ return res
+
def remove_follower(self, user_id):
"""
Remove a follower.
And if you don't know, add this to (your lib folder)/instagram_private_api/endpoints/friendships.py:
def approve_user(self, user_id):
"""
Approve a user's follow request.
:param user_id:
:return:
"""
params = {'user_id': user_id, 'radio_type': self.radio_type}
params.update(self.authenticated_params)
res = self._call_api(
'friendships/approve/{user_id!s}/'.format(**{'user_id': user_id}),
params=params)
return res
Tested on Instagram app, works correctly.
Please follow the guide below
x
into all the boxes [ ] relevant to your issue (==> [x] no spaces).Before submitting an issue, make sure you have:
Which client are you using?
instagram_private_api/
)instagram_web_api/
)Describe your Feature Request:
Well this is just ridiculous. In this library, there is a method to check incoming follow requests, but no way to approve it. In library with the same name but for javascript, there is a method to approve follow requests, but not to check list of them.
Please implement it! friendship_create just follows user, but does not approves its outgoing follow request. If such method exists, please add it to the documentation :)