diff --git a/build.sh b/build.sh index d2cc3d5..7cf5d01 100644 --- a/build.sh +++ b/build.sh @@ -3,14 +3,16 @@ if [[ -d $dest_dir ]] then echo "$dest_dir exists on your filesystem." else - mkdir -p $dest_dir + mkdir -p $dest_dir fi if [[ "$OSTYPE" == "msys" ]] then -./venv/Scripts/pyarmor.exe obfuscate --recursive --output $dest_dir/src src/__init__.py + ./venv/Scripts/pyarmor.exe obfuscate --recursive --output $dest_dir/src src/__init__.py else - pyarmor obfuscate --recursive --output $dest_dir/src src/__init__.py + echo "will obfuscate the source code" + pyarmor obfuscate --recursive --output $dest_dir/src src/__init__.py fi cp main.py $dest_dir cp appointment.py $dest_dir -cp requirements.txt $dest_dir \ No newline at end of file +cp requirements.txt $dest_dir +cp server.py $dest_dir \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 176f07b..507fb15 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,12 +10,9 @@ wget==3.2.0 pocketsphinx==0.1.15 oci~=2.54.1 XlsxWriter~=3.0.3 -playwright-stealth==1.0.5 boto3~=1.21.13 openpyxl==3.0.9 google-cloud-firestore==2.4.0 PySimpleGUI==4.60.1 -SQLAlchemy~=1.4.37 requests~=2.27.1 -sqlalchemy_utils~=0.38.2 Mako~=1.2.0 \ No newline at end of file diff --git a/src/mail/mail_reader.py b/src/mail/mail_reader.py index 9c11cda..20637a1 100644 --- a/src/mail/mail_reader.py +++ b/src/mail/mail_reader.py @@ -145,7 +145,8 @@ def need_to_valid_url(url: str, successful_items) -> bool: def need_to_check_email(mail: str, successful_items) -> bool: - # return True + return True + print("successful_items size is " + str(len(successful_items))) for item in successful_items: if mail in item.email: if item.url_validated is not None: @@ -181,7 +182,7 @@ def read_mails(): mail_reader = MailReader(mail.mail, mail.password) executor.submit(mail_reader.read_emails, mails_messages) - with ThreadPoolExecutor(max_workers=5) as executor: + with ThreadPoolExecutor(max_workers=8) as executor: for mail in mails_messages: match = re.search(VALIDATION_URL_REGEX, mail.body) if match: @@ -189,7 +190,7 @@ def read_mails(): if need_to_valid_url(url, successful_items): url_validator = LinkValidator(url) print("need to validate url: " + url) - executor.submit(url_validator.start_page, params.get_proxy(ProxyType.RESIDENTIAL), True) + executor.submit(url_validator.start_page, params.get_proxy(ProxyType.RESIDENTIAL), False) else: print("do not need to click url --> {}".format(mail.mail_address)) diff --git a/src/utils/excel_reader.py b/src/utils/excel_reader.py index 8fa39f2..1345fcc 100644 --- a/src/utils/excel_reader.py +++ b/src/utils/excel_reader.py @@ -212,12 +212,12 @@ def save_mails_to_db(): if __name__ == '__main__': - excel_reader = ExcelHelper() - contacts = excel_reader.read_names("/Users/lpan/Documents/rdv/随机/22-09-2022/随机10.xlsx") - print(contacts) - write_new_contacts_to_excel(valid_contacts=contacts) + # excel_reader = ExcelHelper() + # contacts = excel_reader.read_names("/Users/lpan/Documents/rdv/随机/28-09-2022/随机.xlsx") + # print(contacts) + # write_new_contacts_to_excel(valid_contacts=contacts) - # save_mails_to_db() + save_mails_to_db() # for mail in excel_reader.read_mails_and_pwd(): # MONGO_STORE_MANAGER.insert_email(mail) # for i in range(1, 64): diff --git a/src/utils/generate_random_passport_id.py b/src/utils/generate_random_passport_id.py index edc84e0..3e4f32b 100644 --- a/src/utils/generate_random_passport_id.py +++ b/src/utils/generate_random_passport_id.py @@ -6,7 +6,8 @@ import string from src.pojo.captcha_error_contact_pojo import ContactInErrorPojo from src.pojo.contact_pojo import ContactPojo -letters = ['E', 'G', 'M'] +# letters = ['E', 'G', 'M'] +letters = ['E'] prefix_tire_de_sejour = "9918" @@ -55,7 +56,7 @@ def generate_titre_sejour_number(size=10) -> list: if __name__ == '__main__': # for i in range(1,200): # print(get_random_id_number()) - # for i in range(1, 804): - # print(get_random_id_number()) + # for i in range(1, 501): + # print(get_random_passport_id_number()) for id in generate_titre_sejour_number(500): print(id)