GramAddict / bot

Completely free and open-source human-like Instagram bot. Powered by UIAutomator2 and compatible with basically any Android device 5.0+ that can run Instagram - real or emulated.
https://docs.gramaddict.org
MIT License
1.11k stars 173 forks source link

Unfollowing Job Continuesly Scrolls and does not Iterate #379

Open sagirab opened 7 months ago

sagirab commented 7 months ago

What happened: When bot enters unfollowing job, it scrolls and iterates over visible followings. However, after 2-3 times doing this successfully it just scrolls and keepy saying:

Need to scroll now. Iterate over visible followings. Need to scroll now. Iterate over visible followings. Need to scroll now. Iterate over visible followings. Need to scroll now. Iterate over visible followings.

Scroll never ends! The following list keep repeat itself.

What you expected to happen:

Iterate users through followings every time after it scrolls.

How to reproduce it (as minimally and precisely as possible): Bot needs to enter unfollow job.

Anything else we need to know?:

Environment:

Relevant Logs:




*Note: if you have a crash log, please do not attach the archive here as this is not a secure place to upload the sensitive data inside. Please open a ticket in Discord in #lobby and provide the ticket ID here.

prakovec commented 7 months ago

Hi! I have the same problem on my environment: GramAddict version: GramAddict 3.2.10 Device Model/Emulator Type: Google Pixel 4XL, Google Pixel Android Version: Android 13, Android 10 Instagram Version: Latest tested version Discord Ticket ID: *(if submitting crash log)

mastrolube commented 7 months ago

Probably ReseouceId needs to get updated

spikeyhair commented 5 months ago

I have the same issue too and i notice it's because after a few scrolls, IG keep repeating the same list of users. I can manually reproduce this issue. If I don't sort the list and use the default settings: I can scroll until end of the list without repeating the same users. if I sort the list, regardless "date followed: latest" or "date followed: earliest", after 1 or 2 scrolls, the users coming out from the list again.

Can we have an option to disable the bot from sorting?

Currently, I tried to mask this option "sort-followers-newest-to-oldest" but it will still sort the list before start scrolling.

I tested with the latest version of IG, it doesn't have this issue. So pretty sure it's the old version IG's bugs.

S85mario commented 5 months ago

What happened: When bot enters unfollowing job, it scrolls and iterates over visible followings. However, after 2-3 times doing this successfully it just scrolls and keepy saying:

Need to scroll now. Iterate over visible followings. Need to scroll now. Iterate over visible followings. Need to scroll now. Iterate over visible followings. Need to scroll now. Iterate over visible followings.

Scroll never ends! The following list keep repeat itself.

What you expected to happen:

Iterate users through followings every time after it scrolls.

How to reproduce it (as minimally and precisely as possible): Bot needs to enter unfollow job.

Anything else we need to know?:

Environment:

* GramAddict version:  GramAddict 3.2.10

* Device Model/Emulator Type: MemuPlay

* Android Version: 9

* Instagram Version: Latest tested version

* Discord Ticket ID:           *(if submitting crash log)

Relevant Logs:

* activate debug mode in confing.yml if you want to paste from the console, otherwise attach the log file from the logs folder

*Note: if you have a crash log, please do not attach the archive here as this is not a secure place to upload the sensitive data inside. Please open a ticket in Discord in #lobby and provide the ticket ID here.

the same problem with my honor 9, I noticed that this problem does not exist if it is set to "Default". I went to look for the file "C:\Users\AppData\Local\Programs\Python\Python39\Lib\site-packages\GramAddict\plugins\action_unfollow_followers.py"

and I changed this code to line 232 and 233

232            logger.info("Sort followings by date: from newest to Default.")
233            sort_options_recycler_view.child(textContains="Default").click()

Now it works well

spikeyhair commented 5 months ago

Strange. I changed the action_unfollow_followers.py in my virtual env but seems like nothing been changed, it's not running from this file. Is it because I am running in a virtual env?

even i restored the original .py file but now whenever i run i see this error messages but all the while I hashed all the unfollowing options I don't see these error messages: [04/21 21:51:21] ERROR | Error while importing arguments of plugin ActionUnfollowFollowers. Error: Missing key from arguments dictionary - argument --unfollow: conflicting option string: --unfollow (config.py:136) [04/21 21:51:21] ERROR | Error while importing arguments of plugin ActionUnfollowFollowers. Error: Missing key from arguments dictionary - argument --unfollow-non-followers: conflicting option string: --unfollow-non-followers (config.py:136) [04/21 21:51:21] ERROR | Error while importing arguments of plugin ActionUnfollowFollowers. Error: Missing key from arguments dictionary - argument --unfollow-any-non-followers: conflicting option string: --unfollow-any-non-followers (config.py:136) [04/21 21:51:21] ERROR | Error while importing arguments of plugin ActionUnfollowFollowers. Error: Missing key from arguments dictionary - argument --unfollow-any-followers: conflicting option string: --unfollow-any-followers (config.py:136) [04/21 21:51:21] ERROR | Error while importing arguments of plugin ActionUnfollowFollowers. Error: Missing key from arguments dictionary - argument --unfollow-any: conflicting option string: --unfollow-any (config.py:136) [04/21 21:51:21] ERROR | Error while importing arguments of plugin ActionUnfollowFollowers. Error: Missing key from arguments dictionary - argument --min-following: conflicting option string: --min-following (config.py:136) [04/21 21:51:21] ERROR | Error while importing arguments of plugin ActionUnfollowFollowers. Error: Missing key from arguments dictionary - argument --sort-followers-newest-to-oldest: conflicting option string: --sort-followers-newest-to-oldest (config.py:136) [04/21 21:51:21] ERROR | Error while importing arguments of plugin ActionUnfollowFollowers. Error: Missing key from arguments dictionary - argument --unfollow-delay: conflicting option string: --unfollow-delay (config.py:136)

kenpyfin commented 3 months ago

Suggest a few lines of code to fix this issue in GramAddict/plugins/action_unfollow_followers.py at the iterate_over_followings function. Simply save the seen username in a see, check in each scroll, and see if more than a threshold (3 in my case) of duplicated usernames in new refreshes.

I was trying to commit the code, but I'm not a contributor.

def iterate_over_followings(
        self,
        device,
        count,
        on_unfollow,
        storage,
        unfollow_restriction,
        my_username,
        posts_end_detector,
        job_name,
    ):
    # Wait until list is rendered
    sorted = False
    for _ in range(2):

    seen_users = set()
    seen_user_threshold = 3
    while True:
        screen_iterated_followings = []
        logger.info("Iterate over visible followings.")
        user_list = device.find(
            resourceIdMatches=self.ResourceID.USER_LIST_CONTAINER,
        )
        row_height, n_users = inspect_current_view(user_list)
        for item in user_list:
            seen_user_count = 0
            cur_row_height = item.get_height()

               .......

            username = user_name_view.get_text()
            screen_iterated_followings.append(username)
            if username in seen_users:
                seen_user_count += 1
            seen_users.add(username)
            if username not in checked:
                checked[username] = None

      .......

       if screen_iterated_followings != prev_screen_iterated_followings:
            prev_screen_iterated_followings = screen_iterated_followings
            if seen_user_count > seen_user_threshold:
                logger.info(
                    "Reached the following list end, finish.",
                    extra={"color": f"{Fore.GREEN}"},
                )
                return
            logger.info("Need to scroll now.", extra={"color": f"{Fore.GREEN}"})
            list_view = device.find(
                resourceId=self.ResourceID.LIST,
            )
            list_view.scroll(Direction.DOWN)