Giter Site home page Giter Site logo

Comments (4)

VityaSchel avatar VityaSchel commented on May 27, 2024 2

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

from instagram_private_api.

VityaSchel avatar VityaSchel commented on May 27, 2024

Here you can see that library uses "approve" endpoint:

https://github.com/dilame/instagram-private-api/blob/623a348343e34058c3a286693740aa3698aed3cc/src/repositories/friendship.repository.ts#L47

So all you need to do is to add a method here:

https://github.com/ping/instagram_private_api/blob/0fda0369ac02bc03d56f5f3f99bc9de2cc25ffaa/instagram_private_api/endpoints/friendships.py

from instagram_private_api.

VityaSchel avatar VityaSchel commented on May 27, 2024

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

from instagram_private_api.

VityaSchel avatar VityaSchel commented on May 27, 2024

Tested on Instagram app, works correctly.

from instagram_private_api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.