From 891f0ea9f198c8dd70b13cbf9fc6cc4df0dadb99 Mon Sep 17 00:00:00 2001 From: EAleixandre Date: Wed, 22 Sep 2021 18:43:47 +0200 Subject: [PATCH 1/4] Checks for private account popup after unfollow --- insomniac/actions_impl.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/insomniac/actions_impl.py b/insomniac/actions_impl.py index 19b8d21..c2a95a8 100644 --- a/insomniac/actions_impl.py +++ b/insomniac/actions_impl.py @@ -802,6 +802,7 @@ def do_unfollow(device, my_username, username, storage, check_if_is_follower, us unfollow_button.click() sleeper.random_sleep() + breakpoint() unfollow_confirmed = False dialog_view = DialogView(device) if dialog_view.is_visible(): @@ -809,6 +810,15 @@ def do_unfollow(device, my_username, username, storage, check_if_is_follower, us unfollow_confirmed = dialog_view.click_unfollow() if unfollow_confirmed: + # 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 sleeper.random_sleep() else: softban_indicator.detect_action_blocked_dialog(device) From 5d424ae7e9e6319dd82c6a740fe87eeca3b16e18 Mon Sep 17 00:00:00 2001 From: EAleixandre Date: Wed, 22 Sep 2021 19:20:05 +0200 Subject: [PATCH 2/4] Removes breakpoint --- insomniac/actions_impl.py | 1 - 1 file changed, 1 deletion(-) diff --git a/insomniac/actions_impl.py b/insomniac/actions_impl.py index c2a95a8..fef5788 100644 --- a/insomniac/actions_impl.py +++ b/insomniac/actions_impl.py @@ -802,7 +802,6 @@ def do_unfollow(device, my_username, username, storage, check_if_is_follower, us unfollow_button.click() sleeper.random_sleep() - breakpoint() unfollow_confirmed = False dialog_view = DialogView(device) if dialog_view.is_visible(): From 1a6d1494dcddb7c4cc39623ca672c5a6d86a60b0 Mon Sep 17 00:00:00 2001 From: EAleixandre Date: Sun, 26 Sep 2021 15:36:45 +0200 Subject: [PATCH 3/4] Fixes crash on new instagram versions --- insomniac/actions_impl.py | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/insomniac/actions_impl.py b/insomniac/actions_impl.py index fef5788..fc6a8e7 100644 --- a/insomniac/actions_impl.py +++ b/insomniac/actions_impl.py @@ -801,7 +801,7 @@ def do_unfollow(device, my_username, username, storage, check_if_is_follower, us print(f"Unfollowing @{username}...") unfollow_button.click() sleeper.random_sleep() - + breakpoint() unfollow_confirmed = False dialog_view = DialogView(device) if dialog_view.is_visible(): @@ -809,16 +809,20 @@ def do_unfollow(device, my_username, username, storage, check_if_is_follower, us unfollow_confirmed = dialog_view.click_unfollow() if unfollow_confirmed: - # 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 - 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) From ea0481c94bb96351aee0d8487c0af12243e78b2c Mon Sep 17 00:00:00 2001 From: EAleixandre Date: Sun, 26 Sep 2021 15:40:26 +0200 Subject: [PATCH 4/4] Removes breakpoint --- insomniac/actions_impl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/insomniac/actions_impl.py b/insomniac/actions_impl.py index fc6a8e7..6f20315 100644 --- a/insomniac/actions_impl.py +++ b/insomniac/actions_impl.py @@ -801,7 +801,7 @@ def do_unfollow(device, my_username, username, storage, check_if_is_follower, us print(f"Unfollowing @{username}...") unfollow_button.click() sleeper.random_sleep() - breakpoint() + unfollow_confirmed = False dialog_view = DialogView(device) if dialog_view.is_visible():