save email address
This commit is contained in:
@@ -117,6 +117,7 @@ class MailReader():
|
||||
print(body)
|
||||
if VALIDATION_URL_SUBJECT_fr in subject or VALIDATION_URL_SUBJECT_EN in subject:
|
||||
mail = MailPojo(subject=subject, body=body, from_address=from_address)
|
||||
mail.mail_address = self.login
|
||||
mail_messages.append(mail)
|
||||
return mail_messages
|
||||
|
||||
@@ -157,6 +158,7 @@ class MailReader():
|
||||
|
||||
|
||||
def need_to_valid_url(url: str, successful_items) -> bool:
|
||||
# return True
|
||||
if len(successful_items) == 0:
|
||||
return False
|
||||
print("url is :" + url)
|
||||
@@ -184,8 +186,8 @@ def need_to_check_email(mail: str, successful_items) -> bool:
|
||||
# return True
|
||||
for item in successful_items:
|
||||
if mail in item.email:
|
||||
print("url_validated for {} is {}".format(mail, item.url_validated))
|
||||
if item.url_validated is not None:
|
||||
print("url_validated for {} is {}".format(mail, item.url_validated))
|
||||
return not item.url_validated
|
||||
else:
|
||||
# if url-validated is none, need to check email
|
||||
@@ -200,7 +202,7 @@ def read_mails():
|
||||
if is_time_between(time(7, 30), time(19, 30)):
|
||||
# get email address
|
||||
mail_list = MONGO_STORE_MANAGER.get_destination_emails()
|
||||
# mail_address1 = MailAddress(mail="enasremor1973@onet.pl", password=")ozBUE0RjZ8N")
|
||||
mail_address1 = MailAddress(mail="camille.gelais@yahoo.com", password="rporemmflqhoewcd")
|
||||
# mail_address1 = MailAddress(mail="chenpeijun@aol.com", password="ytifuwguknzifqyb")
|
||||
# # mail_address3 = MailAddress(mail="ciyuexie@aol.com", password="czezlmmyypokdfce")
|
||||
# mail_list = [mail_address1]
|
||||
@@ -226,7 +228,7 @@ def read_mails():
|
||||
# else:
|
||||
url = match.group(0)
|
||||
if need_to_valid_url(url, successful_items):
|
||||
MONGO_STORE_MANAGER.save_links_to_validate(url)
|
||||
MONGO_STORE_MANAGER.save_links_to_validate(url, mail.mail_address)
|
||||
# url_validator = LinkValidator(url)
|
||||
print("need to validate url: " + url)
|
||||
# executor.submit(url_validator.start_page, params.get_proxy(ProxyType.OXYLABS), False)
|
||||
|
||||
Reference in New Issue
Block a user