I am using this bot for my personal Instagram account. I'm not interested in follows/unfollows, simply liking images that I typically would like to maintain a level of activity on my private Instagram account, while no longer using it.
I have InstaPy working, here is my code (sensitive data redacted):
from instapy import InstaPy
## Config
ignore_user_list = ['username1', 'username2']
number_of_likes_per_session = 20
maximum_number_of_followers = 10000
## Bot
InstaPy(username='myinstagramusername', password='myinstagrampassword', nogui=True)\
.login()\
.set_ignore_users(ignore_user_list)\
.set_upper_follower_count(maximum_number_of_followers)\
.like_by_feed(number_of_likes_per_session)\
.end()
The script runs and displays output as expected.
However, I've noticed that the like_by_feed() function likes images sequentially without observing the rules set by the previous two functions, set_ignore_users() & set_upper_follower_count(). For example, it liked an image from username1, even though username1 is listed in the array ignore_user_list.
Furthermore, the bot liked a photo posted by National Geographic (@natgeo), when that Instagram account has more than 10,000 followers (currently sitting at 79.4 million). It is ignoring the set_upper_follower_count() limit of maximum_number_of_followers.
Therefore, both constraining functions seem to not be applied to the like_by_feed() function.
Is this a bug or intended behavior?
I took a look at the code of the InstaPy library. Doesn't appear to be referencing any of those constraining functions, just use the feed utility to get buttons to click.
Feature request?
I might fork the project and work on making those functions applicable to the like_by_feed(). For now, I'll take a look at some alternatives
Otherwise, it's probably not too hard to limit the buttons returned by that utility feed function based on these constraints, at least by username should be easy since that data is available on the Feed page (followers of each user would require an additional scrape of their Instagram profile pages, or maybe I integrate with your other library, https://github.com/timgrossmann/instagram-profilecrawl).
Cheers and thank you !
@mr-White Yes exactly, this is something that still has to be done.
Would be awesome if you could implement this!
Would love to see it. (Same functionality as the other .like_by_.. methods)
I'm also thinking about staring using bountysource.com for this project.
@timgrossmann I'll see what I can do once I get some free time, maybe this coming weekend. My Python skills are rather rusty... it's been 10 years since I've last used it
Any direction or suggestions will be greatly appreciated 馃憤
@mr-White I'm pretty sure you can handle that well.
It's actually really similar to the other .like_by_... methods.
Once this is implemented, I probably will start cleaning and refactoring before this completely explodes.