From 4a330941406a1d50ff7ff284a1f05d2cdcf3a61d Mon Sep 17 00:00:00 2001 From: Lei PAN Date: Tue, 18 Nov 2025 23:42:44 +0100 Subject: [PATCH] use oxylab proxy --- mail/mail_reader_all_contacts.py | 12 ++++++------ request_sender_test.py | 3 ++- scheduler_second.py | 8 ++++---- scheduler_test.py | 4 ++-- workers/link_validator_with_provided_list.py | 3 +-- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/mail/mail_reader_all_contacts.py b/mail/mail_reader_all_contacts.py index ca6f99c..f62e87f 100755 --- a/mail/mail_reader_all_contacts.py +++ b/mail/mail_reader_all_contacts.py @@ -172,11 +172,11 @@ class MailReader(): search_terms = 'SINCE "{}"'.format( datetime.datetime.today().strftime( date_format)) - print("{}: search terms is {}".format(self.login,search_terms)) + print("{}: search terms is {}".format(self.login, search_terms)) imap.select_folder(folder) messages = imap.search(['SINCE', datetime.datetime.today()]) print("{}: {} messages from our best friend".format(self.login, len(messages))) - if len(messages) ==0: + if len(messages) == 0: return mail_messages for uid, message_data in imap.fetch(messages, 'RFC822').items(): try: @@ -244,7 +244,7 @@ def need_to_valid_url(url: str, item: Union[ReserveResultPojo, None]) -> bool: def need_to_check_email(mail: str, successful_items) -> bool: print("successful_items size is " + str(len(successful_items))) - if mail =="saigecong1990@pissmail.com": + if mail == "saigecong1990@pissmail.com": return True filtered_items = list(filter(lambda item: item.email == mail, successful_items)) # has validated value @@ -296,9 +296,9 @@ if __name__ == '__main__': contact_to_book_list = read_contacts( # file_name="/Users/rdv/Desktop/contact_list_not_used_contacts.xlsx") # file_name="/Users/lpan/Desktop/contact_list_not_used_contacts.xlsx") - file_name="/Users/rdv/Desktop/contact_list_2025-10-30.xlsx") - # file_name="~/Desktop/contact_list_all.xlsx") - # file_name="~/Desktop/contact_list_2025-09-08.xlsx") + # file_name="/Users/rdv/Desktop/contact_list_2025-10-30.xlsx") + # file_name="~/Desktop/contact_list_all.xlsx") + file_name="~/Desktop/contact_list_2025-11-06.xlsx") # file_name="/Users/rdv/Desktop/contact_list_all_studo_gmx_us.xlsx") # file_name="/Users/rdv/Desktop/contact_list_2025-05-24.xlsx") all_mail_list = MONGO_STORE_MANAGER.get_destination_emails() diff --git a/request_sender_test.py b/request_sender_test.py index b0c5590..6536087 100644 --- a/request_sender_test.py +++ b/request_sender_test.py @@ -100,7 +100,8 @@ if __name__ == '__main__': # file_list = ['~/Desktop/contact_list_2024-05-23.xlsx', # '~/Desktop/contact_list_2024-05-21.xlsx', # '~/Desktop/15_05_to_test.xlsx'] - file_list = ['~/Desktop/contact_list_2025-10-30.xlsx'] + # file_list = ['~/Desktop/contact_list_2025-10-30.xlsx'] + file_list = ['~/Desktop/contact_list_2025-11-06.xlsx'] # file_list = ['~/Desktop/contact_list_all.xlsx'] # file_list = ['~/Desktop/contact_list_2025-09-08.xlsx'] # file_list = ['~/Desktop/real_name_contacts_100_aol_17_04.xlsx'] diff --git a/scheduler_second.py b/scheduler_second.py index cd5895b..380669c 100644 --- a/scheduler_second.py +++ b/scheduler_second.py @@ -6,14 +6,14 @@ from request_sender_test import send_request_for_file_list def start_book_appointment(): - file_list = ['~/Desktop/contact_list_2025-09-08.xlsx'] - send_request_for_file_list(file_list=file_list, thread_number=20, + file_list = ['~/Desktop/contact_list_2025-10-30.xlsx'] + send_request_for_file_list(file_list=file_list, thread_number=2, data_queue_name=MORNING_DATA_CACHE, stop_at_hour=18, stop_at_mins=20) def start_check_results_job(sched): - sched.add_job(start_book_appointment, 'cron', day_of_week='mon-sat', hour='14', - minute='01', + sched.add_job(start_book_appointment, 'cron', day_of_week='mon-sat', hour='11', + minute='40', misfire_grace_time=10, second='10', timezone='Europe/Paris', max_instances=1, args=[]) diff --git a/scheduler_test.py b/scheduler_test.py index c2b11e7..cf91547 100644 --- a/scheduler_test.py +++ b/scheduler_test.py @@ -7,8 +7,8 @@ from request_sender_test import send_request_for_file_list def start_book_appointment(): # file_list = ['~/Desktop/contact_list_2025-09-08.xlsx'] - file_list = ['~/Desktop/contact_list_2025-10-30.xlsx'] - send_request_for_file_list(file_list=file_list, thread_number=60, + file_list = ['~/Desktop/contact_list_2025-11-06.xlsx'] + send_request_for_file_list(file_list=file_list, thread_number=70, data_queue_name=MORNING_DATA_CACHE, stop_at_hour=11, stop_at_mins=10) diff --git a/workers/link_validator_with_provided_list.py b/workers/link_validator_with_provided_list.py index 1158da5..56e8a7e 100644 --- a/workers/link_validator_with_provided_list.py +++ b/workers/link_validator_with_provided_list.py @@ -233,9 +233,8 @@ def validate_all_links(_contact_serial_list): # get the first 50 links if len(link_to_validated) == 0: return - divided = 1 # default_segment_number = 20 - _first_25_percent_links = link_to_validated[0:(int(len(all_link_list) / divided))] + random.shuffle(all_link_list) _first_25_percent_links = all_link_list # _queue_name = "REQUEST_DATA" _queue_name = MORNING_DATA_CACHE_BAK