Instapy: Interact with specific photo/URL, follow the likers

Created on 15 Dec 2018  路  6Comments  路  Source: timgrossmann/InstaPy

**Apologies if this feature does not exist yet and this is more of a request.

I would like to give a specific URL for a photo (my own photo), and have InstaPy scan through those that have liked the image, then follow them and like two of their photos.

This seems possible, if not close to.. In the docs, we have "Interact on posts at given URLs", as well as "Follow the likers of photos of users".

Currently I am using using the code snippet in "Follow the likers of photos of users", but I just have my own username in there(and it randomizes the photo it goes after).. However, I would like to be able to specify which photo I want it to work through (some of my photos have 1000-2000 likes.. which is a gold mine).

Bonus points: InstaPy scans through all likes (likely not to change much, if the photo is a week old or more), and then be able to just chip away at this list, following and liking from that list. This way, it doesn't need to start scanning through the image, from the top, every time I run the script. It just has a pool of likers, ready to go.

Any suggestions would be much appreciated! Thank you for your time.

Most helpful comment

Hi @pxtnpxtn

You have expressed 2 styles and I will not talk about a generic solution for that, instead, I will offer a solution for your wish.

You want to do it on your own posts, right.
Then do this:

# inside quickstart script

from instapy.commenters_util import users_liked as get_likers_from_post

URLs = ["www.ig.com/pxtnpxtn/post/1", "www.ig.com/pxtnpxtn/post/2"]

for URL in URLs:
    likers = get_likers_from_post(session.browser, URL, 14)
    session.set_do_like(enabled=True, percentage=100)
    session.set_user_interact(amount=2, percentage=100, randomize=False, media="Photo")
    session.follow_by_list(followlist=likers, times=1, sleep_delay=600, interact=True)

It will open the posts with given URLs one by one and get 14 likers from each of those posts and then follow them, also, like 2 photos from each of those likers just after following them.

Having it as a separate feature, hmm.


Cheers 馃榿

All 6 comments

Hi @pxtnpxtn

You have expressed 2 styles and I will not talk about a generic solution for that, instead, I will offer a solution for your wish.

You want to do it on your own posts, right.
Then do this:

# inside quickstart script

from instapy.commenters_util import users_liked as get_likers_from_post

URLs = ["www.ig.com/pxtnpxtn/post/1", "www.ig.com/pxtnpxtn/post/2"]

for URL in URLs:
    likers = get_likers_from_post(session.browser, URL, 14)
    session.set_do_like(enabled=True, percentage=100)
    session.set_user_interact(amount=2, percentage=100, randomize=False, media="Photo")
    session.follow_by_list(followlist=likers, times=1, sleep_delay=600, interact=True)

It will open the posts with given URLs one by one and get 14 likers from each of those posts and then follow them, also, like 2 photos from each of those likers just after following them.

Having it as a separate feature, hmm.


Cheers 馃榿

Wow, thank you so much @uluQulu . Truly appreciate your help with that one.

Hello guys. Tnx for for your help @uluQulu . There is a simple solution to give like back to those that give me like to a certain picture!

I tried :
from instapy.commenters_util import users_liked as get_likers_from_post
URLs = ["https://www.instagram.com/p/BrFQB6GlkHP/"]

likers = get_likers_from_post(session.browser, URL)
session.set_do_like(True, percentage=100)
session.interact_by_users_tagged_posts([liker], amount=1, randomize=False, media='Photo')

but it does not seem to recognize all likes.
I just want like per like to a certain photo.
Thank you!!!

Welcome @pxtnpxtn @babalau

@babalau I really have not understood what are you trying to do and what is your problem.
Can you write everything about what you are trying to do precisely in details?

I think he is simply trying to return all likes which he received for a particular post, back to the users who liked his post. #like4like

Had trouble finding further reference to 'get_likers_from_post()'

I can get this to work. But I can't seem to limit the returned list to a set number. I seem to get the full list of likers back even if I specify a number as the last argument..

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ingorichter picture ingorichter  路  3Comments

Spyd3r0us picture Spyd3r0us  路  3Comments

drcyber975 picture drcyber975  路  3Comments

ediooo picture ediooo  路  3Comments

wyvers picture wyvers  路  3Comments