After some checks, I can see the followedPool.csv full of non-existing users.
If a user does not longer exists, or its name has changed, I think it should be removed from the followedPool. It will prevent having a dead followedPool full of users on top of the list that will be checked on every run.
The bot shows that the user no longer exists and skip it, leaving the user in the followedPool.
Original code from unfollow_util.py:
except:
logger.error(
'--> Unfollow error with {},'
' maybe no longer exists...'
.format(person.encode('utf-8')))
continue
Changes:
except:
logger.error(
'--> Unfollow error with {},'
' maybe no longer exists...'
.format(person.encode('utf-8')))
delete_line_from_file('{0}{1}_followedPool.csv'.format(logfolder, username),
person + ",\n", logger)
print('')
sleep(2)
continue
Try to unfollow a non existing user with the quickstart.py file
Just pointing out that a check is in O(n) even if the check is N+1 it wont really impact the performance. But I agree that the expected behavior would be to delete the user from the list! 馃憤
I have this same issue, however, your code above does not seem to help me, if I am experiencing the same issue. The code iterates through hundreds of people I have already unfollowed:
Or do I need to manually remove these and the code you wrote above removes them going forward?
WARNING [2018-07-04 08:52:33] [xx] --> Cannot Unfollow From InstaPy 0, maybe zz1 was unfollowed before...
WARNING [2018-07-04 08:52:38] [xx] --> Cannot Unfollow From InstaPy 0, maybe zz2 was unfollowed before...
WARNING [2018-07-04 08:52:43] [xx] --> Cannot Unfollow From InstaPy 0, maybe zz3 was unfollowed before...
WARNING [2018-07-04 08:52:48] [x] --> Cannot Unfollow From InstaPy 0, maybe zz4 was unfollowed before...
@dbmathis you are experiencing a different error, it says that the user was probably unfollowed, so those users exist on Instagram. The problem seems the same, but in another part of the code, look for "was unfollowed before" and add the same delete_line_from_file after the print, as the same as I've done in the possible solution.
@joanroig the delete code seems to already be there. I don't see any indication in the logs that people are being removed from the CSV at any stage of the code execution, weird.
logger.warning(
"--> Cannot Unfollow From InstaPy {}"
", maybe {} was unfollowed before..."
.format(str(unfollowNum), person.encode('utf-8')))
delete_line_from_file('{0}{1}_followedPool.csv'.format(logfolder, username),
person + ",\n", logger)
print('')
sleep(2)
@dbmathis I'll have a look tonight or tomorrow, thanks for the info :+1:
I have the same issues since weeks and already opened an issue for that.
My bot is only working with unfollowing users that "doesn't exist"...and I have no idea how to fix it.
_
INFO [2018-07-04 18:19:09] [my_name] Starting to unfollow users..
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
INFO [2018-07-04 18:19:12] [my_name] Unfollowing the users followed by InstaPyINFO [2018-07-04 18:19:12] [my_name] Total 439 users available to unfollow ~didn't pass
unfollow_after
: 498ERROR [2018-07-04 18:19:40] [my_name] --> Unfollow error with b'ddavis884', maybe no longer exists...
ERROR [2018-07-04 18:20:07] [my_name] --> Unfollow error with user maybe no longer exists...
ERROR [2018-07-04 18:20:34] [my_name] --> Unfollow error with b'everything_tech_1980', maybe no longer exists...
ERROR [2018-07-04 18:21:01] [my_name] --> Unfollow error with b'kjkraus87', maybe no longer exists...
ERROR [2018-07-04 18:21:29] [my_name] --> Unfollow error with b'best.cars.al', maybe no longer exists...
ERROR [2018-07-04 18:21:56] [my_name] --> Unfollow error with user maybe no longer exists...
ERROR [2018-07-04 18:22:24] [my_name] --> Unfollow error with b'tenhundredthousands', maybe no longer exists...
ERROR [2018-07-04 18:22:52] [my_name] --> Unfollow error with b'scott_trade', maybe no longer exists...
ERROR [2018-07-04 18:23:19] [my_name] --> Unfollow error with b'jade__flipcash', maybe no longer exists...
ERROR [2018-07-04 18:23:46] [my_name] --> Unfollow error with b'success_withmichelle', maybe no longer exists...
ERROR [2018-07-04 18:24:14] [my_name] --> Unfollow error with b'earn_passively', maybe no longer exists...
ERROR [2018-07-04 18:24:42] [my_name] --> Unfollow error with b'sportsjudge85', maybe no longer exists...
ERROR [2018-07-04 18:25:11] [my_name] --> Unfollow error with user maybe no longer exists...
ERROR [2018-07-04 18:25:39] [my_name] --> Unfollow error with b'jahan.pjr_089', maybe no longer exists...
ERROR [2018-07-04 18:26:07] [my_name] --> Unfollow error with b'hottmemez', maybe no longer exists...
ERROR [2018-07-04 18:26:34] [my_name] --> Unfollow error with user maybe no longer exists...
ERROR [2018-07-04 18:27:02] [my_name] --> Unfollow error with b'australiayes', maybe no longer exists...
ERROR [2018-07-04 18:27:29] [my_name] --> Unfollow error with b'kiarra_money_banks', maybe no longer exists...
ERROR [2018-07-04 18:27:56] [my_name] --> Unfollow error with b'matey.breza', maybe no longer exists...
ERROR [2018-07-04 18:28:25] [my_name] --> Unfollow error with b'nygmoo', maybe no longer exists...
ERROR [2018-07-04 18:28:53] [my_name] --> Unfollow error with b'highly_hysterical', maybe no longer exists...
ERROR [2018-07-04 18:29:21] [my_name] --> Unfollow error with user maybe no longer exists...
ERROR [2018-07-04 18:29:50] [my_name] --> Unfollow error with b'cutecouplesofriverdale', maybe no longer exists...
ERROR [2018-07-04 18:30:18] [my_name] --> Unfollow error with user maybe no longer exists...
ERROR [2018-07-04 18:30:45] [my_name] --> Unfollow error with b'therealcirovelardi', maybe no longer exists...
ERROR [2018-07-04 18:31:12] [my_name] --> Unfollow error with b'loveme.bab', maybe no longer exists...
ERROR [2018-07-04 18:31:41] [my_name] --> Unfollow error with b'hotzonegirls', maybe no longer exists...
ERROR [2018-07-04 18:32:08] [my_name] --> Unfollow error with b'sonjaleed', maybe no longer exists...
ERROR [2018-07-04 18:32:35] [my_name] --> Unfollow error with b'martinscholz86', maybe no longer exists...
ERROR [2018-07-04 18:33:03] [my_name] --> Unfollow error with b'forexdagoat', maybe no longer exists...
ERROR [2018-07-04 18:33:30] [my_name] --> Unfollow error with b'kozmetikmix', maybe no longer exists...
ERROR [2018-07-04 18:33:58] [my_name] --> Unfollow error with b'volkankoermecli', maybe no longer exists...
ERROR [2018-07-04 18:34:26] [my_name] --> Unfollow error with b'flipcash_agent_somers', maybe no longer exists...
ERROR [2018-07-04 18:34:53] [my_name] --> Unfollow error with b'uniqueauto1682', maybe no longer exists...
ERROR [2018-07-04 18:35:20] [my_name] --> Unfollow error with b'camsi48_aj', maybe no longer exists...
ERROR [2018-07-04 18:35:47] [my_name] --> Unfollow error with b'gestiondinversion', maybe no longer exists...
ERROR [2018-07-04 18:36:14] [my_name] --> Unfollow error with b'buyingaccountsnow', maybe no longer exists...
ERROR [2018-07-04 18:36:41] [my_name] --> Unfollow error with b'jungkookiiee._', maybe no longer exists...
ERROR [2018-07-04 18:37:09] [my_name] --> Unfollow error with b'empty__vessels', maybe no longer exists...
ERROR [2018-07-04 18:37:37] [my_name] --> Unfollow error with b'pyradigital', maybe no longer exists...
ERROR [2018-07-04 18:38:05] [my_name] --> Unfollow error with b'cameron.alexdr', maybe no longer exists...
ERROR [2018-07-04 18:38:32] [my_name] --> Unfollow error with b'bucks_trade', maybe no longer exists...
ERROR [2018-07-04 18:38:59] [my_name] --> Unfollow error with b'expert_trader_danek', maybe no longer exists...
ERROR [2018-07-04 18:39:27] [my_name] --> Unfollow error with b'phil_wornat', maybe no longer exists...
ERROR [2018-07-04 18:39:55] [my_name] --> Unfollow error with b'nkotya.78', maybe no longer exists...
ERROR [2018-07-04 18:40:22] [my_name] --> Unfollow error with b'londoner_ukr', maybe no longer exists...
ERROR [2018-07-04 18:40:50] [my_name] --> Unfollow error with b'samonawil', maybe no longer exists...
This is a never ending story here -_-
@joanroig, thanks, this works for me (and I also posted an issue about it last week)!
This segment of code appears, btw, twice in the file, once in a function that is never called (at least not from within the same file) and once somewhere else. Pasting it in the second location worked for me.
@realsony @nadavdrukker append your issues here and I'll do a pull request next week to solve them too, we can use this issue for testing the results after the PR.
Could this be implement ? or has to be an option ?
@ortegafernando in my opinion should be always as the described expected behaviour, if a user changes its username then you should track them by its ID, otherwise makes no sense storing dead usernames forever
@joanroig
I deleted all files in logs and after that, the people started being removed from the CSV.
I think you鈥檙e case is valid, BTW, even if mine was not related. Dead users should be removed from the file.
Not show profile pic
Wait, dead/deleted user profiles don't get removed from CSV? Instead it is permanently trying to delete them over and over again?
If so, it would explain why my bot is trying since weeks to delete some entries and kinda caught in a loop
@realsony exactly, that's the current behaviour and these days I've been testing the solution and seems to work fine. I'll make the pull request later, thanks everybody for your thoughts on that
ok ty as well. I'll close this now, yes?
@realsony yes, thanks.
Hi I am facing the same issue:
ERROR [2018-08-29 13:31:54] [them] --> Unfollow error with b'emilykonopka', maybe no longer exists....
ERROR [2018-08-29 13:31:54] [them] --> Unfollow error with b'emilykonopka', maybe username has changed or he/she blocked you...
ERROR [2018-08-29 13:31:54] [them] --> Unfollow error with b'emilykonopka', maybe no longer exists...
I have tried the above code and got this error:
File "quickstart-merch.py", line 1, in
from instapy import InstaPy
File "[path]\instapy__init__.py", line 2, in
from .instapy import InstaPy
File "[path]\instapy\instapy.py", line 44, in
from .unfollow_util import get_given_user_followers
File "[path]\instapy\unfollow_util.py", line 287
except:
^
TabError: inconsistent use of tabs and spaces in indentation
Please help I am new to Python and GIT