MCPcopy
hub / github.com/InstaPy/InstaPy / unfollow

Function unfollow

instapy/unfollow_util.py:154–535  ·  view source on GitHub ↗

Unfollows the given amount of users

(
    browser,
    username,
    amount,
    customList,
    InstapyFollowed,
    nonFollowers,
    allFollowing,
    style,
    automatedFollowedPool,
    relationship_data,
    dont_include,
    white_list,
    sleep_delay,
    jumps,
    delay_followbackers,
    logger,
    logfolder,
)

Source from the content-addressed store, hash-verified

152
153
154def unfollow(
155 browser,
156 username,
157 amount,
158 customList,
159 InstapyFollowed,
160 nonFollowers,
161 allFollowing,
162 style,
163 automatedFollowedPool,
164 relationship_data,
165 dont_include,
166 white_list,
167 sleep_delay,
168 jumps,
169 delay_followbackers,
170 logger,
171 logfolder,
172):
173 """Unfollows the given amount of users"""
174
175 msg = None
176 unfollow_num = 0
177 unfollow_list = None
178 unfollow_track = None
179 unfollow_state = None
180 customList_data = None
181 user_link = "https://www.instagram.com/{}/".format(username)
182
183 if (
184 customList is not None
185 and isinstance(customList, (tuple, list))
186 and len(customList) == 3
187 and customList[0] is True
188 and isinstance(customList[1], (list, tuple, set))
189 and len(customList[1]) > 0
190 and customList[2] in ["all", "nonfollowers"]
191 ):
192 customList_data = customList[1]
193 if not isinstance(customList_data, list):
194 customList_data = list(customList_data)
195 unfollow_track = customList[2]
196 customList = True
197 else:
198 customList = False
199
200 if (
201 InstapyFollowed is not None
202 and isinstance(InstapyFollowed, (tuple, list))
203 and len(InstapyFollowed) == 2
204 and InstapyFollowed[0] is True
205 and InstapyFollowed[1] in ["all", "nonfollowers"]
206 ):
207 unfollow_track = InstapyFollowed[1]
208 InstapyFollowed = True
209 else:
210 InstapyFollowed = False
211

Callers 1

unfollow_usersMethod · 0.85

Calls 14

web_address_navigatorFunction · 0.85
get_relationship_countsFunction · 0.85
get_nonfollowersFunction · 0.85
get_followersFunction · 0.85
get_followingFunction · 0.85
truncate_floatFunction · 0.85
sleepFunction · 0.85
is_page_availableFunction · 0.85
is_follow_meFunction · 0.85
get_epoch_time_diffFunction · 0.85
set_followback_in_poolFunction · 0.85
unfollow_userFunction · 0.85

Tested by

no test coverage detected