Instapy: After last update 22.07 unfollowing still not working

Created on 22 Jul 2018  路  24Comments  路  Source: timgrossmann/InstaPy

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

Most helpful comment

@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 馃榿

All 24 comments

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

same here

Same here.

Same here

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

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

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

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

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)

@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()`

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

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

@uluQulu maybe can help about it .

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?

@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 馃帀馃帀

@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

@torbenberger
Can you pull your release?
Thank you

@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 馃榿

@uluQulu Thanks Grate , i added PR for it .

@uluQulu much thanks peace and love

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

@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馃榿

@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

@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 馃榿

Was this page helpful?
0 / 5 - 0 ratings