Commit 0111d37f authored by wang's avatar wang

ws 测试

parent d80de2fa
......@@ -241,54 +241,54 @@ while True:
selectId = random.choice(list(envs))
# selectId = '197d94c3099d110aef4e0a52'
# if usedTime > 1:
if usedTime > 5:
# c = session.get('https://www.westjet.com/assets/app/scripts/swa-common.js').text
response = requests.post('http://52.52.23.116/tls/forward',
json=dict(url='https://www.westjet.com/resources/js/wj_common.js', headers=headers, method="GET", proxy=proxy, debug=True
, allow_redirects=True, random_tls=True
))
c1 = response.json()['text']
m5 = md5(c1)
ck = response.json()['cookies']['z0t0U8fo']
# if m5 != lastHash:
# lastHash = m5
# usedTime = 0
# logger.debug('js变化')
js_uri = re.findall('(https://www\.westjet\.com/resources/.+?)"', c1)[0]
logger.info(f'get {js_uri}' )
response = requests.post('http://52.52.23.116/tls/forward',
json=dict(url=js_uri,
headers=headers, method="GET", proxy=proxy, debug=True
, allow_redirects=True, random_tls=True
))
c2 = response.json()['text']
code = open('src2.js', 'r', encoding='utf-8').read()
with open('src_run3.js', 'w', encoding='utf-8') as f:
f.write(code + '\n\n' + ';;' + c1 + ';;;\n\n;;;' + c2
+
';;;\n\n' + '''
setTimeout(r=> {
var
xhr = new
XMLHttpRequest();
xhr.open('POST', "https://apiw.westjet.com/ecomm/booktrip/flight-search-api/v1", false);
xhr.send(`{"tripType": "oneWay", "from": "ZLA", "to": "NAS", "depart": "2023-04-11",
"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}`)
xhr.setRequestHeader('user-agent', ENV.navigatorparams.useragent)
//xhr.setRequestHeader('xhr_url', xhr_url)
//xhr.setRequestHeader('xhr_res', xhr_res)
print22(JSON.stringify(xhr.headers))
_process.exit(0)
}, 1000)
'''
)
# f.write(code + '\n\n' + get_random_location() + ';;' + c)
response = requests.post('http://52.52.23.116/tls/forward',
json=dict(url='https://www.westjet.com/resources/js/wj_common.js', headers=headers, method="GET", proxy=proxy, debug=True
, allow_redirects=True, random_tls=True
))
c1 = response.json()['text']
m5 = md5(c1)
ck = response.json()['cookies']['z0t0U8fo']
if m5 != lastHash:
lastHash = m5
usedTime = 0
logger.debug('js变化')
js_uri = re.findall('(https://www\.westjet\.com/resources/.+?)"', c1)[0]
logger.info(f'get {js_uri}' )
response = requests.post('http://52.52.23.116/tls/forward',
json=dict(url=js_uri,
headers=headers, method="GET", proxy=proxy, debug=True
, allow_redirects=True, random_tls=True
))
c2 = response.json()['text']
code = open('src2.js', 'r', encoding='utf-8').read()
with open('src_run3.js', 'w', encoding='utf-8') as f:
f.write(code + '\n\n' + ';;' + c1 + ';;;\n\n;;;' + c2
+
';;;\n\n' + '''
setTimeout(r=> {
var
xhr = new
XMLHttpRequest();
xhr.open('POST', "https://apiw.westjet.com/ecomm/booktrip/flight-search-api/v1", false);
xhr.send(`{"tripType": "oneWay", "from": "ZLA", "to": "NAS", "depart": "2023-04-11",
"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}`)
xhr.setRequestHeader('user-agent', ENV.navigatorparams.useragent)
//xhr.setRequestHeader('xhr_url', xhr_url)
//xhr.setRequestHeader('xhr_res', xhr_res)
print22(JSON.stringify(xhr.headers))
_process.exit(0)
}, 1000)
'''
)
# f.write(code + '\n\n' + get_random_location() + ';;' + c)
t1 = time.time()
# token = list(db.token_shape.aggregate( [ {'$match': {'update_time':{'$gte': int(time.time() * 1000) - 60*60*12}}}, { '$sample': { 'size': 1 } } ] ))[0]['_id']
......
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