Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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)
else:
print('--> Not commented')
sleep(1)
else:
already_liked += 1
else:
print('--> Image not liked: {}'.format(reason))
inap_img += 1
except NoSuchElementException as err:
print('Invalid Page: {}'.format(err))
self.logFile.write('Invalid Page: {}\n'.format(err))
print('')
self.logFile.write('\n')
commenting):
if self.delimit_commenting:
self.commenting_approved, disapproval_reason = verify_commenting(self.browser, self.max_comments, self.min_comments, self.logger)
if self.commenting_approved:
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,
user_name,
comments,
self.blacklist,
self.logger,
self.logfolder)
else:
self.logger.info(disapproval_reason)
else:
self.logger.info('--> Not commented')
sleep(1)
else:
already_liked += 1
else:
self.logger.info(
'--> Image not liked: {}'.format(reason.encode('utf-8')))
commenting):
if self.delimit_commenting:
self.commenting_approved, disapproval_reason = verify_commenting(self.browser, self.max_comments, self.min_comments, self.logger)
if self.commenting_approved:
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,
user_name,
comments,
self.blacklist,
self.logger,
self.logfolder)
else:
self.logger.info(disapproval_reason)
else:
self.logger.info('--> Not commented')
sleep(1)
else:
already_liked += 1
else:
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)
else:
print('--> Not commented')
sleep(1)
if self.do_follow and user_name not in self.dont_include \
and checked_img and following \
and self.follow_restrict.get(user_name, 0) < self.follow_times:
followed += follow_user(self.browser, self.follow_restrict, self.username, user_name)
else:
print('--> Not following')
sleep(1)
else:
already_liked += 1
else:
print('--> Image not liked: {}'.format(reason))
inap_img += 1
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)
else:
print('--> Not commented')
sleep(1)
if self.do_follow and user_name not in self.dont_include \
and checked_img and following \
and self.follow_restrict.get(user_name, 0) < self.follow_times:
followed += follow_user(self.browser, self.follow_restrict, self.username, user_name)
else:
print('--> Not following')
sleep(1)
else:
already_liked += 1
else:
print('--> Image not liked: {}'.format(reason))
inap_img += 1