I have the algorithm below that performs likes and comments on instagram photos via URL, my goal is to run this script on an AWS machine within 5 minutes which will generate 288 comments per day. However, whenever he realizes that he already executes LIKE in the photo, he returns "LIKED 0 images | ALREADY LIKED: 1"
, and aborts the process. I wanted to create a deal for when LIKE already exists, just execute the comment, is it possible? If yes you can help me with provisioning examples or the solution in question, thank you!
from instapy import InstaPy
from instapy import smart_run
def connect(insta_username,insta_password):
try:
session = InstaPy(username=insta_username,
password=insta_password,
headless_browser=False)
return session
except Exception as e:
print("[FAILED] Caused by: {}".format(e))
def action(url,insta_username,insta_password):
session = connect(insta_username,insta_password)
try:
with smart_run(session):
# Always follow and like before, the algorithm understands how it has already been executed when used in place of the like function
# Define interaction settings
session.set_do_comment(enabled=True, percentage=100)
session.set_comments(["@user-id"])
session.set_user_interact(amount=1, randomize=False, percentage=100, media='Photo')
# Start the feature
session.interact_by_URL(urls=url, randomize=False, interact=True)
session.end()
except Exception as e:
print("[FAILED] Caused by: {}".format(e))
if __name__ == "__main__":
pics = ["https://www.instagram.com/p/id-here"]
for url in pics:
action(url,'username','password')