Commit 8b09d391 authored by wang's avatar wang

收集更多信息

parent 8d1f1c4e
...@@ -62,88 +62,88 @@ code = open('src.js', 'r', encoding='utf-8').read() ...@@ -62,88 +62,88 @@ code = open('src.js', 'r', encoding='utf-8').read()
code1 = open('js_dom_run.js', 'r', encoding='utf-8').read() code1 = open('js_dom_run.js', 'r', encoding='utf-8').read()
for i in range(100): for i in range(100):
selectId = random.choice(list(envs)) selectId = random.choice(list(envs))
# selectId = '55a8fe24a752595e774341d6' try:
proxy = f'http://unfflcc:76cc14-47b8dd-1f8ace-827836-0c740e@usa.rotating.proxyrack.net:{int(random.randint(10000, 11149))}' # selectId = '55a8fe24a752595e774341d6'
# proxy = f'http://unfflcc:76cc14-47b8dd-1f8ace-827836-0c740e@198.147.25.26:{int(random.randint(10000, 11149))}' proxy = f'http://unfflcc:76cc14-47b8dd-1f8ace-827836-0c740e@usa.rotating.proxyrack.net:{int(random.randint(10000, 11149))}'
# proxy = 'http://user-unifflcc-region-us:q39CEBTs5A5YQXor@pr.roxlabs.cn:4600' # proxy = f'http://unfflcc:76cc14-47b8dd-1f8ace-827836-0c740e@198.147.25.26:{int(random.randint(10000, 11149))}'
if platform.uname().system == 'Darwin': # proxy = 'http://user-unifflcc-region-us:q39CEBTs5A5YQXor@pr.roxlabs.cn:4600'
proxy = 'http://127.0.0.1:7890' if platform.uname().system == 'Darwin':
tlsV = f'chrome_{random.randint(105, 113)}' proxy = 'http://127.0.0.1:7890'
tlsV = 'chrome_112' tlsV = f'chrome_{random.randint(105, 113)}'
session = tls_client.Session(tlsV) tlsV = 'chrome_112'
session.proxies = { session = tls_client.Session(tlsV)
'http': proxy, session.proxies = {
'https': proxy, 'http': proxy,
'https': proxy,
} }
# 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 > 2:
lastHash = m5 lastHash = m5
usedTime = 0 usedTime = 0
logger.debug('js变化') logger.debug('js变化')
code = open('src.js', 'r', encoding='utf-8').read() code = open('src.js', 'r', encoding='utf-8').read()
code1 = open('js_dom_run.js', 'r', encoding='utf-8').read() code1 = open('js_dom_run.js', 'r', encoding='utf-8').read()
with open('src_run1.js', 'w', encoding='utf-8') as f: with open('src_run1.js', 'w', encoding='utf-8') as f:
f.write(code + '\n\n' + c) f.write(code + '\n\n' + c)
# # with open('js_dom_run1.js', 'w', encoding='utf-8') as f: # # with open('js_dom_run1.js', 'w', encoding='utf-8') as f:
# # f.write(code1 + '\n\n' + c)` # # f.write(code1 + '\n\n' + c)`
t1 = time.time() t1 = time.time()
# r = requests.get('http://127.0.0.1:5000/getinfo').json()['message'] # r = requests.get('http://127.0.0.1:5000/getinfo').json()['message']
# r = requests.get('http://127.0.0.1:3001').json() # r = requests.get('http://127.0.0.1:3001').json()
# 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_run1.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 = ''
if p.returncode == 0: if p.returncode == 0:
tmp = output.decode().split('\n')[-2] tmp = output.decode().split('\n')[-2]
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:{i+1} {(time.time() - t1) *1000:.3f}ms {len(headers['X-1ItxWO9i-a'.lower()])} {selectId} {headers['user-agent']}") logger.info(f"success:{success} total:{i+1} {(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()
try:
response = session.post(url, headers=headers, json=data, insecure_skip_verify=True) response = session.post(url, headers=headers, json=data, insecure_skip_verify=True)
logger.info(f'tls:{tlsV} proxy:{proxy} res:: {response.status_code}') logger.info(f'tls:{tlsV} proxy:{proxy} res:: {response.status_code}')
......
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