save phone model
This commit is contained in:
+6
-4
@@ -38,7 +38,8 @@ class Sender:
|
||||
self.proxy_to_use = proxy_to_use
|
||||
self.cookie.load(self.cookie_str)
|
||||
|
||||
def publish_message_to_queue(self, contact: ContactPojo, status: PublishType, url: str, store_type: str):
|
||||
def publish_message_to_queue(self, contact: ContactPojo, status: PublishType, url: str, store_type: str,
|
||||
model: str = ""):
|
||||
# create the message
|
||||
if url == "https://rendezvousparis.hermes.com/client/welcome":
|
||||
return
|
||||
@@ -59,11 +60,12 @@ class Sender:
|
||||
result.proxy = "data_impulse"
|
||||
result.id = id
|
||||
result.store_type = store_type
|
||||
result.model = model
|
||||
result.created_at = time.strftime("%H:%M:%S", time.localtime())
|
||||
collection_name = str(datetime.date.today())
|
||||
MONGO_STORE_MANAGER.insert_reserve_result(collection_name=collection_name, reserve=result)
|
||||
|
||||
def apply_redirect(self, response, old_headers, contact, js_data, selected_store):
|
||||
def apply_redirect(self, response, old_headers, contact, js_data, selected_store, model=""):
|
||||
# /client/register/5XD2E2
|
||||
_res_headers = response.headers
|
||||
_location = _res_headers['location']
|
||||
@@ -87,7 +89,7 @@ class Sender:
|
||||
contact.current_ip = get_address_ip(proxy_to_use=self.proxy_to_use)
|
||||
_appointment_url = _redirect_url
|
||||
self.publish_message_to_queue(contact, status=PublishType.SUCCESS, url=_appointment_url,
|
||||
store_type=selected_store)
|
||||
store_type=selected_store, model=model)
|
||||
self.cookie.load(_cookies_to_set)
|
||||
new_cookies = {k: v.value for k, v in self.cookie.items()}
|
||||
new_coolies_str = ""
|
||||
@@ -175,7 +177,7 @@ class Sender:
|
||||
# add to mongodb
|
||||
self.logger.info(response.text)
|
||||
self.apply_redirect(response=response, old_headers=headers, contact=contact, js_data=js_data,
|
||||
selected_store=_selected_store)
|
||||
selected_store=_selected_store, model=model)
|
||||
# self.logger.info("{}:{}".format(contact.mail, response.url))
|
||||
# contact.ua = js_data.ua
|
||||
# contact.current_ip = get_address_ip(proxy_to_use=proxy_to_use)
|
||||
|
||||
Reference in New Issue
Block a user