Commit ab409dd2 authored by wang's avatar wang

ws 测试

parent d6be9a5e
...@@ -191,6 +191,9 @@ headers = { ...@@ -191,6 +191,9 @@ headers = {
success = 0 success = 0
total = 0 total = 0
token = '' token = ''
run_js_md5 = ''
run_js_cache = ''
run_js_code = ''
while True: while True:
r = requests.get('http://aws-lcc.unififi.com/header/task/pull/cookieWS?brush_name=test') r = requests.get('http://aws-lcc.unififi.com/header/task/pull/cookieWS?brush_name=test')
if platform.uname().system == 'Darwin': if platform.uname().system == 'Darwin':
...@@ -257,16 +260,20 @@ while True: ...@@ -257,16 +260,20 @@ while True:
usedTime = 0 usedTime = 0
logger.debug('js变化') logger.debug('js变化')
js_uri = re.findall('(https://www\.westjet\.com/resources/.+?)"', c1)[0] js_uri = re.findall('(https://www\.westjet\.com/resources/.+?)"', c1)[0]
logger.info(f'get {js_uri}' )
if run_js_cache != js_uri:
logger.info(f'get {js_uri}')
run_js_cache = js_uri
response = requests.post('http://52.52.23.116/tls/forward', response = requests.post('http://52.52.23.116/tls/forward',
json=dict(url=js_uri, json=dict(url=js_uri,
headers=headers, method="GET", proxy=proxy, debug=True headers=headers, method="GET", proxy=proxy, debug=True
, allow_redirects=True, random_tls=True , allow_redirects=True, random_tls=True
)) ))
c2 = response.json()['text'] c2 = response.json()['text']
run_js_code = c2
code = open('src2.js', 'r', encoding='utf-8').read() code = open('src2.js', 'r', encoding='utf-8').read()
with open('src_run3.js', 'w', encoding='utf-8') as f: with open('src_run3.js', 'w', encoding='utf-8') as f:
f.write(code + '\n\n' + ';;' + c1 + ';;;\n\n;;;' + c2 f.write(code + '\n\n' + ';;' + c1 + ';;;\n\n;;;' + run_js_code
+ +
';;;\n\n' + ''' ';;;\n\n' + '''
......
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