session.unfollow_users should unfollow the full amount of users specified and delete them from followedPool.csv as they are unfollowed or actioned upon.
I've determined through testing that the unfollow process of unfollow_util.py skips every 11th user without including them in the count. Using terminal messages as an example:
INFO - --> Ongoing Unfollow From InstaPy 1, now unfollowing: User 1
INFO - --> Ongoing Unfollow From InstaPy 2, now unfollowing: User 2
INFO - --> Ongoing Unfollow From InstaPy 3, now unfollowing: User 3
INFO - --> Ongoing Unfollow From InstaPy 4, now unfollowing: User 4
INFO - --> Ongoing Unfollow From InstaPy 5, now unfollowing: User 5
INFO - --> Ongoing Unfollow From InstaPy 6, now unfollowing: User 6
INFO - --> Ongoing Unfollow From InstaPy 7, now unfollowing: User 7
INFO - --> Ongoing Unfollow From InstaPy 8, now unfollowing: User 8
INFO - --> Ongoing Unfollow From InstaPy 9, now unfollowing: User 9
INFO - --> Ongoing Unfollow From InstaPy 10, now unfollowing: User 10
WARNING - sleeping for about 10min | User 11 gets skipped during this process |
***INFO - --> Ongoing Unfollow From | InstaPy 11 | , now unfollowing: | User 12 | ***
This results in every 11th user skipped and remaining in the followedPool.csv.
I cannot determine the cause of this reading the code, though I do know it occurs when the unfollow program sleeps after every 10 unfollows. My hypothesis is there is some deviation between the "sleep every 10" code for unfollow_users and for follow_through_dialog. The follow function follows the correct amount of users.
My program specifically runs follow_user_followers and unfollow_users consecutively. Every 300 users followed will result in about 270 unfollows and 30 remainders in the followedPool.csv.
I just pulled the most recent commits and am currently testing if the commits may have fixed this.
@uluQulu this is the determination I made from the previous issue with unfollow_util.py you helped me with (thank you)!
Update: Confirmed that this issue persists with the current master branch commits.
Update: Solved with the help of @uluQulu ; modified the unfollow loop of unfollow_util.py to use pass instead of continue in the sleep code. (The if statement below is present twice in unfollow_util.py and needs to be changed in both places)
Previous:
if unfollowNum != 0 and \
hasSlept is False and \
unfollowNum % 10 == 0:
logger.warning('sleeping for about {}min'
.format(int(sleep_delay/60)))
sleep(sleep_delay)
hasSlept = True
continue
New:
if unfollowNum != 0 and \
hasSlept is False and \
unfollowNum % 10 == 0:
logger.warning('sleeping for about {}min'
.format(int(sleep_delay/60)))
sleep(sleep_delay)
hasSlept = True
pass
@timgrossmann @uluQulu and I have found a problem/solution that is present in the master unfollow_util.py file. Can these changes be merged to the origin master?
Most helpful comment
Update: Solved with the help of @uluQulu ; modified the unfollow loop of
unfollow_util.pyto usepassinstead ofcontinuein the sleep code. (The if statement below is present twice inunfollow_util.pyand needs to be changed in both places)Previous:
New:
@timgrossmann @uluQulu and I have found a problem/solution that is present in the master
unfollow_util.pyfile. Can these changes be merged to the origin master?