Commit 11879868 authored by wang's avatar wang

1

parent c901f6a4
Pipeline #462 canceled with stages
......@@ -4,7 +4,7 @@ import random
import subprocess
import time
from pathlib import Path
import tempfile
import tls_client
from loguru import logger
......@@ -66,23 +66,21 @@ class Reese84ByPass(object):
t1 = time.time()
r1 = self.__session.get('https://www.volaris.com/Germand-and-haue-lent-Layest-Lord-former-Guill-m')
self.log.log('REQU', f'JSURL: code:{r1.status_code} cost:{(time.time() - t1):.3f}s')
a, filename = tempfile.mkstemp()
envCode = open(work_dir + 'src/run.js', 'r').read()
with open(work_dir + 'src/vm_env.js', 'w') as f:
f.write(envCode + r1.text)
t2 = time.time()
p = subprocess.Popen(['node', f'{work_dir}src/vm_env.js'], stdin=subprocess.PIPE, stdout=subprocess.PIPE,
p = subprocess.Popen(['node', f'{work_dir}src/vm_env.js' ,filename], stdin=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
output, err = p.communicate(timeout=10)
if p.returncode == 0:
datas = output.decode().split('\n')
else:
raise Exception("执行 JS 超时")
print(filename)
self.log.log('VMJS', f'执行JS: cost:{(time.time() - t2):.3f}s')
try:
data = json.loads(datas[-2])
except:
data = json.loads(datas[-1])
data = json.loads(open(filename,'r').read())
# print(len(data['solution']['interrogation']['p']))
t3 = time.time()
......
......@@ -981,7 +981,7 @@ window.cancelAnimationFrame = function cancelAnimationFrame() {
window.fetch = function (url, options) {
// console.log('fetch', url, options)
_console(options.body)
// fss.writeFileSync('data.txt', options.body)
process.argv[2] && fss.writeFileSync(process.argv[2], options.body)
process.exit(0)
// console.log(JSON.stringify(window.fonts))
}
......
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