How to use the instapy.clarifai_util.check_image 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
self.logfolder)
                        else:
                            liked = True

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

                            if self.use_clarifai and (following or commenting):
                                try:
                                    checked_img, temp_comments = (
                                        check_image(self.browser,
                                                    self.clarifai_api_key,
                                                    self.clarifai_img_tags,
                                                    self.logger,
                                                    self.clarifai_full_match)
                                    )
                                except Exception as err:
                                    self.logger.error(
                                        'Image check error: {}'.format(err))

                            if (self.do_comment and
                                user_name not in self.dont_include and
                                checked_img and
                                    commenting):

                                if self.delimit_commenting:
                                    self.commenting_approved, disapproval_reason = verify_commenting(self.browser, self.max_comments, self.min_comments, self.logger)
github Instagram-Tools / bot / instapy / instapy.py View on Github external
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:
                                    checked_img, temp_comments = \
                                        check_image(self.browser,
                                                    self.clarifai_api_key,
                                                    self.clarifai_img_tags,
                                                    self.clarifai_full_match)
                                except Exception as err:
                                    print('Image check error: {}'.format(err))
                                    self.logFile.write('Image check error: {}\n'.format(err))
                            if self.do_comment and user_name not in self.dont_include \
                                    and checked_img and commenting:
                                if temp_comments:
                                     # Use clarifai related comments only!
                                    comments = temp_comments
                                elif is_video:
                                    comments = self.comments + self.video_comments
                                else:
                                    comments = self.comments + self.photo_comments
                                commented += comment_image(self.browser, comments)
github Instagram-Tools / bot / instapy / instapy.py View on Github external
self.blacklist,
                                           self.logger,
                                           self.logfolder)

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

                            if self.use_clarifai and (following or commenting):
                                try:
                                    checked_img, temp_comments = (
                                        check_image(self.browser,
                                                    self.clarifai_api_key,
                                                    self.clarifai_img_tags,
                                                    self.logger,
                                                    self.clarifai_full_match)
                                    )
                                except Exception as err:
                                    self.logger.error(
                                        'Image check error: {}'.format(err))


                            if (self.do_comment and
                                user_name not in self.dont_include and
                                checked_img and
                                    commenting):

                                if self.delimit_commenting:
github Instagram-Tools / bot / instapy / instapy.py View on Github external
liked = like_image(self.browser)
                        else:
                            like = True

                        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:
                                    checked_img, temp_comments = \
                                        check_image(self.browser, self.clarifai_id,
                                                    self.clarifai_secret,
                                                    self.clarifai_img_tags,
                                                    self.clarifai_full_match)
                                except Exception as err:
                                    print('Image check error: {}'.format(err))
                                    self.logFile.write('Image check error: {}\n'.format(err))
                            if self.do_comment and user_name not in self.dont_include \
                                    and checked_img and commenting:
                                if temp_comments:
                                     # Use clarifai related comments only!
                                    comments = temp_comments
                                elif is_video:
                                    comments = self.comments + self.video_comments
                                else:
                                    comments = self.comments + self.photo_comments
                                commented += comment_image(self.browser, comments)
github Instagram-Tools / bot / instapy / instapy.py View on Github external
name.append(username)

                                    if interact:
                                        print('--> User followed: {}'.format(name))
                                        self.like_by_users(name, self.user_interact_amount, self.user_interact_random, self.user_interact_media)

                                    liked_img += 1
                                    checked_img = True
                                    temp_comments = []
                                    commenting = randint(0, 100) <= self.comment_percentage
                                    following = randint(0, 100) <= self.follow_percentage

                                    if self.use_clarifai and (following or commenting):
                                        try:
                                            checked_img, temp_comments = \
                                                check_image(self.browser, self.clarifai_id,
                                                            self.clarifai_secret,
                                                            self.clarifai_img_tags,
                                                            self.clarifai_full_match)
                                        except Exception as err:
                                            print('Image check error: {}'.format(err))
                                            self.logFile.write('Image check error: {}\n'.format(err))

                                    if self.do_comment and user_name not in self.dont_include \
                                            and checked_img and commenting:
                                        if temp_comments:
                                            # Use clarifai related comments only!
                                            comments = temp_comments
                                        elif is_video:
                                            comments = self.comments + self.video_comments
                                        else:
                                            comments = self.comments + self.photo_comments