Instapy: Unfollow function doesn't appear to unfollow all accounts its supposed to

Created on 10 Feb 2019  ·  18Comments  ·  Source: timgrossmann/InstaPy

I'm running the latest version as of 2019/02/10

I've noticed a strange phenomenon where the unfollow function doesn't appear to unfollow all the accounts it's supposed to. It's almost as though accounts aren't either being added to the _followedPool.csv or accounts are being prematurely removed from that csv file. As a result, my account's 'followed users' steadily increases over time.

In order to get my account back to normal, every couple of weeks I have to copy the _record_all_followed.csv to _followedPool.csv and to re-run my unfollow scripts over a day or so. After this is done, I remove users added before 7 days (my setting for unfollowing all accounts which have been added by InstaPy irrespective of whether they follow me or not).

I run a separate unfollow script which runs independent of my like/follow scripts and here are the relevant lines from it:

#Unfollow non-followers
    session.unfollow_users(amount=200, InstapyFollowed=(True, "nonfollowers"), style="RANDOM", unfollow_after=48*60*60)   

    #Clean all followed users - Unfollow all users followed by InstaPy...                      
    session.unfollow_users(amount=200, InstapyFollowed=(True, "all"), style="RANDOM", unfollow_after=168*60*60)

Has anyone else seen this phenomenon? Is there some way of intelligently debugging/identifying what the problem might be?

wontfix

Most helpful comment

@gyrex Well there are several problems with data integrity infringements to be honest that is exactly why we had this PR https://github.com/timgrossmann/InstaPy/pull/2154 and now am going to work on completely removing files from the tool and move everything to the database which gives us ACID operations.

@oskarkrawczyk I'm sorry to hear this. Kind of sad to still see people complaining about the support of a project that until a few days ago had $0 to work with from day to day. (And still has extremely limited resources but luckily good people and devs that are passionate about this project). Especially from someone like you who seems to have already worked on one or the other OS project.
If you pay for it, you'll definitely get the privilege of complaining about it, otherwise, please try to be patient since we are all working on this project in our free time only.

All 18 comments

Thinking about it a little more, can someone with coding abilities tell me at what point an account is added to the followedPool.csv? Is the account added as soon as you follow someone or is it added at the end of the follow/like/comment sequence?

This issue has been reported and ignored before, so don't keep your hopes up for an answer 😉

Doubt the devs really know what can be causing it and how to fix it.

From my understanding, an account is added instantly after following the user, because sometimes you get ~ unfollowing account due to mismatching validation right after following, which is then followed by a message that states that the user is removed from followedpool.csv. I'm not sure about that issue though, since my unfollowing works perfectly fine :male_shrug:

@gyrex Well there are several problems with data integrity infringements to be honest that is exactly why we had this PR https://github.com/timgrossmann/InstaPy/pull/2154 and now am going to work on completely removing files from the tool and move everything to the database which gives us ACID operations.

@oskarkrawczyk I'm sorry to hear this. Kind of sad to still see people complaining about the support of a project that until a few days ago had $0 to work with from day to day. (And still has extremely limited resources but luckily good people and devs that are passionate about this project). Especially from someone like you who seems to have already worked on one or the other OS project.
If you pay for it, you'll definitely get the privilege of complaining about it, otherwise, please try to be patient since we are all working on this project in our free time only.

@timgrossmann this issue of none unfollowing is critical.
I sync my following to the ever follow pool for last 14 days to see who did not unfollow and I get 10-100 users each time. looking at the logs it seems that the user did unfollowed.

I can say that the issue started since @uluQulu changes the structure for the unfollow util.
It might is an selenium issue, blocking issue or something else that need to be investigated by adding tones of logs. I can see also that users that use the old version (modified) of unfollow has almost 0 left overs (in the sync functionalty).
*I personally think this is a network issue that cause it.

I might will add the sync(reading all following and comparing it to ever follow and follow pool) functionalty to instapy someday.

@gyrex Well there are several problems with data integrity infringements to be honest that is exactly why we had this PR #2154 and now am going to work on completely removing files from the tool and move everything to the database which gives us ACID operations.

@oskarkrawczyk I'm sorry to hear this. Kind of sad to still see people complaining about the support of a project that until a few days ago had $0 to work with from day to day. (And still has extremely limited resources but luckily good people and devs that are passionate about this project). Especially from someone like you who seems to have already worked on one or the other OS project.
If you pay for it, you'll definitely get the privilege of complaining about it, otherwise, please try to be patient since we are all working on this project in our free time only.

Thanks for the wonderful project Tim. I wish I could help in some way but I don't have any decent coding skills. I understand that projects such as this rely on people donating their time and I really appreciate it.

For those who do suffer from this, I've found the following process will 'clean' out accounts which have been missed by the unfollow process:

  1. Rename followedPool.csv to followedPool_yyyymmdd.csv
  2. Rename all_followed.csv to followedPool.csv
  3. Run unfollow script
  4. To avoid having to run through all the accounts in the entire all_followed.csv again, edit the csv in a text editor and trim/delete all the users which were added before 7 days to the current date.

You should notice all the rogue accounts have been unfollowed after this.

keep it up @Timgrossmann ! even I got through my first few python tutorials now, in a hope to be more useful in future (though my profession is as far from programming as it is possible 😂😂)

@gyrex: Your workaround is really a smart idea, thanks!

