InstaPy / InstaPy

πŸ“· Instagram Bot - Tool for automated Instagram interactions
GNU General Public License v3.0
16.73k stars 3.77k forks source link

After last update 22.07 unfollowing still not working #2501

Closed alezhke closed 6 years ago

alezhke commented 6 years ago

Sorry, an error occured: 'bool' object is not subscriptable

Mehran commented 6 years ago

yes same as me , Sorry, an error occured: 'bool' object is not subscriptable

ceribbo commented 6 years ago

same here

griffr10 commented 6 years ago

Same here.

cesarcm96 commented 6 years ago

Same here

jeremycjang commented 6 years ago

Are you running with GUI? I've had no problems with GUI enabled.

griffr10 commented 6 years ago

I am running it from a CMD line in a Digital Ocean droplet.

lucanello commented 6 years ago

I have the same problem. Running on debian with a headless Chrome browser

griffr10 commented 6 years ago

I was able to get this to work by commenting out the lines that give me the issue the error arises on line 662. For me I commented out lines 662-668 and 678-690 within the unfollow_util.py file in the get_users_through_dialog function and it works fine.

Be warned, this will disable the following of users that was added to the script to simulate real interaction. However, I am doing this with something else so this is not functionality I need anyway.

This is not a fix, but i am using it as a work around until it is fixed

torbenberger commented 6 years ago

Hi guys, i can't reproduce this issue. my unfollow is running like a charm for days.

could you provide more information?

Which functions are you using? Which settings did you set? Did you make any changes to any files (git status)

alezhke commented 6 years ago

@torbenberger i using git cmd, getting this:

INFO [2018-07-23 10:28:15] [00] Session started! INFO [2018-07-23 10:28:47] [00] Logged in successfully! INFO [2018-07-23 10:28:52] [00] Starting to unfollow users.. INFO [2018-07-23 10:28:53] [00] Unfollowing the users you are following INFO [2018-07-23 10:29:05] [00] Failed to load desired amount of users ERROR [2018-07-23 10:29:05] [00] Sorry, an error occured: 'bool' object is not subscriptable INFO [2018-07-23 10:29:08] [00] Session ended - 2018-07-23 10:29:08

my settings: `session = InstaPy(username=insta_username, password=insta_password, headless_browser=False, multi_logs=False)

try: session.login()

# settings
session.set_relationship_bounds(enabled=False,
             potency_ratio=-1.00,
              delimit_by_numbers=False,
               max_followers=1000,
                max_following=1150,
                 min_followers=15,
                  min_following=30)
session.set_dont_like(['toys', 'gay'])

# actions
session.unfollow_users(amount=2000, customList=(False, ["user1", "user2", "user88", "user200"], "all"), InstapyFollowed=(False, "all"), nonFollowers=False, allFollowing=True, style="FIFO", unfollow_after=None, sleep_delay=10)

except Exception as exc: if isinstance(exc, NoSuchElementException): file_path = os.path.join(gettempdir(), '{}.html'.format(time.strftime('%Y%m%d-%H%M%S'))) with open(file_path, 'wb') as fp: fp.write(session.browser.page_source.encode('utf8')) print('{0}\nIf raising an issue, please also upload the file located at:\n{1}\n{0}'.format( '' 70, file_path)) raise

finally:

end the bot session

session.end()`
Mehran commented 6 years ago

@torbenberger just updated to last version and this issue happen , i use noguiand HeadLess

michaelBielang commented 6 years ago

This issue is already open. Please read other issues before opening one?

Mehran commented 6 years ago

@uluQulu maybe can help about it .

michaelBielang commented 6 years ago

Why you downvote. I mean what is the purpose that people open always x-times issues for the exakt same thing, could you please explain it to me?

uluQulu commented 6 years ago

@realsony, think about the issuers very new to GitHub but people must be careful 😊

@Mehran, I have got a busy time but I will help you with it, hopefully πŸŽ‰πŸŽ‰

alezhke commented 6 years ago

@realsony @uluQulu Yes i saw this topics about nothing inside it. So we here want finally find the answer what is fkin wrong. If you dont want to help go read other topics u will find nothing. Here we see that is with last update same thing. I personally dont care about other topics. and u see how many answers we see here and in other topics. So u can continue post about same topics somewhere to others

alezhke commented 6 years ago

@torbenberger Can you pull your release? Thank you

uluQulu commented 6 years ago

@Mehran assuming you have encountered the exact error posted in this Issue: "Sorry, an error occured: 'bool' object is not subscriptable"

It was a mistake out of my latest PR πŸ˜€

Do this to solve it:

Open up unfollow_util.py file and there, find and replace,

get_users_through_dialog(browser, None, username, amount,
                             allfollowing, False, None,
                              None, None, None,
                               False, "Unfollow", logger, logfolder)

with

get_users_through_dialog(browser, None, username, amount,
                             allfollowing, False, None,
                              None, None, None,
                               {"enabled":False, "percentage":0},
                                "Unfollow", logger, logfolder)

The only change has been False became {"enabled":False, "percentage":0}

It would be great if somebody could PR it πŸ™Œ

Cheers 😁

Mehran commented 6 years ago

@uluQulu Thanks Grate , i added PR for it .

alezhke commented 6 years ago

@uluQulu much thanks peace and love

alezhke commented 6 years ago

@uluQulu i see its freeze long time with the message: Too many requests sent! attempt: 1 | gathered links: 1056 ~sleeping a bit

uluQulu commented 6 years ago

@alezhke It is a very clear and helpful message saying that you have sent too many requests to the server while scrolling and it needs to cool down a bit before scrolling again 😎 WHERE it will sleep ~10 minutes after each new 85 scrolls.

There links are the follow buttons' links of users and it's a sleep rather than a freeze😁

myehrajat commented 5 years ago

@uluQulu can we make such sleeping a bit less than 10 min? however i wait 10 min and scroll again but gathering link take long time or at least make it more informative ie

sleep a bit about 10 minutes

uluQulu commented 5 years ago

@alezhke Sure, you can set a desired value you want, the source code is open πŸ™‚ But note that, those values we set as defaults are the safest ones at peak.

I remember, I did write that part and per every 85 (up to 100) scrolls it must sleep around 10 minutes. Those stats are actual for the time I tested (6 months ago?), now those values might change.

And it really sleeps around 10 minutes, does it still have to print its amount precisely?

sleep(random.randint(600, 655))

If you are gonna change something there, the right block is,

        if sc_rolled > 85:   # you may want to use up to 100
            if total_list < amount:
                logger.info("Too many requests sent!  attempt: {}  |  gathered links: {}"
                            "\t~sleeping a bit".format(try_again+1, total_list))
                sleep(random.randint(600, 655))
                try_again += 1
                sc_rolled = 0

in unfollow_util.py file, get_users_through_dialog definition.


Cheers 😁