Instapy: All actions blocked on Instapy (Raspberry Pi 3), BUT working on my phone

Created on 18 Jul 2019  Β·  64Comments  Β·  Source: timgrossmann/InstaPy

I have a simple Instapy script which likes pictures by Hashtag and tries to follow 20% of those users. The script runs on a raspberry Pi 3. Liking and commenting pictures still works, but following doesnt anymore. It always says "Phew, couldnt verify the follow. Maybe you are blocked". EDIT: Liking and commenting doesnt work either anymore.

This script ran for a while but unfortunately it stopped working suddenly a few days ago.

On my phone following still works, even when Im using the same WiFi to connect to Instagram.

I tried to delete the Instapy stored cookie (MYACCOUNT_cookie.pkl) and it worked again for one script-run, but not anymore afterwards.

My Instapy Version is 0.4.2. I dont dare to update as I know from initially setting up everything that getting things to work on a Raspberry Pi 3 with the dependency on Chromedriver was a bit cumbersome. But in the changed codebase it doesnt seem as if the latest Instapy version changed something w.r.t. Following users.

Is there anything I can do?
What are you ideas?

Thanks!

EDIT EDIT EDIT

See below for my temporary solution which seems to work fine for me as of now (changing Chromium settings)

wontfix

Most helpful comment

Guys you need to be patient.
The team is developing some new stuff so hopefully this IG mess will get fixed soon ;)

All 64 comments

I got the same issue !

Do you also use version 0.4.4 or do you even use latest version 0.5.x something?
Because if you are using the latest 0.5.x than I dont even need to try updating to it..

Is there any way to delete Chromium/Chromedriver cache or so, so that instagram doesnt detect me again? Maybe they block the same browser over and over again?

I'm running the last version:Β 0.5.4

I'm getting the same! I think it relates to cache and cookies. Don't know how to flush them. If anyone got an idea ...

@angezanetti Thanks for the info, so as I thought by comparing the codebase, it's got nothing to do with my older version 0.4.4. So no need to try updating as of now if you got the same problems.

Are your problems also solved temporarly when deleting the cookie?

@andifds Yes thought the same. When I once deleted the cookie it worked once again. Ill try again to verify. Unfortunately I dont have a clue how to clear/delete the whole cache, or even better how to change chrome/chromedriver to delete all cache/cookies etc when closing it. As Im running Raspberry in the terminal without GUI wondering how to do it on commandline.

I modified the Chromium settings (I suspect Chromium is used by Chromedriver in the background ;-)) and it seems everything is working fine again, even when Instapy adds my User-Cookie to Chromium while running...

sudo nano /etc/chromium-browser/default

Than change the settings to:

CHROMIUM_FLAGS="--incognito --disk-cache-dir=/dev/null --disk-cache-size=1"

If it doesnt work for you, you could change the Instapy code slightly to not load the user cookie at all, so that Instapy would login again everytime the Bot runs. In the file instapy/login_util.py you would just need to comment out the following line:
browser.add_cookie(cookie)

So it would never use the cookie.pkl file.

I edited the login_util.py file and commented out the line below:
browser.add_cookie(cookie)

This worked for me for about 3 minutes and then I got blocked again :(.

Does it work for you to change the config of Chromium?

I edited the login_util.py file and commented out the line below:
browser.add_cookie(cookie)

I did the same and removed cookie. Still working. Around a hour or so

with #browser.add_cookie(cookie)

now it works for me all the day

@e1x4 & @Good-Kat
Glad it worked for you.
Maybe you should try to change Chromium config instead if it helps you as well. It's a better solution when it comes to updating instapy in future

@aranwilcox
Changing this line in the code will only work in case manually deleting the pkl file (the stored cookie in the instapy folder) works. For me, whenever I manually deleted the cookie file to force instapy to login fresh, it worked for one session of the bot. As I didn't want to delete the file every time I commented this line of code which in fact will have the same outcome: no cookie loaded hence fresh login required.

Sorry to hear it doesn't work for you but very strange to hear that so many have trouble right now with using the stored cookie from session to session.

@e1x4 & @Good-Kat
Glad it worked for you.
Maybe you should try to change Chromium config instead if it helps you as well. It's a better solution when it comes to updating instapy in future

I forgot to say I am on windows...so I can't use those commands: sudo nano /etc/chromium-browser/default

anyway now I have put again browser.add_cookie(cookie) and it works...

@e1x4
No worries, but I'm pretty sure there's also a way to change the way Chrome behaves when initiated by chromedriver, so that it doesn't store cookies and cache or deletes it on closure.

Otherwise you could also remove the cookie pkl file by your python script at the end of runtime.

@timgrossmann could you please check why do many people have trouble right now with the storage and usage of the login cookie? Thanks

@e1x4 @Good-Kat @bjspi how long are your sessions and at what speed (liking/following) are you going?

This is so weird. I commented out add cookie line, but cookie gets created every time still :)

