Interact on posts at given URLs
(
self, urls: list = [], randomize: bool = False, interact: bool = False
)
| 4998 | return self |
| 4999 | |
| 5000 | def interact_by_URL( |
| 5001 | self, urls: list = [], randomize: bool = False, interact: bool = False |
| 5002 | ): |
| 5003 | """Interact on posts at given URLs""" |
| 5004 | |
| 5005 | if self.aborting: |
| 5006 | return self |
| 5007 | |
| 5008 | message = "Starting to interact by given URLs.." |
| 5009 | highlight_print(self.username, message, "feature", "info", self.logger) |
| 5010 | |
| 5011 | if not isinstance(urls, list): |
| 5012 | urls = [urls] |
| 5013 | |
| 5014 | if randomize is True: |
| 5015 | random.shuffle(urls) |
| 5016 | |
| 5017 | liked_img = 0 |
| 5018 | already_liked = 0 |
| 5019 | inap_img = 0 |
| 5020 | commented = 0 |
| 5021 | followed = 0 |
| 5022 | not_valid_users = 0 |
| 5023 | |
| 5024 | for index, url in enumerate(urls): |
| 5025 | if self.jumps["consequent"]["likes"] >= self.jumps["limit"]["likes"]: |
| 5026 | self.logger.warning( |
| 5027 | "--> Like quotient reached its peak!" |
| 5028 | "\t~leaving Interact-By-URL activity\n" |
| 5029 | ) |
| 5030 | # reset jump counter before breaking the loop |
| 5031 | self.jumps["consequent"]["likes"] = 0 |
| 5032 | # we have not used `quotient_breach` here |
| 5033 | # cos this method has just one iterator |
| 5034 | break |
| 5035 | |
| 5036 | if "https://www.instagram.com/p/" not in url: |
| 5037 | url = "https://www.instagram.com/p/" + url |
| 5038 | |
| 5039 | self.logger.info("URL [{}/{}]".format(index + 1, len(urls))) |
| 5040 | self.logger.info("--> {}".format(url.encode("utf-8"))) |
| 5041 | |
| 5042 | try: |
| 5043 | inappropriate, user_name, is_video, reason, scope = check_link( |
| 5044 | self.browser, |
| 5045 | url, |
| 5046 | self.dont_like, |
| 5047 | self.mandatory_words, |
| 5048 | self.mandatory_language, |
| 5049 | self.is_mandatory_character, |
| 5050 | self.mandatory_character, |
| 5051 | self.check_character_set, |
| 5052 | self.ignore_if_contains, |
| 5053 | self.logger, |
| 5054 | ) |
| 5055 | |
| 5056 | if not inappropriate and self.delimit_liking: |
| 5057 | self.liking_approved = verify_liking( |
nothing calls this directly
no test coverage detected