Commit f9e97ba7 authored by wang's avatar wang

收集更多信息

parent 9b0abeb8
......@@ -80,7 +80,7 @@ for i in range(100):
# selectId = 'a74b38e7115cf4d1b1f6976c'
c = session.get('https://www.jetblue.com/js/src/jb-74873.js', insecure_skip_verify=True).text
m5 = md5(c)
if m5 != lastHash and usedTime > 2:
if m5 != lastHash and usedTime > 5:
lastHash = m5
usedTime = 0
logger.debug('js变化')
......@@ -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', '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_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)
output, err = p.communicate(timeout=10)
tmp = ''
......@@ -105,71 +105,71 @@ for i in range(100):
else:
raise Exception(selectId)
r = json.loads(tmp)
res = db.env_shape.update_one(
{'_id': ObjectId(selectId)},
{"$inc": {"used": 1}}
)
# res = db.env_shape.update_one(
# {'_id': ObjectId(selectId)},
# {"$inc": {"used": 1}}
# )
usedTime += 1
headers.update(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} {(time.time() - t1) *1000:.3f}ms {headers['X-1ItxWO9i-a'.lower()]}")
url = "https://jbrest.jetblue.com/lfs-rwb/outboundLFS"
data = {
"tripType": "oneWay",
"from": "LAS",
"to": "BOS",
"depart": "2023-05-10",
"cabin": "economy",
"refundable": False,
"dates": {
"before": "3",
"after": "3"
},
"pax": {
"ADT": 1,
"CHD": 0,
"INF": 0,
"UNN": 0
},
"redempoint": False,
"pointsBreakup": {
"option": "",
"value": 0
},
"isMultiCity": False,
"isDomestic": False
}
# session = requests.Session()
# url = "https://jbrest.jetblue.com/lfs-rwb/outboundLFS"
# data = {
# "tripType": "oneWay",
# "from": "LAS",
# "to": "BOS",
# "depart": "2023-05-10",
# "cabin": "economy",
# "refundable": False,
# "dates": {
# "before": "3",
# "after": "3"
# },
# "pax": {
# "ADT": 1,
# "CHD": 0,
# "INF": 0,
# "UNN": 0
# },
# "redempoint": False,
# "pointsBreakup": {
# "option": "",
# "value": 0
# },
# "isMultiCity": False,
# "isDomestic": False
# }
#
# # 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)
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'
# })
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}')
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)
except Exception as 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