Yes thats the expected behaviour, but it will not get loaded during startup of the session. If you want to make absolutely sure you can also comment out the line where it gets stored to disk. Which would be this line:

# create cookie for username

 pickle.dump(browser.get_cookies(), open(
            '{0}{1}_cookie.pkl'.format(logfolder, username), 'wb'))

after 3 days that worked well the problem recurred today, ok I have I commented out the cookie line, now it's ok.

Edit: just 1 hour runtime and action blocked again :(

@e1x4 @Good-Kat @bjspi how long are your sessions and at what speed (liking/following) are you going?

it worked for 3 days, now again the same issue...my speed was only following, about 10 followers every 10 minutes

Oh my gosh, I think developers should step in here, as so many of us have problems here. I really don't have a clue maybe Instagram can detect in the meantime the bot

Oh my gosh, I think developers should step in here, as so many of us have problems here. I really don't have a clue maybe Instagram can detect in the meantime the bot

Maybe detect chromium drivers?

Oh my gosh, I think developers should step in here, as so many of us have problems here. I really don't have a clue maybe Instagram can detect in the meantime the bot

Maybe detect chromium drivers?

yes, chrome driver detect by insta server

Oh my gosh, I think developers should step in here, as so many of us have problems here. I really don't have a clue maybe Instagram can detect in the meantime the bot

Maybe detect chromium drivers?

yes, chrome driver detect by insta server

I was thinking about it as well, but dont think so.
Just think about it: You gotta have Chrome/Chromium installed which is just controlled by chromedriver, i.e. chromedriver just takes care of controlling the mouse and the keyboard (scrolling the page, clicking buttons or links, "typing" letters into fields), nothing else. So instagram just sees that Chrome visits the page, nothing else.

@uluQulu Could you maybe check why so many people have problems here? Thanks

well I tried with firefox, with my account, the same thing, so I tried with my app and the same, so it's a instagram block about my account today...ok I'll wait one day without following

I think you better wait a week or so :)

add random user agent fix this problem?

You could try yourself like this and see whether it fixes the prob:
https://stackoverflow.com/a/49565080/701049

Guys you need to be patient.
The team is developing some new stuff so hopefully this IG mess will get fixed soon ;)

This is a major fix which should be supplied faster than ALL new features.
Thats usually how you go about major problems which affect so many users and make the whole tool un-usable. :)

@JoeFertig Awesome news! I thought everyone has given up on it :D

Does not work for me, deleted cookie, commented out this

create cookie for username

pickle.dump(browser.get_cookies(), open(
'{0}{1}_cookie.pkl'.format(logfolder, username), 'wb'))

and that

browser.add_cookie(cookie)

modified the

sudo nano /etc/chromium-browser/default

Default settings for chromium-browser. This file is sourced by /bin/sh from

/usr/bin/chromium-browser

CHROMIUM_FLAGS="--incognito --disk-cache-dir=/dev/null --disk-cache-size=1"

but instapy wants to load the cookie and then wants to create some...

this is the error message i get:

Traceback (most recent call last):
File "good_commenting_strategy_and_new_qs_system.py", line 38, in
with smart_run(session):
File "/usr/lib/python3.5/contextlib.py", line 59, in __enter__
return next(self.gen)
File "/home/pi/projects/InstaPy/instapy/util.py", line 1662, in smart_run
session.login()
File "/home/pi/projects/InstaPy/instapy/instapy.py", line 373, in login
self.bypass_with_mobile):
File "/home/pi/projects/InstaPy/instapy/login_util.py", line 262, in login_user
"//button[text()='Log in']")
File "/home/pi/.local/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 394, in find_element_by_xpath
return self.find_element(by=By.XPATH, value=xpath)
File "/home/pi/.local/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 978, in find_element
'value': value})['value']
File "/home/pi/.local/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/home/pi/.local/lib/python3.5/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//button[text()='Log in']"}
(Session info: chrome=65.0.3325.181)
(Driver info: chromedriver=2.36 (a81166ad79e68fbfe7cf5ba243192d6412e26b37),platform=Linux 4.14.79-v7+ armv7l)

No we won't give up ;)
I hope the new update will make Raspberry users life easier :)

Same problem here

I have been running my bot for the last 3days without issues with the fix coming https://github.com/timgrossmann/InstaPy/pull/4696

Here are my stats for the last 24h:

image

just wait for new release guys πŸ‘

Hey nice data graphics, how did you get them?

Will check the update and try

On Fri, Jul 26, 2019, 13:50 Maxime Janton notifications@github.com wrote:

I have been running my bot for the last 3days without issues with the fix
coming #4696 https://github.com/timgrossmann/InstaPy/pull/4696

Here are my stats for the last 24h:

[image: image]
https://user-images.githubusercontent.com/893837/61971040-51b61a00-afde-11e9-9714-422449fab088.png

just wait for new release guys πŸ‘

β€”
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/timgrossmann/InstaPy/issues/4676?email_source=notifications&email_token=AJHXDLEF6FIVGCMNJECEYDDQBM2NXA5CNFSM4IEYOTHKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD25I5OA#issuecomment-515542712,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AJHXDLAKTLIIPS65OUQ4Y2LQBM2NXANCNFSM4IEYOTHA
.

Disable headless (after updating chromedriver)
Disable cookie like said before
Enable random_user_agent
add the chromium flags like said before

test by liking in chrome driver, refresh and see if the like sticks

@VNRARA I am unable to enable random_user_agent it is throwing back unexpected argument?

@VNRARA I am unable to enable random_user_agent it is throwing back unexpected argument?

https://github.com/timgrossmann/InstaPy/blob/master/DOCUMENTATION.md#get-a-random-useragent

Should work fine if done according to documentation.

https://github.com/timgrossmann/InstaPy/blob/master/DOCUMENTATION.md#get-a-random-useragent
Should work fine if done according to documentation.

I have, see the tail below @VNRARA - I've removed my pw

pi@raspberrypi:~/scripts $ python3 new3.py
Traceback (most recent call last):
  File "new3.py", line 6, in <module>
    session = InstaPy(username='Bradscanvas', password='xxxx', random_user_agent=True, headless_browser=False)
TypeError: __init__() got an unexpected keyword argument 'random_user_agent'

Looks like you need to update instaPy. Mine works just fine.. bu I've updated twice theses last couple of weeks.

updated and same issue @VNRARA

Disable headless (after updating chromedriver) - using nogui=True, chromedriver in version 2.37, when using headless_browser=False, chrome don't start
Disable cookie like said before - disabled cookie commenting browser.add_cookie(cookie) line, removed profile on logs folder (with the cookie)
Enable random_user_agent - included random_user_agent = True on session line
add the chromium flags like said before - added

Updated Instapy, same problem :(

updated InstaPy today. Still can't like and follow.
unix server. headless mode.

-------- WARNING! Image was NOT liked! You are have a BLOCK on likes!
WARNING [2019-08-01 14:33:29] [**] Phew! Last follow is not verified. ~'**' might be temporarily blocked from following

Strange thing is for me it still works with my old 0.4.4 version after editing the Chrome config as given above. I'm a bit surprised

Random user agent seems to be removed suddenly.. Idk
I keep getting blocks again as well.

Strange thing is for me it still works with my old 0.4.4 version after editing the Chrome config as given above. I'm a bit surprised

Okay, since today it also stopped working for me (still using 0.4.4) even after deleting the cookie file etc ... Dont know what to do tbh

Is it fixed for anyone who uses 0.6.0 release? or 0.5.9?

I have been running my bot for the last 3days without issues with the fix coming #4696

Here are my stats for the last 24h:

image

just wait for new release guys πŸ‘

@iam4x nice visualisation to see bot performance over time. can you hint me towards how you did that?

I edited the login_util.py file and commented out the line below:
browser.add_cookie(cookie)

This worked for me for about 3 minutes and then I got blocked again :(.

I edited the login_util.py file and commented out the line below:
browser.add_cookie(cookie)

I did the same and removed cookie. Still working. Around a hour or so

Somehow on my Mac, I can't see a login.util.py file, not even hidden. I'm a bit stuck here trying to fix the issue. Also, when I do headless=False, it's Firefox that launches and not Chrome. Did all this change in the latest updates?

I'm eager to find a solution where cache would be cleared automatically

Or it could run in private (browser) mode maybe? But I'm not sure how I'd do that

I just copied all of the GitHub over to my computer and changed the login.util.py file

Now it gives me

  File "/Users/name/InstaPy-master/instapy/login_util.py", line 26, in <module>
    browser.add_cookie(cookie)
NameError: name 'browser' is not defined

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this problem still occurs, please open a new issue

any updates on this?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this problem still occurs, please open a new issue

any updates on this?

Yea please delete .pkl file

On Sat, 2 May 2020, 9:16 pm Roger Santos, notifications@github.com wrote:

any updates on this?

β€”
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/timgrossmann/InstaPy/issues/4676#issuecomment-622977695,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AN2SSFOF6BAEAARG6MW2UPTRPRBNTANCNFSM4IEYOTHA
.

Works just for a while. Is it the same with u?

yes

发θ‡ͺζˆ‘ηš„iPhone

------------------ Original ------------------
From: Roger Santos <[email protected]>
Date: Sun,May 3,2020 11:39 AM
To: timgrossmann/InstaPy <[email protected]>
Cc: xuhig <[email protected]>, Comment <[email protected]>
Subject: Re: [timgrossmann/InstaPy] All actions blocked on Instapy (Raspberry Pi 3), BUT working on my phone (#4676)

Works just for a while. Is it the same with u?

β€”
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.

NEWS? i have the same problem

Same problem here! I tried to delete cookies and commented this line: browser.add_cookie(cookie), but doesn't work :(

Same problem here! I tried to delete cookies and commented this line: browser.add_cookie(cookie), but doesn't work :(

the best robot for instagram : https://www.v-user.com/en/side-products/instagram-robot

No block action
No need to clean cookies
unrecognizable
Unique
With timely support and updates

So I actually found a fix if you really want to have an instagram bot. Basically instagram got very good at detecting bots so I tried to work around that. Basically I have connected my old android phone to the Raspberry (you can connect it to any computer) and I just send a bunch of adb commands to it. I wrote a little script. Its been working so well.

I guess instagram finds it hard to find bots from someone using the app itself and not the browser version.

Hit me up if you are interested in developing this project with me, there is still a lot to do to make it very efficient.

So I actually found a fix if you really want to have an instagram bot. Basically instagram got very good at detecting bots so I tried to work around that. Basically I have connected my old android phone to the Raspberry (you can connect it to any computer) and I just send a bunch of adb commands to it. I wrote a little script. Its been working so well.

I guess instagram finds it hard to find bots from someone using the app itself and not the browser version.

Hit me up if you are interested in developing this project with me, there is still a lot to do to make it very efficient.

thats a very good idea, thanks!

If you still get blocked with InstaPy read this:

So I actually found a fix if you really want to have an instagram bot. Basically instagram got very good at detecting bots so I tried to work around that. Basically I have connected my old android phone to the Raspberry (you can connect it to any computer) and I just send a bunch of adb commands to it. I wrote a little script. Its been working so well.

I guess instagram finds it hard to find bots from someone using the app itself and not the browser version.

Hit me up if you are interested in developing this project with me, there is still a lot to do to make it very efficient.

Any news about that? I'm trying with selenium 4 (beta testing) and the last of instapy but it doesn't fix that :(

I'm on a raspberry 4 and on windows.. same problem and only inside the firefox with the robot in the address bar. Works fine in normal firefox and so on..

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rahulkapoor90 picture rahulkapoor90  Β·  3Comments

thisishotdog picture thisishotdog  Β·  3Comments

converge picture converge  Β·  3Comments

tibor picture tibor  Β·  3Comments

neomh picture neomh  Β·  3Comments