Commit 92dd977b authored by wang's avatar wang

添加环境提取

parent 4b360d8d
import log4js from 'log4js'
import qs from 'qs'
import {genPc, genUuid, ie, randint} from "./utils.js"
import {genUuid, ie, randint} from "./utils.js"
import axios from "axios";
import {encodePayload} from './encodepayload.js'
import {PxEnv} from './px.js'
import * as fs from "fs";
import {getPayload} from "./all.js";
......@@ -145,7 +143,7 @@ class PxBypass {
// body = this.updateBody(body);
let body = getPayload(this.uuid, this.vid, this.sid, this.px755, this.ts, this.cts, data, undefined,this.appId,this.tag,this.ft)
let body = getPayload(this.uuid, this.vid, this.sid, this.px755, this.ts, this.cts, data, undefined, this.appId, this.tag, this.ft)
// this.log.info(body)
let res = await axios.post(this.tlsUrl, JSON.stringify({
......@@ -355,56 +353,63 @@ class PxBypass {
}
async function run() {
let res = await axios.get('http://ymx-lcc.unififi.com/header/task/pull/cookieF9?brush_name=test')
let data = res.data;
// if r.json()['status'] != 0:
// # logger.debug(f'不需要刷值')
// # time.sleep(10)
// # continue
if (data.status === 0) {
for (let i = 0; i < 10; i++) {
while (true) {
try {
let px = new PxBypass()
let res = await axios.get('http://ymx-lcc.unififi.com/header/task/pull/cookieF9?brush_name=test')
let data = res.data;
// if r.json()['status'] != 0:
// # logger.debug(f'不需要刷值')
// # time.sleep(10)
// # continue
if (data.status === 0) {
for (let i = 0; i < 10; i++) {
try {
let px = new PxBypass()
await px.step1()
// await px.test()
await px.step2()
// await sleep(1500)
await px.step3()
if (px.check()) {
continue
}
await sleep(1000)
await px.step4()
if (px.check()) {
continue
}
// await sleep(1500)
await px.test()
// await px.add_headers()
await sleep(1000)
} catch (e) {
console.log(e)
} finally {
await sleep(1000)
}
await px.step1()
// await px.test()
await px.step2()
// await sleep(1500)
await px.step3()
if (px.check()) {
continue
}
await sleep(1000)
}
await px.step4()
if (px.check()) {
continue
}
// await sleep(1500)
await px.test()
// await px.add_headers()
await sleep(1000)
await sleep(10000)
} catch (e) {
console.log(e)
}finally {
await sleep(1000)
}
}
}
await sleep(10000)
// }
}
while (true){
run();
}
run();
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