diff --git a/contact_all.xlsx b/contact_all.xlsx index d109f01..2d502af 100644 Binary files a/contact_all.xlsx and b/contact_all.xlsx differ diff --git a/main.py b/main.py index dc14c4d..8499b57 100644 --- a/main.py +++ b/main.py @@ -7,8 +7,6 @@ from logs.AppLogging import init_logger from utils.excel_reader import ExcelHelper from workers.commandor_page import CommandorPage -OTP_TIMEOUT = 240 -current_gsm_modem = None # used to save the current slot position init_logger() @@ -19,11 +17,11 @@ logger.addHandler(logging.StreamHandler(stream=sys.stdout)) def start_book(start_number, end_number, store=0): # read the contact, and contact the 2 objects together excel_reader = ExcelHelper() - contacts = excel_reader.read_contacts()[start_number - 1: end_number - 1] + contacts = excel_reader.read_contacts()[start_number - 1: end_number] print(contacts) - with ThreadPoolExecutor(max_workers=10) as executor: + with ThreadPoolExecutor(max_workers=1) as executor: for contact in contacts: - proxy = get_proxy(contact.phone_number) + proxy = get_proxy(contact.phone) commandor = CommandorPage(contact, store_type=store) # start the task in thread executor.submit(commandor.start_page, proxy) @@ -42,5 +40,5 @@ def get_proxy(phone_number): if __name__ == '__main__': - # 修改起始行,结束行, 第三个参数store等于0的时候是随机,传入1的时候是总店 - start_book(2, 18, store=0) + # 修改联系人行,结束联系人行 第三个参数store等于0的时候是随机,传入1的时候是总店 + start_book(1, 1, store=0) diff --git a/pojo/contact_pojo.py b/pojo/contact_pojo.py index fccf059..77ef414 100644 --- a/pojo/contact_pojo.py +++ b/pojo/contact_pojo.py @@ -11,8 +11,9 @@ class ContactPojo: ccid: str position: int - def __init__(self, phone_number: str, passport_number: str, last_name: str, first_name: str, ccid: str, mail: str, - position: int): + def __init__(self, phone_number: str, passport_number: str, last_name: str, first_name: str, mail: str, + ccid: str = "", + position: int = 0): self.phone = phone_number self.passport = passport_number self.last_name = last_name diff --git a/utils/excel_reader.py b/utils/excel_reader.py index ced33ba..84d8aba 100644 --- a/utils/excel_reader.py +++ b/utils/excel_reader.py @@ -72,9 +72,7 @@ class ExcelHelper: contact = ContactPojo(phone_number=contact_dict['phone'], last_name=last_name, first_name=first_name, - ccid=contact_dict['ccid'], passport_number=contact_dict['passport'], - position=contact_dict['position'], mail=contact_dict['email']) contact_list.append(contact) return contact_list diff --git a/workers/commandor_page.py b/workers/commandor_page.py index a36b0a9..2094aad 100644 --- a/workers/commandor_page.py +++ b/workers/commandor_page.py @@ -13,10 +13,10 @@ from pojo.ReserveResultPojo import ReserveResultPojo, PublishType from pojo.contact_pojo import ContactPojo from utils.excel_reader import ExcelHelper -# RDV_URL = "https://rendezvousparis.hermes.com/client/register" +RDV_URL = "https://rendezvousparis.hermes.com/client/register" # RDV_URL = "file:///Users/lpan/Downloads/test_appointment.html" -RDV_URL = "https://api.ipify.org" +# RDV_URL = "https://api.ipify.org" # RDV_URL ="https://bot.sannysoft.com/" otp_value = None user_agent_list = ExcelHelper().read_user_agent_list()