Skip to content

Commit

Permalink
Merge pull request #382 from e-aleixandre/hotfix/unfollow-private
Browse files Browse the repository at this point in the history
Checks for private account popup after unfollow
  • Loading branch information
alexal1 authored Oct 29, 2021
2 parents 1f81948 + ea0481c commit 7c9d572
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion insomniac/actions_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,20 @@ def do_unfollow(device, my_username, username, storage, check_if_is_follower, us
unfollow_confirmed = dialog_view.click_unfollow()

if unfollow_confirmed:
sleeper.random_sleep()
try:
# If the account is private, another popup is shown
confirm_button = device.find(classNameMatches=TEXTVIEW_OR_BUTTON_REGEX,
clickable=True,
text='Unfollow')
# If it exists, click unfollow
if confirm_button.exists():
print("Private account, confirming unfollow...")
confirm_button.click()
# Either way, sleep
except:
pass
finally:
sleeper.random_sleep()
else:
softban_indicator.detect_action_blocked_dialog(device)

Expand Down

0 comments on commit 7c9d572

Please sign in to comment.