Merge branch 'master' of git.lpaconsulting.fr:panleicim/appointment_request

This commit is contained in:
Lei PAN
2025-12-21 23:10:06 +01:00
8 changed files with 23 additions and 21 deletions
+2 -2
View File
@@ -11,7 +11,7 @@ from models.contact_pojo import ContactPojo
from models.mail_pojo import MailAddress
from models.regisered_user_pojo import RegisteredUserPojo
MONGO_DB_URL = "mongodb://mongo.lpaconsulting.fr/?timeoutMS=100000"
MONGO_DB_URL = "mongodb://mongo2.lpaconsulting.fr/?timeoutMS=100000"
CAPTCHA_ERROR_COLLECTION_PREFIX = "CAPTCHA_ERROR_"
BLACK_LIST = "BLACK_LIST"
ACCEPTED_APPOINTMENT_LIST = "ACCEPTED_APPOINTMENT_LIST"
@@ -25,7 +25,7 @@ CONTACT_LIST_SERIAL_MAP = "CONTACT_LIST_SERIAL_MAP"
class MongoDbManager:
def __init__(self):
client = MongoClient(MONGO_DB_URL, username='appointment', password='Rdv@2022', authSource='appointment')
client = MongoClient(MONGO_DB_URL, username='appointment', password='Rdv@20222021', authSource='appointment')
self.db = client.appointment
self.logger = logging.getLogger("mongoDb")
+3 -1
View File
@@ -411,7 +411,9 @@ def find_links_to_validate_from_mail_list(mail_list: List[MailAddress], logger)
if __name__ == '__main__':
# 读取联系人列表
contact_to_book_list = read_contacts(
file_name="~/Desktop/contact_list_2025-11-06.xlsx")
file_name="~/Desktop/contact_list_2025-11-28.xlsx")
# file_name="~/Desktop/contact_list_all.xlsx")
# file_name="~/Desktop/contact_list_2025-11-06.xlsx")
# 获取目标邮箱列表
all_mail_list = MONGO_STORE_MANAGER.get_destination_emails()
+4 -6
View File
@@ -99,11 +99,9 @@ def send_request_for_file_list(file_list: list, thread_number: int = 20, data_qu
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-11-06.xlsx']
file_list = ['~/Desktop/contact_list_2025-11-28.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']
send_request_for_file_list(file_list=file_list, thread_number=30,
data_queue_name=MORNING_DATA_CACHE, stop_at_hour=19, stop_at_mins=50)
send_request_for_file_list(file_list=file_list, thread_number=20,
data_queue_name=MORNING_DATA_CACHE_2, stop_at_hour=19, stop_at_mins=50)
+2 -2
View File
@@ -5,8 +5,8 @@ from link_validator_executor import start_link_validation
def start_check_results_job(sched):
sched.add_job(start_link_validation, 'cron', day_of_week='mon-sat', hour='13',
minute='48',
sched.add_job(start_link_validation, 'cron', day_of_week='mon-sun', hour='14',
minute='10',
misfire_grace_time=10,
second='10', timezone='Europe/Paris', max_instances=1, args=[])
+3 -3
View File
@@ -7,13 +7,13 @@ 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-11-06.xlsx']
send_request_for_file_list(file_list=file_list, thread_number=70,
file_list = ['~/Desktop/contact_list_2025-11-28.xlsx']
send_request_for_file_list(file_list=file_list, thread_number=73,
data_queue_name=MORNING_DATA_CACHE, stop_at_hour=11, stop_at_mins=10)
def start_check_results_job(sched):
sched.add_job(start_book_appointment, 'cron', day_of_week='mon-sat', hour='10',
sched.add_job(start_book_appointment, 'cron', day_of_week='mon-sun', hour='10',
minute='30',
misfire_grace_time=10,
second='10', timezone='Europe/Paris', max_instances=1, args=[])
+6 -6
View File
@@ -14,13 +14,13 @@ from models.jsdata_pojo import JsDataPojo
from models.result_pojo import RequestResult
from utils.get_only_datadome_cookies import get_datadome_cookies, get_app_cookies, get_lang_cookies, \
retain_only_dataome_cookies
from workers.proxy_constants import PROXY_TIMEOUT_S
API_KEY = "d66aaf490d8aa424a5175e1fbd1aadea"
HOST_ADDRESS = "https://api.2captcha.com/createTask"
HERMES_REGISTER = "https://rendezvousparis.hermes.com/client/register"
class CaptchaResultGetter:
def __init__(self):
@@ -51,7 +51,7 @@ class CaptchaResultGetter:
print(proxy_to_use)
try:
response = requests.get(url=HERMES_REGISTER, headers=headers, verify=False, proxies=proxy_to_use,
timeout=15)
timeout=PROXY_TIMEOUT_S)
print(response.status_code)
if response.status_code == 200:
print(response.text)
@@ -94,7 +94,7 @@ class CaptchaResultGetter:
raw_data = self.get_le_type_raw_data(old_valid_cookie=old_valid_cookie, js_le_type_data=js_le_type_data)
response = requests.post(url="https://d.digital.hermes/js/", headers=headers, verify=False,
data=raw_data,
proxies=proxy_to_use, timeout=15)
proxies=proxy_to_use, timeout=PROXY_TIMEOUT_S)
# print(response.status_code)
if response.status_code == 200:
print(response.text)
@@ -109,7 +109,7 @@ class CaptchaResultGetter:
return None
def get_ch_raw_data_from_js_data(self, js_data: JsDataPojo, old_valid_cookie) -> str:
_tag_version = "5.1.9"
_tag_version = "5.1.12"
_jspl = encrpte_to_jspl(js_data.to_url_encoded_json())
_raw_data = "jspl={}&eventCounters=%5B%5D&jsType=ch&cid={}&ddk=789361B674144528D0B7EE76B35826&Referer=https%253A%252F%252Frendezvousparis.hermes.com%252Fclient%252Fregister&request=%252Fclient%252Fregister&responsePage=origin&ddv={}".format(
_jspl, old_valid_cookie, _tag_version)
@@ -149,7 +149,7 @@ class CaptchaResultGetter:
response = requests.post(url="https://d.digital.hermes/js/", headers=headers, verify=False,
data=self.get_ch_raw_data_from_js_data(js_data=js_data,
old_valid_cookie=_cookies_to_use),
proxies=proxy_to_use, timeout=15)
proxies=proxy_to_use, timeout=PROXY_TIMEOUT_S)
print(response.status_code)
if response.status_code == 200:
print(response.text)
@@ -180,7 +180,7 @@ class CaptchaResultGetter:
# old_valid_cookie=old_valid_cookie)
_cid = get_datadome_cookies(old_valid_cookie)
_jspl = encrpte_to_jspl(js_le_type_data.to_url_encoded_json())
_raw_data = "jsData={}&eventCounters=%7B%22mousemove%22%3A{}%2C%22click%22%3A{}%2C%22scroll%22%3A{}%2C%22touchstart%22%3A{}%2C%22touchend%22%3A{}%2C%22touchmove%22%3A{}%2C%22keydown%22%3A{}%2C%22keyup%22%3A{}%7D&jsType=le&cid={}&ddk=789361B674144528D0B7EE76B35826&Referer=https%253A%252F%252Frendezvousparis.hermes.com%252Fclient%252Fregister&request=%252Fclient%252Fregister&responsePage=origin&ddv=5.1.9".format(
_raw_data = "jsData={}&eventCounters=%7B%22mousemove%22%3A{}%2C%22click%22%3A{}%2C%22scroll%22%3A{}%2C%22touchstart%22%3A{}%2C%22touchend%22%3A{}%2C%22touchmove%22%3A{}%2C%22keydown%22%3A{}%2C%22keyup%22%3A{}%7D&jsType=le&cid={}&ddk=789361B674144528D0B7EE76B35826&Referer=https%253A%252F%252Frendezvousparis.hermes.com%252Fclient%252Fregister&request=%252Fclient%252Fregister&responsePage=origin&ddv=5.1.12".format(
_jspl, mousemove_count, click_count, scroll_count, touch_count, touch_count,
touch_move,
key_count,
+1
View File
@@ -0,0 +1 @@
PROXY_TIMEOUT_S = 20
+2 -1
View File
@@ -13,6 +13,7 @@ from models.result_pojo import RequestResult
from queue_message.CookiesPublisher import CookiesPublisher
from utils.address_ip import get_address_ip
from workers.captcha_result_getter import CaptchaResultGetter
from workers.proxy_constants import PROXY_TIMEOUT_S
def get_chrome_version_from_ua(ua):
@@ -206,7 +207,7 @@ class Sender:
proxy_to_use = self.proxy_to_use
# print(proxy_to_use)
response = requests.post(url=url, proxies=proxy_to_use, verify=False, headers=headers, data=data,
timeout=15, allow_redirects=False, impersonate="chrome99_android")
timeout=PROXY_TIMEOUT_S, allow_redirects=False, impersonate="chrome99_android")
self.logger.info(response.status_code)
if response.status_code == 302:
# add to mongodb