MCPcopy
hub / github.com/InstaPy/InstaPy / engage_with_posts

Method engage_with_posts

instapy/instapy.py:6026–6102  ·  view source on GitHub ↗
(self, pod_posts, modespecific_comment_percentage)

Source from the content-addressed store, hash-verified

6024 return self
6025
6026 def engage_with_posts(self, pod_posts, modespecific_comment_percentage):
6027 for pod_post in pod_posts:
6028 try:
6029 pod_post_id = pod_post["postid"]
6030 post_link = "https://www.instagram.com/p/{}".format(pod_post_id)
6031 web_address_navigator(self.browser, post_link)
6032
6033 inappropriate, user_name, is_video, reason, scope = check_link(
6034 self.browser,
6035 post_link,
6036 self.dont_like,
6037 self.mandatory_words,
6038 self.mandatory_language,
6039 self.is_mandatory_character,
6040 self.mandatory_character,
6041 self.check_character_set,
6042 self.ignore_if_contains,
6043 self.logger,
6044 )
6045
6046 if user_name != self.username:
6047 follow_state, msg = follow_user(
6048 self.browser,
6049 "post",
6050 self.username,
6051 user_name,
6052 None,
6053 self.blacklist,
6054 self.logger,
6055 self.logfolder,
6056 )
6057
6058 self.dont_include.add(user_name)
6059
6060 if not inappropriate and user_name != self.username:
6061 pods_like_percent = max(90, min(100, self.like_percentage))
6062 liking = random.randint(0, 100) <= pods_like_percent
6063 commenting = (
6064 random.randint(0, 100) <= modespecific_comment_percentage
6065 )
6066
6067 if liking:
6068 like_state, msg = like_image(
6069 self.browser,
6070 user_name,
6071 self.blacklist,
6072 self.logger,
6073 self.logfolder,
6074 self.liked_img,
6075 )
6076
6077 if like_state is True or self.do_comment_liked_photo:
6078 self.liked_img += 1
6079
6080 elif msg == "block on likes":
6081 break
6082
6083 commenting_restricted = comment_restriction(

Callers 1

join_podsMethod · 0.95

Calls 7

fetch_smart_commentsMethod · 0.95
web_address_navigatorFunction · 0.85
check_linkFunction · 0.85
follow_userFunction · 0.85
like_imageFunction · 0.85
comment_restrictionFunction · 0.85
comment_imageFunction · 0.85

Tested by

no test coverage detected