@sionking
Above at https://github.com/timgrossmann/InstaPy/issues/3954#issuecomment-462767962,
image

And at https://github.com/timgrossmann/InstaPy/issues/3665#issuecomment-462935369,
image

Well :octocat:..

Below, I have fetched _last_ 10 commits of mine to the unfollow_util.py file of the master branch.

1. _8 days ago_ - https://github.com/timgrossmann/InstaPy/commit/a1064df6b4adb8514b3e463298308a33806ca832#diff-827045af55209eedc06ca16f1f27fb84

  • [x] Visual change
  • Add Progress Tracker to `get_users_through_dialog()`` function provide realtime grabbed data stats.

2. _8 days ago_ - https://github.com/timgrossmann/InstaPy/commit/513707483f40e5bd2a6bdc6fc654fac2bf300b84#diff-827045af55209eedc06ca16f1f27fb84

  • [x] Logical change
  • Fix BROKEN "Failed to load desired amount of users!" issue by adding correct XPath.

3. _28 days ago_ - https://github.com/timgrossmann/InstaPy/commit/6b6050bcc7cacedff9644cb727a7d81761f9ad8b#diff-827045af55209eedc06ca16f1f27fb84

  • [x] Logical change
  • Fix BROKEN "Failed to load desired amount of users!" issue by adding correct XPath.

4. _Dec 15, 2018_ - https://github.com/timgrossmann/InstaPy/commit/dc31949052d108274ed32d3af1fa7f15d5ef99a3#diff-827045af55209eedc06ca16f1f27fb84

  • [x] Logical change
  • Indent back sleep line to fulfill the logic. It was mistakenly indented by @sionking.

5. _Nov 8, 2018_ - https://github.com/timgrossmann/InstaPy/commit/8c655b96648be19d8e97255571f1b4f88fdd6047#diff-827045af55209eedc06ca16f1f27fb84

  • [x] Logical change
  • Remove unused imports.

6. _Nov 8, 2018_ - https://github.com/timgrossmann/InstaPy/commit/c0cc41e93b9454f6683235a548e03e913f797260#diff-827045af55209eedc06ca16f1f27fb84

  • [x] Logical change
  • Replace username variable with person to fulfill expected behaviour.

7. _Nov 6, 2018_ - https://github.com/timgrossmann/InstaPy/commit/7ed88bb3ae5e64fcf22b348afb7155834fd8d843#diff-827045af55209eedc06ca16f1f27fb84

  • [x] Visual change
  • Visual changes in the unfollow_util.py file.

8. _Nov 6, 2018_ - https://github.com/timgrossmann/InstaPy/commit/d5cc130a298d37ec4036580928e3cdf0e51f5afe#diff-827045af55209eedc06ca16f1f27fb84

  • [x] Logical change
  • Use truncate_float() truncate the floating point value easily and precisely.

9. _Oct 28, 2018_ - https://github.com/timgrossmann/InstaPy/commit/e69243695a069d870bef4faf42864f9ed6d4313f#diff-827045af55209eedc06ca16f1f27fb84

  • [x] Logical change
  • Fix stale element reference error raised at #3173 which occured after #3159 by repositioning a function call.

10. _Oct 26, 2018_ - https://github.com/timgrossmann/InstaPy/commit/0da63f9bf6f15910115586f8459c99189de89ab8#diff-827045af55209eedc06ca16f1f27fb84

  • [x] Logical change
  • Add missing variable into string formatter & a good little visual change.

And I really wonder what is that [structural] change and in which of those commits it is I did that you're talking about that caused [those] issues.

If you want to fetch more of my older commits on unfollow_util.py file, please visit this page - https://github.com/timgrossmann/instapy/commits/master/instapy/unfollow_util.py?author=uluQulu.


I didn't really enjoy writing this which consumed minutes from my life but when you blame my [innocent] code in several posts with a bold emphasis as it is de facto proven, well, that's something I have to respond, deeply..


Cheers 😁

Hi guys,

Just checking in to see if there's been any progress on this issue? My list of accounts I'm following is growing at a rapid rate :(

Thanks again for everyone's contribution to this project!

Hey Gyrex, which version of instapy are you using?

There's no 'version' per se. I usually run a git pull daily so I'm up-to-date.

Of course it is, i am running version 0.3.3.

Try to remove any .csb file and run!

Of course it is, i am running version 0.3.3.

Try to remove any .csb file and run!

How do I find out what version I'm running?

Don’t remember the path, but you can “ls” /home/pi/.lib/python3.5/

Or do a sudo find / -name instapy it will give you the path of the files and there’s a instapy folder with the version, in my case “instapy-0.3.3”

pip3 show instapy shows all the info about the package, including the version :)

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

Hi Everyone. I finally decide to take new challege coding (starting programming basic course in 4 weeks time)

I manage to install and start executing InstaPy today which seem working but I need your help.

  1. I want to be able to add a line to automate on Unfollow all users on the account

  2. I would like at list 30 seconds interval between follow to avoid ban

  3. To add comment to picture that

  4. How to keep session on for at list more than 4 hours .

Thank you very much in advance

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Spyd3r0us picture Spyd3r0us  ·  3Comments

drcyber975 picture drcyber975  ·  3Comments

tibor picture tibor  ·  3Comments

wyvers picture wyvers  ·  3Comments

neomh picture neomh  ·  3Comments