MCPcopy
hub / github.com/InstaPy/InstaPy / remove_follow_requests

Method remove_follow_requests

instapy/instapy.py:4083–4122  ·  view source on GitHub ↗

Remove user unaccepted follow requests

(self, amount: int = 200, sleep_delay: int = 600)

Source from the content-addressed store, hash-verified

4081 return self
4082
4083 def remove_follow_requests(self, amount: int = 200, sleep_delay: int = 600):
4084 """Remove user unaccepted follow requests"""
4085
4086 if self.aborting:
4087 return self
4088
4089 message = "Starting to get follow requests.."
4090 highlight_print(self.username, message, "feature", "info", self.logger)
4091
4092 follow_requests = get_follow_requests(
4093 self.browser, amount, sleep_delay, self.logger, self.logfolder
4094 )
4095
4096 unfollow_count = 0
4097
4098 for person in follow_requests:
4099 self.logger.warning(
4100 "--> Unfollow {}/{}:"
4101 " Removing request for: '{}' ".format(
4102 unfollow_count + 1, len(follow_requests), person
4103 )
4104 )
4105
4106 unfollow_state, msg = unfollow_user(
4107 self.browser,
4108 "profile",
4109 self.username,
4110 person,
4111 None,
4112 None,
4113 self.relationship_data,
4114 self.logger,
4115 self.logfolder,
4116 )
4117
4118 if unfollow_state is True:
4119 unfollow_count += 1
4120 self.unfollowed += 1
4121
4122 return self
4123
4124 def like_by_feed(self, amount, randomize, unfollow, interact):
4125 """

Callers

nothing calls this directly

Calls 3

highlight_printFunction · 0.85
get_follow_requestsFunction · 0.85
unfollow_userFunction · 0.85

Tested by

no test coverage detected