Commit f9e97ba7 authored by wang's avatar wang

收集更多信息

parent 9b0abeb8
...@@ -80,7 +80,7 @@ for i in range(100): ...@@ -80,7 +80,7 @@ for i in range(100):
# selectId = 'a74b38e7115cf4d1b1f6976c' # selectId = 'a74b38e7115cf4d1b1f6976c'
c = session.get('https://www.jetblue.com/js/src/jb-74873.js', insecure_skip_verify=True).text c = session.get('https://www.jetblue.com/js/src/jb-74873.js', insecure_skip_verify=True).text
m5 = md5(c) m5 = md5(c)
if m5 != lastHash and usedTime > 2: if m5 != lastHash and usedTime > 5:
lastHash = m5 lastHash = m5
usedTime = 0 usedTime = 0
logger.debug('js变化') logger.debug('js变化')
...@@ -96,7 +96,7 @@ for i in range(100): ...@@ -96,7 +96,7 @@ for i in range(100):
# p = subprocess.Popen(['node', 'js_dom_run.js', selectId, '11'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, # p = subprocess.Popen(['node', 'js_dom_run.js', selectId, '11'], stdin=subprocess.PIPE, stdout=subprocess.PIPE,
# p = subprocess.Popen(['node', 'src_run_chrome_105.js', selectId, '11'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, # p = subprocess.Popen(['node', 'src_run_chrome_105.js', selectId, '11'], stdin=subprocess.PIPE, stdout=subprocess.PIPE,
# p = subprocess.Popen(['node', 'src_run_company_chrome.js', selectId, '11'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, # p = subprocess.Popen(['node', 'src_run_company_chrome.js', selectId, '11'], stdin=subprocess.PIPE, stdout=subprocess.PIPE,
p = subprocess.Popen(['node', 'src_run1.js', selectId, '11'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, p = subprocess.Popen(['node', 'src_run.js', selectId, '11'], stdin=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.PIPE) stderr=subprocess.PIPE)
output, err = p.communicate(timeout=10) output, err = p.communicate(timeout=10)
tmp = '' tmp = ''
...@@ -105,71 +105,71 @@ for i in range(100): ...@@ -105,71 +105,71 @@ for i in range(100):
else: else:
raise Exception(selectId) raise Exception(selectId)
r = json.loads(tmp) r = json.loads(tmp)
res = db.env_shape.update_one( # res = db.env_shape.update_one(
{'_id': ObjectId(selectId)}, # {'_id': ObjectId(selectId)},
{"$inc": {"used": 1}} # {"$inc": {"used": 1}}
) # )
usedTime += 1 usedTime += 1
headers.update(r) headers.update(r)
# headers = r # headers = r
logger.info(f"success:{success} total:{total} {(time.time() - t1) *1000:.3f}ms {len(headers['X-1ItxWO9i-a'.lower()])} {selectId} {headers['user-agent']}") logger.info(f"success:{success} total:{total} {(time.time() - t1) *1000:.3f}ms {len(headers['X-1ItxWO9i-a'.lower()])} {selectId} {headers['user-agent']}")
# logger.info(f"success:{success} {(time.time() - t1) *1000:.3f}ms {headers['X-1ItxWO9i-a'.lower()]}") # logger.info(f"success:{success} {(time.time() - t1) *1000:.3f}ms {headers['X-1ItxWO9i-a'.lower()]}")
url = "https://jbrest.jetblue.com/lfs-rwb/outboundLFS" # url = "https://jbrest.jetblue.com/lfs-rwb/outboundLFS"
data = { # data = {
"tripType": "oneWay", # "tripType": "oneWay",
"from": "LAS", # "from": "LAS",
"to": "BOS", # "to": "BOS",
"depart": "2023-05-10", # "depart": "2023-05-10",
"cabin": "economy", # "cabin": "economy",
"refundable": False, # "refundable": False,
"dates": { # "dates": {
"before": "3", # "before": "3",
"after": "3" # "after": "3"
}, # },
"pax": { # "pax": {
"ADT": 1, # "ADT": 1,
"CHD": 0, # "CHD": 0,
"INF": 0, # "INF": 0,
"UNN": 0 # "UNN": 0
}, # },
"redempoint": False, # "redempoint": False,
"pointsBreakup": { # "pointsBreakup": {
"option": "", # "option": "",
"value": 0 # "value": 0
}, # },
"isMultiCity": False, # "isMultiCity": False,
"isDomestic": False # "isDomestic": False
} # }
#
# session = requests.Session() # # session = requests.Session()
#
# response = session.post(url, headers=headers, json=data, insecure_skip_verify=True)
# logger.info(f'tls:{tlsV} proxy:{proxy} res:: {response.status_code}')
# total += 1
# # print(response.text)
# if response.status_code != 403:
# res = db.env_shape.update_one(
# {'_id': ObjectId(selectId)},
# {"$inc": {"success": 1}}
# )
# # proxy = requests.post('http://ymx-lcc.unififi.com/proxy/get-proxy', json={
# # 'type':'headerB6'
# # })
response = session.post(url, headers=headers, json=data, insecure_skip_verify=True) uri = 'http://ymx-lcc.unififi.com/header/add'
logger.info(f'tls:{tlsV} proxy:{proxy} res:: {response.status_code}') proxy = f'http://unfflcc:76cc14-47b8dd-1f8ace-827836-0c740e@usa.rotating.proxyrack.net:{int(random.randint(10000, 11149))}'
total += 1 r = requests.post(uri, json={
# print(response.text) 'brush_fromto': 'LAS-BOS',
if response.status_code != 403: 'brush_fromdate': '2023-05-26',
res = db.env_shape.update_one( 'brush_header': headers,
{'_id': ObjectId(selectId)}, 'brush_proxy': proxy,
{"$inc": {"success": 1}} 'brush_mode': 'shopping',
) 'brush_name': 'jsr',
# proxy = requests.post('http://ymx-lcc.unififi.com/proxy/get-proxy', json={ 'brush_type': 'headerB6',
# 'type':'headerB6' })
# }) success += 1
logger.success(f'添加成功 {success}')
uri = 'http://ymx-lcc.unififi.com/header/add'
proxy = f'http://unfflcc:76cc14-47b8dd-1f8ace-827836-0c740e@usa.rotating.proxyrack.net:{int(random.randint(10000, 11149))}'
r = requests.post(uri, json={
'brush_fromto': 'LAS-BOS',
'brush_fromdate': '2023-05-26',
'brush_header': headers,
'brush_proxy': proxy,
'brush_mode': 'shopping',
'brush_name': 'jsr',
'brush_type': 'headerB6',
})
success += 1
logger.success(f'添加成功 {success}')
# time.sleep(3) # time.sleep(3)
except Exception as e: except Exception as e:
print(e) print(e)
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment