For several days now I had no luck with unfollow session. I've used always the last commit but something always gone wrong.
I need to know if there's a problem on my side or something needs to be reviewed with the last update.
Below the log.
The script tried to unfollow 2 users before report the serious issue: not logged in
.
Sometimes I also get the error not connected
.
Also, to check the first user the script takes more than 5 minutes, I believe it is a biblical time compared to the old versions.
I have the impression that InstaPy worked better and faster some time ago, even with some bug. Anyone with the same issue? Any solution?
INFO [2018-09-19 11:04:14] [user] Starting to unfollow users..
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
INFO [2018-09-19 11:04:14] [user] Unfollowing from the list of pre-defined usernames
INFO [2018-09-19 11:04:14] [user] Total 2726 users available to unfollow ~not found in 'followedPool.csv': 0 | didn't pass `unfollow_after`: 0
INFO [2018-09-19 11:04:14] [user] Ongoing Unfollow [1/100]: now unfollowing 'b'dorsey_8365__darron''...
INFO [2018-09-19 11:05:33] [user] Timed out with failure while explicitly waiting until visibility of element located!
INFO [2018-09-19 11:06:50] [user] Timed out with failure while explicitly waiting until visibility of element located!
ERROR [2018-09-19 11:06:50] [user] --> Unable to detect the following status of 'b'dorsey_8365__darron''!
INFO [2018-09-19 11:06:50] [user] Pinging 'instagram.com' to check the connectivity...
PING instagram.com (54.209.17.35): 56 data bytes
64 bytes from 54.209.17.35: icmp_seq=0 ttl=234 time=137.672 ms
--- instagram.com ping statistics ---
1 packets transmitted, 1 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 137.672/137.672/137.672/0.000 ms
INFO [2018-09-19 11:06:50] [user] Checking if 'user' is logged in...
WARNING [2018-09-19 11:06:53] [user] Maybe 'b'dorsey_8365__darron'' has changed the username! ~verifying through the user ID
INFO [2018-09-19 11:08:13] [user] Timed out with failure while explicitly waiting until visibility of element located!
^[[B^[[BINFO [2018-09-19 11:09:30] [user] Timed out with failure while explicitly waiting until visibility of element located!
ERROR [2018-09-19 11:09:30] [user] --> Unable to detect the following status of 'b'dorsey_8365__darron''!
WARNING [2018-09-19 11:09:30] [user] --> Couldn't access the profile page of 'b'dorsey_8365__darron''! ~user has either closed the profile or blocked you
INFO [2018-09-19 11:09:30] [user] Removed '2018-09-10 04:31 ~ dorsey_8365__darron ~ 1478009921' from followedPool.csv file
INFO [2018-09-19 11:09:33] [user] Ongoing Unfollow [1/100]: now unfollowing 'b'amool__sy99''...
INFO [2018-09-19 11:10:52] [user] Timed out with failure while explicitly waiting until visibility of element located!
INFO [2018-09-19 11:12:08] [user] Timed out with failure while explicitly waiting until visibility of element located!
ERROR [2018-09-19 11:12:08] [user] --> Unable to detect the following status of 'b'amool__sy99''!
INFO [2018-09-19 11:12:08] [user] Pinging 'instagram.com' to check the connectivity...
PING instagram.com (34.233.179.104): 56 data bytes
64 bytes from 34.233.179.104: icmp_seq=0 ttl=234 time=134.180 ms
--- instagram.com ping statistics ---
1 packets transmitted, 1 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 134.180/134.180/134.180/0.000 ms
INFO [2018-09-19 11:12:09] [user] Checking if 'user' is logged in...
CRITICAL [2018-09-19 11:12:12] [user] --> 'user' is not logged in!
WARNING [2018-09-19 11:12:12] [user] There is a serious issue: 'not logged in'! ~leaving Unfollow-Users activity
INFO [2018-09-19 11:12:12] [user] --> Total people unfollowed : 0
INFO [2018-09-19 11:12:12] [user] Sessional Live Report:
|> LIKED 0 images | ALREADY LIKED: 0
|> COMMENTED on 0 images
|> FOLLOWED 0 users | ALREADY FOLLOWED: 0
|> UNFOLLOWED 0 users
|> INAPPROPRIATE images: 0
|> NOT VALID users: 0
currently FOLLOWING 2861 users & has got 5154 FOLLOWERS
I encountered this issue too.
When this issue happened, I notice from chrome, I was actually being logged out.
Once I terminate the bot and start again, it's logged in and run perfectly and then the same problem occurred.
same here
same here
Hi all
@spikeyhair
I read from your comment the feedback I was looking for
I encountered this issue too.
When this issue happened, I notice from chrome, I was actually being logged out.
Once I terminate the bot and start again, it's logged in and run perfectly and then the same problem occurred.
Now, @spikeyhair, can you really verify,
If anybody can help me debug it, I have other options to offer as a solution but I must be sure about that it really logs out.
@uluQulu
I always run with a graphical session.
Yes, it was logged in and I saw it at the Chrome.
I am using session.unfollow_users(amount=10, nonFollowers=true, style="FIFO", unfollow_after=24*3600, sleep_delay=11) method.
I notice when it try to load all my followers, it keeps throwing error message on the screen (command console). It rest for a while after querying too much (this is norm) but at the end of the query (reaching 100%), I notice below the browser there is a black banner saying that I am not login.
I tried a few times, it always give the same result.
If I terminate the session, run the bot again, I notice the browser is already in logged in mode. Once the unfollow function finish loading my followers, the browser will show I am not logged in again.
It's clear, @spikeyhair
Thanks for a detailed feedback.
Although, can you also provide a console output of one of those misbehavior cases?
_If it takes big time to load while using nonFollowers
method, you can use InstapyFollowed
method to test it quickly_.
I am using this method now:
session.unfollow_users(amount=10, InstapyFollowed=(True, "nonfollowers"), style="FIFO", unfollow_after=246060, sleep_delay=60)
it's still need a long time to do loading but at least I didn't see any error messages on the screen, it's loading smoothly. I will let you know the result at the end of loading.
Great efforts, @spikeyhair
You can also use the track- "_all_" which will load faster
session.unfollow_users(amount=10, InstapyFollowed=(True, "all"), style="FIFO", unfollow_after=246060, sleep_delay=60)
Unlike "_nonfollowers_" track WHICH loads the followers data from graphql in order to compare and find the nonfollowers, "_all_" track unfollows everybody in your username_followedPool.csv file and does not need any live data from the server.
You mean use this method?
session.unfollow_users(amount=40, allFollowing=True, style="LIFO", unfollow_after=36060, sleep_delay=450)
@spikeyhair
session.unfollow_users(amount=10, InstapyFollowed=(True, "all"), style="FIFO", unfollow_after=246060, sleep_delay=60)
It's just,
InstapyFollowed=(True, "all")
rather than,
InstapyFollowed=(True, "nonfollowers")
I didn't let it finish running until the 10th user but it can run smoothly without the logged in / out issue:
INFO [2018-09-20 20:54:31] [xxx] Starting to unfollow users..
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
INFO [2018-09-20 20:54:31] [xxx] Unfollowing the users followed by InstaPy
INFO [2018-09-20 20:54:31] [xxx] Total 271 users available to unfollow ~di
dn't pass unfollow_after
: 384
INFO [2018-09-20 20:54:31] [xxx] Ongoing Unfollow [1/10]: now unfollowing '
b'abc''...
INFO [2018-09-20 20:54:41] [xxx] --> Unfollowed 'abc'!
INFO [2018-09-20 20:54:41] [xxx] Removed '2018-09-16 22:29 ~ abc ~ 2
43045411' from followedPool.csv file
INFO [2018-09-20 20:54:50] [xxx] Ongoing Unfollow [2/10]: now unfollowing '
b'def''...
INFO [2018-09-20 20:55:01] [xxx] --> Unfollowed 'def'!
INFO [2018-09-20 20:55:01] [xxx] Removed '2018-09-16 22:37 ~ def ~ 1
224340650' from followedPool.csv file
I see, @spikeyhair
Can you run a test to directly hit that condition WHERE it [assumably] logged out
Do this modification in your unfollow_util.py file:
# find out following status
following, follow_button = get_following_status(browser, person, logger)
following =None # ADD NEW LINE HERE
if following is None:
# check out if the loop has to be broken immidiately
sirens_wailing, emergency_state = emergency_exit(browser, username, logger)
""" # ADD NEW LINE HERE
if sirens_wailing == True:
return False, emergency_state
""" # ADD NEW LINE HERE
if True: # there is no any serious issue- loop should continue # MODIFIED LINE HERE
logger.warning("Maybe '{}' has changed the username!\t~verifying through the user ID"
.format(person.encode('utf-8')))
# try to find the user by ID
if person_id is None:
person_id = load_user_id(username, person, logger, logfolder)
if person_id and person_id not in [None, "unknown", "undefined"] :
user_link_by_id = ("https://www.instagram.com/web/friendships/{}/follow/"
.format(person_id))
web_address_navigator(browser, user_link_by_id)
# re-check the following status
following, follow_button = get_following_status(browser, person, logger)
if following is None:
logger.warning("--> Couldn't access the profile page of '{}'!"
"\t~user has either closed the profile or blocked you"
.format(person.encode('utf-8')))
post_unfollow_cleanup("uncertain", username, person, relationship_data, logger, logfolder)
return False, "user unavailable"
else:
person_new = get_username(browser, logger)
logger.info("User '{}' has changed username and now is called '{}' :S"
.format(person, person_new))
return False, "test line" # ADD NEW LINE HERE
else:
logger.info("--> Couldn't unfollow '{0}'!\t~the user ID of '{0}' "
It's just 1 modified line and 5 new lines.
And see if logs out anywhere, if so provide full console output.
*Note that, while trying the debug lines above, it will not unfollow anybody.
Not sure I am replacing the junk of code correct or not but I am not able to run.
Error message:
Traceback (most recent call last):
File "D:\DropboxInstapy\quickstart_verify.py", line 7, in
from instapy import InstaPy
File "D:\DropboxInstapy\instapy__init__.py", line 2, in
from .instapy import InstaPy
File "D:\DropboxInstapy\instapy\instapy.py", line 45, in
from .unfollow_util import get_given_user_followers
File "D:\DropboxInstapy\instapy\unfollow_util.py", line 1120
if following in [True, "Requested"]:
^
SyntaxError: invalid syntax
@spikeyhair
You can use this easily,
unfollow_util_test.zip
It's the file from master with the changes I mentioned above
I am using this method:
session.unfollow_users(amount=10, InstapyFollowed=(True, "all"), style="FIFO", unfollow_after=246060, sleep_delay=60)
INFO [2018-09-20 22:00:23] [xxx] Starting to unfollow users..
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
INFO [2018-09-20 22:00:24] [xxx] Unfollowing the users followed by InstaPy
INFO [2018-09-20 22:00:24] [xxx] Total 263 users available to unfollow ~di
dn't pass unfollow_after
: 380
INFO [2018-09-20 22:00:24] [xxx] Ongoing Unfollow [1/10]: now unfollowing '
b'elrah.online''...
INFO [2018-09-20 22:00:27] [xxx] Pinging 'instagram.com' to check the conne
ctivity...
Pinging instagram.com [34.196.139.229] with 32 bytes of data:
Reply from 34.196.139.229: bytes=32 time=233ms TTL=234
Ping statistics for 34.196.139.229:
Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 233ms, Maximum = 233ms, Average = 233ms
INFO [2018-09-20 22:00:28] [xxx] Checking if 'xxx' is logged in...
WARNING [2018-09-20 22:00:31] [xxx] Maybe 'b'elrah.online'' has changed the
username! ~verifying through the user ID
INFO [2018-09-20 22:00:35] [xxx] User 'elrah.online' has changed username a
nd now is called 'elrah.online' :S
INFO [2018-09-20 22:00:35] [xxx] Ongoing Unfollow [1/10]: now unfollowing '
b'tataming_makeup''...
INFO [2018-09-20 22:00:40] [xxx] Pinging 'instagram.com' to check the conne
ctivity...
Pinging instagram.com [34.196.139.229] with 32 bytes of data:
Reply from 34.196.139.229: bytes=32 time=232ms TTL=234
Ping statistics for 34.196.139.229:
Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 232ms, Maximum = 232ms, Average = 232ms
INFO [2018-09-20 22:00:40] [xxx] Checking if 'xxx' is logged in...
WARNING [2018-09-20 22:00:43] [xxx] Maybe 'b'tataming_makeup'' has changed
the username! ~verifying through the user ID
INFO [2018-09-20 22:00:47] [xxx] User 'tataming_makeup' has changed usernam
e and now is called 'tataming_makeup' :S
INFO [2018-09-20 22:00:47] [xxx] Ongoing Unfollow [1/10]: now unfollowing '
b'dawu_vine''...
INFO [2018-09-20 22:00:51] [xxx] Pinging 'instagram.com' to check the conne
ctivity...
Pinging instagram.com [34.196.139.229] with 32 bytes of data:
Reply from 34.196.139.229: bytes=32 time=234ms TTL=234
Ping statistics for 34.196.139.229:
Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 234ms, Maximum = 234ms, Average = 234ms
INFO [2018-09-20 22:00:51] [xxx] Checking if 'xxx' is logged in...
WARNING [2018-09-20 22:00:55] [xxx] Maybe 'b'dawu_vine'' has changed the us
ername! ~verifying through the user ID
INFO [2018-09-20 22:00:59] [xxx] User 'dawu_vine' has changed username and
now is called 'dawu_vine' :S
INFO [2018-09-20 22:00:59] [xxx] Ongoing Unfollow [1/10]: now unfollowing '
b'leelee3_''...
INFO [2018-09-20 22:01:03] [xxx] Pinging 'instagram.com' to check the conne
ctivity...
Pinging instagram.com [34.202.227.200] with 32 bytes of data:
Reply from 34.202.227.200: bytes=32 time=239ms TTL=234
Ping statistics for 34.202.227.200:
Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 239ms, Maximum = 239ms, Average = 239ms
INFO [2018-09-20 22:01:03] [xxx] Checking if 'xxx' is logged in...
WARNING [2018-09-20 22:01:07] [xxx] Maybe 'b'leelee3_'' has changed the use
rname! ~verifying through the user ID
INFO [2018-09-20 22:01:12] [xxx] User 'leelee3_' has changed username and n
ow is called 'leelee3_' :S
INFO [2018-09-20 22:01:12] [xxx] Ongoing Unfollow [1/10]: now unfollowing '
b'xi_kris1991''...
INFO [2018-09-20 22:01:17] [xxx] Pinging 'instagram.com' to check the conne
ctivity...
Getting the exact same results.
I was having crashing error saying there is no server connection.
Tried the util_test and it keeps saying all the usernames are changed and it skips to the next one on the list, while saying there is no connection to the servers.
Amazing, @spikeyhair ๐
But from that outout I can say that your system does not have any issue.
Can you run your normal unfollow procedure and report back when GETS that error with logging out AS you stated in top comment WITH the full console output [again]?
@pagokrat0r
I have noticed it, it sometimes returns returns with failure while checking connectivity.
It can be due to several reasons and do this change to solve it,
open up util.py file
find ping_server()
definition and replace,
# pinging
conn = call(command, shell=need_sh) == 0
with
# pinging
ping_attempts = 2
connectivity = None
while connectivity != True and ping_attempts > 0:
connectivity = call(command, shell=need_sh) == 0
if connectivity == False:
logger.warning("Pinging the server again!\t~total attempts left: {}"
.format(ping_attempts))
ping_attempts -= 1
sleep(5)
Now, it will ping several 2 more times if fails.
@spikeyhair @pagokrat0r @tompicca
Wow guys I guess I have hit it ๐คซ
@CharlesCCC
The problem is clear, @sionking.
It has really logged out ๐ฆ [in my tests]
After having known the bug- gonna push the alternative solutions now [after running a few more tests]
session.unfollow_users(amount=10, InstapyFollowed=(True, "nonfollowers"), style="FIFO", unfollow_after=246060, sleep_delay=60)
I tested with the method above which caused this logged out issue previously but now I tested again, it ran smoothly without issue at all. It took about 35 mins to load all my followers (this is norm), no errors observed in the console and it started to unfollow people. Work as expected.
Ooopppssss... too early to say that.
No problems while unfollowing from 1-7 then hit the error below then 9-10 no issues again. At least I didn't observe any logged out problem.
INFO [2018-09-20 23:00:01] [xxx] Grabbed 11453 usernames from Followers
i
n 34.05 minutes
INFO [2018-09-20 23:07:00] [xxx] Ongoing Unfollow [8/10]: now unfollowing '
b'norman_jackson_''...
INFO [2018-09-20 23:08:20] [xxx] Timed out with failure while explicitly wa
iting until visibility of element located!
INFO [2018-09-20 23:09:37] [xxx] Timed out with failure while explicitly wa
iting until visibility of element located!
ERROR [2018-09-20 23:09:37] [xxx] --> Unable to detect the following status
of 'b'norman_jackson_''!
INFO [2018-09-20 23:09:37] [xxx] Pinging 'instagram.com' to check the conne
ctivity...
Pinging instagram.com [52.200.243.149] with 32 bytes of data:
Reply from 52.200.243.149: bytes=32 time=234ms TTL=233
Ping statistics for 52.200.243.149:
Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 234ms, Maximum = 234ms, Average = 234ms
INFO [2018-09-20 23:09:37] [xxx] Checking if 'xxx' is logged in...
WARNING [2018-09-20 23:09:42] [xxx] Maybe 'b'norman_jackson_'' has changed
the username! ~verifying through the user ID
INFO [2018-09-20 23:09:47] [xxx] User 'norman_jackson_' has changed usernam
e and now is called 'normannonono' :S
INFO [2018-09-20 23:09:52] [xxx] --> Unfollowed 'norman_jackson_'!
INFO [2018-09-20 23:09:52] [xxx] Removed '2018-09-17 00:28 ~ norman_jacks
on_ ~ 13759587' from followedPool.csv file
Great feedback, @spikeyhair ๐ฌ
It is an intended behavior:
INFO [2018-09-20 23:09:47] [xxx] User 'norman_jackson_' has changed usernam
e and now is called 'normannonono' :S
It happened cos the user has changed username and it found the new username of that user and then unfollowed with it.
The timeout failure message and ping, is it an intended behavior? I remember last time I didnโt see this.
Yes @spikeyhair
You can find my PRs on them and read in details.
Thanks.
Will wait for your solution on this logged out issue. :)
Side notes:
Turned off pinging and it still does log out as same as pinging enabled
@sionking, it means pinging does not relate to it
@CharlesCCC
The problems occurs while navigating,
https://www.instagram.com/web/friendships/{user_id}/follow/
redirects to,
https://www.instagram.com/accounts/login/?next=/web/friendships/{user_id}/follow/
in very some unexpected cases.
_Currently I cannot detect HOW that can happen- still mystic_.
@spikeyhair, testing the alternatives now and will share soon.
@uluQulu Sure it is not related to ping but you should not ping IG server.
Reading the page title is a good way to check connectivity to IG.
I get this all the time:
"Facebook | Error"
So we shall add title check for web_address_nev...
@sionking
Actually, that's not what I thought of. Good idea ๐ค๐ผ
If not page title [of fully loaded page] returns the connectivity it gives a good idea of what is going on.
Maybe adding that block and it will handle most of time and only in rest of the extreme situations it should ping.
I will try to look at it some time if not somebody does it earlier.
Hi Same Problem
@uluQulu
What about searching the search panel for username this is who we will get the new username and also look more real to start using the search bar.
@sionking
I have shown an example before,
There are user A and user B.
Followed user A; then user A changed username to C and user B changed username to A;
Now if you search for A, it will return the original user B.
It needs to be verified by unique user ID and search box does not support ID search.
I resume the bot to use this method:
session.unfollow_users(amount=20, InstapyFollowed=(True, "nonfollowers"), style="FIFO", unfollow_after=48*3600, sleep_delay=60)
Everything is running smoothly as before, no throwing error on the console screen, no logged out issue.
Hey @spikeyhair
I use the same method and have the issues from above.
@spikeyhair @JoeFertig @pagokrat0r @tompicca
I will share the solution soon.
If you have any other problems, let us know.
Thanks @uluQulu!
please read here if you haven't do yet:
https://github.com/timgrossmann/InstaPy/issues/2926#issuecomment-423487543
Helo @tompicca
I have read your post as commented. It's just I have got a seasonal illness that's why can hardly keep track of the issues.
After a quick check I noticed that all these users are still followed by my account or are under request of following so InstaPy is wrong when says that the user is maybe unfollowed before
It probably can be a bug and need to read the source code to verify it.
I will help you after finishes solving current issues raised in this thread, hopefully.
The second error as I mentioned above,
After lots of this errors Instapy stop working and report a not logged in error when try to evaluate a user that changed its username:
has been solved and I'm opening a PR for it right now.
Thanks for your hard work @uluQulu, much appreciated ๐
Get well!
Thanks @tompicca ๐๐ผโโ๏ธ
Solution is live at https://github.com/timgrossmann/InstaPy/pull/2978#issue-217387646.
I resume the bot to use this method:
session.unfollow_users(amount=20, InstapyFollowed=(True, "nonfollowers"), style="FIFO", unfollow_after=48*3600, sleep_delay=60)Everything is running smoothly as before, no throwing error on the console screen, no logged out issue.
After running the bot for 12 hours, the logout issue still appear. So... please ignore the post above.
Will wait for the fix. :)
* OLD * Running it now for 3 hours and everything works smooth and fine on my Rasp Pi 3b.
Thanks!
* NEW Sorry that was a bit too quick. It is not working and exiting with the same errors as written above **
After some days of testing I can say that sometimes it works and sometimes it says critical error not logged in.
So you have to start the script some more times to do all the unfollowing you wanted to perform.
Thanks guys for all the feedback.
It has been solved while back at #2978 and I mentioned it in my above comment- https://github.com/timgrossmann/InstaPy/issues/2953#issuecomment-423656235.
If you have not applied those changes manually, now you can pull it from the master cos now it is merged.
Unless you have got the mentioned changes of #2978 you should not either raise or report an issue.
Yes, if you have got those changes and still having similar issues labeled in this thread, please let me know.
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