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

Block and report users #742

Open
adw0rd opened this issue Jun 23, 2022 Discussed in #740 · 2 comments
Open

Block and report users #742

adw0rd opened this issue Jun 23, 2022 Discussed in #740 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@adw0rd
Copy link
Contributor

adw0rd commented Jun 23, 2022

Discussed in #740

Originally posted by chrishsr June 23, 2022
I'm fighting Bot accounts on my page, and an API endpoint to Block and report these users would make my life a lot easier.
Thanks in advance.

@adw0rd adw0rd added the enhancement New feature or request label Jun 23, 2022
@adw0rd adw0rd self-assigned this Jun 23, 2022
@88um
Copy link

88um commented Aug 2, 2022

def unblock(self, user_id : str) -> bool:
    """
    Unblock an Instagram user

    Parameters
    ----------
    user_id: str
        User ID

    Returns
    -------
    bool
        A boolean value
    """
    data = {"surface":"profile","is_auto_block_enabled":"true","user_id":user_id,"_uid":self.user_id,"_uuid":self.uuid}
    response = self.private_request(f"friendships/unblock/{user_id}/",data=data)
    return response.get("friendship_status",{}).get("blocking") == False

def block(self, user_id : str) -> bool:
    """
    Block an Instagram user

    Parameters
    ----------
    user_id: str
        User ID

    Returns
    -------
    bool
        A boolean value
    """
    data = {"surface":"profile","is_auto_block_enabled":"true","user_id":user_id,"_uid":self.user_id,"_uuid":self.uuid}
    response = self.private_request(f"friendships/unblock/{user_id}/",data=data)
    return response.get("friendship_status",{}).get("blocking")

@adw0rd
Copy link
Contributor Author

adw0rd commented Aug 7, 2022

@88um great! Can you send me a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants