Commit 2f3640d1 authored by wang's avatar wang

详细对比

parent f1bb74e6
This diff is collapsed.
This diff is collapsed.
......@@ -2,12 +2,17 @@ import platform
import random
import subprocess
import time
import loguru
import requests
import json
import tls_client
from bson import ObjectId
import hashlib
from pymongo import MongoClient
from loguru import logger
def md5(text):
......@@ -72,19 +77,19 @@ for i in range(100):
if m5 != lastHash and usedTime > 2:
lastHash = m5
usedTime = 0
print('js变化')
logger.debug('js变化')
selectId = random.choice(list(envs))
code = open('src.js', 'r').read()
code1 = open('js_dom_run.js', 'r').read()
# with open('src_run1.js', 'w') as f:
# f.write(code + '\n\n' + c)
with open('src_run1.js', 'w') as f:
f.write(code + '\n\n' + c)
# with open('js_dom_run1.js', 'w') as f:
# f.write(code1 + '\n\n' + c)`
t1 = time.time()
# r = requests.get('http://127.0.0.1:5000/getinfo').json()['message']
# r = requests.get('http://127.0.0.1:3001').json()
# p = subprocess.Popen(['node', 'js_dom_run.js', selectId], stdin=subprocess.PIPE, stdout=subprocess.PIPE,
p = subprocess.Popen(['node', 'src_run.js', selectId], stdin=subprocess.PIPE, stdout=subprocess.PIPE,
p = subprocess.Popen(['node', 'src_run.js', selectId, '11'], stdin=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
......@@ -103,8 +108,7 @@ for i in range(100):
headers.update(r)
# headers = r
print(f'{(time.time() - t1) *1000:.3f}ms', len(headers['X-1ItxWO9i-a'.lower()]))
print(selectId, headers['user-agent'])
logger.info(f"{(time.time() - t1) *1000:.3f}ms {len(headers['X-1ItxWO9i-a'.lower()])} {selectId} {headers['user-agent']}")
url = "https://jbrest.jetblue.com/lfs-rwb/outboundLFS"
data = {
"tripType": "oneWay",
......@@ -134,11 +138,10 @@ for i in range(100):
# session = requests.Session()
print(tlsV, proxy)
response = session.post(url, headers=headers, json=data)
logger.info(f'tls:{tlsV} proxy:{proxy} res:: {response.status_code}')
# print(response.text)
print(response.status_code)
if response.status_code != 403:
res = db.env_shape.update_one(
{'_id': ObjectId(selectId)},
......@@ -150,8 +153,6 @@ for i in range(100):
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))}'
print(selectId, headers)
r = requests.post(uri, json={
'brush_fromto': 'LAS-BOS',
'brush_fromdate': '2023-05-26',
......@@ -161,5 +162,5 @@ for i in range(100):
'brush_name':'js',
'brush_type':'headerB6',
})
print('添加成功')
logger.success('添加成功')
# time.sleep(3)
This diff is collapsed.
......@@ -259,37 +259,37 @@ function Window(options) {
// vm initialization is deferred until script processing is activated
this._globalProxy = this;
// this._globalProxy = new Proxy(this._globalProxy, {
// get(target, p, receiver) {
// // if (p === 'addEventListener'){
// // debugger;
// // }
// let res = Reflect.get(target, p, receiver);
// if (!['Object','Window' , 'debug','Math', 'Array', '_random'].includes(p)){
// console.log('window get', p, typeof res)
//
// }
// // if (p === 'StyleSheet'){
// // debugger;
// // }
// // console.log(Reflect.get(target, '_cf_chl_ctx', receiver))
//
// if (
// !['_registeredHandlers', 'window', '_currentEvent','debug','_eventListenerss','JSON', 'Math'].includes(p) &&
// res && typeof res === 'object' && typeof p !== 'symbol') {
// return proxy(res, p)
// }
// return res;
// },
// // set(target, p, newValue, receiver) {
// // console.log('set window', p, newValue)
// // if (typeof newValue === 'string' && newValue.startsWith('3g')) {
// // _console(newValue)
// // // process.exit(0)
// // }
// // return Reflect.set(target, p, newValue, receiver)
// // }
// })
this._globalProxy = new Proxy(this._globalProxy, {
get(target, p, receiver) {
// if (p === 'addEventListener'){
// debugger;
// }
let res = Reflect.get(target, p, receiver);
if (!['Object','Window' , 'debug','Math', 'Array', '_random'].includes(p)){
console.log('window get', p, typeof res)
}
// if (p === 'StyleSheet'){
// debugger;
// }
// console.log(Reflect.get(target, '_cf_chl_ctx', receiver))
if (
!['_registeredHandlers', 'window', '_currentEvent','debug','_eventListenerss','JSON', 'Math'].includes(p) &&
res && typeof res === 'object' && typeof p !== 'symbol') {
return proxy(res, p)
}
return res;
},
// set(target, p, newValue, receiver) {
// console.log('set window', p, newValue)
// if (typeof newValue === 'string' && newValue.startsWith('3g')) {
// _console(newValue)
// // process.exit(0)
// }
// return Reflect.set(target, p, newValue, receiver)
// }
})
Object.defineProperty(idlUtils.implForWrapper(this), idlUtils.wrapperSymbol, { get: () => this._globalProxy });
// List options explicitly to be clear which are passed through
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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