Instapy: unfollow users

Created on 8 Dec 2018  路  10Comments  路  Source: timgrossmann/InstaPy

InstaPy configuration

all_unfollowers, active_unfollowers = session.pick_unfollowers(username="XXXXX",compare_by="earliest", compare_track="first", live_match=True, store_locally=True, print_out=True)
sleep(200)
session.unfollow_users(amount=len(active_unfollowers), customList=(True, active_unfollowers, "all"), style="RANDOM", unfollow_after=None, sleep_delay=600

after picking the data and sleeping i get this :

Pow! Error occurred while dumping follow restriction data to a local JSON:
b'Expecting value: line 1 column 1 (char 0)'

bug wontfix

All 10 comments

I do also

WARNING [2018-12-08 16:01:05] [123]  Maybe 'b'shoshykogman'' has changed the username!    ~verifying through the user ID
INFO [2018-12-08 16:01:05] [123]  Trying to find the username from the given user ID by loading a post
INFO [2018-12-08 16:01:16] [123]  Failed to get the username from 'https://www.instagram.com/p/BrGmmU_HVQK/' page
INFO [2018-12-08 16:01:16] [123]  Trying to find the username from the given user ID by a quick API call
ERROR [2018-12-08 16:01:17] [123]  Unfollow loop error:  Expecting value: line 1 column 1 (char 0)

INFO [2018-12-08 16:01:17] [123]  --> Total people unfollowed : 0

@uluQulu @CharlesCCC as I thought so any non-human call is a fail to the system and can be worst as a way to detect bot.
the "https://i.instagram.com/api/v1/users/198566306/info/" call is not working anymore.

Moreover it log you out.... isn't it was the https://www.instagram.com/web/friendships/249229606/follow/
that logged you out ?

What is the solution ?

I have a solution:

  1. save all users we can't get username to a file (we have it in a form of uncertain unfollow list).
  2. once in a week grab all following of running user (sync).
  3. compare id from file == id from sync, if id match - > the username is in the sync.

@sionking Yea, you are right, i believe the second link is the one kick you out. but apparently now is the reverse. (I just tried both). I guess Instagram is playing with their URL APIs

As for your solution, how does that gonna solve the problem, what happen if the id didn't match ?

@sionking
It rather a workaround than a solution.

So, the only solution left to find the username from a user ID is by loading a post.
Obviously it can't help if user has no any posts or if is private or has blocked you.

I am out of news but as @CharlesCCC says I don't know what is going on and it might be we have lost that API call for ever. And there may be a new endpoint to replace it or not.

I think it is time to think on having external sessions and use the method using graphql 'Follow' endpoint (_@CharlesCCC's initial solution with random log outs_) safely [BIG work].

Earlier there were no any username to user ID conversion and I think the last alive method will serve more than 70%. So I don't think it might be a problem considering less than %14 of people ever change usernames.
Me, users like me WHO is a big fan of unfollow non-followers, literally will not need that conversion, at all costs.


Cheers 馃榿

Thanks friends for the work, let us know please when a solution or workaround is ready or simply if you need some tests.
Thanks again

I suggest if a work around is quite big work for this we implement a fix in the mean time that skips that user and moves onto the next one rather than stopping unfollows completely, @sionking @uluQulu would you agree?

@w4ngel
It should not stop the loop unless there is other bug(s).

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

Was this page helpful?
0 / 5 - 0 ratings