tuxity / insta-unfollower

An Instagram script to unfollow accounts who doesn't follow-you-back
MIT License
381 stars 89 forks source link

creation of the unfollowers list is generating wrong result #34

Closed coderade closed 4 years ago

coderade commented 4 years ago

When we are trying to generate the unfollow_users_list we are getting wrong results.

This occurrs because in the line 256 when comparing the following_list and followers_list using the user dict:

unfollow_users_list = [user for user in following_list if user not in followers_list]

some users has a diferent query parameter oe on the profile_pic_url, so in these cases the users are the same, but result as different users. Like we can see on the following example:

user_on_the_follower_list = {'id': '226800192', 'username': 'test_user', 'full_name': 'Test User',
                   'profile_pic_url': 'https://scontent-gru1-1.cdninstagram.com/v/t51.2885-19/s150x150/81628840_1492995750855871_111111111111111111_n.jpg?_nc_ht=scontent-gru1-1.cdninstagram.com&_nc_ohc=KNwAxZQWkU4AX9JlCMo&oh=6c054feb11f013f3aaf29ccc5322c1d6&oe=5ED3E05D',
                   'is_private': True, 'is_verified': False, 'followed_by_viewer': True,
                   'requested_by_viewer': False}
user_on_the_following_list = {'id': '226800192', 'username': 'test_user', 'full_name': 'Test user',
                    'profile_pic_url': 'https://scontent-gru1-1.cdninstagram.com/v/t51.2885-19/s150x150/81628840_1492995750855871_111111111111111111_n.jpg?_nc_ht=scontent-gru1-1.cdninstagram.com&_nc_ohc=KNwAxZQWkU4AX9JlCMo&oh=dc5f0df641c05645cb2cd3858f75375c&oe=5ED7D4DD',
                    'is_private': True, 'is_verified': False, 'followed_by_viewer': True,
                    'requested_by_viewer': False}

print(user_on_the_following_list == user_on_the_follower_list) # results false

In this case &oe=5ED3E05D is diferent in each profile_pic_url

coderade commented 4 years ago

I created a pull request to solve this issue: https://github.com/tuxity/insta-unfollower/pull/33

tuxity commented 4 years ago

Good catch! I will merge your PR soon.

tuxity commented 4 years ago

Done, thanks for your contribution!