Open adw0rd opened 2 years ago
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")
@88um great! Can you send me a PR?
Discussed in https://github.com/adw0rd/instagrapi/discussions/740