Commit 8f4c8ab9 authored by wang's avatar wang

收集环境

parent 64aebf22
...@@ -496,6 +496,10 @@ try { ...@@ -496,6 +496,10 @@ try {
} }
var d2; var d2;
try { try {
function bl(t, e) {
var n = document.createElement("canvas");
return n.width = t || 2e3, n.height = e || 200, n.style.display = "inline", n;
}
var r = bl(650, 12); var r = bl(650, 12);
if (r) { if (r) {
var a = Al(r); var a = Al(r);
......
...@@ -4874,6 +4874,62 @@ class PxBypass { ...@@ -4874,6 +4874,62 @@ class PxBypass {
this.prox = proxyRes.data.url; this.prox = proxyRes.data.url;
this.log.info(`proxy ${this.prox}`) this.log.info(`proxy ${this.prox}`)
}
async initMongo2() {
this.log.info("init mongo 获取环境数据")
const database = client.db("env");
const movies = database.collection("px_env");
// Query for a movie that has the title 'The Room'
const query = {
// 'env.funcs': {$ne: null},
// 'env.navigatorparams.platform': 'MacIntel',
// // 'env.navigatorparams.platform': 'Win32',
// "env.navigatorparams.vendor": "Google Inc.",
// // 'env.useragentdata.highvalue.uafullversion':{$ne:null},
// 'env.useragentdata.highvalue.uafullversion': {$ne: ""}
};
// Execute query
const movie = await movies.aggregate([
{$match: query},
// {
// $project: {
// 'env.windowparams': 1,
// 'env.screenparams': 1,
// 'env.navigatorparams': 1,
// 'env.featurepolicy': 1,
// 'env.plugins': 1,
// 'env.mimetypes': 1,
// 'env.glres': 1,
// 'env.jpg': 1,
// 'env.jpg2': 1,
// 'env.useragentdata': 1,
// 'env.consoleprops': 1,
// 'env.webglprops': 1,
// 'env.windowprops': 1,
// 'env.locationprops': 1,
// 'env.mathprops': 1,
// 'env.funcs': 1,
// 'env.funcs2': 1,
// 'env.documentfunc': 1,
// 'env.bodyfunc': 1,
// 'env.navigatorfunc': 1
// }
// },
{$sample: {size: 1}}
])
let res = await movie.toArray()
this.env2 = res[0]
this.envid2 = res[0]._id.toString()
// this.env = ENVS[keys[randint(0, keys.length - 1)]]
// this.ua = this.env.navigatorparams.useragent
this.ua = this.env2.px11590.PX11754;
this.log.info('ua', this.ua)
} }
async add_headers(headers) { async add_headers(headers) {
...@@ -5144,7 +5200,9 @@ class PxBypass { ...@@ -5144,7 +5200,9 @@ class PxBypass {
// let data = genPayload2(this.url, this.sid, this.vid, this.ts, this.num1, this.num2, // let data = genPayload2(this.url, this.sid, this.vid, this.ts, this.num1, this.num2,
// this.str1, this.uuid, // this.str1, this.uuid,
// this.startTs, this.startTs2, this.performanceNow, this.px12280) // this.startTs, this.startTs2, this.performanceNow, this.px12280)
let data = [this.pxenv.get_px11590()] let px11590 = this.pxenv.get_px11590();
Object.assign(px11590.d, this.env2.px11590)
let data = [px11590]
let res = await this.do_collector(data) let res = await this.do_collector(data)
} }
...@@ -5169,7 +5227,7 @@ class PxBypass { ...@@ -5169,7 +5227,7 @@ class PxBypass {
// this.startTs, this.startTs2, this.performanceNow, this.px12280) // this.startTs, this.startTs2, this.performanceNow, this.px12280)
this.pxenv.performanceNow = this.performanceNow this.pxenv.performanceNow = this.performanceNow
let d = this.pxenv.get_px11547(); let d = this.pxenv.get_px11547();
Object.assign(d.d, this.px_11547_env) Object.assign(d.d, this.env2.px11547)
let data = [ let data = [
// this.pxenv.get_px11891(), // this.pxenv.get_px11891(),
d] d]
...@@ -5268,6 +5326,7 @@ async function run() { ...@@ -5268,6 +5326,7 @@ async function run() {
try { try {
let px = new PxBypass() let px = new PxBypass()
await px.initMongo() await px.initMongo()
await px.initMongo2()
await px.step1() await px.step1()
await px.step3() await px.step3()
await sleep(1000) await sleep(1000)
......
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