How to use the instapy.like_util.check_link function in instapy

To help you get started, we’ve selected a few instapy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Instagram-Tools / bot / instapy / instapy.py View on Github external
following = random.randint(0, 100) <= self.follow_percentage

            for i, link in enumerate(links[:amount]):
                # Check if target has reached
                if liked_img >= amount:
                    self.logger.info('-------------')
                    self.logger.info("--> Total liked image reached it's "
                                     "amount given: {}".format(liked_img))
                    break

                self.logger.info('Post [{}/{}]'.format(liked_img + 1, amount))
                self.logger.info(link)

                try:
                    inappropriate, user_name, is_video, reason, scope = (
                        check_link(self.browser,
                                   link,
                                   self.dont_like,
                                   self.ignore_if_contains,
                                   self.logger)
                    )

                    if not inappropriate:

                        if (self.do_follow and
                            username not in self.dont_include and
                            following and
                            self.follow_restrict.get(
                                username, 0) < self.follow_times):

                            followed += follow_user(
                                self.browser,
github Instagram-Tools / bot / instapy / instapy.py View on Github external
for i, link in enumerate(links):
                # Check if target has reached
                if liked_img >= amount:
                    print('-------------')
                    print("--> Total liked image reached it's amount given: ", liked_img)
                    print('')
                    break

                print('Post [{}/{}]'.format(liked_img + 1, amount))
                self.logFile.write('[{}/{}]'.format(liked_img + 1, amount))
                self.logFile.write(link)

                try:
                    inappropriate, user_name, is_video, reason = \
                        check_link(self.browser, link, self.dont_like, self.ignore_if_contains, self.ignore_users,
                                   self.username, self.like_by_followers_upper_limit,
                                   self.like_by_followers_lower_limit)

                    if not inappropriate:
                        liked = like_image(self.browser)

                        if liked:
                            total_liked_img += 1
                            liked_img += 1
                            checked_img = True
                            temp_comments = []
                            commenting = randint(0, 100) <= self.comment_percentage


                            if self.use_clarifai and (following or commenting):
                                try:
github Instagram-Tools / bot / instapy / instapy.py View on Github external
else:
                    if link in history:
                        self.logger.info('This link has already '
                                         'been visited: {}'
                                         .format(link))
                        continue
                    else:
                        self.logger.info('New link found...')
                        history.append(link)
                        self.logger.info('[{} posts liked /{} amount]'
                                         .format(liked_img, amount))
                        self.logger.info(link)

                        try:
                            inappropriate, user_name, is_video, reason, scope = (
                                check_link(self.browser,
                                           link,
                                           self.dont_like,
                                           self.ignore_if_contains,
                                           self.logger)
                            )

                            if not inappropriate and self.delimit_liking:
                                self.liking_approved = verify_liking(self.browser, self.max_likes, self.min_likes, self.logger)

                            if not inappropriate and self.liking_approved:
                                #validate user
                                validation, details = validate_username(self.browser,
                                                               user_name,
                                                               self.username,
                                                               self.ignore_users,
                                                               self.blacklist,
github Instagram-Tools / bot / instapy / instapy.py View on Github external
tag,
                                          amount,
                                          self.logger,
                                          media,
                                          skip_top_posts)
            except NoSuchElementException:
                self.logger.info('Too few images, skipping this tag')
                continue

            for i, link in enumerate(links):
                self.logger.info('[{}/{}]'.format(i + 1, len(links)))
                self.logger.info(link)

                try:
                    inappropriate, user_name, is_video, reason, scope = (
                        check_link(self.browser,
                                   link,
                                   self.dont_like,
                                   self.ignore_if_contains,
                                   self.logger)
                    )

                    if not inappropriate and self.delimit_liking:
                        self.liking_approved = verify_liking(self.browser, self.max_likes, self.min_likes, self.logger)

                    if not inappropriate and self.liking_approved:
                        #validate user
                        validation, details = validate_username(self.browser,
                                                       user_name,
                                                       self.username,
                                                       self.ignore_users,
                                                       self.blacklist,
github Instagram-Tools / bot / instapy / instapy.py View on Github external
amount,
                                               self.logger,
                                               media,
                                               skip_top_posts)
            except NoSuchElementException:
                self.logger.warning('Too few images, skipping this location')
                raise
                continue

            for i, link in enumerate(links):
                self.logger.info('[{}/{}]'.format(i + 1, len(links)))
                self.logger.info(link)

                try:
                    inappropriate, user_name, is_video, reason, scope = (
                        check_link(self.browser,
                                   link,
                                   self.dont_like,
                                   self.ignore_if_contains,
                                   self.logger)
                    )

                    if not inappropriate and self.delimit_liking:
                        self.liking_approved = verify_liking(self.browser, self.max_likes, self.min_likes, self.logger)
                    
                    if not inappropriate and self.liking_approved:
                        #validate user
                        validation, details = validate_username(self.browser,
                                                       user_name,
                                                       self.username,
                                                       self.ignore_users,
                                                       self.blacklist,
github Instagram-Tools / bot / instapy / instapy.py View on Github external
tag,
                                          amount,
                                          self.logger,
                                          media,
                                          skip_top_posts)
            except NoSuchElementException:
                self.logger.info('Too few images, skipping this tag')
                continue

            for i, link in enumerate(links):
                self.logger.info('[{}/{}]'.format(i + 1, len(links)))
                self.logger.info(link)

                try:
                    inappropriate, user_name, is_video, reason, scope = (
                        check_link(self.browser,
                                   link,
                                   self.dont_like,
                                   self.ignore_if_contains,
                                   self.logger)
                    )

                    if not inappropriate:
                        #validate user
                        validation, details = validate_username(self.browser,
                                                       user_name,
                                                       self.username,
                                                       self.ignore_users,
                                                       self.blacklist,
                                                       self.potency_ratio,
                                                       self.delimit_by_numbers,
                                                       self.max_followers,