Instapy: Not an Issue, but i fixed the Bot detection problem!

Created on 13 Nov 2019  路  16Comments  路  Source: timgrossmann/InstaPy

Good evening guys

it took me a few Days to figure out the best Template and settings for it.
I also had success after beeing bot banned to get it working back again
I changed the user agent in the browser.py file to the following
(located in C:UsersChrisAppDataLocalProgramsPythonPython37libsite-packagesinstapy)


# set Firefox Agent to mobile agent
    user_agent = (
        "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:70.0) Gecko/20100101 Firefox/70.0"

    )

for those intrested, i changed it to a Windows10 Client with 64Bit and Firefox version 70.0
Im going to attach the file, just delete the ".txt" part

If you are Bot banned, just let the script open firefox for you, then kill the task, navigate to instagram. com and change your password.

then go to the firefox settings, (in the same session) and delete all chronik files.

then go ahead an close firefox.
Run the script, but still with the old password, it will fail to log in, but instagram thinks the bot still got the Old PW.
after that you cang change the password in the .py file to the correct on

after the script startet the browser window and opedn instagram, i clicked with my mouse somwhere in the window (like in a picture or a blank white sport)
and then i didnt touch my mouse again, maybe that helps instagram to see the window is like used by an human, idk correct me if you can tell that step was useless :D

then just let the script do ist job and be happy with the result ^^

Sorry for my bad english, I'm german

The quickstart template file (just delete the ".txt" part)
simple_interaction_good_for_beginners - this time without my info.py.txt

The browser.py file with the changed user agent (just delete the ".txt" part)
browser.py.txt

if im in the wrong thread im sorry, im new to github, so please just move it or something

wontfix

Most helpful comment

lol yeah noticed that i left my login info in there... im dumb as hell

All 16 comments

I had to disable the commment function(always stale element with ENTER input) but it works.
instapy 0.6.6 - RasperryPi 3B+
thanks you!

!!remove your login credentials from the template!!

lol yeah noticed that i left my login info in there... im dumb as hell

I had to disable the commment function(always stale element with ENTER input) but it works.

yeah i have the same issue, anyone an idea how to tell the script to post the comment by simulating an input on the enter button?

or at least an idea what script i have to search for the part?

File "/Users/banginpadr/venv/lib/python3.6/site-packages/urllib3/util/retry.py", line 399, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='127.0.0.1', port=60146): Max retries exceeded with url: /session/0b1fd938-27f9-164b-862f-6c027231631a/execute/sync (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 61] Connection refused',))

this mean my bot is blocked or something???it wont start

File "/Users/banginpadr/venv/lib/python3.6/site-packages/urllib3/util/retry.py", line 399, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='127.0.0.1', port=60146): Max retries exceeded with url: /session/0b1fd938-27f9-164b-862f-6c027231631a/execute/sync (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 61] Connection refused',))

this mean my bot is blocked or something???it wont start

no idea whats going on, is this the output of your cmd Window?

I Also found out, that instagram blocks following more than 50 perople in one go
so I've got 3 people in my script set to follow 97 people
for easier math i justused 300. so i set my follow % to 16, so i will not get over 50 people in one go, that also helps to prevent getting detected as Bot

Good evening guys

it took me a few Days to figure out the best Template and settings for it.
I also had success after beeing bot banned to get it working back again
I changed the user agent in the browser.py file to the following
(located in C:UsersChrisAppDataLocalProgramsPythonPython37libsite-packagesinstapy)

# set Firefox Agent to mobile agent
    user_agent = (
        "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:70.0) Gecko/20100101 Firefox/70.0"

    )

for those intrested, i changed it to a Windows10 Client with 64Bit and Firefox version 70.0
Im going to attach the file, just delete the ".txt" part

If you are Bot banned, just let the script open firefox for you, then kill the task, navigate to instagram. com and change your password.

then go to the firefox settings, (in the same session) and delete all chronik files.

then go ahead an close firefox.
Run the script, but still with the old password, it will fail to log in, but instagram thinks the bot still got the Old PW.
after that you cang change the password in the .py file to the correct on

after the script startet the browser window and opedn instagram, i clicked with my mouse somwhere in the window (like in a picture or a blank white sport)
and then i didnt touch my mouse again, maybe that helps instagram to see the window is like used by an human, idk correct me if you can tell that step was useless :D

then just let the script do ist job and be happy with the result ^^

Sorry for my bad english, I'm german

The quickstart template file (just delete the ".txt" part)
simple_interaction_good_for_beginners - this time without my info.py.txt

The browser.py file with the changed user agent (just delete the ".txt" part)
browser.py.txt

if im in the wrong thread im sorry, im new to github, so please just move it or something

Hello mate , any good template to share ? , thx in advance .

Hi Thanks for the advice. Does anyone know how to terminate the script in Sublime Text without closing the Firefox (browser) window? Do I understand that correctly? You run the script to open Firefox than you stop it to follow/like... go change your password and than delete the cookies and history and than close the window? Thanks

Looked at your settings - interesting that you don't even use the Quota Manager.
Literally a 37 second wait between likes.
Which leads me to believe that it was fixed by just changing the user agent!

I'm currently using these settings and will report back with my findings.

Update: Back with "Error Please wait a few minutes before you try again."
[Session lasted 2.32 hours] of likes before it kicked me.
Oh well.... :(

Really difficult to read with all the spelling faults, I鈥檒l try again tonight

Thank you so much! This worked for me. But I wonder if there's a way to automate this process or do we have to do this everytime we log in?

Hi, it worked but just for one single like. Then I got this message:

INFO [2019-11-30 14:36:05] [username] --> Image Liked!

INFO [2019-11-30 14:36:53] [username] Sessional Live Report:
|> No any statistics to show

On session start was FOLLOWING 123 users & had 4725 FOLLOWERS
[Session lasted 3.48 minutes]
OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
INFO [2019-11-30 14:36:53] [username] Session ended!
oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo

Traceback (most recent call last):
File "simple_interaction_good_for_beginners.py", line 52, in
session.interact_user_followers(['ninja', 'pewdiepie', 'kimkardashian',], amount=208)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/instapy/instapy.py", line 3202, in interact_user_followers
self.user_interact_media,
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/instapy/instapy.py", line 2607, in interact_by_users
self.logfolder,
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/instapy/comment_util.py", line 101, in comment_image
.send_keys(Keys.ENTER)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/selenium/webdriver/common/action_chains.py", line 80, in perform
self.w3c_actions.perform()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/selenium/webdriver/common/actions/action_builder.py", line 76, in perform
self.driver.execute(Command.W3C_ACTIONS, enc)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.StaleElementReferenceException: Message: The element reference of