master
commit
b0679b2882
|
@ -0,0 +1,14 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"pt_pin": "ptpin1",
|
||||||
|
"Uid": "UID_AAAAAAAAAAAA"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"pt_pin": "ptpin2",
|
||||||
|
"Uid": "UID_BBBBBBBBBB"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"pt_pin": "ptpin3",
|
||||||
|
"Uid": "UID_CCCCCCCCC"
|
||||||
|
}
|
||||||
|
]
|
|
@ -0,0 +1,532 @@
|
||||||
|
const https = require('https');
|
||||||
|
const http = require('http');
|
||||||
|
const stream = require('stream');
|
||||||
|
const zlib = require('zlib');
|
||||||
|
const vm = require('vm');
|
||||||
|
const PNG = require('png-js');
|
||||||
|
let UA = require('./USER_AGENTS.js').USER_AGENT;
|
||||||
|
const validatorCount = process.env.JDJR_validator_Count ? process.env.JDJR_validator_Count : 100
|
||||||
|
|
||||||
|
|
||||||
|
Math.avg = function average() {
|
||||||
|
var sum = 0;
|
||||||
|
var len = this.length;
|
||||||
|
for (var i = 0; i < len; i++) {
|
||||||
|
sum += this[i];
|
||||||
|
}
|
||||||
|
return sum / len;
|
||||||
|
};
|
||||||
|
|
||||||
|
function sleep(timeout) {
|
||||||
|
return new Promise((resolve) => setTimeout(resolve, timeout));
|
||||||
|
}
|
||||||
|
|
||||||
|
class PNGDecoder extends PNG {
|
||||||
|
constructor(args) {
|
||||||
|
super(args);
|
||||||
|
this.pixels = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
decodeToPixels() {
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
this.decode((pixels) => {
|
||||||
|
this.pixels = pixels;
|
||||||
|
resolve();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
getImageData(x, y, w, h) {
|
||||||
|
const {pixels} = this;
|
||||||
|
const len = w * h * 4;
|
||||||
|
const startIndex = x * 4 + y * (w * 4);
|
||||||
|
|
||||||
|
return {data: pixels.slice(startIndex, startIndex + len)};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const PUZZLE_GAP = 8;
|
||||||
|
const PUZZLE_PAD = 10;
|
||||||
|
|
||||||
|
class PuzzleRecognizer {
|
||||||
|
constructor(bg, patch, y) {
|
||||||
|
// console.log(bg);
|
||||||
|
const imgBg = new PNGDecoder(Buffer.from(bg, 'base64'));
|
||||||
|
const imgPatch = new PNGDecoder(Buffer.from(patch, 'base64'));
|
||||||
|
|
||||||
|
// console.log(imgBg);
|
||||||
|
|
||||||
|
this.bg = imgBg;
|
||||||
|
this.patch = imgPatch;
|
||||||
|
this.rawBg = bg;
|
||||||
|
this.rawPatch = patch;
|
||||||
|
this.y = y;
|
||||||
|
this.w = imgBg.width;
|
||||||
|
this.h = imgBg.height;
|
||||||
|
}
|
||||||
|
|
||||||
|
async run() {
|
||||||
|
await this.bg.decodeToPixels();
|
||||||
|
await this.patch.decodeToPixels();
|
||||||
|
|
||||||
|
return this.recognize();
|
||||||
|
}
|
||||||
|
|
||||||
|
recognize() {
|
||||||
|
const {ctx, w: width, bg} = this;
|
||||||
|
const {width: patchWidth, height: patchHeight} = this.patch;
|
||||||
|
const posY = this.y + PUZZLE_PAD + ((patchHeight - PUZZLE_PAD) / 2) - (PUZZLE_GAP / 2);
|
||||||
|
// const cData = ctx.getImageData(0, a.y + 10 + 20 - 4, 360, 8).data;
|
||||||
|
const cData = bg.getImageData(0, posY, width, PUZZLE_GAP).data;
|
||||||
|
const lumas = [];
|
||||||
|
|
||||||
|
for (let x = 0; x < width; x++) {
|
||||||
|
var sum = 0;
|
||||||
|
|
||||||
|
// y xais
|
||||||
|
for (let y = 0; y < PUZZLE_GAP; y++) {
|
||||||
|
var idx = x * 4 + y * (width * 4);
|
||||||
|
var r = cData[idx];
|
||||||
|
var g = cData[idx + 1];
|
||||||
|
var b = cData[idx + 2];
|
||||||
|
var luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;
|
||||||
|
|
||||||
|
sum += luma;
|
||||||
|
}
|
||||||
|
|
||||||
|
lumas.push(sum / PUZZLE_GAP);
|
||||||
|
}
|
||||||
|
|
||||||
|
const n = 2; // minium macroscopic image width (px)
|
||||||
|
const margin = patchWidth - PUZZLE_PAD;
|
||||||
|
const diff = 20; // macroscopic brightness difference
|
||||||
|
const radius = PUZZLE_PAD;
|
||||||
|
for (let i = 0, len = lumas.length - 2 * 4; i < len; i++) {
|
||||||
|
const left = (lumas[i] + lumas[i + 1]) / n;
|
||||||
|
const right = (lumas[i + 2] + lumas[i + 3]) / n;
|
||||||
|
const mi = margin + i;
|
||||||
|
const mLeft = (lumas[mi] + lumas[mi + 1]) / n;
|
||||||
|
const mRigth = (lumas[mi + 2] + lumas[mi + 3]) / n;
|
||||||
|
|
||||||
|
if (left - right > diff && mLeft - mRigth < -diff) {
|
||||||
|
const pieces = lumas.slice(i + 2, margin + i + 2);
|
||||||
|
const median = pieces.sort((x1, x2) => x1 - x2)[20];
|
||||||
|
const avg = Math.avg(pieces);
|
||||||
|
|
||||||
|
// noise reducation
|
||||||
|
if (median > left || median > mRigth) return;
|
||||||
|
if (avg > 100) return;
|
||||||
|
// console.table({left,right,mLeft,mRigth,median});
|
||||||
|
// ctx.fillRect(i+n-radius, 0, 1, 360);
|
||||||
|
// console.log(i+n-radius);
|
||||||
|
return i + n - radius;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// not found
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
runWithCanvas() {
|
||||||
|
const {createCanvas, Image} = require('canvas');
|
||||||
|
const canvas = createCanvas();
|
||||||
|
const ctx = canvas.getContext('2d');
|
||||||
|
const imgBg = new Image();
|
||||||
|
const imgPatch = new Image();
|
||||||
|
const prefix = 'data:image/png;base64,';
|
||||||
|
|
||||||
|
imgBg.src = prefix + this.rawBg;
|
||||||
|
imgPatch.src = prefix + this.rawPatch;
|
||||||
|
const {naturalWidth: w, naturalHeight: h} = imgBg;
|
||||||
|
canvas.width = w;
|
||||||
|
canvas.height = h;
|
||||||
|
ctx.clearRect(0, 0, w, h);
|
||||||
|
ctx.drawImage(imgBg, 0, 0, w, h);
|
||||||
|
|
||||||
|
const width = w;
|
||||||
|
const {naturalWidth, naturalHeight} = imgPatch;
|
||||||
|
const posY = this.y + PUZZLE_PAD + ((naturalHeight - PUZZLE_PAD) / 2) - (PUZZLE_GAP / 2);
|
||||||
|
// const cData = ctx.getImageData(0, a.y + 10 + 20 - 4, 360, 8).data;
|
||||||
|
const cData = ctx.getImageData(0, posY, width, PUZZLE_GAP).data;
|
||||||
|
const lumas = [];
|
||||||
|
|
||||||
|
for (let x = 0; x < width; x++) {
|
||||||
|
var sum = 0;
|
||||||
|
|
||||||
|
// y xais
|
||||||
|
for (let y = 0; y < PUZZLE_GAP; y++) {
|
||||||
|
var idx = x * 4 + y * (width * 4);
|
||||||
|
var r = cData[idx];
|
||||||
|
var g = cData[idx + 1];
|
||||||
|
var b = cData[idx + 2];
|
||||||
|
var luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;
|
||||||
|
|
||||||
|
sum += luma;
|
||||||
|
}
|
||||||
|
|
||||||
|
lumas.push(sum / PUZZLE_GAP);
|
||||||
|
}
|
||||||
|
|
||||||
|
const n = 2; // minium macroscopic image width (px)
|
||||||
|
const margin = naturalWidth - PUZZLE_PAD;
|
||||||
|
const diff = 20; // macroscopic brightness difference
|
||||||
|
const radius = PUZZLE_PAD;
|
||||||
|
for (let i = 0, len = lumas.length - 2 * 4; i < len; i++) {
|
||||||
|
const left = (lumas[i] + lumas[i + 1]) / n;
|
||||||
|
const right = (lumas[i + 2] + lumas[i + 3]) / n;
|
||||||
|
const mi = margin + i;
|
||||||
|
const mLeft = (lumas[mi] + lumas[mi + 1]) / n;
|
||||||
|
const mRigth = (lumas[mi + 2] + lumas[mi + 3]) / n;
|
||||||
|
|
||||||
|
if (left - right > diff && mLeft - mRigth < -diff) {
|
||||||
|
const pieces = lumas.slice(i + 2, margin + i + 2);
|
||||||
|
const median = pieces.sort((x1, x2) => x1 - x2)[20];
|
||||||
|
const avg = Math.avg(pieces);
|
||||||
|
|
||||||
|
// noise reducation
|
||||||
|
if (median > left || median > mRigth) return;
|
||||||
|
if (avg > 100) return;
|
||||||
|
// console.table({left,right,mLeft,mRigth,median});
|
||||||
|
// ctx.fillRect(i+n-radius, 0, 1, 360);
|
||||||
|
// console.log(i+n-radius);
|
||||||
|
return i + n - radius;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// not found
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const DATA = {
|
||||||
|
"appId": "17839d5db83",
|
||||||
|
"product": "embed",
|
||||||
|
"lang": "zh_CN",
|
||||||
|
};
|
||||||
|
const SERVER = 'iv.jd.com';
|
||||||
|
|
||||||
|
class JDJRValidator {
|
||||||
|
constructor() {
|
||||||
|
this.data = {};
|
||||||
|
this.x = 0;
|
||||||
|
this.t = Date.now();
|
||||||
|
this.count = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
async run(scene = 'cww', eid='') {
|
||||||
|
const tryRecognize = async () => {
|
||||||
|
const x = await this.recognize(scene, eid);
|
||||||
|
|
||||||
|
if (x > 0) {
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
// retry
|
||||||
|
return await tryRecognize();
|
||||||
|
};
|
||||||
|
const puzzleX = await tryRecognize();
|
||||||
|
// console.log(puzzleX);
|
||||||
|
const pos = new MousePosFaker(puzzleX).run();
|
||||||
|
const d = getCoordinate(pos);
|
||||||
|
|
||||||
|
// console.log(pos[pos.length-1][2] -Date.now());
|
||||||
|
// await sleep(4500);
|
||||||
|
await sleep(pos[pos.length - 1][2] - Date.now());
|
||||||
|
this.count++;
|
||||||
|
const result = await JDJRValidator.jsonp('/slide/s.html', {d, ...this.data}, scene);
|
||||||
|
|
||||||
|
if (result.message === 'success') {
|
||||||
|
// console.log(result);
|
||||||
|
console.log('JDJR验证用时: %fs', (Date.now() - this.t) / 1000);
|
||||||
|
return result;
|
||||||
|
} else {
|
||||||
|
console.log(`验证失败: ${this.count}/${validatorCount}`);
|
||||||
|
// console.log(JSON.stringify(result));
|
||||||
|
if(this.count >= validatorCount){
|
||||||
|
console.log("JDJR验证次数已达上限,退出验证");
|
||||||
|
return result;
|
||||||
|
}else{
|
||||||
|
await sleep(300);
|
||||||
|
return await this.run(scene, eid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async recognize(scene, eid) {
|
||||||
|
const data = await JDJRValidator.jsonp('/slide/g.html', {e: eid}, scene);
|
||||||
|
const {bg, patch, y} = data;
|
||||||
|
// const uri = 'data:image/png;base64,';
|
||||||
|
// const re = new PuzzleRecognizer(uri+bg, uri+patch, y);
|
||||||
|
const re = new PuzzleRecognizer(bg, patch, y);
|
||||||
|
// console.log(JSON.stringify(re))
|
||||||
|
const puzzleX = await re.run();
|
||||||
|
|
||||||
|
if (puzzleX > 0) {
|
||||||
|
this.data = {
|
||||||
|
c: data.challenge,
|
||||||
|
w: re.w,
|
||||||
|
e: eid,
|
||||||
|
s: '',
|
||||||
|
o: '',
|
||||||
|
};
|
||||||
|
this.x = puzzleX;
|
||||||
|
}
|
||||||
|
return puzzleX;
|
||||||
|
}
|
||||||
|
|
||||||
|
async report(n) {
|
||||||
|
console.time('PuzzleRecognizer');
|
||||||
|
let count = 0;
|
||||||
|
|
||||||
|
for (let i = 0; i < n; i++) {
|
||||||
|
const x = await this.recognize();
|
||||||
|
|
||||||
|
if (x > 0) count++;
|
||||||
|
if (i % 50 === 0) {
|
||||||
|
// console.log('%f\%', (i / n) * 100);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('验证成功: %f\%', (count / n) * 100);
|
||||||
|
console.clear()
|
||||||
|
console.timeEnd('PuzzleRecognizer');
|
||||||
|
}
|
||||||
|
|
||||||
|
static jsonp(api, data = {}, scene) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
const fnId = `jsonp_${String(Math.random()).replace('.', '')}`;
|
||||||
|
const extraData = {callback: fnId};
|
||||||
|
const query = new URLSearchParams({...DATA,...{"scene": scene}, ...extraData, ...data}).toString();
|
||||||
|
const url = `https://${SERVER}${api}?${query}`;
|
||||||
|
const headers = {
|
||||||
|
'Accept': '*/*',
|
||||||
|
'Accept-Encoding': 'gzip,deflate,br',
|
||||||
|
'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8',
|
||||||
|
'Connection': 'keep-alive',
|
||||||
|
'Host': "iv.jd.com",
|
||||||
|
'Proxy-Connection': 'keep-alive',
|
||||||
|
'Referer': 'https://h5.m.jd.com/',
|
||||||
|
'User-Agent': UA,
|
||||||
|
};
|
||||||
|
|
||||||
|
const req = https.get(url, {headers}, (response) => {
|
||||||
|
let res = response;
|
||||||
|
if (res.headers['content-encoding'] === 'gzip') {
|
||||||
|
const unzipStream = new stream.PassThrough();
|
||||||
|
stream.pipeline(
|
||||||
|
response,
|
||||||
|
zlib.createGunzip(),
|
||||||
|
unzipStream,
|
||||||
|
reject,
|
||||||
|
);
|
||||||
|
res = unzipStream;
|
||||||
|
}
|
||||||
|
res.setEncoding('utf8');
|
||||||
|
|
||||||
|
let rawData = '';
|
||||||
|
|
||||||
|
res.on('data', (chunk) => rawData += chunk);
|
||||||
|
res.on('end', () => {
|
||||||
|
try {
|
||||||
|
const ctx = {
|
||||||
|
[fnId]: (data) => ctx.data = data,
|
||||||
|
data: {},
|
||||||
|
};
|
||||||
|
|
||||||
|
vm.createContext(ctx);
|
||||||
|
vm.runInContext(rawData, ctx);
|
||||||
|
|
||||||
|
// console.log(ctx.data);
|
||||||
|
res.resume();
|
||||||
|
resolve(ctx.data);
|
||||||
|
} catch (e) {
|
||||||
|
reject(e);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
req.on('error', reject);
|
||||||
|
req.end();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getCoordinate(c) {
|
||||||
|
function string10to64(d) {
|
||||||
|
var c = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-~".split("")
|
||||||
|
, b = c.length
|
||||||
|
, e = +d
|
||||||
|
, a = [];
|
||||||
|
do {
|
||||||
|
mod = e % b;
|
||||||
|
e = (e - mod) / b;
|
||||||
|
a.unshift(c[mod])
|
||||||
|
} while (e);
|
||||||
|
return a.join("")
|
||||||
|
}
|
||||||
|
|
||||||
|
function prefixInteger(a, b) {
|
||||||
|
return (Array(b).join(0) + a).slice(-b)
|
||||||
|
}
|
||||||
|
|
||||||
|
function pretreatment(d, c, b) {
|
||||||
|
var e = string10to64(Math.abs(d));
|
||||||
|
var a = "";
|
||||||
|
if (!b) {
|
||||||
|
a += (d > 0 ? "1" : "0")
|
||||||
|
}
|
||||||
|
a += prefixInteger(e, c);
|
||||||
|
return a
|
||||||
|
}
|
||||||
|
|
||||||
|
var b = new Array();
|
||||||
|
for (var e = 0; e < c.length; e++) {
|
||||||
|
if (e == 0) {
|
||||||
|
b.push(pretreatment(c[e][0] < 262143 ? c[e][0] : 262143, 3, true));
|
||||||
|
b.push(pretreatment(c[e][1] < 16777215 ? c[e][1] : 16777215, 4, true));
|
||||||
|
b.push(pretreatment(c[e][2] < 4398046511103 ? c[e][2] : 4398046511103, 7, true))
|
||||||
|
} else {
|
||||||
|
var a = c[e][0] - c[e - 1][0];
|
||||||
|
var f = c[e][1] - c[e - 1][1];
|
||||||
|
var d = c[e][2] - c[e - 1][2];
|
||||||
|
b.push(pretreatment(a < 4095 ? a : 4095, 2, false));
|
||||||
|
b.push(pretreatment(f < 4095 ? f : 4095, 2, false));
|
||||||
|
b.push(pretreatment(d < 16777215 ? d : 16777215, 4, true))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return b.join("")
|
||||||
|
}
|
||||||
|
|
||||||
|
const HZ = 20;
|
||||||
|
|
||||||
|
class MousePosFaker {
|
||||||
|
constructor(puzzleX) {
|
||||||
|
this.x = parseInt(Math.random() * 20 + 20, 10);
|
||||||
|
this.y = parseInt(Math.random() * 80 + 80, 10);
|
||||||
|
this.t = Date.now();
|
||||||
|
this.pos = [[this.x, this.y, this.t]];
|
||||||
|
this.minDuration = parseInt(1000 / HZ, 10);
|
||||||
|
// this.puzzleX = puzzleX;
|
||||||
|
this.puzzleX = puzzleX + parseInt(Math.random() * 2 - 1, 10);
|
||||||
|
|
||||||
|
this.STEP = parseInt(Math.random() * 6 + 5, 10);
|
||||||
|
this.DURATION = parseInt(Math.random() * 7 + 14, 10) * 100;
|
||||||
|
// [9,1600] [10,1400]
|
||||||
|
this.STEP = 9;
|
||||||
|
// this.DURATION = 2000;
|
||||||
|
// console.log(this.STEP, this.DURATION);
|
||||||
|
}
|
||||||
|
|
||||||
|
run() {
|
||||||
|
const perX = this.puzzleX / this.STEP;
|
||||||
|
const perDuration = this.DURATION / this.STEP;
|
||||||
|
const firstPos = [this.x - parseInt(Math.random() * 6, 10), this.y + parseInt(Math.random() * 11, 10), this.t];
|
||||||
|
|
||||||
|
this.pos.unshift(firstPos);
|
||||||
|
this.stepPos(perX, perDuration);
|
||||||
|
this.fixPos();
|
||||||
|
|
||||||
|
const reactTime = parseInt(60 + Math.random() * 100, 10);
|
||||||
|
const lastIdx = this.pos.length - 1;
|
||||||
|
const lastPos = [this.pos[lastIdx][0], this.pos[lastIdx][1], this.pos[lastIdx][2] + reactTime];
|
||||||
|
|
||||||
|
this.pos.push(lastPos);
|
||||||
|
return this.pos;
|
||||||
|
}
|
||||||
|
|
||||||
|
stepPos(x, duration) {
|
||||||
|
let n = 0;
|
||||||
|
const sqrt2 = Math.sqrt(2);
|
||||||
|
for (let i = 1; i <= this.STEP; i++) {
|
||||||
|
n += 1 / i;
|
||||||
|
}
|
||||||
|
for (let i = 0; i < this.STEP; i++) {
|
||||||
|
x = this.puzzleX / (n * (i + 1));
|
||||||
|
const currX = parseInt((Math.random() * 30 - 15) + x, 10);
|
||||||
|
const currY = parseInt(Math.random() * 7 - 3, 10);
|
||||||
|
const currDuration = parseInt((Math.random() * 0.4 + 0.8) * duration, 10);
|
||||||
|
|
||||||
|
this.moveToAndCollect({
|
||||||
|
x: currX,
|
||||||
|
y: currY,
|
||||||
|
duration: currDuration,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fixPos() {
|
||||||
|
const actualX = this.pos[this.pos.length - 1][0] - this.pos[1][0];
|
||||||
|
const deviation = this.puzzleX - actualX;
|
||||||
|
|
||||||
|
if (Math.abs(deviation) > 4) {
|
||||||
|
this.moveToAndCollect({
|
||||||
|
x: deviation,
|
||||||
|
y: parseInt(Math.random() * 8 - 3, 10),
|
||||||
|
duration: 250,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
moveToAndCollect({x, y, duration}) {
|
||||||
|
let movedX = 0;
|
||||||
|
let movedY = 0;
|
||||||
|
let movedT = 0;
|
||||||
|
const times = duration / this.minDuration;
|
||||||
|
let perX = x / times;
|
||||||
|
let perY = y / times;
|
||||||
|
let padDuration = 0;
|
||||||
|
|
||||||
|
if (Math.abs(perX) < 1) {
|
||||||
|
padDuration = duration / Math.abs(x) - this.minDuration;
|
||||||
|
perX = 1;
|
||||||
|
perY = y / Math.abs(x);
|
||||||
|
}
|
||||||
|
|
||||||
|
while (Math.abs(movedX) < Math.abs(x)) {
|
||||||
|
const rDuration = parseInt(padDuration + Math.random() * 16 - 4, 10);
|
||||||
|
|
||||||
|
movedX += perX + Math.random() * 2 - 1;
|
||||||
|
movedY += perY;
|
||||||
|
movedT += this.minDuration + rDuration;
|
||||||
|
|
||||||
|
const currX = parseInt(this.x + movedX, 10);
|
||||||
|
const currY = parseInt(this.y + movedY, 10);
|
||||||
|
const currT = this.t + movedT;
|
||||||
|
|
||||||
|
this.pos.push([currX, currY, currT]);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.x += x;
|
||||||
|
this.y += y;
|
||||||
|
this.t += Math.max(duration, movedT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function injectToRequest(fn,scene = 'cww', ua = '') {
|
||||||
|
if(ua) UA = ua
|
||||||
|
return (opts, cb) => {
|
||||||
|
fn(opts, async (err, resp, data) => {
|
||||||
|
if (err) {
|
||||||
|
console.error(JSON.stringify(err));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (data.search('验证') > -1) {
|
||||||
|
console.log('JDJR验证中......');
|
||||||
|
let arr = opts.url.split("&")
|
||||||
|
let eid = ''
|
||||||
|
for(let i of arr){
|
||||||
|
if(i.indexOf("eid=")>-1){
|
||||||
|
eid = i.split("=") && i.split("=")[1] || ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const res = await new JDJRValidator().run(scene, eid);
|
||||||
|
|
||||||
|
opts.url += `&validate=${res.validate}`;
|
||||||
|
fn(opts, cb);
|
||||||
|
} else {
|
||||||
|
cb(err, resp, data);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
exports.injectToRequest = injectToRequest;
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,119 @@
|
||||||
|
/*
|
||||||
|
感谢github@dompling的PR
|
||||||
|
|
||||||
|
Author: 2Ya
|
||||||
|
|
||||||
|
Github: https://github.com/dompling
|
||||||
|
|
||||||
|
===================
|
||||||
|
特别说明:
|
||||||
|
1.获取多个京东cookie的脚本,不和NobyDa的京东cookie冲突。注:如与NobyDa的京东cookie重复,建议在BoxJs处删除重复的cookie
|
||||||
|
===================
|
||||||
|
===================
|
||||||
|
使用方式:在代理软件配置好下方配置后,复制 https://home.m.jd.com/myJd/newhome.action 到浏览器打开 ,在个人中心自动获取 cookie,
|
||||||
|
若弹出成功则正常使用。否则继续再此页面继续刷新一下试试。
|
||||||
|
|
||||||
|
注:建议通过脚本去获取cookie,若要在BoxJs处手动修改,请按照JSON格式修改(注:可使用此JSON校验 https://www.bejson.com/json/format)
|
||||||
|
示例:[{"userName":"jd_xxx","cookie":"pt_key=AAJ;pt_pin=jd_xxx;"},{"userName":"jd_66","cookie":"pt_key=AAJ;pt_pin=jd_66;"}]
|
||||||
|
===================
|
||||||
|
new Env('获取多账号京东Cookie');//此处忽略即可,为自动生成iOS端软件配置文件所需
|
||||||
|
===================
|
||||||
|
[MITM]
|
||||||
|
hostname = me-api.jd.com
|
||||||
|
|
||||||
|
===================Quantumult X=====================
|
||||||
|
[rewrite_local]
|
||||||
|
# 获取多账号京东Cookie
|
||||||
|
https:\/\/me-api\.jd\.com\/user_new\/info\/GetJDUserInfoUnion url script-request-header JD_extra_cookie.js
|
||||||
|
|
||||||
|
===================Loon===================
|
||||||
|
[Script]
|
||||||
|
http-request https:\/\/me-api\.jd\.com\/user_new\/info\/GetJDUserInfoUnion script-path=JD_extra_cookie.js, tag=获取多账号京东Cookie
|
||||||
|
|
||||||
|
===================Surge===================
|
||||||
|
[Script]
|
||||||
|
获取多账号京东Cookie = type=http-request,pattern=^https:\/\/me-api\.jd\.com\/user_new\/info\/GetJDUserInfoUnion,requires-body=1,max-size=0,script-path=JD_extra_cookie.js,script-update-interval=0
|
||||||
|
*/
|
||||||
|
|
||||||
|
const APIKey = "CookiesJD";
|
||||||
|
$ = new API(APIKey, true);
|
||||||
|
const CacheKey = `#${APIKey}`;
|
||||||
|
if ($request) GetCookie();
|
||||||
|
|
||||||
|
function getCache() {
|
||||||
|
var cache = $.read(CacheKey) || "[]";
|
||||||
|
$.log(cache);
|
||||||
|
return JSON.parse(cache);
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetCookie() {
|
||||||
|
try {
|
||||||
|
if ($request.headers && $request.url.indexOf("GetJDUserInfoUnion") > -1) {
|
||||||
|
var CV = $request.headers["Cookie"] || $request.headers["cookie"];
|
||||||
|
if (CV.match(/(pt_key=.+?pt_pin=|pt_pin=.+?pt_key=)/)) {
|
||||||
|
var CookieValue = CV.match(/pt_key=.+?;/) + CV.match(/pt_pin=.+?;/);
|
||||||
|
var UserName = CookieValue.match(/pt_pin=([^; ]+)(?=;?)/)[1];
|
||||||
|
var DecodeName = decodeURIComponent(UserName);
|
||||||
|
var CookiesData = getCache();
|
||||||
|
var updateCookiesData = [...CookiesData];
|
||||||
|
var updateIndex;
|
||||||
|
var CookieName = "【账号】";
|
||||||
|
var updateCodkie = CookiesData.find((item, index) => {
|
||||||
|
var ck = item.cookie;
|
||||||
|
var Account = ck
|
||||||
|
? ck.match(/pt_pin=.+?;/)
|
||||||
|
? ck.match(/pt_pin=([^; ]+)(?=;?)/)[1]
|
||||||
|
: null
|
||||||
|
: null;
|
||||||
|
const verify = UserName === Account;
|
||||||
|
if (verify) {
|
||||||
|
updateIndex = index;
|
||||||
|
}
|
||||||
|
return verify;
|
||||||
|
});
|
||||||
|
var tipPrefix = "";
|
||||||
|
if (updateCodkie) {
|
||||||
|
updateCookiesData[updateIndex].cookie = CookieValue;
|
||||||
|
CookieName = `【账号${updateIndex + 1}】`;
|
||||||
|
tipPrefix = "更新京东";
|
||||||
|
} else {
|
||||||
|
updateCookiesData.push({
|
||||||
|
userName: DecodeName,
|
||||||
|
cookie: CookieValue,
|
||||||
|
});
|
||||||
|
CookieName = "【账号" + updateCookiesData.length + "】";
|
||||||
|
tipPrefix = "首次写入京东";
|
||||||
|
}
|
||||||
|
const cacheValue = JSON.stringify(updateCookiesData, null, "\t");
|
||||||
|
$.write(cacheValue, CacheKey);
|
||||||
|
$.notify(
|
||||||
|
"用户名: " + DecodeName,
|
||||||
|
"",
|
||||||
|
tipPrefix + CookieName + "Cookie成功 🎉"
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
$.notify("写入京东Cookie失败", "", "请查看脚本内说明, 登录网页获取 ‼️");
|
||||||
|
}
|
||||||
|
$.done();
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
$.notify("写入京东Cookie失败", "", "请检查匹配URL或配置内脚本类型 ‼️");
|
||||||
|
}
|
||||||
|
} catch (eor) {
|
||||||
|
$.write("", CacheKey);
|
||||||
|
$.notify("写入京东Cookie失败", "", "已尝试清空历史Cookie, 请重试 ⚠️");
|
||||||
|
console.log(
|
||||||
|
`\n写入京东Cookie出现错误 ‼️\n${JSON.stringify(
|
||||||
|
eor
|
||||||
|
)}\n\n${eor}\n\n${JSON.stringify($request.headers)}\n`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
$.done();
|
||||||
|
}
|
||||||
|
|
||||||
|
// prettier-ignore
|
||||||
|
function ENV(){const isQX=typeof $task!=="undefined";const isLoon=typeof $loon!=="undefined";const isSurge=typeof $httpClient!=="undefined"&&!isLoon;const isJSBox=typeof require=="function"&&typeof $jsbox!="undefined";const isNode=typeof require=="function"&&!isJSBox;const isRequest=typeof $request!=="undefined";const isScriptable=typeof importModule!=="undefined";return{isQX,isLoon,isSurge,isNode,isJSBox,isRequest,isScriptable}}
|
||||||
|
// prettier-ignore
|
||||||
|
function HTTP(baseURL,defaultOptions={}){const{isQX,isLoon,isSurge,isScriptable,isNode}=ENV();const methods=["GET","POST","PUT","DELETE","HEAD","OPTIONS","PATCH"];function send(method,options){options=typeof options==="string"?{url:options}:options;options.url=baseURL?baseURL+options.url:options.url;options={...defaultOptions,...options};const timeout=options.timeout;const events={...{onRequest:()=>{},onResponse:(resp)=>resp,onTimeout:()=>{},},...options.events,};events.onRequest(method,options);let worker;if(isQX){worker=$task.fetch({method,...options})}else if(isLoon||isSurge||isNode){worker=new Promise((resolve,reject)=>{const request=isNode?require("request"):$httpClient;request[method.toLowerCase()](options,(err,response,body)=>{if(err)reject(err);else resolve({statusCode:response.status||response.statusCode,headers:response.headers,body,})})})}else if(isScriptable){const request=new Request(options.url);request.method=method;request.headers=options.headers;request.body=options.body;worker=new Promise((resolve,reject)=>{request.loadString().then((body)=>{resolve({statusCode:request.response.statusCode,headers:request.response.headers,body,})}).catch((err)=>reject(err))})}let timeoutid;const timer=timeout?new Promise((_,reject)=>{timeoutid=setTimeout(()=>{events.onTimeout();return reject(`${method}URL:${options.url}exceeds the timeout ${timeout}ms`)},timeout)}):null;return(timer?Promise.race([timer,worker]).then((res)=>{clearTimeout(timeoutid);return res}):worker).then((resp)=>events.onResponse(resp))}const http={};methods.forEach((method)=>(http[method.toLowerCase()]=(options)=>send(method,options)));return http}
|
||||||
|
// prettier-ignore
|
||||||
|
function API(name="untitled",debug=false){const{isQX,isLoon,isSurge,isNode,isJSBox,isScriptable}=ENV();return new(class{constructor(name,debug){this.name=name;this.debug=debug;this.http=HTTP();this.env=ENV();this.node=(()=>{if(isNode){const fs=require("fs");return{fs}}else{return null}})();this.initCache();const delay=(t,v)=>new Promise(function(resolve){setTimeout(resolve.bind(null,v),t)});Promise.prototype.delay=function(t){return this.then(function(v){return delay(t,v)})}}initCache(){if(isQX)this.cache=JSON.parse($prefs.valueForKey(this.name)||"{}");if(isLoon||isSurge)this.cache=JSON.parse($persistentStore.read(this.name)||"{}");if(isNode){let fpath="root.json";if(!this.node.fs.existsSync(fpath)){this.node.fs.writeFileSync(fpath,JSON.stringify({}),{flag:"wx"},(err)=>console.log(err))}this.root={};fpath=`${this.name}.json`;if(!this.node.fs.existsSync(fpath)){this.node.fs.writeFileSync(fpath,JSON.stringify({}),{flag:"wx"},(err)=>console.log(err));this.cache={}}else{this.cache=JSON.parse(this.node.fs.readFileSync(`${this.name}.json`))}}}persistCache(){const data=JSON.stringify(this.cache);if(isQX)$prefs.setValueForKey(data,this.name);if(isLoon||isSurge)$persistentStore.write(data,this.name);if(isNode){this.node.fs.writeFileSync(`${this.name}.json`,data,{flag:"w"},(err)=>console.log(err));this.node.fs.writeFileSync("root.json",JSON.stringify(this.root),{flag:"w"},(err)=>console.log(err))}}write(data,key){this.log(`SET ${key}`);if(key.indexOf("#")!==-1){key=key.substr(1);if(isSurge||isLoon){return $persistentStore.write(data,key)}if(isQX){return $prefs.setValueForKey(data,key)}if(isNode){this.root[key]=data}}else{this.cache[key]=data}this.persistCache()}read(key){this.log(`READ ${key}`);if(key.indexOf("#")!==-1){key=key.substr(1);if(isSurge||isLoon){return $persistentStore.read(key)}if(isQX){return $prefs.valueForKey(key)}if(isNode){return this.root[key]}}else{return this.cache[key]}}delete(key){this.log(`DELETE ${key}`);if(key.indexOf("#")!==-1){key=key.substr(1);if(isSurge||isLoon){$persistentStore.write(null,key)}if(isQX){$prefs.removeValueForKey(key)}if(isNode){delete this.root[key]}}else{delete this.cache[key]}this.persistCache()}notify(title,subtitle="",content="",options={}){const openURL=options["open-url"];const mediaURL=options["media-url"];if(isQX)$notify(title,subtitle,content,options);if(isSurge){$notification.post(title,subtitle,content+`${mediaURL?"\n多媒体:"+mediaURL:""}`,{url:openURL})}if(isLoon){let opts={};if(openURL)opts["openUrl"]=openURL;if(mediaURL)opts["mediaUrl"]=mediaURL;if(JSON.stringify(opts)=="{}"){$notification.post(title,subtitle,content)}else{$notification.post(title,subtitle,content,opts)}}if(isNode||isScriptable){const content_=content+(openURL?`\n点击跳转:${openURL}`:"")+(mediaURL?`\n多媒体:${mediaURL}`:"");if(isJSBox){const push=require("push");push.schedule({title:title,body:(subtitle?subtitle+"\n":"")+content_,})}else{console.log(`${title}\n${subtitle}\n${content_}\n\n`)}}}log(msg){if(this.debug)console.log(msg)}info(msg){console.log(msg)}error(msg){console.log("ERROR: "+msg)}wait(millisec){return new Promise((resolve)=>setTimeout(resolve,millisec))}done(value={}){if(isQX||isLoon||isSurge){$done(value)}else if(isNode&&!isJSBox){if(typeof $context!=="undefined"){$context.headers=value.headers;$context.statusCode=value.statusCode;$context.body=value.body}}}})(name,debug)}
|
|
@ -0,0 +1,92 @@
|
||||||
|
const USER_AGENTS = [
|
||||||
|
'jdltapp;iPad;3.7.0;14.4;network/wifi;Mozilla/5.0 (iPad; CPU OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;android;3.7.0;10;2346663656561603-4353564623932316;network/wifi;model/ONEPLUS A5010;addressid/0;aid/2dfceea045ed292a;oaid/;osVer/29;appBuild/1436;psn/BS6Y9SAiw0IpJ4ro7rjSOkCRZTgR3z2K|10;psq/5;adk/;ads/;pap/JA2020_3112531|3.7.0|ANDROID 10;osv/10;pv/10.5;jdv/;ref/com.jd.jdlite.lib.personal.view.fragment.JDPersonalFragment;partner/oppo;apprpd/MyJD_Main;eufv/1;Mozilla/5.0 (Linux; Android 10; ONEPLUS A5010 Build/QKQ1.191014.012; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/045140 Mobile Safari/537.36',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.1;59d6ae6e8387bd09fe046d5b8918ead51614e80a;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone12,1;hasOCPay/0;appBuild/1017;supportBestPay/0;addressid/;pv/1.26;apprpd/;ref/JDLTSubMainPageViewController;psq/0;ads/;psn/59d6ae6e8387bd09fe046d5b8918ead51614e80a|3;jdv/0|;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.1;Mozilla/5.0 (iPhone; CPU iPhone OS 14_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;13.5;22d679c006bf9c087abf362cf1d2e0020ebb8798;network/wifi;ADID/10857A57-DDF8-4A0D-A548-7B8F43AC77EE;hasUPPay/0;pushNoticeIsOpen/1;lang/zh_CN;model/iPhone12,1;addressid/2378947694;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/15.7;apprpd/Allowance_Registered;ref/JDLTTaskCenterViewController;psq/6;ads/;psn/22d679c006bf9c087abf362cf1d2e0020ebb8798|22;jdv/0|kong|t_1000170135|tuiguang|notset|1614153044558|1614153044;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 13.5;Mozilla/5.0 (iPhone; CPU iPhone OS 13_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;android;3.7.0;10;2616935633265383-5333463636261326;network/UNKNOWN;model/M2007J3SC;addressid/1840745247;aid/ba9e3b5853dccb1b;oaid/371d8af7dd71e8d5;osVer/29;appBuild/1436;psn/t7JmxZUXGkimd4f9Jdul2jEeuYLwxPrm|8;psq/6;adk/;ads/;pap/JA2020_3112531|3.7.0|ANDROID 10;osv/10;pv/5.6;jdv/;ref/com.jd.jdlite.lib.jdlitemessage.view.activity.MessageCenterMainActivity;partner/xiaomi;apprpd/MessageCenter_MessageMerge;eufv/1;Mozilla/5.0 (Linux; Android 10; M2007J3SC Build/QKQ1.200419.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/045135 Mobile Safari/537.36',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.3;d7beab54ae7758fa896c193b49470204fbb8fce9;network/4g;ADID/97AD46C9-6D49-4642-BF6F-689256673906;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone11,2;addressid/;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/6.28;apprpd/;ref/JDLTRedPacketViewController;psq/3;ads/;psn/d7beab54ae7758fa896c193b49470204fbb8fce9|8;jdv/0|kong|t_1001707023_|jingfen|79ad0319fa4d47e38521a616d80bc4bd|1613800945610|1613824900;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.3;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;android;3.7.0;9;D246836333735-3264353430393;network/4g;model/MIX 2;addressid/138678023;aid/bf8bcf1214b3832a;oaid/308540d1f1feb2f5;osVer/28;appBuild/1436;psn/Z/rGqfWBY/h5gcGFnVIsRw==|16;psq/3;adk/;ads/;pap/JA2020_3112531|3.7.0|ANDROID 9;osv/9;pv/13.7;jdv/;ref/com.jd.jdlite.lib.personal.view.fragment.JDPersonalFragment;partner/xiaomi;apprpd/MyJD_Main;eufv/1;Mozilla/5.0 (Linux; Android 9; MIX 2 Build/PKQ1.190118.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/045135 Mobile Safari/537.36',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;eb5a9e7e596e262b4ffb3b6b5c830984c8a5c0d5;network/wifi;ADID/5603541B-30C1-4B5C-A782-20D0B569D810;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone9,2;addressid/1041002757;hasOCPay/0;appBuild/101;supportBestPay/0;pv/34.6;apprpd/MyJD_Main;ref/MyJdMTAManager;psq/5;ads/;psn/eb5a9e7e596e262b4ffb3b6b5c830984c8a5c0d5|44;jdv/0|androidapp|t_335139774|appshare|CopyURL|1612612940307|1612612944;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.3;21631ed983b3e854a3154b0336413825ad0d6783;network/3g;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone13,4;addressid/;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/4.47;apprpd/;ref/JDLTSubMainPageViewController;psq/8;ads/;psn/21631ed983b3e854a3154b0336413825ad0d6783|9;jdv/0|direct|-|none|-|1614150725100|1614225882;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.3;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;13.5;500a795cb2abae60b877ee4a1930557a800bef1c;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone8,1;addressid/669949466;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/9.11;apprpd/;ref/JDLTSubMainPageViewController;psq/10;ads/;psn/500a795cb2abae60b877ee4a1930557a800bef1c|11;jdv/;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 13.5;Mozilla/5.0 (iPhone; CPU iPhone OS 13_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPad;3.7.0;14.4;f5e7b7980fb50efc9c294ac38653c1584846c3db;network/wifi;hasUPPay/0;pushNoticeIsOpen/1;lang/zh_CN;model/iPad6,3;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/231.11;pap/JA2020_3112531|3.7.0|IOS 14.4;apprpd/;psn/f5e7b7980fb50efc9c294ac38653c1584846c3db|305;usc/kong;jdv/0|kong|t_1000170135|tuiguang|notset|1613606450668|1613606450;umd/tuiguang;psq/2;ucp/t_1000170135;app_device/IOS;utr/notset;ref/JDLTRedPacketViewController;adk/;ads/;Mozilla/5.0 (iPad; CPU OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;19fef5419f88076c43f5317eabe20121d52c6a61;network/wifi;ADID/00000000-0000-0000-0000-000000000000;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone11,8;addressid/3430850943;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/10.4;apprpd/;ref/JDLTSubMainPageViewController;psq/3;ads/;psn/19fef5419f88076c43f5317eabe20121d52c6a61|16;jdv/0|kong|t_1001327829_|jingfen|f51febe09dd64b20b06bc6ef4c1ad790#/|1614096460311|1614096511;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148',
|
||||||
|
'jdltapp;iPhone;3.7.0;12.2;f995bc883282f7c7ea9d7f32da3f658127aa36c7;network/4g;ADID/9F40F4CA-EA7C-4F2E-8E09-97A66901D83E;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone10,4;addressid/525064695;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/11.11;apprpd/;ref/JDLTSubMainPageViewController;psq/2;ads/;psn/f995bc883282f7c7ea9d7f32da3f658127aa36c7|22;jdv/0|;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 12.2;Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;android;3.7.0;10;5366566313931326-6633931643233693;network/wifi;model/Mi9 Pro 5G;addressid/0;aid/5fe6191bf39a42c9;oaid/e3a9473ef6699f75;osVer/29;appBuild/1436;psn/b3rJlGi AwLqa9AqX7Vp0jv4T7XPMa0o|5;psq/4;adk/;ads/;pap/JA2020_3112531|3.7.0|ANDROID 10;osv/10;pv/5.4;jdv/;ref/HomeFragment;partner/xiaomi;apprpd/Home_Main;eufv/1;Mozilla/5.0 (Linux; Android 10; Mi9 Pro 5G Build/QKQ1.190825.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/045135 Mobile Safari/537.36',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;4e6b46913a2e18dd06d6d69843ee4cdd8e033bc1;network/3g;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone13,2;addressid/666624049;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/54.11;apprpd/MessageCenter_MessageMerge;ref/MessageCenterController;psq/10;ads/;psn/4e6b46913a2e18dd06d6d69843ee4cdd8e033bc1|101;jdv/0|kong|t_2010804675_|jingfen|810dab1ba2c04b8588c5aa5a0d44c4bd|1614183499;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.2;c71b599e9a0bcbd8d1ad924d85b5715530efad06;network/wifi;ADID/751C6E92-FD10-4323-B37C-187FD0CF0551;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone11,8;addressid/4053561885;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/263.8;apprpd/;ref/JDLTSubMainPageViewController;psq/2;ads/;psn/c71b599e9a0bcbd8d1ad924d85b5715530efad06|481;jdv/0|kong|t_1001610202_|jingfen|3911bea7ee2f4fcf8d11fdf663192bbe|1614157052210|1614157056;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.2;Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;2d306ee3cacd2c02560627a5113817ebea20a2c9;network/4g;ADID/A346F099-3182-4889-9A62-2B3C28AB861E;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone13,3;hasOCPay/0;appBuild/1017;supportBestPay/0;addressid/;pv/1.35;apprpd/Allowance_Registered;ref/JDLTTaskCenterViewController;psq/0;ads/;psn/2d306ee3cacd2c02560627a5113817ebea20a2c9|2;jdv/0|;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;28355aff16cec8bcf3e5728dbbc9725656d8c2c2;network/4g;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone10,2;addressid/833058617;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/4.10;apprpd/;ref/JDLTWebViewController;psq/9;ads/;psn/28355aff16cec8bcf3e5728dbbc9725656d8c2c2|5;jdv/0|;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;13.5;24ddac73a3de1b91816b7aedef53e97c4c313733;network/4g;ADID/598C6841-76AC-4512-AA97-CBA940548D70;hasUPPay/0;pushNoticeIsOpen/1;lang/zh_CN;model/iPhone11,6;addressid/;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/12.6;apprpd/;ref/JDLTSubMainPageViewController;psq/5;ads/;psn/24ddac73a3de1b91816b7aedef53e97c4c313733|23;jdv/0|kong|t_1000170135|tuiguang|notset|1614126110904|1614126110;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 13.5;Mozilla/5.0 (iPhone; CPU iPhone OS 13_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;d7732ba60c8ff73cc3f5ba7290a3aa9551f73a1b;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone12,1;addressid/25239372;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/8.6;apprpd/;ref/JDLTSubMainPageViewController;psq/5;ads/;psn/d7732ba60c8ff73cc3f5ba7290a3aa9551f73a1b|14;jdv/0|kong|t_1001226363_|jingfen|5713234d1e1e4893b92b2de2cb32484d|1614182989528|1614182992;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;ca1a32afca36bc9fb37fd03f18e653bce53eaca5;network/wifi;ADID/3AF380AB-CB74-4FE6-9E7C-967693863CA3;hasUPPay/0;pushNoticeIsOpen/1;lang/zh_CN;model/iPhone8,1;addressid/138323416;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/72.12;apprpd/;ref/JDLTRedPacketViewController;psq/3;ads/;psn/ca1a32afca36bc9fb37fd03f18e653bce53eaca5|109;jdv/0|kong|t_1000536212_|jingfen|c82bfa19e33a4269a5884ffc614790f4|1614141246;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;android;3.7.0;10;7346933333666353-8333366646039373;network/wifi;model/ONEPLUS A5010;addressid/138117973;aid/7d933f6583cfd097;oaid/;osVer/29;appBuild/1436;psn/T/eqfRSwp8VKEvvXyEunq09Cg2MUkiQ5|17;psq/4;adk/;ads/;pap/JA2020_3112531|3.7.0|ANDROID 10;osv/10;pv/11.4;jdv/0|kong|t_1001849073_|jingfen|495a47f6c0b8431c9d460f61ad2304dc|1614084403978|1614084407;ref/HomeFragment;partner/oppo;apprpd/Home_Main;eufv/1;Mozilla/5.0 (Linux; Android 10; ONEPLUS A5010 Build/QKQ1.191014.012; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/045140 Mobile Safari/537.36',
|
||||||
|
'jdltapp;android;3.7.0;11;4626269356736353-5353236346334673;network/wifi;model/M2006J10C;addressid/0;aid/dbb9e7655526d3d7;oaid/66a7af49362987b0;osVer/30;appBuild/1436;psn/rQRQgJ 4 S3qkq8YDl28y6jkUHmI/rlX|3;psq/4;adk/;ads/;pap/JA2020_3112531|3.7.0|ANDROID 11;osv/11;pv/3.4;jdv/;ref/HomeFragment;partner/xiaomi;apprpd/Home_Main;eufv/1;Mozilla/5.0 (Linux; Android 11; M2006J10C Build/RP1A.200720.011; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045513 Mobile Safari/537.36',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;78fc1d919de0c8c2de15725eff508d8ab14f9c82;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone13,1;addressid/137829713;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/23.11;apprpd/;ref/JDLTSubMainPageViewController;psq/10;ads/;psn/78fc1d919de0c8c2de15725eff508d8ab14f9c82|34;jdv/0|iosapp|t_335139774|appshare|Wxfriends|1612508702380|1612534293;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;android;3.7.0;10;0373263343266633-5663030363465326;network/wifi;model/Redmi Note 7;addressid/590846082;aid/07b34bf3e6006d5b;oaid/17975a142e67ec92;osVer/29;appBuild/1436;psn/OHNqtdhQKv1okyh7rB3HxjwI00ixJMNG|4;psq/3;adk/;ads/;pap/JA2020_3112531|3.7.0|ANDROID 10;osv/10;pv/2.3;jdv/;ref/activityId=8a8fabf3cccb417f8e691b6774938bc2;partner/xiaomi;apprpd/jsbqd_home;eufv/1;Mozilla/5.0 (Linux; Android 10; Redmi Note 7 Build/QKQ1.190910.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/88.0.4324.152 Mobile Safari/537.36',
|
||||||
|
'jdltapp;android;3.7.0;10;3636566623663623-1693635613166646;network/wifi;model/ASUS_I001DA;addressid/1397761133;aid/ccef2fc2a96e1afd;oaid/;osVer/29;appBuild/1436;psn/T8087T0D82PHzJ4VUMGFrfB9dw4gUnKG|76;psq/5;adk/;ads/;pap/JA2020_3112531|3.7.0|ANDROID 10;osv/10;pv/73.5;jdv/0|kong|t_1002354188_|jingfen|2335e043b3344107a2750a781fde9a2e#/|1614097081426|1614097087;ref/com.jd.jdlite.lib.personal.view.fragment.JDPersonalFragment;partner/yingyongbao;apprpd/MyJD_Main;eufv/1;Mozilla/5.0 (Linux; Android 10; ASUS_I001DA Build/QKQ1.190825.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/045140 Mobile Safari/537.36',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone10,2;addressid/138419019;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/5.7;apprpd/MyJD_Main;ref/MyJdMTAManager;psq/6;ads/;psn/4ee6af0db48fd605adb69b63f00fcbb51c2fc3f0|9;jdv/0|direct|-|none|-|1613705981655|1613823229;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.3;network/wifi;ADID/F9FD7728-2956-4DD1-8EDD-58B07950864C;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone10,1;addressid/1346909722;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/30.8;apprpd/;ref/JDLTSubMainPageViewController;psq/7;ads/;psn/40d4d4323eb3987226cae367d6b0d8be50f2c7b3|39;jdv/0|kong|t_1000252057_0|tuiguang|eba7648a0f4445aa9cfa6f35c6f36e15|1613995717959|1613995723;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.3;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;network/wifi;ADID/5D306F0D-A131-4B26-947E-166CCB9BFFFF;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone11,6;addressid/138164461;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/7.8;apprpd/;ref/JDLTSubMainPageViewController;psq/7;ads/;psn/d40e5d4a33c100e8527f779557c347569b49c304|7;jdv/0|kong|t_1001226363_|jingfen|3bf5372cb9cd445bbb270b8bc9a34f00|1608439066693|1608439068;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPad;3.7.0;14.5;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPad8,9;hasOCPay/0;appBuild/1017;supportBestPay/0;addressid/;pv/1.20;apprpd/MyJD_Main;ref/MyJdMTAManager;psq/5;ads/;psn/d9f5ddaa0160a20f32fb2c8bfd174fae7993c1b4|3;jdv/0|;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.5;Mozilla/5.0 (iPad; CPU OS 14_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.3;network/wifi;ADID/31548A9C-8A01-469A-B148-E7D841C91FD0;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone11,2;addressid/;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/10.5;apprpd/;ref/JDLTSubMainPageViewController;psq/4;ads/;psn/a858fb4b40e432ea32f80729916e6c3e910bb922|12;jdv/0|direct|-|none|-|1613898710373|1613898712;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.3;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;13.5;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone9,2;addressid/2237496805;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/13.6;apprpd/;ref/JDLTSubMainPageViewController;psq/5;ads/;psn/48e495dcf5dc398b4d46b27e9f15a2b427a154aa|15;jdv/0|direct|-|none|-|1613354874698|1613952828;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 13.5;Mozilla/5.0 (iPhone; CPU iPhone OS 13_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;android;3.7.0;10;3346332626262353-1666434336539336;network/wifi;model/ONEPLUS A6000;addressid/0;aid/3d3bbb25af44c59c;oaid/;osVer/29;appBuild/1436;psn/ECbc2EqmdSa7mDF1PS1GSrV/Tn7R1LS1|6;psq/8;adk/;ads/;pap/JA2020_3112531|3.7.0|ANDROID 10;osv/10;pv/2.67;jdv/0|direct|-|none|-|1613822479379|1613991194;ref/com.jd.jdlite.lib.personal.view.fragment.JDPersonalFragment;partner/oppo;apprpd/MyJD_Main;eufv/1;Mozilla/5.0 (Linux; Android 10; ONEPLUS A6000 Build/QKQ1.190716.003; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/045140 Mobile Safari/537.36',
|
||||||
|
'jdltapp;android;3.7.0;8.1.0;8363834353530333132333132373-43D2930366035323639333662383;network/wifi;model/16th Plus;addressid/0;aid/f909e5f2c464c7c6;oaid/;osVer/27;appBuild/1436;psn/c21YWvVr77Hn6 pOZfxXGY4TZrre1 UOL5hcPbCEDMo=|3;psq/10;adk/;ads/;pap/JA2020_3112531|3.7.0|ANDROID 8.1.0;osv/8.1.0;pv/2.15;jdv/;ref/com.jd.jdlite.lib.personal.view.fragment.JDPersonalFragment;partner/jsxdlyqj09;apprpd/MyJD_Main;eufv/1;Mozilla/5.0 (Linux; Android 8.1.0; 16th Plus Build/OPM1.171019.026; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045514 Mobile Safari/537.36',
|
||||||
|
'jdltapp;android;3.7.0;11;1343467336264693-3343562673463613;network/wifi;model/Mi 10 Pro;addressid/0;aid/14d7cbd934eb7dc1;oaid/335f198546eb3141;osVer/30;appBuild/1436;psn/ZcQh/Wov sNYfZ6JUjTIUBu28 KT0T3u|1;psq/24;adk/;ads/;pap/JA2020_3112531|3.7.0|ANDROID 11;osv/11;pv/1.24;jdv/;ref/com.jd.jdlite.lib.jdlitemessage.view.activity.MessageCenterMainActivity;partner/xiaomi;apprpd/MessageCenter_MessageMerge;eufv/1;Mozilla/5.0 (Linux; Android 11; Mi 10 Pro Build/RKQ1.200826.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/88.0.4324.181 Mobile Safari/537.36',
|
||||||
|
'jdltapp;android;3.7.0;10;8353636393732346-6646931673935346;network/wifi;model/MI 8;addressid/1969998059;aid/8566972dfd9a795d;oaid/4a8b773c3e307386;osVer/29;appBuild/1436;psn/PhYbUtCsCJo r 1b8hwxjnY8rEv5S8XC|383;psq/14;adk/;ads/;pap/JA2020_3112531|3.7.0|ANDROID 10;osv/10;pv/374.14;jdv/0|iosapp|t_335139774|liteshare|CopyURL|1609306590175|1609306596;ref/com.jd.jdlite.lib.jdlitemessage.view.activity.MessageCenterMainActivity;partner/jsxdlyqj09;apprpd/MessageCenter_MessageMerge;eufv/1;Mozilla/5.0 (Linux; Android 10; MI 8 Build/QKQ1.190828.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/045140 Mobile Safari/537.36',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;6d343c58764a908d4fa56609da4cb3a5cc1396d3;network/wifi;ADID/4965D884-3E61-4C4E-AEA7-9A8CE3742DA7;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone9,1;addressid/70390480;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/4.24;apprpd/MyJD_Main;ref/https%3A%2F%2Fjdcs.m.jd.com%2Fafter%2Findex.action%3FcategoryId%3D600%26v%3D6%26entry%3Dm_self_jd;psq/4;ads/;psn/6d343c58764a908d4fa56609da4cb3a5cc1396d3|17;jdv/0|;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;13.6.1;4606ddccdfe8f343f8137de7fea7f91fc4aef3a3;network/4g;ADID/C6FB6E20-D334-45FA-818A-7A4C58305202;hasUPPay/0;pushNoticeIsOpen/1;lang/zh_CN;model/iPhone10,1;addressid/;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/5.9;apprpd/MyJD_Main;ref/MyJdMTAManager;psq/8;ads/;psn/4606ddccdfe8f343f8137de7fea7f91fc4aef3a3|5;jdv/0|iosapp|t_335139774|liteshare|Qqfriends|1614206359106|1614206366;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 13.6.1;Mozilla/5.0 (iPhone; CPU iPhone OS 13_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;3b6e79334551fc6f31952d338b996789d157c4e8;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone10,1;addressid/138051400;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/14.34;apprpd/MyJD_Main;ref/MyJdMTAManager;psq/12;ads/;psn/3b6e79334551fc6f31952d338b996789d157c4e8|46;jdv/0|kong|t_1001707023_|jingfen|e80d7173a4264f4c9a3addcac7da8b5d|1613837384708|1613858760;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;android;3.7.0;10;1346235693831363-2373837393932673;network/wifi;model/LYA-AL00;addressid/3321567203;aid/1d2e9816278799b7;oaid/00000000-0000-0000-0000-000000000000;osVer/29;appBuild/1436;psn/45VUZFTZJkhP5fAXbeBoQ0 O2GCB I|7;psq/5;adk/;ads/;pap/JA2020_3112531|3.7.0|ANDROID 10;osv/10;pv/5.8;jdv/0|iosapp|t_335139774|liteshare|CopyURL|1614066210320|1614066219;ref/com.jd.jdlite.lib.personal.view.fragment.JDPersonalFragment;partner/huawei;apprpd/MyJD_Main;eufv/1;Mozilla/5.0 (Linux; Android 10; LYA-AL00 Build/HUAWEILYA-AL00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/83.0.4103.106 Mobile Safari/537.36',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.3;c2a8854e622a1b17a6c56c789f832f9d78ef1ba7;network/wifi;hasUPPay/0;pushNoticeIsOpen/1;lang/zh_CN;model/iPhone12,5;addressid/;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/3.9;apprpd/MyJD_Main;ref/MyJdMTAManager;psq/8;ads/;psn/c2a8854e622a1b17a6c56c789f832f9d78ef1ba7|6;jdv/0|direct|-|none|-|1613541016735|1613823566;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.3;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;android;3.7.0;9;;network/wifi;model/MIX 2S;addressid/;aid/f87efed6d9ed3c65;oaid/94739128ef9dd245;osVer/28;appBuild/1436;psn/R7wD/OWkQjYWxax1pDV6kTIDFPJCUid7C/nl2hHnUuI=|3;psq/13;adk/;ads/;pap/JA2020_3112531|3.7.0|ANDROID 9;osv/9;pv/1.42;jdv/;ref/activityId=8a8fabf3cccb417f8e691b6774938bc2;partner/xiaomi;apprpd/jsbqd_home;eufv/1;Mozilla/5.0 (Linux; Android 9; MIX 2S Build/PKQ1.180729.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/88.0.4324.181 Mobile Safari/537.36',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;android;3.7.0;10;network/wifi;Mozilla/5.0 (Linux; Android 10; Redmi Note 7 Build/QKQ1.190910.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/88.0.4324.152 Mobile Safari/537.36',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;network/3g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148',
|
||||||
|
'jdltapp;iPad;3.7.0;14.4;network/wifi;hasUPPay/0;pushNoticeIsOpen/1;lang/zh_CN;model/iPad6,3;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/231.11;pap/JA2020_3112531|3.7.0|IOS 14.4;apprpd/;psn/f5e7b7980fb50efc9c294ac38653c1584846c3db|305;usc/kong;jdv/0|kong|t_1000170135|tuiguang|notset|1613606450668|1613606450;umd/tuiguang;psq/2;ucp/t_1000170135;app_device/IOS;utr/notset;ref/JDLTRedPacketViewController;adk/;ads/;Mozilla/5.0 (iPad; CPU OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;13.5;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone8,1;addressid/669949466;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/9.11;apprpd/;ref/JDLTSubMainPageViewController;psq/10;ads/;psn/500a795cb2abae60b877ee4a1930557a800bef1c|11;jdv/;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 13.5;Mozilla/5.0 (iPhone; CPU iPhone OS 13_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.3;network/3g;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone13,4;addressid/;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/4.47;apprpd/;ref/JDLTSubMainPageViewController;psq/8;ads/;psn/21631ed983b3e854a3154b0336413825ad0d6783|9;jdv/0|direct|-|none|-|1614150725100|1614225882;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.3;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.3;network/3g;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone13,4;addressid/;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/4.47;apprpd/;ref/JDLTSubMainPageViewController;psq/8;ads/;psn/21631ed983b3e854a3154b0336413825ad0d6783|9;jdv/0|direct|-|none|-|1614150725100|1614225882;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.3;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone13,2;addressid/;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/3.15;apprpd/;ref/https%3A%2F%2Fjdcs.m.jd.com%2Fchat%2Findex.action%3Fentry%3Djd_m_JiSuCommodity%26pid%3D7763388%26lng%3D118.159665%26lat%3D24.504633%26sid%3D31cddc2d58f6e36bf2c31c4e8a79767w%26un_area%3D16_1315_3486_0;psq/12;ads/;psn/c10e0db6f15dec57a94637365f4c3d43e05bbd48|4;jdv/0|;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone13,2;addressid/;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/3.15;apprpd/;ref/https%3A%2F%2Fjdcs.m.jd.com%2Fchat%2Findex.action%3Fentry%3Djd_m_JiSuCommodity%26pid%3D7763388%26lng%3D118.159665%26lat%3D24.504633%26sid%3D31cddc2d58f6e36bf2c31c4e8a79767w%26un_area%3D16_1315_3486_0;psq/12;ads/;psn/c10e0db6f15dec57a94637365f4c3d43e05bbd48|4;jdv/0|;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone13,2;addressid/;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/3.15;apprpd/;ref/https%3A%2F%2Fjdcs.m.jd.com%2Fchat%2Findex.action%3Fentry%3Djd_m_JiSuCommodity%26pid%3D7763388%26lng%3D118.159665%26lat%3D24.504633%26sid%3D31cddc2d58f6e36bf2c31c4e8a79767w%26un_area%3D16_1315_3486_0;psq/12;ads/;psn/c10e0db6f15dec57a94637365f4c3d43e05bbd48|4;jdv/0|;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone11,6;hasOCPay/0;appBuild/1017;supportBestPay/0;addressid/2813715704;pv/67.38;apprpd/MyJD_Main;ref/https%3A%2F%2Fh5.m.jd.com%2FbabelDiy%2FZeus%2F2ynE8QDtc2svd36VowmYWBzzDdK6%2Findex.html%3Flng%3D103.957532%26lat%3D30.626962%26sid%3D4fe8ef4283b24723a7bb30ee87c18b2w%26un_area%3D22_1930_49324_52512;psq/4;ads/;psn/5aef178f95931bdbbde849ea9e2fc62b18bc5829|127;jdv/0|direct|-|none|-|1612588090667|1613822580;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.3;;network/4g;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone11,2;addressid/;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/6.28;apprpd/;ref/JDLTRedPacketViewController;psq/3;ads/;psn/d7beab54ae7758fa896c193b49470204fbb8fce9|8;jdv/0|kong|t_1001707023_|jingfen|79ad0319fa4d47e38521a616d80bc4bd|1613800945610|1613824900;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.3;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.3;network/4g;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone11,2;addressid/;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/6.28;apprpd/;ref/JDLTRedPacketViewController;psq/3;ads/;psn/d7beab54ae7758fa896c193b49470204fbb8fce9|8;jdv/0|kong|t_1001707023_|jingfen|79ad0319fa4d47e38521a616d80bc4bd|1613800945610|1613824900;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.3;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.3;;network/4g;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone11,2;addressid/;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/6.28;apprpd/;ref/JDLTRedPacketViewController;psq/3;ads/;psn/d7beab54ae7758fa896c193b49470204fbb8fce9|8;jdv/0|kong|t_1001707023_|jingfen|79ad0319fa4d47e38521a616d80bc4bd|1613800945610|1613824900;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.3;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.3;network/4g;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone11,2;addressid/;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/6.28;apprpd/;ref/JDLTRedPacketViewController;psq/3;ads/;psn/d7beab54ae7758fa896c193b49470204fbb8fce9|8;jdv/0|kong|t_1001707023_|jingfen|79ad0319fa4d47e38521a616d80bc4bd|1613800945610|1613824900;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.3;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.3;network/4g;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone11,2;addressid/;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/6.28;apprpd/;ref/JDLTRedPacketViewController;psq/3;ads/;psn/d7beab54ae7758fa896c193b49470204fbb8fce9|8;jdv/0|kong|t_1001707023_|jingfen|79ad0319fa4d47e38521a616d80bc4bd|1613800945610|1613824900;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.3;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;network/4g;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone12,1;addressid/3104834020;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/4.6;apprpd/;ref/JDLTSubMainPageViewController;psq/5;ads/;psn/c633e62b5a4ad0fdd93d9862bdcacfa8f3ecef63|6;jdv/0|;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.3;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone10,1;addressid/1346909722;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/30.8;apprpd/;ref/JDLTSubMainPageViewController;psq/7;ads/;psn/40d4d4323eb3987226cae367d6b0d8be50f2c7b3|39;jdv/0|kong|t_1000252057_0|tuiguang|eba7648a0f4445aa9cfa6f35c6f36e15|1613995717959|1613995723;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.3;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.3;network/wifi;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone10,1;addressid/1346909722;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/30.8;apprpd/;ref/JDLTSubMainPageViewController;psq/7;ads/;psn/40d4d4323eb3987226cae367d6b0d8be50f2c7b3|39;jdv/0|kong|t_1000252057_0|tuiguang|eba7648a0f4445aa9cfa6f35c6f36e15|1613995717959|1613995723;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.3;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone11,6;addressid/138164461;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/7.8;apprpd/;ref/JDLTSubMainPageViewController;psq/7;ads/;psn/d40e5d4a33c100e8527f779557c347569b49c304|7;jdv/0|kong|t_1001226363_|jingfen|3bf5372cb9cd445bbb270b8bc9a34f00|1608439066693|1608439068;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone11,6;addressid/138164461;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/7.8;apprpd/;ref/JDLTSubMainPageViewController;psq/7;ads/;psn/d40e5d4a33c100e8527f779557c347569b49c304|7;jdv/0|kong|t_1001226363_|jingfen|3bf5372cb9cd445bbb270b8bc9a34f00|1608439066693|1608439068;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone11,6;addressid/138164461;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/7.8;apprpd/;ref/JDLTSubMainPageViewController;psq/7;ads/;psn/d40e5d4a33c100e8527f779557c347569b49c304|7;jdv/0|kong|t_1001226363_|jingfen|3bf5372cb9cd445bbb270b8bc9a34f00|1608439066693|1608439068;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;13.5;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone9,2;addressid/2237496805;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/13.6;apprpd/;ref/JDLTSubMainPageViewController;psq/5;ads/;psn/48e495dcf5dc398b4d46b27e9f15a2b427a154aa|15;jdv/0|direct|-|none|-|1613354874698|1613952828;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 13.5;Mozilla/5.0 (iPhone; CPU iPhone OS 13_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;android;3.7.0;10;network/wifi;model/ONEPLUS A6000;addressid/0;aid/3d3bbb25af44c59c;oaid/;osVer/29;appBuild/1436;psn/ECbc2EqmdSa7mDF1PS1GSrV/Tn7R1LS1|6;psq/8;adk/;ads/;pap/JA2020_3112531|3.7.0|ANDROID 10;osv/10;pv/2.67;jdv/0|direct|-|none|-|1613822479379|1613991194;ref/com.jd.jdlite.lib.personal.view.fragment.JDPersonalFragment;partner/oppo;apprpd/MyJD_Main;eufv/1;Mozilla/5.0 (Linux; Android 10; ONEPLUS A6000 Build/QKQ1.190716.003; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/045140 Mobile Safari/537.36',
|
||||||
|
'jdltapp;android;3.7.0;8.1.0;network/wifi;model/16th Plus;addressid/0;aid/f909e5f2c464c7c6;oaid/;osVer/27;appBuild/1436;psn/c21YWvVr77Hn6 pOZfxXGY4TZrre1 UOL5hcPbCEDMo=|3;psq/10;adk/;ads/;pap/JA2020_3112531|3.7.0|ANDROID 8.1.0;osv/8.1.0;pv/2.15;jdv/;ref/com.jd.jdlite.lib.personal.view.fragment.JDPersonalFragment;partner/jsxdlyqj09;apprpd/MyJD_Main;eufv/1;Mozilla/5.0 (Linux; Android 8.1.0; 16th Plus Build/OPM1.171019.026; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045514 Mobile Safari/537.36',
|
||||||
|
'jdltapp;android;3.7.0;11;network/wifi;model/Mi 10 Pro;addressid/0;aid/14d7cbd934eb7dc1;oaid/335f198546eb3141;osVer/30;appBuild/1436;psn/ZcQh/Wov sNYfZ6JUjTIUBu28 KT0T3u|1;psq/24;adk/;ads/;pap/JA2020_3112531|3.7.0|ANDROID 11;osv/11;pv/1.24;jdv/;ref/com.jd.jdlite.lib.jdlitemessage.view.activity.MessageCenterMainActivity;partner/xiaomi;apprpd/MessageCenter_MessageMerge;eufv/1;Mozilla/5.0 (Linux; Android 11; Mi 10 Pro Build/RKQ1.200826.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/88.0.4324.181 Mobile Safari/537.36',
|
||||||
|
'jdltapp;android;3.7.0;10;network/wifi;model/MI 8;addressid/1969998059;aid/8566972dfd9a795d;oaid/4a8b773c3e307386;osVer/29;appBuild/1436;psn/PhYbUtCsCJo r 1b8hwxjnY8rEv5S8XC|383;psq/14;adk/;ads/;pap/JA2020_3112531|3.7.0|ANDROID 10;osv/10;pv/374.14;jdv/0|iosapp|t_335139774|liteshare|CopyURL|1609306590175|1609306596;ref/com.jd.jdlite.lib.jdlitemessage.view.activity.MessageCenterMainActivity;partner/jsxdlyqj09;apprpd/MessageCenter_MessageMerge;eufv/1;Mozilla/5.0 (Linux; Android 10; MI 8 Build/QKQ1.190828.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/045140 Mobile Safari/537.36',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone8,4;addressid/1477231693;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/21.15;apprpd/MyJD_Main;ref/https%3A%2F%2Fgold.jd.com%2F%3Flng%3D0.000000%26lat%3D0.000000%26sid%3D4584eb84dc00141b0d58e000583a338w%26un_area%3D19_1607_3155_62114;psq/0;ads/;psn/2c822e59db319590266cc83b78c4a943783d0077|46;jdv/0|;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone9,1;addressid/70390480;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/4.24;apprpd/MyJD_Main;ref/https%3A%2F%2Fjdcs.m.jd.com%2Fafter%2Findex.action%3FcategoryId%3D600%26v%3D6%26entry%3Dm_self_jd;psq/4;ads/;psn/6d343c58764a908d4fa56609da4cb3a5cc1396d3|17;jdv/0|;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone9,1;addressid/70390480;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/4.24;apprpd/MyJD_Main;ref/https%3A%2F%2Fjdcs.m.jd.com%2Fafter%2Findex.action%3FcategoryId%3D600%26v%3D6%26entry%3Dm_self_jd;psq/4;ads/;psn/6d343c58764a908d4fa56609da4cb3a5cc1396d3|17;jdv/0|;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;network/wifi;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone9,1;addressid/70390480;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/4.24;apprpd/MyJD_Main;ref/https%3A%2F%2Fjdcs.m.jd.com%2Fafter%2Findex.action%3FcategoryId%3D600%26v%3D6%26entry%3Dm_self_jd;psq/4;ads/;psn/6d343c58764a908d4fa56609da4cb3a5cc1396d3|17;jdv/0|;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone9,1;addressid/70390480;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/4.24;apprpd/MyJD_Main;ref/https%3A%2F%2Fjdcs.m.jd.com%2Fafter%2Findex.action%3FcategoryId%3D600%26v%3D6%26entry%3Dm_self_jd;psq/4;ads/;psn/6d343c58764a908d4fa56609da4cb3a5cc1396d3|17;jdv/0|;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;network/4g;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone12,3;hasOCPay/0;appBuild/1017;supportBestPay/0;addressid/;pv/3.49;apprpd/MyJD_Main;ref/MyJdMTAManager;psq/7;ads/;psn/9e0e0ea9c6801dfd53f2e50ffaa7f84c7b40cd15|6;jdv/0|;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPad;3.7.0;14.4;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPad7,5;addressid/;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/4.14;apprpd/MyJD_Main;ref/MyJdMTAManager;psq/3;ads/;psn/956c074c769cd2eeab2e36fca24ad4c9e469751a|8;jdv/0|;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.4;Mozilla/5.0 (iPad; CPU OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
]
|
||||||
|
/**
|
||||||
|
* 生成随机数字
|
||||||
|
* @param {number} min 最小值(包含)
|
||||||
|
* @param {number} max 最大值(不包含)
|
||||||
|
*/
|
||||||
|
function randomNumber(min = 0, max = 100) {
|
||||||
|
return Math.min(Math.floor(min + Math.random() * (max - min)), max);
|
||||||
|
}
|
||||||
|
const USER_AGENT = USER_AGENTS[randomNumber(0, USER_AGENTS.length)];
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
USER_AGENT
|
||||||
|
}
|
|
@ -0,0 +1,399 @@
|
||||||
|
import axios from "axios"
|
||||||
|
import {Md5} from "ts-md5"
|
||||||
|
import * as dotenv from "dotenv"
|
||||||
|
import {existsSync, readFileSync} from "fs"
|
||||||
|
import {sendNotify} from './sendNotify'
|
||||||
|
|
||||||
|
dotenv.config()
|
||||||
|
|
||||||
|
let fingerprint: string | number, token: string = '', enCryptMethodJD: any
|
||||||
|
|
||||||
|
const USER_AGENTS: Array<string> = [
|
||||||
|
"jdapp;android;10.0.2;10;network/wifi;Mozilla/5.0 (Linux; Android 10; ONEPLUS A5010 Build/QKQ1.191014.012; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045230 Mobile Safari/537.36",
|
||||||
|
"jdapp;iPhone;10.0.2;14.3;network/4g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;android;10.0.2;9;network/4g;Mozilla/5.0 (Linux; Android 9; Mi Note 3 Build/PKQ1.181007.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/045131 Mobile Safari/537.36",
|
||||||
|
"jdapp;android;10.0.2;10;network/wifi;Mozilla/5.0 (Linux; Android 10; GM1910 Build/QKQ1.190716.003; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045230 Mobile Safari/537.36",
|
||||||
|
"jdapp;android;10.0.2;9;network/wifi;Mozilla/5.0 (Linux; Android 9; 16T Build/PKQ1.190616.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/044942 Mobile Safari/537.36",
|
||||||
|
"jdapp;iPhone;10.0.2;13.6;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 13_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;iPhone;10.0.2;13.6;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 13_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;iPhone;10.0.2;13.5;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 13_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;iPhone;10.0.2;14.1;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 14_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;iPhone;10.0.2;13.3;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 13_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;iPhone;10.0.2;13.7;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 13_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;iPhone;10.0.2;14.1;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 14_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;iPhone;10.0.2;13.3;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 13_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;iPhone;10.0.2;13.4;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 13_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;iPhone;10.0.2;14.3;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;android;10.0.2;9;network/wifi;Mozilla/5.0 (Linux; Android 9; MI 6 Build/PKQ1.190118.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/044942 Mobile Safari/537.36",
|
||||||
|
"jdapp;android;10.0.2;11;network/wifi;Mozilla/5.0 (Linux; Android 11; Redmi K30 5G Build/RKQ1.200826.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045511 Mobile Safari/537.36",
|
||||||
|
"jdapp;iPhone;10.0.2;11.4;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 11_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15F79",
|
||||||
|
"jdapp;android;10.0.2;10;;network/wifi;Mozilla/5.0 (Linux; Android 10; M2006J10C Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045230 Mobile Safari/537.36",
|
||||||
|
"jdapp;android;10.0.2;10;network/wifi;Mozilla/5.0 (Linux; Android 10; M2006J10C Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045230 Mobile Safari/537.36",
|
||||||
|
"jdapp;android;10.0.2;10;network/wifi;Mozilla/5.0 (Linux; Android 10; ONEPLUS A6000 Build/QKQ1.190716.003; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045224 Mobile Safari/537.36",
|
||||||
|
"jdapp;android;10.0.2;9;network/wifi;Mozilla/5.0 (Linux; Android 9; MHA-AL00 Build/HUAWEIMHA-AL00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/044942 Mobile Safari/537.36",
|
||||||
|
"jdapp;android;10.0.2;8.1.0;network/wifi;Mozilla/5.0 (Linux; Android 8.1.0; 16 X Build/OPM1.171019.026; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/044942 Mobile Safari/537.36",
|
||||||
|
"jdapp;android;10.0.2;8.0.0;network/wifi;Mozilla/5.0 (Linux; Android 8.0.0; HTC U-3w Build/OPR6.170623.013; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/044942 Mobile Safari/537.36",
|
||||||
|
"jdapp;iPhone;10.0.2;14.0.1;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 14_0_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;android;10.0.2;10;network/wifi;Mozilla/5.0 (Linux; Android 10; LYA-AL00 Build/HUAWEILYA-AL00L; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045230 Mobile Safari/537.36",
|
||||||
|
"jdapp;iPhone;10.0.2;14.2;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;iPhone;10.0.2;14.3;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;iPhone;10.0.2;14.2;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;android;10.0.2;8.1.0;network/wifi;Mozilla/5.0 (Linux; Android 8.1.0; MI 8 Build/OPM1.171019.026; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/045131 Mobile Safari/537.36",
|
||||||
|
"jdapp;android;10.0.2;10;network/wifi;Mozilla/5.0 (Linux; Android 10; Redmi K20 Pro Premium Edition Build/QKQ1.190825.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045227 Mobile Safari/537.36",
|
||||||
|
"jdapp;iPhone;10.0.2;14.3;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;iPhone;10.0.2;14.3;network/4g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;android;10.0.2;11;network/wifi;Mozilla/5.0 (Linux; Android 11; Redmi K20 Pro Premium Edition Build/RKQ1.200826.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045513 Mobile Safari/537.36",
|
||||||
|
"jdapp;android;10.0.2;10;network/wifi;Mozilla/5.0 (Linux; Android 10; MI 8 Build/QKQ1.190828.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045227 Mobile Safari/537.36",
|
||||||
|
"jdapp;iPhone;10.0.2;14.1;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 14_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
]
|
||||||
|
|
||||||
|
function TotalBean(cookie: string) {
|
||||||
|
return {
|
||||||
|
cookie: cookie,
|
||||||
|
isLogin: true,
|
||||||
|
nickName: ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getRandomNumberByRange(start: number, end: number) {
|
||||||
|
end <= start && (end = start + 100)
|
||||||
|
return Math.floor(Math.random() * (end - start) + start)
|
||||||
|
}
|
||||||
|
|
||||||
|
let USER_AGENT = USER_AGENTS[getRandomNumberByRange(0, USER_AGENTS.length)]
|
||||||
|
|
||||||
|
async function getBeanShareCode(cookie: string) {
|
||||||
|
let {data}: any = await axios.post('https://api.m.jd.com/client.action',
|
||||||
|
`functionId=plantBeanIndex&body=${encodeURIComponent(
|
||||||
|
JSON.stringify({version: "9.0.0.1", "monitor_source": "plant_app_plant_index", "monitor_refer": ""})
|
||||||
|
)}&appid=ld&client=apple&area=5_274_49707_49973&build=167283&clientVersion=9.1.0`, {
|
||||||
|
headers: {
|
||||||
|
Cookie: cookie,
|
||||||
|
Host: "api.m.jd.com",
|
||||||
|
Accept: "*/*",
|
||||||
|
Connection: "keep-alive",
|
||||||
|
"User-Agent": USER_AGENT
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (data.data?.jwordShareInfo?.shareUrl)
|
||||||
|
return data.data.jwordShareInfo.shareUrl.split('Uuid=')![1]
|
||||||
|
else
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getFarmShareCode(cookie: string) {
|
||||||
|
let {data}: any = await axios.post('https://api.m.jd.com/client.action?functionId=initForFarm', `body=${encodeURIComponent(JSON.stringify({"version": 4}))}&appid=wh5&clientVersion=9.1.0`, {
|
||||||
|
headers: {
|
||||||
|
"cookie": cookie,
|
||||||
|
"origin": "https://home.m.jd.com",
|
||||||
|
"referer": "https://home.m.jd.com/myJd/newhome.action",
|
||||||
|
"User-Agent": USER_AGENT,
|
||||||
|
"Content-Type": "application/x-www-form-urlencoded"
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
if (data.farmUserPro)
|
||||||
|
return data.farmUserPro.shareCode
|
||||||
|
else
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
|
||||||
|
async function requireConfig(check: boolean = false): Promise<string[]> {
|
||||||
|
let cookiesArr: string[] = []
|
||||||
|
const jdCookieNode = require('./jdCookie.js')
|
||||||
|
let keys: string[] = Object.keys(jdCookieNode)
|
||||||
|
for (let i = 0; i < keys.length; i++) {
|
||||||
|
let cookie = jdCookieNode[keys[i]]
|
||||||
|
if (!check) {
|
||||||
|
cookiesArr.push(cookie)
|
||||||
|
} else {
|
||||||
|
if (await checkCookie(cookie)) {
|
||||||
|
cookiesArr.push(cookie)
|
||||||
|
} else {
|
||||||
|
let username = decodeURIComponent(jdCookieNode[keys[i]].match(/pt_pin=([^;]*)/)![1])
|
||||||
|
console.log('Cookie失效', username)
|
||||||
|
await sendNotify('Cookie失效', '【京东账号】' + username)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log(`共${cookiesArr.length}个京东账号\n`)
|
||||||
|
return cookiesArr
|
||||||
|
}
|
||||||
|
|
||||||
|
async function checkCookie(cookie: string) {
|
||||||
|
await wait(3000)
|
||||||
|
try {
|
||||||
|
let {data}: any = await axios.get(`https://api.m.jd.com/client.action?functionId=GetJDUserInfoUnion&appid=jd-cphdeveloper-m&body=${encodeURIComponent(JSON.stringify({"orgFlag": "JD_PinGou_New", "callSource": "mainorder", "channel": 4, "isHomewhite": 0, "sceneval": 2}))}&loginType=2&_=${Date.now()}&sceneval=2&g_login_type=1&callback=GetJDUserInfoUnion&g_ty=ls`, {
|
||||||
|
headers: {
|
||||||
|
'authority': 'api.m.jd.com',
|
||||||
|
'user-agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/10.0 Mobile/14E304 Safari/602.1',
|
||||||
|
'referer': 'https://home.m.jd.com/',
|
||||||
|
'cookie': cookie
|
||||||
|
}
|
||||||
|
})
|
||||||
|
data = JSON.parse(data.match(/GetJDUserInfoUnion\((.*)\)/)[1])
|
||||||
|
return data.retcode === '0';
|
||||||
|
} catch (e) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function wait(timeout: number) {
|
||||||
|
return new Promise(resolve => {
|
||||||
|
setTimeout(resolve, timeout)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
async function requestAlgo(appId: number = 10032) {
|
||||||
|
fingerprint = generateFp()
|
||||||
|
return new Promise<void>(async resolve => {
|
||||||
|
let {data}: any = await axios.post('https://cactus.jd.com/request_algo?g_ty=ajax', {
|
||||||
|
"version": "1.0",
|
||||||
|
"fp": fingerprint,
|
||||||
|
"appId": appId,
|
||||||
|
"timestamp": Date.now(),
|
||||||
|
"platform": "web",
|
||||||
|
"expandParams": ""
|
||||||
|
}, {
|
||||||
|
"headers": {
|
||||||
|
'Authority': 'cactus.jd.com',
|
||||||
|
'Pragma': 'no-cache',
|
||||||
|
'Cache-Control': 'no-cache',
|
||||||
|
'Accept': 'application/json',
|
||||||
|
'User-Agent': USER_AGENT,
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Origin': 'https://st.jingxi.com',
|
||||||
|
'Sec-Fetch-Site': 'cross-site',
|
||||||
|
'Sec-Fetch-Mode': 'cors',
|
||||||
|
'Sec-Fetch-Dest': 'empty',
|
||||||
|
'Referer': 'https://st.jingxi.com/',
|
||||||
|
'Accept-Language': 'zh-CN,zh;q=0.9,zh-TW;q=0.8,en;q=0.7'
|
||||||
|
},
|
||||||
|
})
|
||||||
|
if (data['status'] === 200) {
|
||||||
|
token = data.data.result.tk
|
||||||
|
let enCryptMethodJDString = data.data.result.algo
|
||||||
|
if (enCryptMethodJDString) enCryptMethodJD = new Function(`return ${enCryptMethodJDString}`)()
|
||||||
|
} else {
|
||||||
|
console.log(`fp: ${fingerprint}`)
|
||||||
|
console.log('request_algo 签名参数API请求失败:')
|
||||||
|
}
|
||||||
|
resolve()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function generateFp() {
|
||||||
|
let e = "0123456789"
|
||||||
|
let a = 13
|
||||||
|
let i = ''
|
||||||
|
for (; a--;)
|
||||||
|
i += e[Math.random() * e.length | 0]
|
||||||
|
return (i + Date.now()).slice(0, 16)
|
||||||
|
}
|
||||||
|
|
||||||
|
function getJxToken(cookie: string, phoneId: string = '') {
|
||||||
|
function generateStr(input: number) {
|
||||||
|
let src = 'abcdefghijklmnopqrstuvwxyz1234567890'
|
||||||
|
let res = ''
|
||||||
|
for (let i = 0; i < input; i++) {
|
||||||
|
res += src[Math.floor(src.length * Math.random())]
|
||||||
|
}
|
||||||
|
return res
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!phoneId)
|
||||||
|
phoneId = generateStr(40)
|
||||||
|
let timestamp = Date.now().toString()
|
||||||
|
let nickname = cookie.match(/pt_pin=([^;]*)/)![1]
|
||||||
|
let jstoken = Md5.hashStr('' + decodeURIComponent(nickname) + timestamp + phoneId + 'tPOamqCuk9NLgVPAljUyIHcPRmKlVxDy')
|
||||||
|
return {
|
||||||
|
'strPgtimestamp': timestamp,
|
||||||
|
'strPhoneID': phoneId,
|
||||||
|
'strPgUUNum': jstoken
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function exceptCookie(filename: string = 'x.ts') {
|
||||||
|
let except: any = []
|
||||||
|
if (existsSync('./utils/exceptCookie.json')) {
|
||||||
|
try {
|
||||||
|
except = JSON.parse(readFileSync('./utils/exceptCookie.json').toString() || '{}')[filename] || []
|
||||||
|
} catch (e) {
|
||||||
|
console.log('./utils/exceptCookie.json JSON格式错误')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return except
|
||||||
|
}
|
||||||
|
|
||||||
|
function randomString(e: number, word?: number) {
|
||||||
|
e = e || 32
|
||||||
|
let t = word === 26 ? "012345678abcdefghijklmnopqrstuvwxyz" : "0123456789abcdef", a = t.length, n = ""
|
||||||
|
for (let i = 0; i < e; i++)
|
||||||
|
n += t.charAt(Math.floor(Math.random() * a))
|
||||||
|
return n
|
||||||
|
}
|
||||||
|
|
||||||
|
function o2s(arr: object, title: string = '') {
|
||||||
|
title ? console.log(title, JSON.stringify(arr)) : console.log(JSON.stringify(arr))
|
||||||
|
}
|
||||||
|
|
||||||
|
function randomNumString(e: number) {
|
||||||
|
e = e || 32
|
||||||
|
let t = '0123456789', a = t.length, n = ""
|
||||||
|
for (let i = 0; i < e; i++)
|
||||||
|
n += t.charAt(Math.floor(Math.random() * a))
|
||||||
|
return n
|
||||||
|
}
|
||||||
|
|
||||||
|
function randomWord(n: number = 1) {
|
||||||
|
let t = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', a = t.length
|
||||||
|
let rnd: string = ''
|
||||||
|
for (let i = 0; i < n; i++) {
|
||||||
|
rnd += t.charAt(Math.floor(Math.random() * a))
|
||||||
|
}
|
||||||
|
return rnd
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getshareCodeHW(key: string) {
|
||||||
|
let shareCodeHW: string[] = []
|
||||||
|
for (let i = 0; i < 5; i++) {
|
||||||
|
try {
|
||||||
|
let {data}: any = await axios.get('https://api.jdsharecode.xyz/api/HW_CODES')
|
||||||
|
shareCodeHW = data[key] || []
|
||||||
|
if (shareCodeHW.length !== 0) {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.log("getshareCodeHW Error, Retry...")
|
||||||
|
await wait(getRandomNumberByRange(2000, 6000))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return shareCodeHW
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getShareCodePool(key: string, num: number) {
|
||||||
|
let shareCode: string[] = []
|
||||||
|
for (let i = 0; i < 2; i++) {
|
||||||
|
try {
|
||||||
|
let {data}: any = await axios.get(`https://api.jdsharecode.xyz/api/${key}/${num}`)
|
||||||
|
shareCode = data.data || []
|
||||||
|
console.log(`随机获取${num}个${key}成功:${JSON.stringify(shareCode)}`)
|
||||||
|
if (shareCode.length !== 0) {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.log("getShareCodePool Error, Retry...")
|
||||||
|
await wait(getRandomNumberByRange(2000, 6000))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return shareCode
|
||||||
|
}
|
||||||
|
|
||||||
|
/*async function wechat_app_msg(title: string, content: string, user: string) {
|
||||||
|
let corpid: string = "", corpsecret: string = ""
|
||||||
|
let {data: gettoken} = await axios.get(`https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=${corpid}&corpsecret=${corpsecret}`)
|
||||||
|
let access_token: string = gettoken.access_token
|
||||||
|
|
||||||
|
let {data: send} = await axios.post(`https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=${access_token}`, {
|
||||||
|
"touser": user,
|
||||||
|
"msgtype": "text",
|
||||||
|
"agentid": 1000002,
|
||||||
|
"text": {
|
||||||
|
"content": `${title}\n\n${content}`
|
||||||
|
},
|
||||||
|
"safe": 0
|
||||||
|
})
|
||||||
|
if (send.errcode === 0) {
|
||||||
|
console.log('企业微信应用消息发送成功')
|
||||||
|
} else {
|
||||||
|
console.log('企业微信应用消息发送失败', send)
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
|
||||||
|
function obj2str(obj: object) {
|
||||||
|
return JSON.stringify(obj)
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getDevice() {
|
||||||
|
let {data} = await axios.get('https://betahub.cn/api/apple/devices/iPhone', {
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
data = data[getRandomNumberByRange(0, 16)]
|
||||||
|
return data.identifier
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getVersion(device: string) {
|
||||||
|
let {data} = await axios.get(`https://betahub.cn/api/apple/firmwares/${device}`, {
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
data = data[getRandomNumberByRange(0, data.length)]
|
||||||
|
return data.firmware_info.version
|
||||||
|
}
|
||||||
|
|
||||||
|
async function jdpingou() {
|
||||||
|
let device: string, version: string;
|
||||||
|
device = await getDevice();
|
||||||
|
version = await getVersion(device);
|
||||||
|
return `jdpingou;iPhone;5.19.0;${version};${randomString(40)};network/wifi;model/${device};appBuild/100833;ADID/;supportApplePay/1;hasUPPay/0;pushNoticeIsOpen/0;hasOCPay/0;supportBestPay/0;session/${getRandomNumberByRange(10, 90)};pap/JA2019_3111789;brand/apple;supportJDSHWK/1;Mozilla/5.0 (iPhone; CPU iPhone OS 14_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148`
|
||||||
|
}
|
||||||
|
|
||||||
|
function get(url: string, headers?: any): Promise<any> {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
axios.get(url, {
|
||||||
|
headers: headers
|
||||||
|
}).then(res => {
|
||||||
|
if (typeof res.data === 'string' && res.data.includes('jsonpCBK')) {
|
||||||
|
resolve(JSON.parse(res.data.match(/jsonpCBK.?\(([\w\W]*)\);?/)[1]))
|
||||||
|
} else {
|
||||||
|
resolve(res.data)
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
reject({
|
||||||
|
code: err?.response?.status || -1,
|
||||||
|
msg: err?.response?.statusText || err.message || 'error'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function post(url: string, prarms?: string | object, headers?: any): Promise<any> {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
axios.post(url, prarms, {
|
||||||
|
headers: headers
|
||||||
|
}).then(res => {
|
||||||
|
resolve(res.data)
|
||||||
|
}).catch(err => {
|
||||||
|
reject({
|
||||||
|
code: err?.response?.status || -1,
|
||||||
|
msg: err?.response?.statusText || err.message || 'error'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export default USER_AGENT
|
||||||
|
export {
|
||||||
|
TotalBean,
|
||||||
|
getBeanShareCode,
|
||||||
|
getFarmShareCode,
|
||||||
|
requireConfig,
|
||||||
|
wait,
|
||||||
|
getRandomNumberByRange,
|
||||||
|
requestAlgo,
|
||||||
|
getJxToken,
|
||||||
|
exceptCookie,
|
||||||
|
randomString,
|
||||||
|
o2s,
|
||||||
|
randomNumString,
|
||||||
|
getshareCodeHW,
|
||||||
|
getShareCodePool,
|
||||||
|
randomWord,
|
||||||
|
obj2str,
|
||||||
|
jdpingou,
|
||||||
|
get,
|
||||||
|
post
|
||||||
|
}
|
|
@ -0,0 +1,128 @@
|
||||||
|
const USER_AGENTS = [
|
||||||
|
"jdapp;android;10.1.6;10;network/wifi;Mozilla/5.0 (Linux; Android 10; ONEPLUS A5010 Build/QKQ1.191014.012; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045230 Mobile Safari/537.36",
|
||||||
|
"jdapp;iPhone;10.1.6;14.3;network/4g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;android;10.1.6;9;network/4g;Mozilla/5.0 (Linux; Android 9; Mi Note 3 Build/PKQ1.181007.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/045131 Mobile Safari/537.36",
|
||||||
|
"jdapp;android;10.1.6;10;network/wifi;Mozilla/5.0 (Linux; Android 10; GM1910 Build/QKQ1.190716.003; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045230 Mobile Safari/537.36",
|
||||||
|
"jdapp;android;10.1.6;9;network/wifi;Mozilla/5.0 (Linux; Android 9; 16T Build/PKQ1.190616.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/044942 Mobile Safari/537.36",
|
||||||
|
"jdapp;iPhone;10.1.6;13.6;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 13_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;iPhone;10.1.6;13.6;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 13_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;iPhone;10.1.6;13.5;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 13_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;iPhone;10.1.6;14.1;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 14_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;iPhone;10.1.6;13.3;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 13_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;iPhone;10.1.6;13.7;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 13_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;iPhone;10.1.6;14.1;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 14_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;iPhone;10.1.6;13.3;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 13_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;iPhone;10.1.6;13.4;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 13_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;iPhone;10.1.6;14.3;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;android;10.1.6;9;network/wifi;Mozilla/5.0 (Linux; Android 9; MI 6 Build/PKQ1.190118.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/044942 Mobile Safari/537.36",
|
||||||
|
"jdapp;android;10.1.6;11;network/wifi;Mozilla/5.0 (Linux; Android 11; Redmi K30 5G Build/RKQ1.200826.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045511 Mobile Safari/537.36",
|
||||||
|
"jdapp;iPhone;10.1.6;11.4;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 11_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15F79",
|
||||||
|
"jdapp;android;10.1.6;10;;network/wifi;Mozilla/5.0 (Linux; Android 10; M2006J10C Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045230 Mobile Safari/537.36",
|
||||||
|
"jdapp;android;10.1.6;10;network/wifi;Mozilla/5.0 (Linux; Android 10; M2006J10C Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045230 Mobile Safari/537.36",
|
||||||
|
"jdapp;android;10.1.6;10;network/wifi;Mozilla/5.0 (Linux; Android 10; ONEPLUS A6000 Build/QKQ1.190716.003; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045224 Mobile Safari/537.36",
|
||||||
|
"jdapp;android;10.1.6;9;network/wifi;Mozilla/5.0 (Linux; Android 9; MHA-AL00 Build/HUAWEIMHA-AL00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/044942 Mobile Safari/537.36",
|
||||||
|
"jdapp;android;10.1.6;8.1.0;network/wifi;Mozilla/5.0 (Linux; Android 8.1.0; 16 X Build/OPM1.171019.026; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/044942 Mobile Safari/537.36",
|
||||||
|
"jdapp;android;10.1.6;8.0.0;network/wifi;Mozilla/5.0 (Linux; Android 8.0.0; HTC U-3w Build/OPR6.170623.013; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/044942 Mobile Safari/537.36",
|
||||||
|
"jdapp;iPhone;10.1.6;14.0.1;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 14_0_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;android;10.1.6;10;network/wifi;Mozilla/5.0 (Linux; Android 10; LYA-AL00 Build/HUAWEILYA-AL00L; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045230 Mobile Safari/537.36",
|
||||||
|
"jdapp;iPhone;10.1.6;14.2;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;iPhone;10.1.6;14.3;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;iPhone;10.1.6;14.2;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;android;10.1.6;8.1.0;network/wifi;Mozilla/5.0 (Linux; Android 8.1.0; MI 8 Build/OPM1.171019.026; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/045131 Mobile Safari/537.36",
|
||||||
|
"jdapp;android;10.1.6;10;network/wifi;Mozilla/5.0 (Linux; Android 10; Redmi K20 Pro Premium Edition Build/QKQ1.190825.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045227 Mobile Safari/537.36",
|
||||||
|
"jdapp;iPhone;10.1.6;14.3;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;iPhone;10.1.6;14.3;network/4g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;android;10.1.6;11;network/wifi;Mozilla/5.0 (Linux; Android 11; Redmi K20 Pro Premium Edition Build/RKQ1.200826.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045513 Mobile Safari/537.36",
|
||||||
|
"jdapp;android;10.1.6;10;network/wifi;Mozilla/5.0 (Linux; Android 10; MI 8 Build/QKQ1.190828.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045227 Mobile Safari/537.36",
|
||||||
|
"jdapp;iPhone;10.1.6;14.1;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 14_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
'jdltapp;iPad;3.7.0;14.4;network/wifi;Mozilla/5.0 (iPad; CPU OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;android;3.7.0;10;2346663656561603-4353564623932316;network/wifi;model/ONEPLUS A5010;addressid/0;aid/2dfceea045ed292a;oaid/;osVer/29;appBuild/1436;psn/BS6Y9SAiw0IpJ4ro7rjSOkCRZTgR3z2K|10;psq/5;adk/;ads/;pap/JA2020_3112531|3.7.0|ANDROID 10;osv/10;pv/10.5;jdv/;ref/com.jd.jdlite.lib.personal.view.fragment.JDPersonalFragment;partner/oppo;apprpd/MyJD_Main;eufv/1;Mozilla/5.0 (Linux; Android 10; ONEPLUS A5010 Build/QKQ1.191014.012; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/045140 Mobile Safari/537.36',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.1;59d6ae6e8387bd09fe046d5b8918ead51614e80a;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone12,1;hasOCPay/0;appBuild/1017;supportBestPay/0;addressid/;pv/1.26;apprpd/;ref/JDLTSubMainPageViewController;psq/0;ads/;psn/59d6ae6e8387bd09fe046d5b8918ead51614e80a|3;jdv/0|;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.1;Mozilla/5.0 (iPhone; CPU iPhone OS 14_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;13.5;22d679c006bf9c087abf362cf1d2e0020ebb8798;network/wifi;ADID/10857A57-DDF8-4A0D-A548-7B8F43AC77EE;hasUPPay/0;pushNoticeIsOpen/1;lang/zh_CN;model/iPhone12,1;addressid/2378947694;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/15.7;apprpd/Allowance_Registered;ref/JDLTTaskCenterViewController;psq/6;ads/;psn/22d679c006bf9c087abf362cf1d2e0020ebb8798|22;jdv/0|kong|t_1000170135|tuiguang|notset|1614153044558|1614153044;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 13.5;Mozilla/5.0 (iPhone; CPU iPhone OS 13_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;android;3.7.0;10;2616935633265383-5333463636261326;network/UNKNOWN;model/M2007J3SC;addressid/1840745247;aid/ba9e3b5853dccb1b;oaid/371d8af7dd71e8d5;osVer/29;appBuild/1436;psn/t7JmxZUXGkimd4f9Jdul2jEeuYLwxPrm|8;psq/6;adk/;ads/;pap/JA2020_3112531|3.7.0|ANDROID 10;osv/10;pv/5.6;jdv/;ref/com.jd.jdlite.lib.jdlitemessage.view.activity.MessageCenterMainActivity;partner/xiaomi;apprpd/MessageCenter_MessageMerge;eufv/1;Mozilla/5.0 (Linux; Android 10; M2007J3SC Build/QKQ1.200419.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/045135 Mobile Safari/537.36',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.3;d7beab54ae7758fa896c193b49470204fbb8fce9;network/4g;ADID/97AD46C9-6D49-4642-BF6F-689256673906;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone11,2;addressid/;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/6.28;apprpd/;ref/JDLTRedPacketViewController;psq/3;ads/;psn/d7beab54ae7758fa896c193b49470204fbb8fce9|8;jdv/0|kong|t_1001707023_|jingfen|79ad0319fa4d47e38521a616d80bc4bd|1613800945610|1613824900;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.3;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;android;3.7.0;9;D246836333735-3264353430393;network/4g;model/MIX 2;addressid/138678023;aid/bf8bcf1214b3832a;oaid/308540d1f1feb2f5;osVer/28;appBuild/1436;psn/Z/rGqfWBY/h5gcGFnVIsRw==|16;psq/3;adk/;ads/;pap/JA2020_3112531|3.7.0|ANDROID 9;osv/9;pv/13.7;jdv/;ref/com.jd.jdlite.lib.personal.view.fragment.JDPersonalFragment;partner/xiaomi;apprpd/MyJD_Main;eufv/1;Mozilla/5.0 (Linux; Android 9; MIX 2 Build/PKQ1.190118.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/045135 Mobile Safari/537.36',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;eb5a9e7e596e262b4ffb3b6b5c830984c8a5c0d5;network/wifi;ADID/5603541B-30C1-4B5C-A782-20D0B569D810;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone9,2;addressid/1041002757;hasOCPay/0;appBuild/101;supportBestPay/0;pv/34.6;apprpd/MyJD_Main;ref/MyJdMTAManager;psq/5;ads/;psn/eb5a9e7e596e262b4ffb3b6b5c830984c8a5c0d5|44;jdv/0|androidapp|t_335139774|appshare|CopyURL|1612612940307|1612612944;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.3;21631ed983b3e854a3154b0336413825ad0d6783;network/3g;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone13,4;addressid/;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/4.47;apprpd/;ref/JDLTSubMainPageViewController;psq/8;ads/;psn/21631ed983b3e854a3154b0336413825ad0d6783|9;jdv/0|direct|-|none|-|1614150725100|1614225882;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.3;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;13.5;500a795cb2abae60b877ee4a1930557a800bef1c;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone8,1;addressid/669949466;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/9.11;apprpd/;ref/JDLTSubMainPageViewController;psq/10;ads/;psn/500a795cb2abae60b877ee4a1930557a800bef1c|11;jdv/;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 13.5;Mozilla/5.0 (iPhone; CPU iPhone OS 13_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPad;3.7.0;14.4;f5e7b7980fb50efc9c294ac38653c1584846c3db;network/wifi;hasUPPay/0;pushNoticeIsOpen/1;lang/zh_CN;model/iPad6,3;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/231.11;pap/JA2020_3112531|3.7.0|IOS 14.4;apprpd/;psn/f5e7b7980fb50efc9c294ac38653c1584846c3db|305;usc/kong;jdv/0|kong|t_1000170135|tuiguang|notset|1613606450668|1613606450;umd/tuiguang;psq/2;ucp/t_1000170135;app_device/IOS;utr/notset;ref/JDLTRedPacketViewController;adk/;ads/;Mozilla/5.0 (iPad; CPU OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;19fef5419f88076c43f5317eabe20121d52c6a61;network/wifi;ADID/00000000-0000-0000-0000-000000000000;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone11,8;addressid/3430850943;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/10.4;apprpd/;ref/JDLTSubMainPageViewController;psq/3;ads/;psn/19fef5419f88076c43f5317eabe20121d52c6a61|16;jdv/0|kong|t_1001327829_|jingfen|f51febe09dd64b20b06bc6ef4c1ad790#/|1614096460311|1614096511;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148',
|
||||||
|
'jdltapp;iPhone;3.7.0;12.2;f995bc883282f7c7ea9d7f32da3f658127aa36c7;network/4g;ADID/9F40F4CA-EA7C-4F2E-8E09-97A66901D83E;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone10,4;addressid/525064695;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/11.11;apprpd/;ref/JDLTSubMainPageViewController;psq/2;ads/;psn/f995bc883282f7c7ea9d7f32da3f658127aa36c7|22;jdv/0|;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 12.2;Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;android;3.7.0;10;5366566313931326-6633931643233693;network/wifi;model/Mi9 Pro 5G;addressid/0;aid/5fe6191bf39a42c9;oaid/e3a9473ef6699f75;osVer/29;appBuild/1436;psn/b3rJlGi AwLqa9AqX7Vp0jv4T7XPMa0o|5;psq/4;adk/;ads/;pap/JA2020_3112531|3.7.0|ANDROID 10;osv/10;pv/5.4;jdv/;ref/HomeFragment;partner/xiaomi;apprpd/Home_Main;eufv/1;Mozilla/5.0 (Linux; Android 10; Mi9 Pro 5G Build/QKQ1.190825.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/045135 Mobile Safari/537.36',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;4e6b46913a2e18dd06d6d69843ee4cdd8e033bc1;network/3g;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone13,2;addressid/666624049;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/54.11;apprpd/MessageCenter_MessageMerge;ref/MessageCenterController;psq/10;ads/;psn/4e6b46913a2e18dd06d6d69843ee4cdd8e033bc1|101;jdv/0|kong|t_2010804675_|jingfen|810dab1ba2c04b8588c5aa5a0d44c4bd|1614183499;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.2;c71b599e9a0bcbd8d1ad924d85b5715530efad06;network/wifi;ADID/751C6E92-FD10-4323-B37C-187FD0CF0551;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone11,8;addressid/4053561885;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/263.8;apprpd/;ref/JDLTSubMainPageViewController;psq/2;ads/;psn/c71b599e9a0bcbd8d1ad924d85b5715530efad06|481;jdv/0|kong|t_1001610202_|jingfen|3911bea7ee2f4fcf8d11fdf663192bbe|1614157052210|1614157056;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.2;Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;2d306ee3cacd2c02560627a5113817ebea20a2c9;network/4g;ADID/A346F099-3182-4889-9A62-2B3C28AB861E;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone13,3;hasOCPay/0;appBuild/1017;supportBestPay/0;addressid/;pv/1.35;apprpd/Allowance_Registered;ref/JDLTTaskCenterViewController;psq/0;ads/;psn/2d306ee3cacd2c02560627a5113817ebea20a2c9|2;jdv/0|;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;28355aff16cec8bcf3e5728dbbc9725656d8c2c2;network/4g;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone10,2;addressid/833058617;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/4.10;apprpd/;ref/JDLTWebViewController;psq/9;ads/;psn/28355aff16cec8bcf3e5728dbbc9725656d8c2c2|5;jdv/0|;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;13.5;24ddac73a3de1b91816b7aedef53e97c4c313733;network/4g;ADID/598C6841-76AC-4512-AA97-CBA940548D70;hasUPPay/0;pushNoticeIsOpen/1;lang/zh_CN;model/iPhone11,6;addressid/;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/12.6;apprpd/;ref/JDLTSubMainPageViewController;psq/5;ads/;psn/24ddac73a3de1b91816b7aedef53e97c4c313733|23;jdv/0|kong|t_1000170135|tuiguang|notset|1614126110904|1614126110;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 13.5;Mozilla/5.0 (iPhone; CPU iPhone OS 13_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;d7732ba60c8ff73cc3f5ba7290a3aa9551f73a1b;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone12,1;addressid/25239372;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/8.6;apprpd/;ref/JDLTSubMainPageViewController;psq/5;ads/;psn/d7732ba60c8ff73cc3f5ba7290a3aa9551f73a1b|14;jdv/0|kong|t_1001226363_|jingfen|5713234d1e1e4893b92b2de2cb32484d|1614182989528|1614182992;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;ca1a32afca36bc9fb37fd03f18e653bce53eaca5;network/wifi;ADID/3AF380AB-CB74-4FE6-9E7C-967693863CA3;hasUPPay/0;pushNoticeIsOpen/1;lang/zh_CN;model/iPhone8,1;addressid/138323416;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/72.12;apprpd/;ref/JDLTRedPacketViewController;psq/3;ads/;psn/ca1a32afca36bc9fb37fd03f18e653bce53eaca5|109;jdv/0|kong|t_1000536212_|jingfen|c82bfa19e33a4269a5884ffc614790f4|1614141246;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;android;3.7.0;10;7346933333666353-8333366646039373;network/wifi;model/ONEPLUS A5010;addressid/138117973;aid/7d933f6583cfd097;oaid/;osVer/29;appBuild/1436;psn/T/eqfRSwp8VKEvvXyEunq09Cg2MUkiQ5|17;psq/4;adk/;ads/;pap/JA2020_3112531|3.7.0|ANDROID 10;osv/10;pv/11.4;jdv/0|kong|t_1001849073_|jingfen|495a47f6c0b8431c9d460f61ad2304dc|1614084403978|1614084407;ref/HomeFragment;partner/oppo;apprpd/Home_Main;eufv/1;Mozilla/5.0 (Linux; Android 10; ONEPLUS A5010 Build/QKQ1.191014.012; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/045140 Mobile Safari/537.36',
|
||||||
|
'jdltapp;android;3.7.0;11;4626269356736353-5353236346334673;network/wifi;model/M2006J10C;addressid/0;aid/dbb9e7655526d3d7;oaid/66a7af49362987b0;osVer/30;appBuild/1436;psn/rQRQgJ 4 S3qkq8YDl28y6jkUHmI/rlX|3;psq/4;adk/;ads/;pap/JA2020_3112531|3.7.0|ANDROID 11;osv/11;pv/3.4;jdv/;ref/HomeFragment;partner/xiaomi;apprpd/Home_Main;eufv/1;Mozilla/5.0 (Linux; Android 11; M2006J10C Build/RP1A.200720.011; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045513 Mobile Safari/537.36',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;78fc1d919de0c8c2de15725eff508d8ab14f9c82;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone13,1;addressid/137829713;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/23.11;apprpd/;ref/JDLTSubMainPageViewController;psq/10;ads/;psn/78fc1d919de0c8c2de15725eff508d8ab14f9c82|34;jdv/0|iosapp|t_335139774|appshare|Wxfriends|1612508702380|1612534293;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;android;3.7.0;10;0373263343266633-5663030363465326;network/wifi;model/Redmi Note 7;addressid/590846082;aid/07b34bf3e6006d5b;oaid/17975a142e67ec92;osVer/29;appBuild/1436;psn/OHNqtdhQKv1okyh7rB3HxjwI00ixJMNG|4;psq/3;adk/;ads/;pap/JA2020_3112531|3.7.0|ANDROID 10;osv/10;pv/2.3;jdv/;ref/activityId=8a8fabf3cccb417f8e691b6774938bc2;partner/xiaomi;apprpd/jsbqd_home;eufv/1;Mozilla/5.0 (Linux; Android 10; Redmi Note 7 Build/QKQ1.190910.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/88.0.4324.152 Mobile Safari/537.36',
|
||||||
|
'jdltapp;android;3.7.0;10;3636566623663623-1693635613166646;network/wifi;model/ASUS_I001DA;addressid/1397761133;aid/ccef2fc2a96e1afd;oaid/;osVer/29;appBuild/1436;psn/T8087T0D82PHzJ4VUMGFrfB9dw4gUnKG|76;psq/5;adk/;ads/;pap/JA2020_3112531|3.7.0|ANDROID 10;osv/10;pv/73.5;jdv/0|kong|t_1002354188_|jingfen|2335e043b3344107a2750a781fde9a2e#/|1614097081426|1614097087;ref/com.jd.jdlite.lib.personal.view.fragment.JDPersonalFragment;partner/yingyongbao;apprpd/MyJD_Main;eufv/1;Mozilla/5.0 (Linux; Android 10; ASUS_I001DA Build/QKQ1.190825.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/045140 Mobile Safari/537.36',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone10,2;addressid/138419019;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/5.7;apprpd/MyJD_Main;ref/MyJdMTAManager;psq/6;ads/;psn/4ee6af0db48fd605adb69b63f00fcbb51c2fc3f0|9;jdv/0|direct|-|none|-|1613705981655|1613823229;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.3;network/wifi;ADID/F9FD7728-2956-4DD1-8EDD-58B07950864C;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone10,1;addressid/1346909722;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/30.8;apprpd/;ref/JDLTSubMainPageViewController;psq/7;ads/;psn/40d4d4323eb3987226cae367d6b0d8be50f2c7b3|39;jdv/0|kong|t_1000252057_0|tuiguang|eba7648a0f4445aa9cfa6f35c6f36e15|1613995717959|1613995723;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.3;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;network/wifi;ADID/5D306F0D-A131-4B26-947E-166CCB9BFFFF;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone11,6;addressid/138164461;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/7.8;apprpd/;ref/JDLTSubMainPageViewController;psq/7;ads/;psn/d40e5d4a33c100e8527f779557c347569b49c304|7;jdv/0|kong|t_1001226363_|jingfen|3bf5372cb9cd445bbb270b8bc9a34f00|1608439066693|1608439068;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPad;3.7.0;14.5;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPad8,9;hasOCPay/0;appBuild/1017;supportBestPay/0;addressid/;pv/1.20;apprpd/MyJD_Main;ref/MyJdMTAManager;psq/5;ads/;psn/d9f5ddaa0160a20f32fb2c8bfd174fae7993c1b4|3;jdv/0|;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.5;Mozilla/5.0 (iPad; CPU OS 14_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.3;network/wifi;ADID/31548A9C-8A01-469A-B148-E7D841C91FD0;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone11,2;addressid/;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/10.5;apprpd/;ref/JDLTSubMainPageViewController;psq/4;ads/;psn/a858fb4b40e432ea32f80729916e6c3e910bb922|12;jdv/0|direct|-|none|-|1613898710373|1613898712;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.3;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;13.5;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone9,2;addressid/2237496805;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/13.6;apprpd/;ref/JDLTSubMainPageViewController;psq/5;ads/;psn/48e495dcf5dc398b4d46b27e9f15a2b427a154aa|15;jdv/0|direct|-|none|-|1613354874698|1613952828;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 13.5;Mozilla/5.0 (iPhone; CPU iPhone OS 13_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;android;3.7.0;10;3346332626262353-1666434336539336;network/wifi;model/ONEPLUS A6000;addressid/0;aid/3d3bbb25af44c59c;oaid/;osVer/29;appBuild/1436;psn/ECbc2EqmdSa7mDF1PS1GSrV/Tn7R1LS1|6;psq/8;adk/;ads/;pap/JA2020_3112531|3.7.0|ANDROID 10;osv/10;pv/2.67;jdv/0|direct|-|none|-|1613822479379|1613991194;ref/com.jd.jdlite.lib.personal.view.fragment.JDPersonalFragment;partner/oppo;apprpd/MyJD_Main;eufv/1;Mozilla/5.0 (Linux; Android 10; ONEPLUS A6000 Build/QKQ1.190716.003; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/045140 Mobile Safari/537.36',
|
||||||
|
'jdltapp;android;3.7.0;8.1.0;8363834353530333132333132373-43D2930366035323639333662383;network/wifi;model/16th Plus;addressid/0;aid/f909e5f2c464c7c6;oaid/;osVer/27;appBuild/1436;psn/c21YWvVr77Hn6 pOZfxXGY4TZrre1 UOL5hcPbCEDMo=|3;psq/10;adk/;ads/;pap/JA2020_3112531|3.7.0|ANDROID 8.1.0;osv/8.1.0;pv/2.15;jdv/;ref/com.jd.jdlite.lib.personal.view.fragment.JDPersonalFragment;partner/jsxdlyqj09;apprpd/MyJD_Main;eufv/1;Mozilla/5.0 (Linux; Android 8.1.0; 16th Plus Build/OPM1.171019.026; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045514 Mobile Safari/537.36',
|
||||||
|
'jdltapp;android;3.7.0;11;1343467336264693-3343562673463613;network/wifi;model/Mi 10 Pro;addressid/0;aid/14d7cbd934eb7dc1;oaid/335f198546eb3141;osVer/30;appBuild/1436;psn/ZcQh/Wov sNYfZ6JUjTIUBu28 KT0T3u|1;psq/24;adk/;ads/;pap/JA2020_3112531|3.7.0|ANDROID 11;osv/11;pv/1.24;jdv/;ref/com.jd.jdlite.lib.jdlitemessage.view.activity.MessageCenterMainActivity;partner/xiaomi;apprpd/MessageCenter_MessageMerge;eufv/1;Mozilla/5.0 (Linux; Android 11; Mi 10 Pro Build/RKQ1.200826.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/88.0.4324.181 Mobile Safari/537.36',
|
||||||
|
'jdltapp;android;3.7.0;10;8353636393732346-6646931673935346;network/wifi;model/MI 8;addressid/1969998059;aid/8566972dfd9a795d;oaid/4a8b773c3e307386;osVer/29;appBuild/1436;psn/PhYbUtCsCJo r 1b8hwxjnY8rEv5S8XC|383;psq/14;adk/;ads/;pap/JA2020_3112531|3.7.0|ANDROID 10;osv/10;pv/374.14;jdv/0|iosapp|t_335139774|liteshare|CopyURL|1609306590175|1609306596;ref/com.jd.jdlite.lib.jdlitemessage.view.activity.MessageCenterMainActivity;partner/jsxdlyqj09;apprpd/MessageCenter_MessageMerge;eufv/1;Mozilla/5.0 (Linux; Android 10; MI 8 Build/QKQ1.190828.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/045140 Mobile Safari/537.36',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;6d343c58764a908d4fa56609da4cb3a5cc1396d3;network/wifi;ADID/4965D884-3E61-4C4E-AEA7-9A8CE3742DA7;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone9,1;addressid/70390480;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/4.24;apprpd/MyJD_Main;ref/https%3A%2F%2Fjdcs.m.jd.com%2Fafter%2Findex.action%3FcategoryId%3D600%26v%3D6%26entry%3Dm_self_jd;psq/4;ads/;psn/6d343c58764a908d4fa56609da4cb3a5cc1396d3|17;jdv/0|;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;13.6.1;4606ddccdfe8f343f8137de7fea7f91fc4aef3a3;network/4g;ADID/C6FB6E20-D334-45FA-818A-7A4C58305202;hasUPPay/0;pushNoticeIsOpen/1;lang/zh_CN;model/iPhone10,1;addressid/;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/5.9;apprpd/MyJD_Main;ref/MyJdMTAManager;psq/8;ads/;psn/4606ddccdfe8f343f8137de7fea7f91fc4aef3a3|5;jdv/0|iosapp|t_335139774|liteshare|Qqfriends|1614206359106|1614206366;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 13.6.1;Mozilla/5.0 (iPhone; CPU iPhone OS 13_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;3b6e79334551fc6f31952d338b996789d157c4e8;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone10,1;addressid/138051400;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/14.34;apprpd/MyJD_Main;ref/MyJdMTAManager;psq/12;ads/;psn/3b6e79334551fc6f31952d338b996789d157c4e8|46;jdv/0|kong|t_1001707023_|jingfen|e80d7173a4264f4c9a3addcac7da8b5d|1613837384708|1613858760;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;android;3.7.0;10;1346235693831363-2373837393932673;network/wifi;model/LYA-AL00;addressid/3321567203;aid/1d2e9816278799b7;oaid/00000000-0000-0000-0000-000000000000;osVer/29;appBuild/1436;psn/45VUZFTZJkhP5fAXbeBoQ0 O2GCB I|7;psq/5;adk/;ads/;pap/JA2020_3112531|3.7.0|ANDROID 10;osv/10;pv/5.8;jdv/0|iosapp|t_335139774|liteshare|CopyURL|1614066210320|1614066219;ref/com.jd.jdlite.lib.personal.view.fragment.JDPersonalFragment;partner/huawei;apprpd/MyJD_Main;eufv/1;Mozilla/5.0 (Linux; Android 10; LYA-AL00 Build/HUAWEILYA-AL00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/83.0.4103.106 Mobile Safari/537.36',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.3;c2a8854e622a1b17a6c56c789f832f9d78ef1ba7;network/wifi;hasUPPay/0;pushNoticeIsOpen/1;lang/zh_CN;model/iPhone12,5;addressid/;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/3.9;apprpd/MyJD_Main;ref/MyJdMTAManager;psq/8;ads/;psn/c2a8854e622a1b17a6c56c789f832f9d78ef1ba7|6;jdv/0|direct|-|none|-|1613541016735|1613823566;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.3;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;android;3.7.0;9;;network/wifi;model/MIX 2S;addressid/;aid/f87efed6d9ed3c65;oaid/94739128ef9dd245;osVer/28;appBuild/1436;psn/R7wD/OWkQjYWxax1pDV6kTIDFPJCUid7C/nl2hHnUuI=|3;psq/13;adk/;ads/;pap/JA2020_3112531|3.7.0|ANDROID 9;osv/9;pv/1.42;jdv/;ref/activityId=8a8fabf3cccb417f8e691b6774938bc2;partner/xiaomi;apprpd/jsbqd_home;eufv/1;Mozilla/5.0 (Linux; Android 9; MIX 2S Build/PKQ1.180729.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/88.0.4324.181 Mobile Safari/537.36',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;android;3.7.0;10;network/wifi;Mozilla/5.0 (Linux; Android 10; Redmi Note 7 Build/QKQ1.190910.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/88.0.4324.152 Mobile Safari/537.36',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;network/3g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148',
|
||||||
|
'jdltapp;iPad;3.7.0;14.4;network/wifi;hasUPPay/0;pushNoticeIsOpen/1;lang/zh_CN;model/iPad6,3;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/231.11;pap/JA2020_3112531|3.7.0|IOS 14.4;apprpd/;psn/f5e7b7980fb50efc9c294ac38653c1584846c3db|305;usc/kong;jdv/0|kong|t_1000170135|tuiguang|notset|1613606450668|1613606450;umd/tuiguang;psq/2;ucp/t_1000170135;app_device/IOS;utr/notset;ref/JDLTRedPacketViewController;adk/;ads/;Mozilla/5.0 (iPad; CPU OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;13.5;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone8,1;addressid/669949466;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/9.11;apprpd/;ref/JDLTSubMainPageViewController;psq/10;ads/;psn/500a795cb2abae60b877ee4a1930557a800bef1c|11;jdv/;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 13.5;Mozilla/5.0 (iPhone; CPU iPhone OS 13_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.3;network/3g;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone13,4;addressid/;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/4.47;apprpd/;ref/JDLTSubMainPageViewController;psq/8;ads/;psn/21631ed983b3e854a3154b0336413825ad0d6783|9;jdv/0|direct|-|none|-|1614150725100|1614225882;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.3;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.3;network/3g;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone13,4;addressid/;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/4.47;apprpd/;ref/JDLTSubMainPageViewController;psq/8;ads/;psn/21631ed983b3e854a3154b0336413825ad0d6783|9;jdv/0|direct|-|none|-|1614150725100|1614225882;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.3;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone13,2;addressid/;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/3.15;apprpd/;ref/https%3A%2F%2Fjdcs.m.jd.com%2Fchat%2Findex.action%3Fentry%3Djd_m_JiSuCommodity%26pid%3D7763388%26lng%3D118.159665%26lat%3D24.504633%26sid%3D31cddc2d58f6e36bf2c31c4e8a79767w%26un_area%3D16_1315_3486_0;psq/12;ads/;psn/c10e0db6f15dec57a94637365f4c3d43e05bbd48|4;jdv/0|;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone13,2;addressid/;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/3.15;apprpd/;ref/https%3A%2F%2Fjdcs.m.jd.com%2Fchat%2Findex.action%3Fentry%3Djd_m_JiSuCommodity%26pid%3D7763388%26lng%3D118.159665%26lat%3D24.504633%26sid%3D31cddc2d58f6e36bf2c31c4e8a79767w%26un_area%3D16_1315_3486_0;psq/12;ads/;psn/c10e0db6f15dec57a94637365f4c3d43e05bbd48|4;jdv/0|;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone13,2;addressid/;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/3.15;apprpd/;ref/https%3A%2F%2Fjdcs.m.jd.com%2Fchat%2Findex.action%3Fentry%3Djd_m_JiSuCommodity%26pid%3D7763388%26lng%3D118.159665%26lat%3D24.504633%26sid%3D31cddc2d58f6e36bf2c31c4e8a79767w%26un_area%3D16_1315_3486_0;psq/12;ads/;psn/c10e0db6f15dec57a94637365f4c3d43e05bbd48|4;jdv/0|;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone11,6;hasOCPay/0;appBuild/1017;supportBestPay/0;addressid/2813715704;pv/67.38;apprpd/MyJD_Main;ref/https%3A%2F%2Fh5.m.jd.com%2FbabelDiy%2FZeus%2F2ynE8QDtc2svd36VowmYWBzzDdK6%2Findex.html%3Flng%3D103.957532%26lat%3D30.626962%26sid%3D4fe8ef4283b24723a7bb30ee87c18b2w%26un_area%3D22_1930_49324_52512;psq/4;ads/;psn/5aef178f95931bdbbde849ea9e2fc62b18bc5829|127;jdv/0|direct|-|none|-|1612588090667|1613822580;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.3;;network/4g;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone11,2;addressid/;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/6.28;apprpd/;ref/JDLTRedPacketViewController;psq/3;ads/;psn/d7beab54ae7758fa896c193b49470204fbb8fce9|8;jdv/0|kong|t_1001707023_|jingfen|79ad0319fa4d47e38521a616d80bc4bd|1613800945610|1613824900;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.3;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.3;network/4g;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone11,2;addressid/;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/6.28;apprpd/;ref/JDLTRedPacketViewController;psq/3;ads/;psn/d7beab54ae7758fa896c193b49470204fbb8fce9|8;jdv/0|kong|t_1001707023_|jingfen|79ad0319fa4d47e38521a616d80bc4bd|1613800945610|1613824900;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.3;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.3;;network/4g;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone11,2;addressid/;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/6.28;apprpd/;ref/JDLTRedPacketViewController;psq/3;ads/;psn/d7beab54ae7758fa896c193b49470204fbb8fce9|8;jdv/0|kong|t_1001707023_|jingfen|79ad0319fa4d47e38521a616d80bc4bd|1613800945610|1613824900;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.3;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.3;network/4g;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone11,2;addressid/;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/6.28;apprpd/;ref/JDLTRedPacketViewController;psq/3;ads/;psn/d7beab54ae7758fa896c193b49470204fbb8fce9|8;jdv/0|kong|t_1001707023_|jingfen|79ad0319fa4d47e38521a616d80bc4bd|1613800945610|1613824900;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.3;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.3;network/4g;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone11,2;addressid/;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/6.28;apprpd/;ref/JDLTRedPacketViewController;psq/3;ads/;psn/d7beab54ae7758fa896c193b49470204fbb8fce9|8;jdv/0|kong|t_1001707023_|jingfen|79ad0319fa4d47e38521a616d80bc4bd|1613800945610|1613824900;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.3;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;network/4g;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone12,1;addressid/3104834020;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/4.6;apprpd/;ref/JDLTSubMainPageViewController;psq/5;ads/;psn/c633e62b5a4ad0fdd93d9862bdcacfa8f3ecef63|6;jdv/0|;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.3;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone10,1;addressid/1346909722;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/30.8;apprpd/;ref/JDLTSubMainPageViewController;psq/7;ads/;psn/40d4d4323eb3987226cae367d6b0d8be50f2c7b3|39;jdv/0|kong|t_1000252057_0|tuiguang|eba7648a0f4445aa9cfa6f35c6f36e15|1613995717959|1613995723;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.3;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.3;network/wifi;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone10,1;addressid/1346909722;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/30.8;apprpd/;ref/JDLTSubMainPageViewController;psq/7;ads/;psn/40d4d4323eb3987226cae367d6b0d8be50f2c7b3|39;jdv/0|kong|t_1000252057_0|tuiguang|eba7648a0f4445aa9cfa6f35c6f36e15|1613995717959|1613995723;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.3;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone11,6;addressid/138164461;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/7.8;apprpd/;ref/JDLTSubMainPageViewController;psq/7;ads/;psn/d40e5d4a33c100e8527f779557c347569b49c304|7;jdv/0|kong|t_1001226363_|jingfen|3bf5372cb9cd445bbb270b8bc9a34f00|1608439066693|1608439068;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone11,6;addressid/138164461;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/7.8;apprpd/;ref/JDLTSubMainPageViewController;psq/7;ads/;psn/d40e5d4a33c100e8527f779557c347569b49c304|7;jdv/0|kong|t_1001226363_|jingfen|3bf5372cb9cd445bbb270b8bc9a34f00|1608439066693|1608439068;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone11,6;addressid/138164461;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/7.8;apprpd/;ref/JDLTSubMainPageViewController;psq/7;ads/;psn/d40e5d4a33c100e8527f779557c347569b49c304|7;jdv/0|kong|t_1001226363_|jingfen|3bf5372cb9cd445bbb270b8bc9a34f00|1608439066693|1608439068;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;13.5;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone9,2;addressid/2237496805;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/13.6;apprpd/;ref/JDLTSubMainPageViewController;psq/5;ads/;psn/48e495dcf5dc398b4d46b27e9f15a2b427a154aa|15;jdv/0|direct|-|none|-|1613354874698|1613952828;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 13.5;Mozilla/5.0 (iPhone; CPU iPhone OS 13_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;android;3.7.0;10;network/wifi;model/ONEPLUS A6000;addressid/0;aid/3d3bbb25af44c59c;oaid/;osVer/29;appBuild/1436;psn/ECbc2EqmdSa7mDF1PS1GSrV/Tn7R1LS1|6;psq/8;adk/;ads/;pap/JA2020_3112531|3.7.0|ANDROID 10;osv/10;pv/2.67;jdv/0|direct|-|none|-|1613822479379|1613991194;ref/com.jd.jdlite.lib.personal.view.fragment.JDPersonalFragment;partner/oppo;apprpd/MyJD_Main;eufv/1;Mozilla/5.0 (Linux; Android 10; ONEPLUS A6000 Build/QKQ1.190716.003; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/045140 Mobile Safari/537.36',
|
||||||
|
'jdltapp;android;3.7.0;8.1.0;network/wifi;model/16th Plus;addressid/0;aid/f909e5f2c464c7c6;oaid/;osVer/27;appBuild/1436;psn/c21YWvVr77Hn6 pOZfxXGY4TZrre1 UOL5hcPbCEDMo=|3;psq/10;adk/;ads/;pap/JA2020_3112531|3.7.0|ANDROID 8.1.0;osv/8.1.0;pv/2.15;jdv/;ref/com.jd.jdlite.lib.personal.view.fragment.JDPersonalFragment;partner/jsxdlyqj09;apprpd/MyJD_Main;eufv/1;Mozilla/5.0 (Linux; Android 8.1.0; 16th Plus Build/OPM1.171019.026; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045514 Mobile Safari/537.36',
|
||||||
|
'jdltapp;android;3.7.0;11;network/wifi;model/Mi 10 Pro;addressid/0;aid/14d7cbd934eb7dc1;oaid/335f198546eb3141;osVer/30;appBuild/1436;psn/ZcQh/Wov sNYfZ6JUjTIUBu28 KT0T3u|1;psq/24;adk/;ads/;pap/JA2020_3112531|3.7.0|ANDROID 11;osv/11;pv/1.24;jdv/;ref/com.jd.jdlite.lib.jdlitemessage.view.activity.MessageCenterMainActivity;partner/xiaomi;apprpd/MessageCenter_MessageMerge;eufv/1;Mozilla/5.0 (Linux; Android 11; Mi 10 Pro Build/RKQ1.200826.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/88.0.4324.181 Mobile Safari/537.36',
|
||||||
|
'jdltapp;android;3.7.0;10;network/wifi;model/MI 8;addressid/1969998059;aid/8566972dfd9a795d;oaid/4a8b773c3e307386;osVer/29;appBuild/1436;psn/PhYbUtCsCJo r 1b8hwxjnY8rEv5S8XC|383;psq/14;adk/;ads/;pap/JA2020_3112531|3.7.0|ANDROID 10;osv/10;pv/374.14;jdv/0|iosapp|t_335139774|liteshare|CopyURL|1609306590175|1609306596;ref/com.jd.jdlite.lib.jdlitemessage.view.activity.MessageCenterMainActivity;partner/jsxdlyqj09;apprpd/MessageCenter_MessageMerge;eufv/1;Mozilla/5.0 (Linux; Android 10; MI 8 Build/QKQ1.190828.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/045140 Mobile Safari/537.36',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone8,4;addressid/1477231693;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/21.15;apprpd/MyJD_Main;ref/https%3A%2F%2Fgold.jd.com%2F%3Flng%3D0.000000%26lat%3D0.000000%26sid%3D4584eb84dc00141b0d58e000583a338w%26un_area%3D19_1607_3155_62114;psq/0;ads/;psn/2c822e59db319590266cc83b78c4a943783d0077|46;jdv/0|;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone9,1;addressid/70390480;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/4.24;apprpd/MyJD_Main;ref/https%3A%2F%2Fjdcs.m.jd.com%2Fafter%2Findex.action%3FcategoryId%3D600%26v%3D6%26entry%3Dm_self_jd;psq/4;ads/;psn/6d343c58764a908d4fa56609da4cb3a5cc1396d3|17;jdv/0|;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone9,1;addressid/70390480;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/4.24;apprpd/MyJD_Main;ref/https%3A%2F%2Fjdcs.m.jd.com%2Fafter%2Findex.action%3FcategoryId%3D600%26v%3D6%26entry%3Dm_self_jd;psq/4;ads/;psn/6d343c58764a908d4fa56609da4cb3a5cc1396d3|17;jdv/0|;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;network/wifi;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone9,1;addressid/70390480;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/4.24;apprpd/MyJD_Main;ref/https%3A%2F%2Fjdcs.m.jd.com%2Fafter%2Findex.action%3FcategoryId%3D600%26v%3D6%26entry%3Dm_self_jd;psq/4;ads/;psn/6d343c58764a908d4fa56609da4cb3a5cc1396d3|17;jdv/0|;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone9,1;addressid/70390480;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/4.24;apprpd/MyJD_Main;ref/https%3A%2F%2Fjdcs.m.jd.com%2Fafter%2Findex.action%3FcategoryId%3D600%26v%3D6%26entry%3Dm_self_jd;psq/4;ads/;psn/6d343c58764a908d4fa56609da4cb3a5cc1396d3|17;jdv/0|;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPhone;3.7.0;14.4;network/4g;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone12,3;hasOCPay/0;appBuild/1017;supportBestPay/0;addressid/;pv/3.49;apprpd/MyJD_Main;ref/MyJdMTAManager;psq/7;ads/;psn/9e0e0ea9c6801dfd53f2e50ffaa7f84c7b40cd15|6;jdv/0|;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.4;Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
'jdltapp;iPad;3.7.0;14.4;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPad7,5;addressid/;hasOCPay/0;appBuild/1017;supportBestPay/0;pv/4.14;apprpd/MyJD_Main;ref/MyJdMTAManager;psq/3;ads/;psn/956c074c769cd2eeab2e36fca24ad4c9e469751a|8;jdv/0|;adk/;app_device/IOS;pap/JA2020_3112531|3.7.0|IOS 14.4;Mozilla/5.0 (iPad; CPU OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
|
]
|
||||||
|
/**
|
||||||
|
* 生成随机数字
|
||||||
|
* @param {number} min 最小值(包含)
|
||||||
|
* @param {number} max 最大值(不包含)
|
||||||
|
*/
|
||||||
|
function randomNumber(min = 0, max = 100) {
|
||||||
|
return Math.min(Math.floor(min + Math.random() * (max - min)), max);
|
||||||
|
}
|
||||||
|
const USER_AGENT = USER_AGENTS[randomNumber(0, USER_AGENTS.length)];
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
USER_AGENT
|
||||||
|
}
|
|
@ -0,0 +1,37 @@
|
||||||
|
FROM node:lts-alpine3.12
|
||||||
|
|
||||||
|
LABEL AUTHOR="none" \
|
||||||
|
VERSION=0.1.4
|
||||||
|
|
||||||
|
ARG KEY="-----BEGIN OPENSSH PRIVATE KEY-----\nb3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABFwAAAAdzc2gtcn\nNhAAAAAwEAAQAAAQEAvRQk2oQqLB01iVnJKrnI3tTfJyEHzc2ULVor4vBrKKWOum4dbTeT\ndNWL5aS+CJso7scJT3BRq5fYVZcz5ra0MLMdQyFL1DdwurmzkhPYbwcNrJrB8abEPJ8ltS\nMoa0X9ecmSepaQFedZOZ2YeT/6AAXY+cc6xcwyuRVQ2ZJ3YIMBrRuVkF6nYwLyBLFegzhu\nJJeU5o53kfpbTCirwK0h9ZsYwbNbXYbWuJHmtl5tEBf2Hz+5eCkigXRq8EhRZlSnXfhPr2\n32VCb1A/gav2/YEaMPSibuBCzqVMVruP5D625XkxMdBdLqLBGWt7bCas7/zH2bf+q3zac4\nLcIFhkC6XwAAA9BjE3IGYxNyBgAAAAdzc2gtcnNhAAABAQC9FCTahCosHTWJWckqucje1N\n8nIQfNzZQtWivi8GsopY66bh1tN5N01YvlpL4ImyjuxwlPcFGrl9hVlzPmtrQwsx1DIUvU\nN3C6ubOSE9hvBw2smsHxpsQ8nyW1IyhrRf15yZJ6lpAV51k5nZh5P/oABdj5xzrFzDK5FV\nDZkndggwGtG5WQXqdjAvIEsV6DOG4kl5TmjneR+ltMKKvArSH1mxjBs1tdhta4kea2Xm0Q\nF/YfP7l4KSKBdGrwSFFmVKdd+E+vbfZUJvUD+Bq/b9gRow9KJu4ELOpUxWu4/kPrbleTEx\n0F0uosEZa3tsJqzv/MfZt/6rfNpzgtwgWGQLpfAAAAAwEAAQAAAQEAnMKZt22CBWcGHuUI\nytqTNmPoy2kwLim2I0+yOQm43k88oUZwMT+1ilUOEoveXgY+DpGIH4twusI+wt+EUVDC3e\nlyZlixpLV+SeFyhrbbZ1nCtYrtJutroRMVUTNf7GhvucwsHGS9+tr+96y4YDZxkBlJBfVu\nvdUJbLfGe0xamvE114QaZdbmKmtkHaMQJOUC6EFJI4JmSNLJTxNAXKIi3TUrS7HnsO3Xfv\nhDHElzSEewIC1smwLahS6zi2uwP1ih4fGpJJbU6FF/jMvHf/yByHDtdcuacuTcU798qT0q\nAaYlgMd9zrLC1OHMgSDcoz9/NQTi2AXGAdo4N+mnxPTHcQAAAIB5XCz1vYVwJ8bKqBelf1\nw7OlN0QDM4AUdHdzTB/mVrpMmAnCKV20fyA441NzQZe/52fMASUgNT1dQbIWCtDU2v1cP6\ncG8uyhJOK+AaFeDJ6NIk//d7o73HNxR+gCCGacleuZSEU6075Or2HVGHWweRYF9hbmDzZb\nCLw6NsYaP2uAAAAIEA3t1BpGHHek4rXNjl6d2pI9Pyp/PCYM43344J+f6Ndg3kX+y03Mgu\n06o33etzyNuDTslyZzcYUQqPMBuycsEb+o5CZPtNh+1klAVE3aDeHZE5N5HrJW3fkD4EZw\nmOUWnRj1RT2TsLwixB21EHVm7fh8Kys1d2ULw54LVmtv4+O3cAAACBANkw7XZaZ/xObHC9\n1PlT6vyWg9qHAmnjixDhqmXnS5Iu8TaKXhbXZFg8gvLgduGxH/sGwSEB5D6sImyY+DW/OF\nbmIVC4hwDUbCsTMsmTTTgyESwmuQ++JCh6f2Ams1vDKbi+nOVyqRvCrAHtlpaqSfv8hkjK\npBBqa/rO5yyYmeJZAAAAFHJvb3RAbmFzLmV2aW5lLnByZXNzAQIDBAUG\n-----END OPENSSH PRIVATE KEY-----"
|
||||||
|
|
||||||
|
ENV DEFAULT_LIST_FILE=crontab_list.sh \
|
||||||
|
CUSTOM_LIST_MERGE_TYPE=append \
|
||||||
|
COOKIES_LIST=/scripts/logs/cookies.list \
|
||||||
|
REPO_URL=git@gitee.com:lxk0301/jd_scripts.git \
|
||||||
|
REPO_BRANCH=master
|
||||||
|
|
||||||
|
RUN set -ex \
|
||||||
|
&& apk update \
|
||||||
|
&& apk upgrade \
|
||||||
|
&& apk add --no-cache bash tzdata git moreutils curl jq openssh-client \
|
||||||
|
&& rm -rf /var/cache/apk/* \
|
||||||
|
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
|
||||||
|
&& echo "Asia/Shanghai" > /etc/timezone \
|
||||||
|
&& mkdir -p /root/.ssh \
|
||||||
|
&& echo -e $KEY > /root/.ssh/id_rsa \
|
||||||
|
&& chmod 600 /root/.ssh/id_rsa \
|
||||||
|
&& ssh-keyscan gitee.com > /root/.ssh/known_hosts \
|
||||||
|
&& git clone -b $REPO_BRANCH $REPO_URL /scripts \
|
||||||
|
&& cd /scripts \
|
||||||
|
&& mkdir logs \
|
||||||
|
&& npm config set registry https://registry.npm.taobao.org \
|
||||||
|
&& npm install \
|
||||||
|
&& cp /scripts/docker/docker_entrypoint.sh /usr/local/bin \
|
||||||
|
&& chmod +x /usr/local/bin/docker_entrypoint.sh
|
||||||
|
|
||||||
|
WORKDIR /scripts
|
||||||
|
|
||||||
|
ENTRYPOINT ["docker_entrypoint.sh"]
|
||||||
|
|
||||||
|
CMD [ "crond" ]
|
|
@ -0,0 +1,264 @@
|
||||||
|
![Docker Pulls](https://img.shields.io/docker/pulls/lxk0301/jd_scripts?style=for-the-badge)
|
||||||
|
### Usage
|
||||||
|
```diff
|
||||||
|
+ 2021-03-21更新 增加bot交互,spnode指令,功能是否开启自动根据你的配置判断,详见 https://gitee.com/lxk0301/jd_docker/pulls/18
|
||||||
|
**bot交互启动前置条件为 配置telegram通知,并且未使用自己代理的 TG_API_HOST**
|
||||||
|
**spnode使用前置条件未启动bot交互** _(后续可能去掉该限制_
|
||||||
|
使用bot交互+spnode后 后续用户的cookie维护更新只需要更新logs/cookies.conf即可
|
||||||
|
使用bot交互+spnode后 后续执行脚本命令请使用spnode否者无法使用logs/cookies.conf的cookies执行脚本,定时任务也将自动替换为spnode命令执行
|
||||||
|
发送/spnode给bot获取可执行脚本的列表,选择对应的按钮执行。(拓展使用:运行指定路径脚本,例:/spnode /scripts/jd_818.js)
|
||||||
|
spnode功能概述示例
|
||||||
|
spnode conc /scripts/jd_bean_change.js 为每个cookie单独执行jd_bean_change脚本(伪并发
|
||||||
|
spnode 1 /scripts/jd_bean_change.js 为logs/cookies.conf文件里面第一行cookie账户单独执行jd_bean_change脚本
|
||||||
|
spnode jd_XXXX /scripts/jd_bean_change.js 为logs/cookies.conf文件里面pt_pin=jd_XXXX的cookie账户单独执行jd_bean_change脚本
|
||||||
|
spnode /scripts/jd_bean_change.js 为logs/cookies.conf所有cookies账户一起执行jd_bean_change脚本
|
||||||
|
|
||||||
|
**请仔细阅读并理解上面的内容,使用bot交互默认开启spnode指令功能功能。**
|
||||||
|
+ 2021-03-9更新 新版docker单容器多账号自动互助
|
||||||
|
+开启方式:docker-compose.yml 中添加环境变量 - ENABLE_AUTO_HELP=true
|
||||||
|
+助力原则:不考虑需要被助力次数与提供助力次数 假设有3个账号,则生成: ”助力码1@助力码2@助力码3&助力码1@助力码2@助力码3&助力码1@助力码2@助力码3“
|
||||||
|
+原理说明:1、定时调用 /scripts/docker/auto_help.sh collect 收集各个活动的助力码,整理、去重、排序、保存到 /scripts/logs/sharecodeCollection.log;
|
||||||
|
2、(由于linux进程限制,父进程无法获取子进程环境变量)在每次脚本运行前,在当前进程先调用 /scripts/docker/auto_help.sh export 把助力码注入到环境变量
|
||||||
|
|
||||||
|
+ 2021-02-21更新 https://gitee.com/lxk0301/jd_scripts仓库被迫私有,老用户重新更新一下镜像:https://hub.docker.com/r/lxk0301/jd_scripts)(docker-compose.yml的REPO_URL记得修改)后续可同步更新jd_script仓库最新脚本
|
||||||
|
+ 2021-02-10更新 docker-compose里面,填写环境变量 SHARE_CODE_FILE=/scripts/logs/sharecode.log, 多账号可实现自己互助(只限sharecode.log日志里面几个活动),注:已停用,请使用2021-03-9更新
|
||||||
|
+ 2021-01-22更新 CUSTOM_LIST_FILE 参数支持远程定时任务列表 (⚠️务必确认列表中的任务在仓库里存在)
|
||||||
|
+ 例1:配置远程crontab_list.sh, 此处借用 shylocks 大佬的定时任务列表, 本仓库不包含列表中的任务代码, 仅作示范
|
||||||
|
+ CUSTOM_LIST_FILE=https://raw.githubusercontent.com/shylocks/Loon/main/docker/crontab_list.sh
|
||||||
|
+
|
||||||
|
+ 例2:配置docker挂载本地定时任务列表, 用法不变, 注意volumes挂载
|
||||||
|
+ volumes:
|
||||||
|
+ - ./my_crontab_list.sh:/scripts/docker/my_crontab_list.sh
|
||||||
|
+ environment:
|
||||||
|
+ - CUSTOM_LIST_FILE=my_crontab_list.sh
|
||||||
|
|
||||||
|
|
||||||
|
+ 2021-01-21更新 增加 DO_NOT_RUN_SCRIPTS 参数配置不执行的脚本
|
||||||
|
+ 例:DO_NOT_RUN_SCRIPTS=jd_family.js&jd_dreamFactory.js&jd_jxnc.js
|
||||||
|
建议填写完整文件名,不完整的文件名可能导致其他脚本被禁用。
|
||||||
|
例如:“jd_joy”会匹配到“jd_joy_feedPets”、“jd_joy_reward”、“jd_joy_steal”
|
||||||
|
|
||||||
|
+ 2021-01-03更新 增加 CUSTOM_SHELL_FILE 参数配置执行自定义shell脚本
|
||||||
|
+ 例1:配置远程shell脚本, 我自己写了一个shell脚本https://raw.githubusercontent.com/iouAkira/someDockerfile/master/jd_scripts/shell_script_mod.sh 内容很简单下载惊喜农场并添加定时任务
|
||||||
|
+ CUSTOM_SHELL_FILE=https://raw.githubusercontent.com/iouAkira/someDockerfile/master/jd_scripts/shell_script_mod.sh
|
||||||
|
+
|
||||||
|
+ 例2:配置docker挂载本地自定义shell脚本,/scripts/docker/shell_script_mod.sh 为你在docker-compose.yml里面挂载到容器里面绝对路径
|
||||||
|
+ CUSTOM_SHELL_FILE=/scripts/docker/shell_script_mod.sh
|
||||||
|
+
|
||||||
|
+ tip:如果使用远程自定义,请保证网络畅通或者选择合适的国内仓库,例如有部分人的容器里面就下载不到github的raw文件,那就可以把自己的自定义shell写在gitee上,或者换本地挂载
|
||||||
|
+ 如果是 docker 挂载本地,请保证文件挂载进去了,并且配置的是绝对路径。
|
||||||
|
+ 自定义 shell 脚本里面如果要加 crontab 任务请使用 echo 追加到 /scripts/docker/merged_list_file.sh 里面否则不生效
|
||||||
|
+ 注⚠️ 建议无shell能力的不要轻易使用,当然你可以找别人写好适配了这个docker镜像的脚本直接远程配置
|
||||||
|
+ 上面写了这么多如果还看不懂,不建议使用该变量功能。
|
||||||
|
_____
|
||||||
|
! ⚠️⚠️⚠️2020-12-11更新镜像启动方式,虽然兼容旧版的运行启动方式,但是强烈建议更新镜像和配置后使用
|
||||||
|
! 更新后`command:`指令配置不再需要
|
||||||
|
! 更新后可以使用自定义任务文件追加在默任务文件之后,比以前的完全覆盖多一个选择
|
||||||
|
! - 新的自定两个环境变量为 `CUSTOM_LIST_MERGE_TYPE`:自定文件的生效方式可选值为`append`,`overwrite`默认为`append` ; `CUSTOM_LIST_FILE`: 自定义文件的名字
|
||||||
|
! 更新镜像增减镜像更新通知,以后镜像如果更新之后,会通知用户更新
|
||||||
|
```
|
||||||
|
> 推荐使用`docker-compose`所以这里只介绍`docker-compose`使用方式
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Docker安装
|
||||||
|
|
||||||
|
- 国内一键安装 `sudo curl -sSL https://get.daocloud.io/docker | sh`
|
||||||
|
- 国外一键安装 `sudo curl -sSL get.docker.com | sh`
|
||||||
|
- 北京外国语大学开源软件镜像站 `https://mirrors.bfsu.edu.cn/help/docker-ce/`
|
||||||
|
|
||||||
|
|
||||||
|
docker-compose 安装(群晖`nas docker`自带安装了`docker-compose`)
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
|
||||||
|
sudo chmod +x /usr/local/bin/docker-compose
|
||||||
|
```
|
||||||
|
`Ubuntu`用户快速安装`docker-compose`
|
||||||
|
```
|
||||||
|
sudo apt-get update && sudo apt-get install -y python3-pip curl vim git moreutils
|
||||||
|
pip3 install --upgrade pip
|
||||||
|
pip install docker-compose
|
||||||
|
```
|
||||||
|
|
||||||
|
### win10用户下载安装[docker desktop](https://www.docker.com/products/docker-desktop)
|
||||||
|
|
||||||
|
通过`docker-compose version`查看`docker-compose`版本,确认是否安装成功。
|
||||||
|
|
||||||
|
|
||||||
|
### 如果需要使用 docker 多个账户独立并发执行定时任务,[参考这里](./example/docker%E5%A4%9A%E8%B4%A6%E6%88%B7%E4%BD%BF%E7%94%A8%E7%8B%AC%E7%AB%8B%E5%AE%B9%E5%99%A8%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E.md#%E4%BD%BF%E7%94%A8%E6%AD%A4%E6%96%B9%E5%BC%8F%E8%AF%B7%E5%85%88%E7%90%86%E8%A7%A3%E5%AD%A6%E4%BC%9A%E4%BD%BF%E7%94%A8docker%E5%8A%9E%E6%B3%95%E4%B8%80%E7%9A%84%E4%BD%BF%E7%94%A8%E6%96%B9%E5%BC%8F)
|
||||||
|
|
||||||
|
> 注⚠️:前提先理解学会使用这下面的教程
|
||||||
|
### 创建一个目录`jd_scripts`用于存放备份配置等数据,迁移重装的时候只需要备份整个jd_scripts目录即可
|
||||||
|
需要新建的目录文件结构参考如下:
|
||||||
|
```
|
||||||
|
jd_scripts
|
||||||
|
├── logs
|
||||||
|
│ ├── XXXX.log
|
||||||
|
│ └── XXXX.log
|
||||||
|
├── my_crontab_list.sh
|
||||||
|
└── docker-compose.yml
|
||||||
|
```
|
||||||
|
- `jd_scripts/logs`建一个空文件夹就行
|
||||||
|
- `jd_scripts/docker-compose.yml` 参考内容如下(自己动手能力不行搞不定请使用默认配置):
|
||||||
|
- - [使用默认配置用这个](./example/default.yml)
|
||||||
|
- - [使用自定义任务追加到默认任务之后用这个](./example/custom-append.yml)
|
||||||
|
- - [使用自定义任务覆盖默认任务用这个](./example/custom-overwrite.yml)
|
||||||
|
- - [一次启动多容器并发用这个](./example/multi.yml)
|
||||||
|
- - [使用群晖默认配置用这个](./example/jd_scripts.syno.json)
|
||||||
|
- - [使用群晖自定义任务追加到默认任务之后用这个](./example/jd_scripts.custom-append.syno.json)
|
||||||
|
- - [使用群晖自定义任务覆盖默认任务用这个](./example/jd_scripts.custom-overwrite.syno.json)
|
||||||
|
- `jd_scripts/docker-compose.yml`里面的环境变量(`environment:`)配置[参考这里](../githubAction.md#互助码类环境变量) 和[本文末尾](../docker/Readme.md#docker专属环境变量)
|
||||||
|
|
||||||
|
|
||||||
|
- `jd_scripts/my_crontab_list.sh` 参考内容如下,自己根据需要调整增加删除,不熟悉用户推荐使用[默认配置](./crontab_list.sh)里面的内容:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
# 每3天的23:50分清理一次日志(互助码不清理,proc_file.sh对该文件进行了去重)
|
||||||
|
50 23 */3 * * find /scripts/logs -name '*.log' | grep -v 'sharecode' | xargs rm -rf
|
||||||
|
|
||||||
|
##############短期活动##############
|
||||||
|
# 小鸽有礼2(活动时间:2021年1月28日~2021年2月28日)
|
||||||
|
34 9 * * * node /scripts/jd_xgyl.js >> /scripts/logs/jd_jd_xgyl.log 2>&1
|
||||||
|
|
||||||
|
#女装盲盒 活动时间:2021-2-19至2021-2-25
|
||||||
|
5 7,23 19-25 2 * node /scripts/jd_nzmh.js >> /scripts/logs/jd_nzmh.log 2>&1
|
||||||
|
|
||||||
|
#京东极速版天天领红包 活动时间:2021-1-18至2021-3-3
|
||||||
|
5 0,23 * * * node /scripts/jd_speed_redpocke.js >> /scripts/logs/jd_speed_redpocke.log 2>&1
|
||||||
|
##############长期活动##############
|
||||||
|
# 签到
|
||||||
|
3 0,18 * * * cd /scripts && node jd_bean_sign.js >> /scripts/logs/jd_bean_sign.log 2>&1
|
||||||
|
# 东东超市兑换奖品
|
||||||
|
0,30 0 * * * node /scripts/jd_blueCoin.js >> /scripts/logs/jd_blueCoin.log 2>&1
|
||||||
|
# 摇京豆
|
||||||
|
0 0 * * * node /scripts/jd_club_lottery.js >> /scripts/logs/jd_club_lottery.log 2>&1
|
||||||
|
# 东东农场
|
||||||
|
5 6-18/6 * * * node /scripts/jd_fruit.js >> /scripts/logs/jd_fruit.log 2>&1
|
||||||
|
# 宠汪汪
|
||||||
|
15 */2 * * * node /scripts/jd_joy.js >> /scripts/logs/jd_joy.log 2>&1
|
||||||
|
# 宠汪汪喂食
|
||||||
|
15 */1 * * * node /scripts/jd_joy_feedPets.js >> /scripts/logs/jd_joy_feedPets.log 2>&1
|
||||||
|
# 宠汪汪偷好友积分与狗粮
|
||||||
|
13 0-21/3 * * * node /scripts/jd_joy_steal.js >> /scripts/logs/jd_joy_steal.log 2>&1
|
||||||
|
# 摇钱树
|
||||||
|
0 */2 * * * node /scripts/jd_moneyTree.js >> /scripts/logs/jd_moneyTree.log 2>&1
|
||||||
|
# 东东萌宠
|
||||||
|
5 6-18/6 * * * node /scripts/jd_pet.js >> /scripts/logs/jd_pet.log 2>&1
|
||||||
|
# 京东种豆得豆
|
||||||
|
0 7-22/1 * * * node /scripts/jd_plantBean.js >> /scripts/logs/jd_plantBean.log 2>&1
|
||||||
|
# 京东全民开红包
|
||||||
|
1 1 * * * node /scripts/jd_redPacket.js >> /scripts/logs/jd_redPacket.log 2>&1
|
||||||
|
# 进店领豆
|
||||||
|
10 0 * * * node /scripts/jd_shop.js >> /scripts/logs/jd_shop.log 2>&1
|
||||||
|
# 京东天天加速
|
||||||
|
8 */3 * * * node /scripts/jd_speed.js >> /scripts/logs/jd_speed.log 2>&1
|
||||||
|
# 东东超市
|
||||||
|
11 1-23/5 * * * node /scripts/jd_superMarket.js >> /scripts/logs/jd_superMarket.log 2>&1
|
||||||
|
# 取关京东店铺商品
|
||||||
|
55 23 * * * node /scripts/jd_unsubscribe.js >> /scripts/logs/jd_unsubscribe.log 2>&1
|
||||||
|
# 京豆变动通知
|
||||||
|
0 10 * * * node /scripts/jd_bean_change.js >> /scripts/logs/jd_bean_change.log 2>&1
|
||||||
|
# 京东抽奖机
|
||||||
|
11 1 * * * node /scripts/jd_lotteryMachine.js >> /scripts/logs/jd_lotteryMachine.log 2>&1
|
||||||
|
# 京东排行榜
|
||||||
|
11 9 * * * node /scripts/jd_rankingList.js >> /scripts/logs/jd_rankingList.log 2>&1
|
||||||
|
# 天天提鹅
|
||||||
|
18 * * * * node /scripts/jd_daily_egg.js >> /scripts/logs/jd_daily_egg.log 2>&1
|
||||||
|
# 金融养猪
|
||||||
|
12 * * * * node /scripts/jd_pigPet.js >> /scripts/logs/jd_pigPet.log 2>&1
|
||||||
|
# 点点券
|
||||||
|
20 0,20 * * * node /scripts/jd_necklace.js >> /scripts/logs/jd_necklace.log 2>&1
|
||||||
|
# 京喜工厂
|
||||||
|
20 * * * * node /scripts/jd_dreamFactory.js >> /scripts/logs/jd_dreamFactory.log 2>&1
|
||||||
|
# 东东小窝
|
||||||
|
16 6,23 * * * node /scripts/jd_small_home.js >> /scripts/logs/jd_small_home.log 2>&1
|
||||||
|
# 东东工厂
|
||||||
|
36 * * * * node /scripts/jd_jdfactory.js >> /scripts/logs/jd_jdfactory.log 2>&1
|
||||||
|
# 十元街
|
||||||
|
36 8,18 * * * node /scripts/jd_syj.js >> /scripts/logs/jd_syj.log 2>&1
|
||||||
|
# 京东快递签到
|
||||||
|
23 1 * * * node /scripts/jd_kd.js >> /scripts/logs/jd_kd.log 2>&1
|
||||||
|
# 京东汽车(签到满500赛点可兑换500京豆)
|
||||||
|
0 0 * * * node /scripts/jd_car.js >> /scripts/logs/jd_car.log 2>&1
|
||||||
|
# 领京豆额外奖励(每日可获得3京豆)
|
||||||
|
33 4 * * * node /scripts/jd_bean_home.js >> /scripts/logs/jd_bean_home.log 2>&1
|
||||||
|
# 微信小程序京东赚赚
|
||||||
|
10 11 * * * node /scripts/jd_jdzz.js >> /scripts/logs/jd_jdzz.log 2>&1
|
||||||
|
# 宠汪汪邀请助力
|
||||||
|
10 9-20/2 * * * node /scripts/jd_joy_run.js >> /scripts/logs/jd_joy_run.log 2>&1
|
||||||
|
# crazyJoy自动每日任务
|
||||||
|
10 7 * * * node /scripts/jd_crazy_joy.js >> /scripts/logs/jd_crazy_joy.log 2>&1
|
||||||
|
# 京东汽车旅程赛点兑换金豆
|
||||||
|
0 0 * * * node /scripts/jd_car_exchange.js >> /scripts/logs/jd_car_exchange.log 2>&1
|
||||||
|
# 导到所有互助码
|
||||||
|
47 7 * * * node /scripts/jd_get_share_code.js >> /scripts/logs/jd_get_share_code.log 2>&1
|
||||||
|
# 口袋书店
|
||||||
|
7 8,12,18 * * * node /scripts/jd_bookshop.js >> /scripts/logs/jd_bookshop.log 2>&1
|
||||||
|
# 京喜农场
|
||||||
|
0 9,12,18 * * * node /scripts/jd_jxnc.js >> /scripts/logs/jd_jxnc.log 2>&1
|
||||||
|
# 签到领现金
|
||||||
|
27 */4 * * * node /scripts/jd_cash.js >> /scripts/logs/jd_cash.log 2>&1
|
||||||
|
# 京喜app签到
|
||||||
|
39 7 * * * node /scripts/jx_sign.js >> /scripts/logs/jx_sign.log 2>&1
|
||||||
|
# 京东家庭号(暂不知最佳cron)
|
||||||
|
# */20 * * * * node /scripts/jd_family.js >> /scripts/logs/jd_family.log 2>&1
|
||||||
|
# 闪购盲盒
|
||||||
|
27 8 * * * node /scripts/jd_sgmh.js >> /scripts/logs/jd_sgmh.log 2>&1
|
||||||
|
# 京东秒秒币
|
||||||
|
10 7 * * * node /scripts/jd_ms.js >> /scripts/logs/jd_ms.log 2>&1
|
||||||
|
#美丽研究院
|
||||||
|
1 7,12,19 * * * node /scripts/jd_beauty.js >> /scripts/logs/jd_beauty.log 2>&1
|
||||||
|
#京东保价
|
||||||
|
1 0,23 * * * node /scripts/jd_price.js >> /scripts/logs/jd_price.log 2>&1
|
||||||
|
#京东极速版签到+赚现金任务
|
||||||
|
1 1,6 * * * node /scripts/jd_speed_sign.js >> /scripts/logs/jd_speed_sign.log 2>&1
|
||||||
|
# 删除优惠券(默认注释,如需要自己开启,如有误删,已删除的券可以在回收站中还原,慎用)
|
||||||
|
#20 9 * * 6 node /scripts/jd_delCoupon.js >> /scripts/logs/jd_delCoupon.log 2>&1
|
||||||
|
```
|
||||||
|
> 定时任务命之后,也就是 `>>` 符号之前加上 `|ts` 可在日志每一行前面显示时间,如下图:
|
||||||
|
> ![image](https://user-images.githubusercontent.com/6993269/99031839-09e04b00-25b3-11eb-8e47-0b6515a282bb.png)
|
||||||
|
- 目录文件配置好之后在 `jd_scripts`目录执行。
|
||||||
|
`docker-compose up -d` 启动(修改docker-compose.yml后需要使用此命令使更改生效);
|
||||||
|
`docker-compose logs` 打印日志;
|
||||||
|
`docker-compose logs -f` 打印日志,-f表示跟随日志;
|
||||||
|
`docker logs -f jd_scripts` 和上面两条相比可以显示汉字;
|
||||||
|
`docker-compose pull` 更新镜像;多容器用户推荐使用`docker pull lxk0301/jd_scripts`;
|
||||||
|
`docker-compose stop` 停止容器;
|
||||||
|
`docker-compose restart` 重启容器;
|
||||||
|
`docker-compose down` 停止并删除容器;
|
||||||
|
|
||||||
|
- 你可能会用到的命令
|
||||||
|
|
||||||
|
`docker exec -it jd_scripts /bin/sh -c ". /scripts/docker/auto_help.sh export > /scripts/logs/auto_help_export.log && node /scripts/xxxx.js |ts >> /scripts/logs/xxxx.log 2>&1"` 手动运行一脚本(有自动助力)
|
||||||
|
|
||||||
|
`docker exec -it jd_scripts /bin/sh -c "node /scripts/xxxx.js |ts >> /scripts/logs/xxxx.log 2>&1"` 手动运行一脚本(无自动助力)
|
||||||
|
|
||||||
|
`docker exec -it jd_scripts /bin/sh -c 'env'` 查看设置的环境变量
|
||||||
|
|
||||||
|
`docker exec -it jd_scripts /bin/sh -c 'crontab -l'` 查看已生效的crontab_list定时器任务
|
||||||
|
|
||||||
|
`docker exec -it jd_scripts sh -c "git pull"` 手动更新jd_scripts仓库最新脚本(默认已有每天拉取两次的定时任务,不推荐使用)
|
||||||
|
|
||||||
|
`docker exec -it jd_scripts /bin/sh` 仅进入容器命令
|
||||||
|
|
||||||
|
`rm -rf logs/*.log` 删除logs文件夹里面所有的日志文件(linux)
|
||||||
|
|
||||||
|
`docker exec -it jd_scripts /bin/sh -c ' ls jd_*.js | grep -v jd_crazy_joy_coin.js |xargs -i node {}'` 执行所有定时任务
|
||||||
|
|
||||||
|
- 如果是群晖用户,在docker注册表搜`jd_scripts`,双击下载映像。
|
||||||
|
不需要`docker-compose.yml`,只需建个logs/目录,调整`jd_scripts.syno.json`里面对应的配置值,然后导入json配置新建容器。
|
||||||
|
若要自定义`my_crontab_list.sh`,再建个`my_crontab_list.sh`文件,配置参考`jd_scripts.my_crontab_list.syno.json`。
|
||||||
|
![image](../icon/qh1.png)
|
||||||
|
|
||||||
|
![image](../icon/qh2.png)
|
||||||
|
|
||||||
|
![image](../icon/qh3.png)
|
||||||
|
|
||||||
|
### DOCKER专属环境变量
|
||||||
|
|
||||||
|
| Name | 归属 | 属性 | 说明 |
|
||||||
|
| :---------------: | :------------: | :----: | ------------------------------------------------------------ |
|
||||||
|
| `CRZAY_JOY_COIN_ENABLE` | 是否jd_crazy_joy_coin挂机 | 非必须 | `docker-compose.yml`文件下填写`CRZAY_JOY_COIN_ENABLE=Y`表示挂机,`CRZAY_JOY_COIN_ENABLE=N`表不挂机 |
|
||||||
|
| `DO_NOT_RUN_SCRIPTS` | 不执行的脚本 | 非必须 | 例:`docker-compose.yml`文件里面填写`DO_NOT_RUN_SCRIPTS=jd_family.js&jd_dreamFactory.js&jd_jxnc.js`, 建议填写完整脚本名,不完整的文件名可能导致其他脚本被禁用 |
|
||||||
|
| `ENABLE_AUTO_HELP` | 单容器多账号自动互助 | 非必须 | 例:`docker-compose.yml`文件里面填写`ENABLE_AUTO_HELP=true` |
|
|
@ -0,0 +1,155 @@
|
||||||
|
#set -e
|
||||||
|
|
||||||
|
#日志路径
|
||||||
|
logDir="/scripts/logs"
|
||||||
|
|
||||||
|
# 处理后的log文件
|
||||||
|
logFile=${logDir}/sharecodeCollection.log
|
||||||
|
if [ -n "$1" ]; then
|
||||||
|
parameter=${1}
|
||||||
|
else
|
||||||
|
echo "没有参数"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 收集助力码
|
||||||
|
collectSharecode() {
|
||||||
|
if [ -f ${2} ]; then
|
||||||
|
echo "${1}:清理 ${preLogFile} 中的旧助力码,收集新助力码"
|
||||||
|
|
||||||
|
#删除预处理旧助力码
|
||||||
|
if [ -f "${logFile}" ]; then
|
||||||
|
sed -i '/'"${1}"'/d' ${logFile}
|
||||||
|
fi
|
||||||
|
|
||||||
|
#收集日志中的互助码
|
||||||
|
codes="$(sed -n '/'${1}'.*/'p ${2} | sed 's/京东账号/京东账号 /g' | sed 's/(/ (/g' | sed 's/】/】 /g' | awk '{print $4,$5,$6,$7}' | sort -gk2 | awk '!a[$2" "$3]++{print}')"
|
||||||
|
|
||||||
|
#获取ck文件夹中的pin值集合
|
||||||
|
if [ -f "/usr/local/bin/spnode" ]; then
|
||||||
|
ptpins="$(awk -F "=" '{print $3}' $COOKIES_LIST | awk -F ";" '{print $1}')"
|
||||||
|
else
|
||||||
|
ptpins="$(echo $JD_COOKIE | sed "s/[ &]/\\n/g" | sed "/^$/d" | awk -F "=" '{print $3}' | awk -F ";" '{print $1}')"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
#遍历pt_pin值
|
||||||
|
for item in $ptpins; do
|
||||||
|
#中文pin解码
|
||||||
|
if [ ${#item} > 20 ]; then
|
||||||
|
item="$(printf $(echo -n "$item" | sed 's/\\/\\\\/g;s/\(%\)\([0-9a-fA-F][0-9a-fA-F]\)/\\x\2/g')"\n")"
|
||||||
|
fi
|
||||||
|
#根据pin值匹配第一个code结果输出到文件中
|
||||||
|
echo "$codes" | grep -m1 $item >> $logFile
|
||||||
|
done
|
||||||
|
else
|
||||||
|
echo "${1}:${2} 文件不存在,不清理 ${logFile} 中的旧助力码"
|
||||||
|
fi
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
# 导出助力码
|
||||||
|
exportSharecode() {
|
||||||
|
if [ -f ${logFile} ]; then
|
||||||
|
#账号数
|
||||||
|
cookiecount=$(echo ${JD_COOKIE} | grep -o pt_key | grep -c pt_key)
|
||||||
|
if [ -f /usr/local/bin/spnode ]; then
|
||||||
|
cookiecount=$(cat "$COOKIES_LIST" | grep -o pt_key | grep -c pt_key)
|
||||||
|
fi
|
||||||
|
echo "cookie个数:${cookiecount}"
|
||||||
|
|
||||||
|
# 单个账号助力码
|
||||||
|
singleSharecode=$(sed -n '/'${1}'.*/'p ${logFile} | awk '{print $4}' | awk '{T=T"@"$1} END {print T}' | awk '{print substr($1,2)}')
|
||||||
|
# | awk '{print $2,$4}' | sort -g | uniq
|
||||||
|
# echo "singleSharecode:${singleSharecode}"
|
||||||
|
|
||||||
|
# 拼接多个账号助力码
|
||||||
|
num=1
|
||||||
|
while [ ${num} -le ${cookiecount} ]; do
|
||||||
|
local allSharecode=${allSharecode}"&"${singleSharecode}
|
||||||
|
num=$(expr $num + 1)
|
||||||
|
done
|
||||||
|
|
||||||
|
allSharecode=$(echo ${allSharecode} | awk '{print substr($1,2)}')
|
||||||
|
|
||||||
|
# echo "${1}:${allSharecode}"
|
||||||
|
|
||||||
|
#判断合成的助力码长度是否大于账号数,不大于,则可知没有助力码
|
||||||
|
if [ ${#allSharecode} -gt ${cookiecount} ]; then
|
||||||
|
echo "${1}:导出助力码"
|
||||||
|
echo "${3}=${allSharecode}"
|
||||||
|
export ${3}=${allSharecode}
|
||||||
|
else
|
||||||
|
echo "${1}:没有助力码,不导出"
|
||||||
|
fi
|
||||||
|
|
||||||
|
else
|
||||||
|
echo "${1}:${logFile} 不存在,不导出助力码"
|
||||||
|
fi
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#生成助力码
|
||||||
|
autoHelp() {
|
||||||
|
if [ ${parameter} == "collect" ]; then
|
||||||
|
|
||||||
|
# echo "收集助力码"
|
||||||
|
collectSharecode ${1} ${2} ${3}
|
||||||
|
|
||||||
|
elif [ ${parameter} == "export" ]; then
|
||||||
|
|
||||||
|
# echo "导出助力码"
|
||||||
|
exportSharecode ${1} ${2} ${3}
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
#日志需要为这种格式才能自动提取
|
||||||
|
#Mar 07 00:15:10 【京东账号1(xxxxxx)的京喜财富岛好友互助码】3B41B250C4A369EE6DCA6834880C0FE0624BAFD83FC03CA26F8DEC7DB95D658C
|
||||||
|
|
||||||
|
#新增自动助力活动格式
|
||||||
|
# autoHelp 关键词 日志路径 变量名
|
||||||
|
|
||||||
|
############# 短期活动 #############
|
||||||
|
|
||||||
|
|
||||||
|
############# 长期活动 #############
|
||||||
|
|
||||||
|
#东东农场
|
||||||
|
autoHelp "东东农场好友互助码" "${logDir}/jd_fruit.log" "FRUITSHARECODES"
|
||||||
|
|
||||||
|
#东东萌宠
|
||||||
|
autoHelp "东东萌宠好友互助码" "${logDir}/jd_pet.log" "PETSHARECODES"
|
||||||
|
|
||||||
|
#种豆得豆
|
||||||
|
autoHelp "京东种豆得豆好友互助码" "${logDir}/jd_plantBean.log" "PLANT_BEAN_SHARECODES"
|
||||||
|
|
||||||
|
#京喜工厂
|
||||||
|
autoHelp "京喜工厂好友互助码" "${logDir}/jd_dreamFactory.log" "DREAM_FACTORY_SHARE_CODES"
|
||||||
|
|
||||||
|
#东东工厂
|
||||||
|
autoHelp "东东工厂好友互助码" "${logDir}/jd_jdfactory.log" "DDFACTORY_SHARECODES"
|
||||||
|
|
||||||
|
#crazyJoy
|
||||||
|
autoHelp "crazyJoy任务好友互助码" "${logDir}/jd_crazy_joy.log" "JDJOY_SHARECODES"
|
||||||
|
|
||||||
|
#京喜财富岛
|
||||||
|
autoHelp "京喜财富岛好友互助码" "${logDir}/jd_cfd.log" "JDCFD_SHARECODES"
|
||||||
|
|
||||||
|
#京喜农场
|
||||||
|
autoHelp "京喜农场好友互助码" "${logDir}/jd_jxnc.log" "JXNC_SHARECODES"
|
||||||
|
|
||||||
|
#京东赚赚
|
||||||
|
autoHelp "京东赚赚好友互助码" "${logDir}/jd_jdzz.log" "JDZZ_SHARECODES"
|
||||||
|
|
||||||
|
######### 日志打印格式需调整 #########
|
||||||
|
|
||||||
|
#口袋书店
|
||||||
|
autoHelp "口袋书店好友互助码" "${logDir}/jd_bookshop.log" "BOOKSHOP_SHARECODES"
|
||||||
|
|
||||||
|
#领现金
|
||||||
|
autoHelp "签到领现金好友互助码" "${logDir}/jd_cash.log" "JD_CASH_SHARECODES"
|
||||||
|
|
||||||
|
#闪购盲盒
|
||||||
|
autoHelp "闪购盲盒好友互助码" "${logDir}/jd_sgmh.log" "JDSGMH_SHARECODES"
|
||||||
|
|
||||||
|
#东东健康社区
|
||||||
|
autoHelp "东东健康社区好友互助码" "${logDir}/jd_health.log" "JDHEALTH_SHARECODES"
|
Binary file not shown.
After Width: | Height: | Size: 7.2 KiB |
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,5 @@
|
||||||
|
python_telegram_bot==13.0
|
||||||
|
requests==2.23.0
|
||||||
|
MyQR==2.3.1
|
||||||
|
telegram==0.0.1
|
||||||
|
tzlocal<3.0
|
|
@ -0,0 +1,13 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# @Author : iouAkira(lof)
|
||||||
|
# @mail : e.akimoto.akira@gmail.com
|
||||||
|
# @CreateTime: 2020-11-02
|
||||||
|
# @UpdateTime: 2021-03-21
|
||||||
|
|
||||||
|
from setuptools import setup
|
||||||
|
|
||||||
|
setup(
|
||||||
|
name='jd-scripts-bot',
|
||||||
|
version='0.2',
|
||||||
|
scripts=['jd_bot', ],
|
||||||
|
)
|
|
@ -0,0 +1,229 @@
|
||||||
|
# 每3天的23:50分清理一次日志(互助码不清理,proc_file.sh对该文件进行了去重)
|
||||||
|
50 23 */3 * * find /scripts/logs -name '*.log' | grep -v 'sharecodeCollection' | xargs rm -rf
|
||||||
|
#收集助力码
|
||||||
|
30 * * * * sh +x /scripts/docker/auto_help.sh collect >> /scripts/logs/auto_help_collect.log 2>&1
|
||||||
|
|
||||||
|
##############活动##############
|
||||||
|
|
||||||
|
#宠汪汪
|
||||||
|
35 0-23/2 * * * node /scripts/jd_joy.js >> /scripts/logs/jd_joy.log 2>&1
|
||||||
|
#宠汪汪兑换
|
||||||
|
59 7,15,23 * * * node /scripts/jd_joy_reward.js >> /scripts/logs/jd_joy_reward.log 2>&1
|
||||||
|
#点点券
|
||||||
|
#10 6,20 * * * node /scripts/jd_necklace.js >> /scripts/logs/jd_necklace.log 2>&1
|
||||||
|
#惊喜签到
|
||||||
|
0 3,8 * * * node /scripts/jd_jxsign.js >> /scripts/logs/jd_jxsign.log 2>&1
|
||||||
|
#东东超市兑换奖品
|
||||||
|
59 23 * * * node /scripts/jd_blueCoin.js >> /scripts/logs/jd_blueCoin.log 2>&1
|
||||||
|
#财富岛
|
||||||
|
35 * * * * node /scripts/jd_cfd.js >> /scripts/logs/jd_cfd.log 2>&1
|
||||||
|
#京东汽车
|
||||||
|
10 4,20 * * * node /scripts/jd_car.js >> /scripts/logs/jd_car.log 2>&1
|
||||||
|
#金榜创造营
|
||||||
|
13 5,19 * * * node /scripts/jd_gold_creator.js >> /scripts/logs/jd_gold_creator.log 2>&1
|
||||||
|
#京东多合一签到
|
||||||
|
0 4,14 * * * node /scripts/jd_bean_sign.js >> /scripts/logs/jd_bean_sign.log 2>&1
|
||||||
|
#半点京豆雨
|
||||||
|
30 0-23/1 * * * node /scripts/jd_half_redrain.js >> /scripts/logs/jd_half_redrain.log 2>&1
|
||||||
|
#东东超市
|
||||||
|
39 * * * * node /scripts/jd_superMarket.js >> /scripts/logs/jd_superMarket.log 2>&1
|
||||||
|
#京东极速版红包
|
||||||
|
20 2,12 * * * node /scripts/jd_speed_redpocke.js >> /scripts/logs/jd_speed_redpocke.log 2>&1
|
||||||
|
#领京豆额外奖励
|
||||||
|
10 3,9 * * * node /scripts/jd_bean_home.js >> /scripts/logs/jd_bean_home.log 2>&1
|
||||||
|
#京东资产变动通知
|
||||||
|
0 12 * * * node /scripts/jd_bean_change.js >> /scripts/logs/jd_bean_change.log 2>&1
|
||||||
|
#京东极速版
|
||||||
|
0 1,7 * * * node /scripts/jd_speed_sign.js >> /scripts/logs/jd_speed_sign.log 2>&1
|
||||||
|
#我是大老板
|
||||||
|
35 0-23/1 * * * node /scripts/jd_wsdlb.js >> /scripts/logs/jd_wsdlb.log 2>&1
|
||||||
|
#
|
||||||
|
5 3,19 * * * node /scripts/jd_unsubscribe.js >> /scripts/logs/jd_unsubscribe.log 2>&1
|
||||||
|
#东东萌宠
|
||||||
|
45 6-18/6 * * * node /scripts/jd_pet.js >> /scripts/logs/jd_pet.log 2>&1
|
||||||
|
#挑一挑
|
||||||
|
1 3,9,18 * * * node /scripts/jd_jump.js >> /scripts/logs/jd_jump.log 2>&1
|
||||||
|
#
|
||||||
|
36 0,1-23/3 * * * node /scripts/jd_mohe.js >> /scripts/logs/jd_mohe.log 2>&1
|
||||||
|
#种豆得豆
|
||||||
|
44 0-23/6 * * * node /scripts/jd_plantBean.js >> /scripts/logs/jd_plantBean.log 2>&1
|
||||||
|
#东东农场
|
||||||
|
35 6-18/6 * * * node /scripts/jd_fruit.js >> /scripts/logs/jd_fruit.log 2>&1
|
||||||
|
#删除优惠券
|
||||||
|
0 3,20 * * * node /scripts/jd_delCoupon.js >> /scripts/logs/jd_delCoupon.log 2>&1
|
||||||
|
#
|
||||||
|
5 2,19 * * * node /scripts/jd_club_lottery.js >> /scripts/logs/jd_club_lottery.log 2>&1
|
||||||
|
#
|
||||||
|
40 * * * * node /scripts/jd_jdfactory.js >> /scripts/logs/jd_jdfactory.log 2>&1
|
||||||
|
#
|
||||||
|
0 0-23/1 * * * node /scripts/jd_super_redrain.js >> /scripts/logs/jd_super_redrain.log 2>&1
|
||||||
|
#领金贴
|
||||||
|
10 1 * * * node /scripts/jd_jin_tie.js >> /scripts/logs/jd_jin_tie.log 2>&1
|
||||||
|
#健康社区
|
||||||
|
13 2,5,20 * * * node /scripts/jd_health.js >> /scripts/logs/jd_health.log 2>&1
|
||||||
|
#秒秒币
|
||||||
|
10 2 * * * node /scripts/jd_ms.js >> /scripts/logs/jd_ms.log 2>&1
|
||||||
|
#
|
||||||
|
1 2,15,19 * * * node /scripts/jd_daily_lottery.js >> /scripts/logs/jd_daily_lottery.log 2>&1
|
||||||
|
#
|
||||||
|
9 0-23/3 * * * node /scripts/jd_ddnc_farmpark.js >> /scripts/logs/jd_ddnc_farmpark.log 2>&1
|
||||||
|
#京喜工厂
|
||||||
|
39 * * * * node /scripts/jd_dreamFactory.js >> /scripts/logs/jd_dreamFactory.log 2>&1
|
||||||
|
#闪购盲盒
|
||||||
|
20 4,16,19 * * * node /scripts/jd_sgmh.js >> /scripts/logs/jd_sgmh.log 2>&1
|
||||||
|
#
|
||||||
|
0 0 * * * node /scripts/jd_bean_change1.js >> /scripts/logs/jd_bean_change1.log 2>&1
|
||||||
|
#
|
||||||
|
1 0 * * * node /scripts/jd_shop.js >> /scripts/logs/jd_shop.log 2>&1
|
||||||
|
#摇钱树
|
||||||
|
23 0-23/2 * * * node /scripts/jd_moneyTree.js >> /scripts/logs/jd_moneyTree.log 2>&1
|
||||||
|
#排行榜
|
||||||
|
37 2 * * * node /scripts/jd_rankingList.js >> /scripts/logs/jd_rankingList.log 2>&1
|
||||||
|
#
|
||||||
|
32 0-23/6 * * * node /scripts/jd_pigPet.js >> /scripts/logs/jd_pigPet.log 2>&1
|
||||||
|
#
|
||||||
|
10-20/5 12 * * * node /scripts/jd_live.js >> /scripts/logs/jd_live.log 2>&1
|
||||||
|
#京东快递
|
||||||
|
40 0 * * * node /scripts/jd_kd.js >> /scripts/logs/jd_kd.log 2>&1
|
||||||
|
#美丽研究院
|
||||||
|
16 9,15,17 * * * node /scripts/jd_beauty.js >> /scripts/logs/jd_beauty.log 2>&1
|
||||||
|
#京喜牧场
|
||||||
|
48 0-23/3 * * * node /scripts/jd_jxmc.js >> /scripts/logs/jd_jxmc.log 2>&1
|
||||||
|
#京东试用
|
||||||
|
30 10 * * * node /scripts/jd_try.js >> /scripts/logs/jd_try.log 2>&1
|
||||||
|
#领现金
|
||||||
|
42 0-23/6 * * * node /scripts/jd_cash.js >> /scripts/logs/jd_cash.log 2>&1
|
||||||
|
#赚金币
|
||||||
|
0 8 * * * node /scripts/jd_zjb.js >> /scripts/logs/jd_zjb.log 2>&1
|
||||||
|
#
|
||||||
|
# 0 6 * * * node /scripts/getJDCookie.js >> /scripts/logs/getJDCookie.log 2>&1
|
||||||
|
#京东赚赚
|
||||||
|
10 0 * * * node /scripts/jd_jdzz.js >> /scripts/logs/jd_jdzz.log 2>&1
|
||||||
|
#获取互助码
|
||||||
|
20 13 * * 6 node /scripts/jd_get_share_code.js >> /scripts/logs/jd_get_share_code.log 2>&1
|
||||||
|
#
|
||||||
|
15-55/20 * * * * node /scripts/jd_health_collect.js >> /scripts/logs/jd_health_collect.log 2>&1
|
||||||
|
#京东到家果园
|
||||||
|
10 0,8,11,17 * * * node /scripts/jd_jddj_fruit.js >> /scripts/logs/jd_jddj_fruit.log 2>&1
|
||||||
|
#京东到家
|
||||||
|
5 0,6,12 * * * node /scripts/jd_jddj_bean.js >> /scripts/logs/jd_jddj_bean.log 2>&1
|
||||||
|
#京东到家收水滴
|
||||||
|
10 * * * * node /scripts/jd_jddj_collectWater.js >> /scripts/logs/jd_jddj_collectWater.log 2>&1
|
||||||
|
#京东到家
|
||||||
|
5-40/5 * * * * node /scripts/jd_jddj_getPoints.js >> /scripts/logs/jd_jddj_getPoints.log 2>&1
|
||||||
|
#京东到家
|
||||||
|
20 */4 * * * node /scripts/jd_jddj_plantBeans.js >> /scripts/logs/jd_jddj_plantBeans.log 2>&1
|
||||||
|
#
|
||||||
|
13 3 * * * node /scripts/jd_drawEntrance.js >> /scripts/logs/jd_drawEntrance.log 2>&1
|
||||||
|
#特务
|
||||||
|
1,10 0 * * * node /scripts/jd_superBrand.js >> /scripts/logs/jd_superBrand.log 2>&1
|
||||||
|
#送豆得豆
|
||||||
|
5 0,12 * * * node /scripts/jd_SendBean.js >> /scripts/logs/jd_SendBean.log 2>&1
|
||||||
|
#
|
||||||
|
20 0,2 * * * node /scripts/jd_wish.js >> /scripts/logs/jd_wish.log 2>&1
|
||||||
|
#财富岛气球
|
||||||
|
5 * * * * node /scripts/jd_cfd_loop.js >> /scripts/logs/jd_cfd_loop.log 2>&1
|
||||||
|
#宠汪汪偷狗粮
|
||||||
|
40 0-21/3 * * * node /scripts/jd_joy_steal.js >> /scripts/logs/jd_joy_steal.log 2>&1
|
||||||
|
#京小鸽
|
||||||
|
18 4,11 * * * node /scripts/jd_jxg.js >> /scripts/logs/jd_jxg.log 2>&1
|
||||||
|
#
|
||||||
|
20 6,7 * * * node /scripts/jd_morningSc.js >> /scripts/logs/jd_morningSc.log 2>&1
|
||||||
|
#领现金兑换
|
||||||
|
0 0 * * * node /scripts/jd_cash_exchange.js >> /scripts/logs/jd_cash_exchange.log 2>&1
|
||||||
|
#快手水果
|
||||||
|
33 1,8,12,19 * * * node /scripts/jd_ks_fruit.js >> /scripts/logs/jd_ks_fruit.log 2>&1
|
||||||
|
#宠汪汪喂食
|
||||||
|
15 0-23/1 * * * node /scripts/jd_joy_feedPets.js >> /scripts/logs/jd_joy_feedPets.log 2>&1
|
||||||
|
#宠汪汪赛跑
|
||||||
|
15 10,12 * * * node /scripts/jd_joy_run.js >> /scripts/logs/jd_joy_run.log 2>&1
|
||||||
|
#领京豆
|
||||||
|
38 8,13 * * * node /scripts/jd_mdou.js >> /scripts/logs/jd_mdou.log 2>&1
|
||||||
|
#
|
||||||
|
0 1 * * * node /scripts/jd_cleancart.js >> /scripts/logs/jd_cleancart.log 2>&1
|
||||||
|
#店铺签到
|
||||||
|
2 2 * * * node /scripts/jd_dpqd.js >> /scripts/logs/jd_dpqd.log 2>&1
|
||||||
|
#推一推
|
||||||
|
2 12 * * * node /scripts/jd_tyt.js >> /scripts/logs/jd_tyt.log 2>&1
|
||||||
|
#
|
||||||
|
55 6 * * * node /scripts/jd_unsubscriLive.js >> /scripts/logs/jd_unsubscriLive.log 2>&1
|
||||||
|
#女装盲盒
|
||||||
|
45 2,20 * * * node /scripts/jd_nzmh.js >> /scripts/logs/jd_nzmh.log 2>&1
|
||||||
|
#开卡74
|
||||||
|
47 3 25-30,1 11,12 * node /scripts/jd_opencard74.js >> /scripts/logs/jd_opencard74.log 2>&1
|
||||||
|
#开卡75
|
||||||
|
47 2 1-15 12 * node /scripts/jd_opencard75.js >> /scripts/logs/jd_opencard75.log 2>&1
|
||||||
|
#开卡76
|
||||||
|
47 3 3-12 12 * node /scripts/jd_opencard76.js >> /scripts/logs/jd_opencard76.log 2>&1
|
||||||
|
#积分换话费
|
||||||
|
43 5,17 * * * node /scripts/jd_dwapp.js >> /scripts/logs/jd_dwapp.log 2>&1
|
||||||
|
# 领券中心签到
|
||||||
|
5 0 * * * node /scripts/jd_ccSign.js >> /scripts/logs/jd_ccSign.log 2>&1
|
||||||
|
#邀请有礼
|
||||||
|
20 9 * * * node /scripts/jd_yqyl.js >> /scripts/logs/jd_yqyl.log 2>&1
|
||||||
|
#
|
||||||
|
20 3,6,9 * * * node /scripts/jd_dreamfactory_tuan.js >> /scripts/logs/jd_dreamfactory_tuan.log 2>&1
|
||||||
|
#京喜领红包
|
||||||
|
23 0,6,12,21 * * * node /scripts/jd_jxlhb.js >> /scripts/logs/jd_jxlhb.log 2>&1
|
||||||
|
#超级直播间盲盒抽京豆
|
||||||
|
1 18,20 * * * node /scripts/jd_super_mh.js >> /scripts/logs/jd_super_mh.log 2>&1
|
||||||
|
# 内容鉴赏官
|
||||||
|
5 2,5,16 * * * node /scripts/jd_connoisseur.js >> /scripts/logs/jd_connoisseur.log 2>&1
|
||||||
|
# 京喜财富岛月饼
|
||||||
|
5 * * * * node /scripts/jd_cfd_mooncake.js >> /scripts/logs/jd_cfd_mooncake.log 2>&1
|
||||||
|
# 东东世界
|
||||||
|
15 3,16 * * * node /scripts/jd_ddworld.js >> /scripts/logs/jd_ddworld.log 2>&1
|
||||||
|
# 小魔方
|
||||||
|
31 2,8 * * * node /scripts/jd_mf.js >> /scripts/logs/jd_mf.log 2>&1
|
||||||
|
# 魔方
|
||||||
|
11 7,19 * * * node /scripts/jd_mofang.js >> /scripts/logs/jd_mofang.log 2>&1
|
||||||
|
# 芥么签到
|
||||||
|
11 0,9 * * * node /scripts/jd_jmsign.js >> /scripts/logs/jd_jmsign.log 2>&1
|
||||||
|
# 芥么赚豪礼
|
||||||
|
37 0,11 * * * node /scripts/jd_jmzhl.js >> /scripts/logs/jd_jmzhl.log 2>&1
|
||||||
|
# 幸运扭蛋
|
||||||
|
24 9 * 10-11 * node /scripts/jd_lucky_egg.js >> /scripts/logs/jd_lucky_egg.log 2>&1
|
||||||
|
# 东东世界兑换
|
||||||
|
0 0 * * * node /scripts/jd_ddworld_exchange.js >> /scripts/logs/jd_ddworld_exchange.log 2>&1
|
||||||
|
# 天天提鹅
|
||||||
|
20 * * * * node /scripts/jd_daily_egg.js >> /scripts/logs/jd_daily_egg.log 2>&1
|
||||||
|
# 发财大赢家
|
||||||
|
1 2,10 * * * node /scripts/jd_fcdyj.js >> /scripts/logs/jd_fcdyj.log 2>&1
|
||||||
|
# 翻翻乐
|
||||||
|
20 * * * * node /scripts/jd_big_winner.js >> /scripts/logs/jd_big_winner.log 2>&1
|
||||||
|
# 京东极速版签到免单
|
||||||
|
18 8,12,20 * * * node /scripts/jd_speed_signfree.js >> /scripts/logs/jd_speed_signfree.log 2>&1
|
||||||
|
# 牛牛福利
|
||||||
|
1 9,19 * * * node /scripts/jd_nnfl.js >> /scripts/logs/jd_nnfl.log 2>&1
|
||||||
|
#赚京豆
|
||||||
|
10,40 0,1 * * * node /scripts/jd_syj.js >> /scripts/logs/jd_syj.log 2>&1
|
||||||
|
#搞基大神-饭粒
|
||||||
|
46 1,19 * * * node /scripts/jd_fanli.js >> /scripts/logs/jd_fanli.log 2>&1
|
||||||
|
#农场集勋章
|
||||||
|
16 7,16 * * * node /scripts/jd_medal.js >> /scripts/logs/jd_medal.log 2>&1
|
||||||
|
#京东签到翻牌
|
||||||
|
10 8,18 * * * node /scripts/jd_sign_graphics.js >> /scripts/logs/jd_sign_graphics.log 2>&1
|
||||||
|
#京喜财富岛合成生鲜
|
||||||
|
45 * * * * node /scripts/jd_cfd_fresh.js >> /scripts/logs/jd_cfd_fresh.log 2>&1
|
||||||
|
#财富岛珍珠兑换
|
||||||
|
59 0-23/1 * * * node /scripts/jd_cfd_pearl_ex.js >> /scripts/logs/jd_cfd_pearl_ex.log 2>&1
|
||||||
|
#美丽研究院--兑换
|
||||||
|
1 7,12,19 * * * node /scripts/jd_beauty_ex.js >> /scripts/logs/jd_beauty_ex.log 2>&1
|
||||||
|
#锦鲤
|
||||||
|
5 0 * * * node /scripts/jd_angryKoi.js >> /scripts/logs/jd_angryKoi.log 2>&1
|
||||||
|
#京东赚京豆一分钱抽奖
|
||||||
|
10 0 * * * node /scripts/jd_lottery_drew.js >> /scripts/logs/jd_lottery_drew.log 2>&1
|
||||||
|
#京东保价
|
||||||
|
41 23 * * * node /scripts/jd_price.js >> /scripts/logs/jd_price.log 2>&1
|
||||||
|
#金榜年终奖
|
||||||
|
10 0,2 * * * node /scripts/jd_split.js >> /scripts/logs/jd_split.log 2>&1
|
||||||
|
#京东小魔方--收集兑换
|
||||||
|
10 7 * * * node /scripts/jd_mofang_ex.js >> /scripts/logs/jd_mofang_ex.log 2>&1
|
||||||
|
#骁龙
|
||||||
|
10 9,17 * * * node /scripts/jd_xiaolong.js >> /scripts/logs/jd_xiaolong.log 2>&1
|
||||||
|
#京东我的理想家
|
||||||
|
10 7 * * * node /scripts/jd_lxLottery.js >> /scripts/logs/jd_lxLottery.log 2>&1
|
||||||
|
#京豆兑换为喜豆
|
||||||
|
33 9 * * * node /scripts/jd_exchangejxbeans.js >> /scripts/logs/jd_exchangejxbeans.log 2>&1
|
||||||
|
#早起签到
|
||||||
|
1 6,7 * * * python3 /jd/scripts/jd_zqfl.py >> /jd/log/jd_zqfl.log 2>&1
|
|
@ -0,0 +1,252 @@
|
||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# 放在这个初始化python3环境,目的减小镜像体积,一些不需要使用bot交互的用户可以不用拉体积比较大的镜像
|
||||||
|
# 在这个任务里面还有初始化还有目的就是为了方便bot更新了新功能的话只需要重启容器就完成更新
|
||||||
|
function initPythonEnv() {
|
||||||
|
echo "开始安装运行jd_bot需要的python环境及依赖..."
|
||||||
|
apk add --update python3-dev py3-pip py3-cryptography py3-numpy py-pillow
|
||||||
|
echo "开始安装jd_bot依赖..."
|
||||||
|
#测试
|
||||||
|
#cd /jd_docker/docker/bot
|
||||||
|
#合并
|
||||||
|
cd /scripts/docker/bot
|
||||||
|
pip3 install --upgrade pip
|
||||||
|
pip3 install -r requirements.txt
|
||||||
|
python3 setup.py install
|
||||||
|
}
|
||||||
|
|
||||||
|
#启动tg bot交互前置条件成立,开始安装配置环境
|
||||||
|
if [ "$1" == "True" ]; then
|
||||||
|
initPythonEnv
|
||||||
|
if [ -z "$DISABLE_SPNODE" ]; then
|
||||||
|
echo "增加命令组合spnode ,使用该命令spnode jd_xxxx.js 执行js脚本会读取cookies.conf里面的jd cokie账号来执行脚本"
|
||||||
|
(
|
||||||
|
cat <<EOF
|
||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
first=\$1
|
||||||
|
cmd=\$*
|
||||||
|
echo \${cmd/\$1/}
|
||||||
|
if [ \$1 == "conc" ]; then
|
||||||
|
for job in \$(cat \$COOKIES_LIST | grep -v "#" | paste -s -d ' '); do
|
||||||
|
{ export JD_COOKIE=\$job && node \${cmd/\$1/}
|
||||||
|
}&
|
||||||
|
done
|
||||||
|
elif [ -n "\$(echo \$first | sed -n "/^[0-9]\+\$/p")" ]; then
|
||||||
|
echo "\$(echo \$first | sed -n "/^[0-9]\+\$/p")"
|
||||||
|
{ export JD_COOKIE=\$(sed -n "\${first}p" \$COOKIES_LIST) && node \${cmd/\$1/}
|
||||||
|
}&
|
||||||
|
elif [ -n "\$(cat \$COOKIES_LIST | grep "pt_pin=\$first")" ];then
|
||||||
|
echo "\$(cat \$COOKIES_LIST | grep "pt_pin=\$first")"
|
||||||
|
{ export JD_COOKIE=\$(cat \$COOKIES_LIST | grep "pt_pin=\$first") && node \${cmd/\$1/}
|
||||||
|
}&
|
||||||
|
else
|
||||||
|
{ export JD_COOKIE=\$(cat \$COOKIES_LIST | grep -v "#" | paste -s -d '&') && node \$*
|
||||||
|
}&
|
||||||
|
fi
|
||||||
|
EOF
|
||||||
|
) >/usr/local/bin/spnode
|
||||||
|
chmod +x /usr/local/bin/spnode
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "spnode需要使用的到,cookie写入文件,该文件同时也为jd_bot扫码获自动取cookies服务"
|
||||||
|
if [ -z "$JD_COOKIE" ]; then
|
||||||
|
if [ ! -f "$COOKIES_LIST" ]; then
|
||||||
|
echo "" >"$COOKIES_LIST"
|
||||||
|
echo "未配置JD_COOKIE环境变量,$COOKIES_LIST文件已生成,请将cookies写入$COOKIES_LIST文件,格式每个Cookie一行"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
if [ -f "$COOKIES_LIST" ]; then
|
||||||
|
echo "cookies.conf文件已经存在跳过,如果需要更新cookie请修改$COOKIES_LIST文件内容"
|
||||||
|
else
|
||||||
|
echo "环境变量 cookies写入$COOKIES_LIST文件,如果需要更新cookie请修改cookies.conf文件内容"
|
||||||
|
echo $JD_COOKIE | sed "s/[ &]/\\n/g" | sed "/^$/d" >$COOKIES_LIST
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
CODE_GEN_CONF=/scripts/logs/code_gen_conf.list
|
||||||
|
echo "生成互助消息需要使用的到的 logs/code_gen_conf.list 文件,后续需要自己根据说明维护更新删除..."
|
||||||
|
if [ ! -f "$CODE_GEN_CONF" ]; then
|
||||||
|
(
|
||||||
|
cat <<EOF
|
||||||
|
#格式为
|
||||||
|
#互助类型-机器人ID-提交代码(根据bot作者配置得来)-活动脚本日志文件名-活动代码(根据bot作者配置得来)-查找互助码需要用到的定位字符串
|
||||||
|
#长期活动示例
|
||||||
|
#long-@TuringLabbot-jd_sgmh.log-sgmh-暂无
|
||||||
|
#临时活动示例
|
||||||
|
#temp-@TuringLabbot-jd_sgmh.log-sgmh-暂无
|
||||||
|
#每天变化活动示例
|
||||||
|
#daily-@TuringLabbot-jd_818.log-818-暂无
|
||||||
|
|
||||||
|
#种豆得豆
|
||||||
|
long-@TuringLabbot-/submit_activity_codes-jd_plantBean.log-bean-种豆得豆好友互助码】
|
||||||
|
#京东农场
|
||||||
|
long-@TuringLabbot-/submit_activity_codes-jd_fruit.log-farm-东东农场好友互助码】
|
||||||
|
#京东萌宠
|
||||||
|
long-@TuringLabbot-/submit_activity_codes-jd_pet.log-pet-东东萌宠好友互助码】
|
||||||
|
#东东工厂
|
||||||
|
long-@TuringLabbot-/submit_activity_codes-jd_jdfactory.log-ddfactory-东东工厂好友互助码】
|
||||||
|
#京喜工厂
|
||||||
|
long-@TuringLabbot-/submit_activity_codes-jd_dreamFactory.log-jxfactory-京喜工厂好友互助码】
|
||||||
|
#临时活动
|
||||||
|
temp-@TuringLabbot-/submit_activity_codes-jd_sgmh.log-sgmh-您的好友助力码为:
|
||||||
|
#临时活动
|
||||||
|
temp-@TuringLabbot-/submit_activity_codes-jd_cfd.log-jxcfd-主】你的互助码:
|
||||||
|
temp-@TuringLabbot-/submit_activity_codes-jd_global.log-jdglobal-好友助力码为
|
||||||
|
|
||||||
|
#分红狗活动
|
||||||
|
long-@LvanLamCommitCodeBot-/jdcrazyjoy-jd_crazy_joy.log-@N-crazyJoy任务好友互助码】
|
||||||
|
#签到领现金
|
||||||
|
long-@LvanLamCommitCodeBot-/jdcash-jd_cash.log-@N-您的助力码为
|
||||||
|
#京东赚赚
|
||||||
|
long-@LvanLamCommitCodeBot-/jdzz-jd_jdzz.log-@N-京东赚赚好友互助码】
|
||||||
|
EOF
|
||||||
|
) >$CODE_GEN_CONF
|
||||||
|
else
|
||||||
|
echo "logs/code_gen_conf.list 文件已经存在跳过初始化操作"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "容器jd_bot交互所需环境已配置安装已完成..."
|
||||||
|
curl -sX POST "https://api.telegram.org/bot$TG_BOT_TOKEN/sendMessage" -d "chat_id=$TG_USER_ID&text=恭喜🎉你获得feature容器jd_bot交互所需环境已配置安装已完成,并启用。请发送 /help 查看使用帮助。如需禁用请在docker-compose.yml配置 DISABLE_BOT_COMMAND=True" >>/dev/null
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
#echo "暂停更新配置,不要尝试删掉这个文件,你的容器可能会起不来"
|
||||||
|
#echo '' >/scripts/logs/pull.lock
|
||||||
|
|
||||||
|
echo "定义定时任务合并处理用到的文件路径..."
|
||||||
|
defaultListFile="/scripts/docker/$DEFAULT_LIST_FILE"
|
||||||
|
echo "默认文件定时任务文件路径为 ${defaultListFile}"
|
||||||
|
mergedListFile="/scripts/docker/merged_list_file.sh"
|
||||||
|
echo "合并后定时任务文件路径为 ${mergedListFile}"
|
||||||
|
|
||||||
|
echo "第1步将默认定时任务列表添加到并后定时任务文件..."
|
||||||
|
cat $defaultListFile >$mergedListFile
|
||||||
|
|
||||||
|
echo "第2步判断是否存在自定义任务任务列表并追加..."
|
||||||
|
if [ $CUSTOM_LIST_FILE ]; then
|
||||||
|
echo "您配置了自定义任务文件:$CUSTOM_LIST_FILE,自定义任务类型为:$CUSTOM_LIST_MERGE_TYPE..."
|
||||||
|
# 无论远程还是本地挂载, 均复制到 $customListFile
|
||||||
|
customListFile="/scripts/docker/custom_list_file.sh"
|
||||||
|
echo "自定义定时任务文件临时工作路径为 ${customListFile}"
|
||||||
|
if expr "$CUSTOM_LIST_FILE" : 'http.*' &>/dev/null; then
|
||||||
|
echo "自定义任务文件为远程脚本,开始下载自定义远程任务。"
|
||||||
|
wget -O $customListFile $CUSTOM_LIST_FILE
|
||||||
|
echo "下载完成..."
|
||||||
|
elif [ -f /scripts/docker/$CUSTOM_LIST_FILE ]; then
|
||||||
|
echo "自定义任务文件为本地挂载。"
|
||||||
|
cp /scripts/docker/$CUSTOM_LIST_FILE $customListFile
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f "$customListFile" ]; then
|
||||||
|
if [ $CUSTOM_LIST_MERGE_TYPE == "append" ]; then
|
||||||
|
echo "合并默认定时任务文件:$DEFAULT_LIST_FILE 和 自定义定时任务文件:$CUSTOM_LIST_FILE"
|
||||||
|
echo -e "" >>$mergedListFile
|
||||||
|
cat $customListFile >>$mergedListFile
|
||||||
|
elif [ $CUSTOM_LIST_MERGE_TYPE == "overwrite" ]; then
|
||||||
|
echo "配置了自定义任务文件:$CUSTOM_LIST_FILE,自定义任务类型为:$CUSTOM_LIST_MERGE_TYPE..."
|
||||||
|
cat $customListFile >$mergedListFile
|
||||||
|
else
|
||||||
|
echo "配置配置了错误的自定义定时任务类型:$CUSTOM_LIST_MERGE_TYPE,自定义任务类型为只能为append或者overwrite..."
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "配置的自定义任务文件:$CUSTOM_LIST_FILE未找到,使用默认配置$DEFAULT_LIST_FILE..."
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "当前只使用了默认定时任务文件 $DEFAULT_LIST_FILE ..."
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "第3步判断是否配置了随机延迟参数..."
|
||||||
|
if [ $RANDOM_DELAY_MAX ]; then
|
||||||
|
if [ $RANDOM_DELAY_MAX -ge 1 ]; then
|
||||||
|
echo "已设置随机延迟为 $RANDOM_DELAY_MAX , 设置延迟任务中..."
|
||||||
|
sed -i "/\(jd_bean_sign.js\|jd_blueCoin.js\|jd_joy_reward.js\|jd_joy_steal.js\|jd_joy_feedPets.js\|jd_car_exchange.js\)/!s/node/sleep \$((RANDOM % \$RANDOM_DELAY_MAX)); node/g" $mergedListFile
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "未配置随机延迟对应的环境变量,故不设置延迟任务..."
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "第4步判断是否配置自定义shell执行脚本..."
|
||||||
|
if [ 0"$CUSTOM_SHELL_FILE" = "0" ]; then
|
||||||
|
echo "未配置自定shell脚本文件,跳过执行。"
|
||||||
|
else
|
||||||
|
if expr "$CUSTOM_SHELL_FILE" : 'http.*' &>/dev/null; then
|
||||||
|
echo "自定义shell脚本为远程脚本,开始下载自定义远程脚本。"
|
||||||
|
wget -O /scripts/docker/shell_script_mod.sh $CUSTOM_SHELL_FILE
|
||||||
|
echo "下载完成,开始执行..."
|
||||||
|
echo "#远程自定义shell脚本追加定时任务" >>$mergedListFile
|
||||||
|
sh -x /scripts/docker/shell_script_mod.sh
|
||||||
|
echo "自定义远程shell脚本下载并执行结束。"
|
||||||
|
else
|
||||||
|
if [ ! -f $CUSTOM_SHELL_FILE ]; then
|
||||||
|
echo "自定义shell脚本为docker挂载脚本文件,但是指定挂载文件不存在,跳过执行。"
|
||||||
|
else
|
||||||
|
echo "docker挂载的自定shell脚本,开始执行..."
|
||||||
|
echo "#docker挂载自定义shell脚本追加定时任务" >>$mergedListFile
|
||||||
|
sh -x $CUSTOM_SHELL_FILE
|
||||||
|
echo "docker挂载的自定shell脚本,执行结束。"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "第5步删除不运行的脚本任务..."
|
||||||
|
if [ $DO_NOT_RUN_SCRIPTS ]; then
|
||||||
|
echo "您配置了不运行的脚本:$DO_NOT_RUN_SCRIPTS"
|
||||||
|
arr=${DO_NOT_RUN_SCRIPTS//&/ }
|
||||||
|
for item in $arr; do
|
||||||
|
sed -ie '/'"${item}"'/d' ${mergedListFile}
|
||||||
|
done
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "第6步设定下次运行docker_entrypoint.sh时间..."
|
||||||
|
echo "删除原有docker_entrypoint.sh任务"
|
||||||
|
sed -ie '/'docker_entrypoint.sh'/d' ${mergedListFile}
|
||||||
|
|
||||||
|
# 12:00前生成12:00后的cron,12:00后生成第二天12:00前的cron,一天只更新两次代码
|
||||||
|
if [ $(date +%-H) -lt 12 ]; then
|
||||||
|
random_h=$(($RANDOM % 12 + 12))
|
||||||
|
else
|
||||||
|
random_h=$(($RANDOM % 12))
|
||||||
|
fi
|
||||||
|
random_m=$(($RANDOM % 60))
|
||||||
|
|
||||||
|
echo "设定 docker_entrypoint.sh cron为:"
|
||||||
|
echo -e "\n# 必须要的默认定时任务请勿删除" >>$mergedListFile
|
||||||
|
echo -e "${random_m} ${random_h} * * * docker_entrypoint.sh >> /scripts/logs/default_task.log 2>&1" | tee -a $mergedListFile
|
||||||
|
|
||||||
|
echo "第7步 自动助力"
|
||||||
|
if [ -n "$ENABLE_AUTO_HELP" ]; then
|
||||||
|
#直接判断变量,如果未配置,会导致sh抛出一个错误,所以加了上面一层
|
||||||
|
if [ "$ENABLE_AUTO_HELP" = "true" ]; then
|
||||||
|
echo "开启自动助力"
|
||||||
|
#在所有脚本执行前,先执行助力码导出
|
||||||
|
sed -i 's/node/ . \/scripts\/docker\/auto_help.sh export > \/scripts\/logs\/auto_help_export.log \&\& node /g' ${mergedListFile}
|
||||||
|
else
|
||||||
|
echo "未开启自动助力"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "第8步增加 |ts 任务日志输出时间戳..."
|
||||||
|
sed -i "/\( ts\| |ts\|| ts\)/!s/>>/\|ts >>/g" $mergedListFile
|
||||||
|
|
||||||
|
echo "第9步执行proc_file.sh脚本任务..."
|
||||||
|
sh /scripts/docker/proc_file.sh
|
||||||
|
|
||||||
|
echo "第10步加载最新的定时任务文件..."
|
||||||
|
if [[ -f /usr/bin/jd_bot && -z "$DISABLE_SPNODE" ]]; then
|
||||||
|
echo "bot交互与spnode 前置条件成立,替换任务列表的node指令为spnode"
|
||||||
|
sed -i "s/ node / spnode /g" $mergedListFile
|
||||||
|
#conc每个cookies独立并行执行脚本示例,cookies数量多使用该功能可能导致内存爆掉,默认不开启 有需求,请在自定义shell里面实现
|
||||||
|
#sed -i "/\(jd_xtg.js\|jd_car_exchange.js\)/s/spnode/spnode conc/g" $mergedListFile
|
||||||
|
fi
|
||||||
|
crontab $mergedListFile
|
||||||
|
|
||||||
|
echo "第11步将仓库的docker_entrypoint.sh脚本更新至系统/usr/local/bin/docker_entrypoint.sh内..."
|
||||||
|
cat /scripts/docker/docker_entrypoint.sh >/usr/local/bin/docker_entrypoint.sh
|
||||||
|
|
||||||
|
echo "发送通知"
|
||||||
|
export NOTIFY_CONTENT=""
|
||||||
|
cd /scripts/docker
|
||||||
|
node notify_docker_user.js
|
|
@ -0,0 +1,57 @@
|
||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
#获取配置的自定义参数
|
||||||
|
if [ -n "$1" ]; then
|
||||||
|
run_cmd=$1
|
||||||
|
fi
|
||||||
|
|
||||||
|
(
|
||||||
|
if [ -f "/scripts/logs/pull.lock" ]; then
|
||||||
|
echo "存在更新锁定文件,跳过git pull操作..."
|
||||||
|
else
|
||||||
|
echo "设定远程仓库地址..."
|
||||||
|
cd /scripts
|
||||||
|
git remote set-url origin "$REPO_URL"
|
||||||
|
git reset --hard
|
||||||
|
echo "git pull拉取最新代码..."
|
||||||
|
git -C /scripts pull --rebase
|
||||||
|
echo "npm install 安装最新依赖"
|
||||||
|
npm install --prefix /scripts
|
||||||
|
fi
|
||||||
|
) || exit 0
|
||||||
|
|
||||||
|
# 默认启动telegram交互机器人的条件
|
||||||
|
# 确认容器启动时调用的docker_entrypoint.sh
|
||||||
|
# 必须配置TG_BOT_TOKEN、TG_USER_ID,
|
||||||
|
# 且未配置DISABLE_BOT_COMMAND禁用交互,
|
||||||
|
# 且未配置自定义TG_API_HOST,因为配置了该变量,说明该容器环境可能并能科学的连到telegram服务器
|
||||||
|
if [[ -n "$run_cmd" && -n "$TG_BOT_TOKEN" && -n "$TG_USER_ID" && -z "$DISABLE_BOT_COMMAND" && -z "$TG_API_HOST" ]]; then
|
||||||
|
ENABLE_BOT_COMMAND=True
|
||||||
|
else
|
||||||
|
ENABLE_BOT_COMMAND=False
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "------------------------------------------------执行定时任务任务shell脚本------------------------------------------------"
|
||||||
|
#测试
|
||||||
|
# sh /jd_docker/docker/default_task.sh "$ENABLE_BOT_COMMAND" "$run_cmd"
|
||||||
|
#合并
|
||||||
|
sh /scripts/docker/default_task.sh "$ENABLE_BOT_COMMAND" "$run_cmd"
|
||||||
|
echo "--------------------------------------------------默认定时任务执行完成---------------------------------------------------"
|
||||||
|
|
||||||
|
if [ -n "$run_cmd" ]; then
|
||||||
|
# 增加一层jd_bot指令已经正确安装成功校验
|
||||||
|
# 以上条件都满足后会启动jd_bot交互,否还是按照以前的模式启动,最大程度避免现有用户改动调整
|
||||||
|
if [[ "$ENABLE_BOT_COMMAND" == "True" && -f /usr/bin/jd_bot ]]; then
|
||||||
|
echo "启动crontab定时任务主进程..."
|
||||||
|
crond
|
||||||
|
echo "启动telegram bot指令交主进程..."
|
||||||
|
jd_bot
|
||||||
|
else
|
||||||
|
echo "启动crontab定时任务主进程..."
|
||||||
|
crond -f
|
||||||
|
fi
|
||||||
|
|
||||||
|
else
|
||||||
|
echo "默认定时任务执行结束。"
|
||||||
|
fi
|
|
@ -0,0 +1,62 @@
|
||||||
|
jd_scripts:
|
||||||
|
image: lxk0301/jd_scripts
|
||||||
|
# 配置服务器资源约束。此例子中服务被限制为使用内存不超过200M以及cpu不超过0.2(单核的20%)
|
||||||
|
# 经过实际测试,建议不低于200M
|
||||||
|
# deploy:
|
||||||
|
# resources:
|
||||||
|
# limits:
|
||||||
|
# cpus: '0.2'
|
||||||
|
# memory: 200M
|
||||||
|
container_name: jd_scripts
|
||||||
|
restart: always
|
||||||
|
volumes:
|
||||||
|
- ./my_crontab_list.sh:/scripts/docker/my_crontab_list.sh
|
||||||
|
- ./logs:/scripts/logs
|
||||||
|
tty: true
|
||||||
|
# 因为更换仓库地址可能git pull的dns解析不到,可以在配置追加hosts
|
||||||
|
extra_hosts:
|
||||||
|
- "gitee.com:180.97.125.228"
|
||||||
|
- "github.com:13.229.188.59"
|
||||||
|
- "raw.githubusercontent.com:151.101.228.133"
|
||||||
|
environment:
|
||||||
|
#脚本更新仓库地址,配置了会切换到对应的地址
|
||||||
|
- REPO_URL=git@gitee.com:lxk0301/jd_scripts.git
|
||||||
|
# 注意环境变量填写值的时候一律不需要引号(""或者'')下面这些只是示例,根据自己的需求增加删除
|
||||||
|
#jd cookies
|
||||||
|
# 例: JD_COOKIE=pt_key=XXX;pt_pin=XXX;
|
||||||
|
# 例(多账号): JD_COOKIE=pt_key=XXX;pt_pin=XXX;&pt_key=XXX;pt_pin=XXX;&pt_key=XXX;pt_pin=XXX;
|
||||||
|
- JD_COOKIE=
|
||||||
|
#微信server酱通知
|
||||||
|
- PUSH_KEY=
|
||||||
|
#Bark App通知
|
||||||
|
- BARK_PUSH=
|
||||||
|
#telegram机器人通知
|
||||||
|
- TG_BOT_TOKEN=
|
||||||
|
- TG_USER_ID=
|
||||||
|
#钉钉机器人通知
|
||||||
|
- DD_BOT_TOKEN=
|
||||||
|
- DD_BOT_SECRET=
|
||||||
|
#企业微信机器人通知
|
||||||
|
- QYWX_KEY=
|
||||||
|
#京东种豆得豆
|
||||||
|
- PLANT_BEAN_SHARECODES=
|
||||||
|
#京东农场
|
||||||
|
# 例: FRUITSHARECODES=京东农场的互助码
|
||||||
|
- FRUITSHARECODES=
|
||||||
|
#京东萌宠
|
||||||
|
# 例: PETSHARECODES=东东萌宠的互助码
|
||||||
|
- PETSHARECODES=
|
||||||
|
# 宠汪汪的喂食数量
|
||||||
|
- JOY_FEED_COUNT=
|
||||||
|
#东东超市
|
||||||
|
# - SUPERMARKET_SHARECODES=
|
||||||
|
#兑换多少数量的京豆(20,或者1000京豆,或者其他奖品的文字)
|
||||||
|
# 例: MARKET_COIN_TO_BEANS=1000
|
||||||
|
- MARKET_COIN_TO_BEANS=
|
||||||
|
#如果设置了 RANDOM_DELAY_MAX ,则会启用随机延迟功能,延迟随机 0 到 RANDOM_DELAY_MAX-1 秒。如果不设置此项,则不使用延迟。
|
||||||
|
#并不是所有的脚本都会被启用延迟,因为有一些脚本需要整点触发。延迟的目的有两个,1是降低抢占cpu资源几率,2是降低检查风险(主要是1)
|
||||||
|
#填写数字,单位为秒,比如写为 RANDOM_DELAY_MAX=30 就是随机产生0到29之间的一个秒数,执行延迟的意思。
|
||||||
|
- RANDOM_DELAY_MAX=120
|
||||||
|
#使用自定义定任务追加默认任务之后,上面volumes挂载之后这里配置对应的文件名
|
||||||
|
- CUSTOM_LIST_FILE=my_crontab_list.sh
|
||||||
|
|
|
@ -0,0 +1,62 @@
|
||||||
|
jd_scripts:
|
||||||
|
image: lxk0301/jd_scripts
|
||||||
|
# 配置服务器资源约束。此例子中服务被限制为使用内存不超过200M以及cpu不超过0.2(单核的20%)
|
||||||
|
# 经过实际测试,建议不低于200M
|
||||||
|
# deploy:
|
||||||
|
# resources:
|
||||||
|
# limits:
|
||||||
|
# cpus: '0.2'
|
||||||
|
# memory: 200M
|
||||||
|
container_name: jd_scripts
|
||||||
|
restart: always
|
||||||
|
volumes:
|
||||||
|
- ./my_crontab_list.sh:/scripts/docker/my_crontab_list.sh
|
||||||
|
- ./logs:/scripts/logs
|
||||||
|
tty: true
|
||||||
|
# 因为更换仓库地址可能git pull的dns解析不到,可以在配置追加hosts
|
||||||
|
extra_hosts:
|
||||||
|
- "gitee.com:180.97.125.228"
|
||||||
|
- "github.com:13.229.188.59"
|
||||||
|
- "raw.githubusercontent.com:151.101.228.133"
|
||||||
|
environment:
|
||||||
|
#脚本更新仓库地址,配置了会切换到对应的地址
|
||||||
|
- REPO_URL=git@gitee.com:lxk0301/jd_scripts.git
|
||||||
|
# 注意环境变量填写值的时候一律不需要引号(""或者'')下面这些只是示例,根据自己的需求增加删除
|
||||||
|
#jd cookies
|
||||||
|
# 例: JD_COOKIE=pt_key=XXX;pt_pin=XXX;
|
||||||
|
#例(多账号): JD_COOKIE=pt_key=XXX;pt_pin=XXX;&pt_key=XXX;pt_pin=XXX;&pt_key=XXX;pt_pin=XXX;
|
||||||
|
- JD_COOKIE=
|
||||||
|
#微信server酱通知
|
||||||
|
- PUSH_KEY=
|
||||||
|
#Bark App通知
|
||||||
|
- BARK_PUSH=
|
||||||
|
#telegram机器人通知
|
||||||
|
- TG_BOT_TOKEN=
|
||||||
|
- TG_USER_ID=
|
||||||
|
#钉钉机器人通知
|
||||||
|
- DD_BOT_TOKEN=
|
||||||
|
- DD_BOT_SECRET=
|
||||||
|
#企业微信机器人通知
|
||||||
|
- QYWX_KEY=
|
||||||
|
#京东种豆得豆
|
||||||
|
- PLANT_BEAN_SHARECODES=
|
||||||
|
#京东农场
|
||||||
|
# 例: FRUITSHARECODES=京东农场的互助码
|
||||||
|
- FRUITSHARECODES=
|
||||||
|
#京东萌宠
|
||||||
|
# 例: PETSHARECODES=东东萌宠的互助码
|
||||||
|
- PETSHARECODES=
|
||||||
|
# 宠汪汪的喂食数量
|
||||||
|
- JOY_FEED_COUNT=
|
||||||
|
#东东超市
|
||||||
|
# - SUPERMARKET_SHARECODES=
|
||||||
|
#兑换多少数量的京豆(20,或者1000京豆,或者其他奖品的文字)
|
||||||
|
# 例: MARKET_COIN_TO_BEANS=1000
|
||||||
|
- MARKET_COIN_TO_BEANS=
|
||||||
|
#如果设置了 RANDOM_DELAY_MAX ,则会启用随机延迟功能,延迟随机 0 到 RANDOM_DELAY_MAX-1 秒。如果不设置此项,则不使用延迟。
|
||||||
|
#并不是所有的脚本都会被启用延迟,因为有一些脚本需要整点触发。延迟的目的有两个,1是降低抢占cpu资源几率,2是降低检查风险(主要是1)
|
||||||
|
#填写数字,单位为秒,比如写为 RANDOM_DELAY_MAX=30 就是随机产生0到29之间的一个秒数,执行延迟的意思。
|
||||||
|
- RANDOM_DELAY_MAX=120
|
||||||
|
#使用自定义定任务覆盖默认任务,上面volumes挂载之后这里配置对应的文件名,和自定义文件使用方式为overwrite
|
||||||
|
- CUSTOM_LIST_FILE=my_crontab_list.sh
|
||||||
|
- CUSTOM_LIST_MERGE_TYPE=overwrite
|
|
@ -0,0 +1,59 @@
|
||||||
|
jd_scripts:
|
||||||
|
image: lxk0301/jd_scripts
|
||||||
|
# 配置服务器资源约束。此例子中服务被限制为使用内存不超过200M以及cpu不超过0.2(单核的20%)
|
||||||
|
# 经过实际测试,建议不低于200M
|
||||||
|
# deploy:
|
||||||
|
# resources:
|
||||||
|
# limits:
|
||||||
|
# cpus: '0.2'
|
||||||
|
# memory: 200M
|
||||||
|
container_name: jd_scripts
|
||||||
|
restart: always
|
||||||
|
volumes:
|
||||||
|
- ./logs:/scripts/logs
|
||||||
|
tty: true
|
||||||
|
# 因为更换仓库地址可能git pull的dns解析不到,可以在配置追加hosts
|
||||||
|
extra_hosts:
|
||||||
|
- "gitee.com:180.97.125.228"
|
||||||
|
- "github.com:13.229.188.59"
|
||||||
|
- "raw.githubusercontent.com:151.101.228.133"
|
||||||
|
environment:
|
||||||
|
#脚本更新仓库地址,配置了会切换到对应的地址
|
||||||
|
- REPO_URL=git@gitee.com:lxk0301/jd_scripts.git
|
||||||
|
# 注意环境变量填写值的时候一律不需要引号(""或者'')下面这些只是示例,根据自己的需求增加删除
|
||||||
|
#jd cookies
|
||||||
|
# 例: JD_COOKIE=pt_key=XXX;pt_pin=XXX;
|
||||||
|
# 例(多账号): JD_COOKIE=pt_key=XXX;pt_pin=XXX;&pt_key=XXX;pt_pin=XXX;&pt_key=XXX;pt_pin=XXX;
|
||||||
|
- JD_COOKIE=
|
||||||
|
#微信server酱通知
|
||||||
|
- PUSH_KEY=
|
||||||
|
#Bark App通知
|
||||||
|
- BARK_PUSH=
|
||||||
|
#telegram机器人通知
|
||||||
|
- TG_BOT_TOKEN=
|
||||||
|
- TG_USER_ID=
|
||||||
|
#钉钉机器人通知
|
||||||
|
- DD_BOT_TOKEN=
|
||||||
|
- DD_BOT_SECRET=
|
||||||
|
#企业微信机器人通知
|
||||||
|
- QYWX_KEY=
|
||||||
|
#京东种豆得豆
|
||||||
|
- PLANT_BEAN_SHARECODES=
|
||||||
|
#京东农场
|
||||||
|
# 例: FRUITSHARECODES=京东农场的互助码
|
||||||
|
- FRUITSHARECODES=
|
||||||
|
#京东萌宠
|
||||||
|
# 例: PETSHARECODES=东东萌宠的互助码
|
||||||
|
- PETSHARECODES=
|
||||||
|
# 宠汪汪的喂食数量
|
||||||
|
- JOY_FEED_COUNT=
|
||||||
|
#东东超市
|
||||||
|
# - SUPERMARKET_SHARECODES=
|
||||||
|
#兑换多少数量的京豆(20,或者1000京豆,或者其他奖品的文字)
|
||||||
|
# 例: MARKET_COIN_TO_BEANS=1000
|
||||||
|
- MARKET_COIN_TO_BEANS=
|
||||||
|
|
||||||
|
#如果设置了 RANDOM_DELAY_MAX ,则会启用随机延迟功能,延迟随机 0 到 RANDOM_DELAY_MAX-1 秒。如果不设置此项,则不使用延迟。
|
||||||
|
#并不是所有的脚本都会被启用延迟,因为有一些脚本需要整点触发。延迟的目的有两个,1是降低抢占cpu资源几率,2是降低检查风险(主要是1)
|
||||||
|
#填写数字,单位为秒,比如写为 RANDOM_DELAY_MAX=30 就是随机产生0到29之间的一个秒数,执行延迟的意思。
|
||||||
|
- RANDOM_DELAY_MAX=120
|
|
@ -0,0 +1,83 @@
|
||||||
|
### 使用此方式,请先理解学会使用[docker办法一](https://github.com/LXK9301/jd_scripts/tree/master/docker#%E5%88%9B%E5%BB%BA%E4%B8%80%E4%B8%AA%E7%9B%AE%E5%BD%95jd_scripts%E7%94%A8%E4%BA%8E%E5%AD%98%E6%94%BE%E5%A4%87%E4%BB%BD%E9%85%8D%E7%BD%AE%E7%AD%89%E6%95%B0%E6%8D%AE%E8%BF%81%E7%A7%BB%E9%87%8D%E8%A3%85%E7%9A%84%E6%97%B6%E5%80%99%E5%8F%AA%E9%9C%80%E8%A6%81%E5%A4%87%E4%BB%BD%E6%95%B4%E4%B8%AAjd_scripts%E7%9B%AE%E5%BD%95%E5%8D%B3%E5%8F%AF)的使用方式
|
||||||
|
> 发现有人好像希望不同账户任务并发执行,不想一个账户执行完了才能再执行另一个,这里写一个`docker办法一`的基础上实现方式,其实就是不同账户创建不同的容器,他们互不干扰单独定时执行自己的任务。
|
||||||
|
配置使用起来还是比较简单的,具体往下看
|
||||||
|
### 文件夹目录参考
|
||||||
|
![image](https://user-images.githubusercontent.com/6993269/97781779-885ae700-1bc8-11eb-93a4-b274cbd6062c.png)
|
||||||
|
### 具体使用说明直接在图片标注了,文件参考[图片下方](https://github.com/LXK9301/jd_scripts/new/master/docker#docker-composeyml%E6%96%87%E4%BB%B6%E5%8F%82%E8%80%83),配置完成后的[执行命令]()
|
||||||
|
![image](https://user-images.githubusercontent.com/6993269/97781610-a1af6380-1bc7-11eb-9397-903b47f5ad6b.png)
|
||||||
|
#### `docker-compose.yml`文件参考
|
||||||
|
```yaml
|
||||||
|
version: "3"
|
||||||
|
services:
|
||||||
|
jd_scripts1: #默认
|
||||||
|
image: lxk0301/jd_scripts
|
||||||
|
# 配置服务器资源约束。此例子中服务被限制为使用内存不超过200M以及cpu不超过 0.2(单核的20%)
|
||||||
|
# 经过实际测试,建议不低于200M
|
||||||
|
# deploy:
|
||||||
|
# resources:
|
||||||
|
# limits:
|
||||||
|
# cpus: '0.2'
|
||||||
|
# memory: 200M
|
||||||
|
restart: always
|
||||||
|
container_name: jd_scripts1
|
||||||
|
tty: true
|
||||||
|
volumes:
|
||||||
|
- ./logs1:/scripts/logs
|
||||||
|
environment:
|
||||||
|
- JD_COOKIE=pt_key=AAJfjaNrADAS8ygfgIsOxxxxxxxKpfDaZ2pSBOYTxtPqLK8U1Q;pt_pin=lxxxxxx5;
|
||||||
|
- TG_BOT_TOKEN=130xxxx280:AAExxxxxxWP10zNf91WQ
|
||||||
|
- TG_USER_ID=12xxxx206
|
||||||
|
# 互助助码等参数可自行增加,如下。
|
||||||
|
# 京东种豆得豆
|
||||||
|
# - PLANT_BEAN_SHARECODES=
|
||||||
|
|
||||||
|
jd_scripts2: #默认
|
||||||
|
image: lxk0301/jd_scripts
|
||||||
|
restart: always
|
||||||
|
container_name: jd_scripts2
|
||||||
|
tty: true
|
||||||
|
volumes:
|
||||||
|
- ./logs2:/scripts/logs
|
||||||
|
environment:
|
||||||
|
- JD_COOKIE=pt_key=AAJfjaNrADAS8ygfgIsOxxxxxxxKpfDaZ2pSBOYTxtPqLK8U1Q;pt_pin=lxxxxxx5;
|
||||||
|
- TG_BOT_TOKEN=130xxxx280:AAExxxxxxWP10zNf91WQ
|
||||||
|
- TG_USER_ID=12xxxx206
|
||||||
|
jd_scripts4: #自定义追加默认之后
|
||||||
|
image: lxk0301/jd_scripts
|
||||||
|
restart: always
|
||||||
|
container_name: jd_scripts4
|
||||||
|
tty: true
|
||||||
|
volumes:
|
||||||
|
- ./logs4:/scripts/logs
|
||||||
|
- ./my_crontab_list4.sh:/scripts/docker/my_crontab_list.sh
|
||||||
|
environment:
|
||||||
|
- JD_COOKIE=pt_key=AAJfjaNrADAS8ygfgIsOxxxxxxxKpfDaZ2pSBOYTxtPqLK8U1Q;pt_pin=lxxxxxx5;
|
||||||
|
- TG_BOT_TOKEN=130xxxx280:AAExxxxxxWP10zNf91WQ
|
||||||
|
- TG_USER_ID=12xxxx206
|
||||||
|
- CUSTOM_LIST_FILE=my_crontab_list.sh
|
||||||
|
jd_scripts5: #自定义覆盖默认
|
||||||
|
image: lxk0301/jd_scripts
|
||||||
|
restart: always
|
||||||
|
container_name: jd_scripts5
|
||||||
|
tty: true
|
||||||
|
volumes:
|
||||||
|
- ./logs5:/scripts/logs
|
||||||
|
- ./my_crontab_list5.sh:/scripts/docker/my_crontab_list.sh
|
||||||
|
environment:
|
||||||
|
- JD_COOKIE=pt_key=AAJfjaNrADAS8ygfgIsOxxxxxxxKpfDaZ2pSBOYTxtPqLK8U1Q;pt_pin=lxxxxxx5;
|
||||||
|
- TG_BOT_TOKEN=130xxxx280:AAExxxxxxWP10zNf91WQ
|
||||||
|
- TG_USER_ID=12xxxx206
|
||||||
|
- CUSTOM_LIST_FILE=my_crontab_list.sh
|
||||||
|
- CUSTOM_LIST_MERGE_TYPE=overwrite
|
||||||
|
|
||||||
|
```
|
||||||
|
#### 目录文件配置好之后在 `jd_scripts_multi`目录执行
|
||||||
|
`docker-compose up -d` 启动;
|
||||||
|
`docker-compose logs` 打印日志;
|
||||||
|
`docker-compose pull` 更新镜像;
|
||||||
|
`docker-compose stop` 停止容器;
|
||||||
|
`docker-compose restart` 重启容器;
|
||||||
|
`docker-compose down` 停止并删除容器;
|
||||||
|
![image](https://user-images.githubusercontent.com/6993269/97781935-8fcec000-1bc9-11eb-9d1a-d219e7a1caa9.png)
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,65 @@
|
||||||
|
{
|
||||||
|
"cap_add" : [],
|
||||||
|
"cap_drop" : [],
|
||||||
|
"cmd" : "",
|
||||||
|
"cpu_priority" : 50,
|
||||||
|
"devices" : null,
|
||||||
|
"enable_publish_all_ports" : false,
|
||||||
|
"enable_restart_policy" : true,
|
||||||
|
"enabled" : true,
|
||||||
|
"env_variables" : [
|
||||||
|
{
|
||||||
|
"key" : "PATH",
|
||||||
|
"value" : "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key" : "CDN_JD_DAILYBONUS",
|
||||||
|
"value" : "true"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key" : "JD_COOKIE",
|
||||||
|
"value" : "pt_key=xxx;pt_pin=xxx;"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key" : "PUSH_KEY",
|
||||||
|
"value" : ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key" : "CUSTOM_LIST_FILE",
|
||||||
|
"value" : "my_crontab_list.sh"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"exporting" : false,
|
||||||
|
"id" : "3a2f6f27c23f93bc104585c22569c760cc9ce82df09cdb41d53b491fe1d0341c",
|
||||||
|
"image" : "lxk0301/jd_scripts",
|
||||||
|
"is_ddsm" : false,
|
||||||
|
"is_package" : false,
|
||||||
|
"links" : [],
|
||||||
|
"memory_limit" : 0,
|
||||||
|
"name" : "jd_scripts",
|
||||||
|
"network" : [
|
||||||
|
{
|
||||||
|
"driver" : "bridge",
|
||||||
|
"name" : "bridge"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"network_mode" : "default",
|
||||||
|
"port_bindings" : [],
|
||||||
|
"privileged" : false,
|
||||||
|
"shortcut" : {
|
||||||
|
"enable_shortcut" : false
|
||||||
|
},
|
||||||
|
"use_host_network" : false,
|
||||||
|
"volume_bindings" : [
|
||||||
|
{
|
||||||
|
"host_volume_file" : "/docker/jd_scripts/my_crontab_list.sh",
|
||||||
|
"mount_point" : "/scripts/docker/my_crontab_list.sh",
|
||||||
|
"type" : "rw"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"host_volume_file" : "/docker/jd_scripts/logs",
|
||||||
|
"mount_point" : "/scripts/logs",
|
||||||
|
"type" : "rw"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,69 @@
|
||||||
|
{
|
||||||
|
"cap_add" : [],
|
||||||
|
"cap_drop" : [],
|
||||||
|
"cmd" : "",
|
||||||
|
"cpu_priority" : 50,
|
||||||
|
"devices" : null,
|
||||||
|
"enable_publish_all_ports" : false,
|
||||||
|
"enable_restart_policy" : true,
|
||||||
|
"enabled" : true,
|
||||||
|
"env_variables" : [
|
||||||
|
{
|
||||||
|
"key" : "PATH",
|
||||||
|
"value" : "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key" : "CDN_JD_DAILYBONUS",
|
||||||
|
"value" : "true"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key" : "JD_COOKIE",
|
||||||
|
"value" : "pt_key=xxx;pt_pin=xxx;"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key" : "PUSH_KEY",
|
||||||
|
"value" : ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key" : "CUSTOM_LIST_FILE",
|
||||||
|
"value" : "my_crontab_list.sh"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key" : "CUSTOM_LIST_MERGE_TYPE",
|
||||||
|
"value" : "overwrite"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"exporting" : false,
|
||||||
|
"id" : "3a2f6f27c23f93bc104585c22569c760cc9ce82df09cdb41d53b491fe1d0341c",
|
||||||
|
"image" : "lxk0301/jd_scripts",
|
||||||
|
"is_ddsm" : false,
|
||||||
|
"is_package" : false,
|
||||||
|
"links" : [],
|
||||||
|
"memory_limit" : 0,
|
||||||
|
"name" : "jd_scripts",
|
||||||
|
"network" : [
|
||||||
|
{
|
||||||
|
"driver" : "bridge",
|
||||||
|
"name" : "bridge"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"network_mode" : "default",
|
||||||
|
"port_bindings" : [],
|
||||||
|
"privileged" : false,
|
||||||
|
"shortcut" : {
|
||||||
|
"enable_shortcut" : false
|
||||||
|
},
|
||||||
|
"use_host_network" : false,
|
||||||
|
"volume_bindings" : [
|
||||||
|
{
|
||||||
|
"host_volume_file" : "/docker/jd_scripts/my_crontab_list.sh",
|
||||||
|
"mount_point" : "/scripts/docker/my_crontab_list.sh",
|
||||||
|
"type" : "rw"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"host_volume_file" : "/docker/jd_scripts/logs",
|
||||||
|
"mount_point" : "/scripts/logs",
|
||||||
|
"type" : "rw"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,83 @@
|
||||||
|
{
|
||||||
|
"cap_add" : null,
|
||||||
|
"cap_drop" : null,
|
||||||
|
"cmd" : "",
|
||||||
|
"cpu_priority" : 0,
|
||||||
|
"devices" : null,
|
||||||
|
"enable_publish_all_ports" : false,
|
||||||
|
"enable_restart_policy" : true,
|
||||||
|
"enabled" : false,
|
||||||
|
"env_variables" : [
|
||||||
|
{
|
||||||
|
"key" : "PATH",
|
||||||
|
"value" : "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key" : "CDN_JD_DAILYBONUS",
|
||||||
|
"value" : "true"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key" : "JD_COOKIE",
|
||||||
|
"value" : "pt_key=AAJfjaNrADASxxxxxxxKpfDaZ2pSBOYTxtPqLK8U1Q;pt_pin=lxxxxx5;"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key" : "TG_BOT_TOKEN",
|
||||||
|
"value" : "13xxxxxx80:AAEkNxxxxxxzNf91WQ"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key" : "TG_USER_ID",
|
||||||
|
"value" : "12xxxx206"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key" : "PLANT_BEAN_SHARECODES",
|
||||||
|
"value" : ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key" : "FRUITSHARECODES",
|
||||||
|
"value" : ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key" : "PETSHARECODES",
|
||||||
|
"value" : ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key" : "SUPERMARKET_SHARECODES",
|
||||||
|
"value" : ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key" : "CRONTAB_LIST_FILE",
|
||||||
|
"value" : "crontab_list.sh"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"exporting" : false,
|
||||||
|
"id" : "18af38bc0ac37a40e4b9608a86fef56c464577cc160bbdddec90155284fcf4e5",
|
||||||
|
"image" : "lxk0301/jd_scripts",
|
||||||
|
"is_ddsm" : false,
|
||||||
|
"is_package" : false,
|
||||||
|
"links" : [],
|
||||||
|
"memory_limit" : 0,
|
||||||
|
"name" : "jd_scripts",
|
||||||
|
"network" : [
|
||||||
|
{
|
||||||
|
"driver" : "bridge",
|
||||||
|
"name" : "bridge"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"network_mode" : "default",
|
||||||
|
"port_bindings" : [],
|
||||||
|
"privileged" : false,
|
||||||
|
"shortcut" : {
|
||||||
|
"enable_shortcut" : false,
|
||||||
|
"enable_status_page" : false,
|
||||||
|
"enable_web_page" : false,
|
||||||
|
"web_page_url" : ""
|
||||||
|
},
|
||||||
|
"use_host_network" : false,
|
||||||
|
"volume_bindings" : [
|
||||||
|
{
|
||||||
|
"host_volume_file" : "/docker/jd_scripts/logs",
|
||||||
|
"mount_point" : "/scripts/logs",
|
||||||
|
"type" : "rw"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,62 @@
|
||||||
|
version: "3"
|
||||||
|
services:
|
||||||
|
jd_scripts1: #默认
|
||||||
|
image: lxk0301/jd_scripts
|
||||||
|
# 配置服务器资源约束。此例子中服务被限制为使用内存不超过200M以及cpu不超过 0.2(单核的20%)
|
||||||
|
# 经过实际测试,建议不低于200M
|
||||||
|
# deploy:
|
||||||
|
# resources:
|
||||||
|
# limits:
|
||||||
|
# cpus: '0.2'
|
||||||
|
# memory: 200M
|
||||||
|
restart: always
|
||||||
|
container_name: jd_scripts1
|
||||||
|
tty: true
|
||||||
|
volumes:
|
||||||
|
- ./logs1:/scripts/logs
|
||||||
|
environment:
|
||||||
|
- JD_COOKIE=pt_key=AAJfjaNrADAS8ygfgIsOxxxxxxxKpfDaZ2pSBOYTxtPqLK8U1Q;pt_pin=lxxxxxx5;
|
||||||
|
- TG_BOT_TOKEN=130xxxx280:AAExxxxxxWP10zNf91WQ
|
||||||
|
- TG_USER_ID=12xxxx206
|
||||||
|
# 互助助码等参数可自行增加,如下。
|
||||||
|
# 京东种豆得豆
|
||||||
|
# - PLANT_BEAN_SHARECODES=
|
||||||
|
|
||||||
|
jd_scripts2: #默认
|
||||||
|
image: lxk0301/jd_scripts
|
||||||
|
restart: always
|
||||||
|
container_name: jd_scripts2
|
||||||
|
tty: true
|
||||||
|
volumes:
|
||||||
|
- ./logs2:/scripts/logs
|
||||||
|
environment:
|
||||||
|
- JD_COOKIE=pt_key=AAJfjaNrADAS8ygfgIsOxxxxxxxKpfDaZ2pSBOYTxtPqLK8U1Q;pt_pin=lxxxxxx5;
|
||||||
|
- TG_BOT_TOKEN=130xxxx280:AAExxxxxxWP10zNf91WQ
|
||||||
|
- TG_USER_ID=12xxxx206
|
||||||
|
jd_scripts4: #自定义追加默认之后
|
||||||
|
image: lxk0301/jd_scripts
|
||||||
|
restart: always
|
||||||
|
container_name: jd_scripts4
|
||||||
|
tty: true
|
||||||
|
volumes:
|
||||||
|
- ./logs4:/scripts/logs
|
||||||
|
- ./my_crontab_list4.sh:/scripts/docker/my_crontab_list.sh
|
||||||
|
environment:
|
||||||
|
- JD_COOKIE=pt_key=AAJfjaNrADAS8ygfgIsOxxxxxxxKpfDaZ2pSBOYTxtPqLK8U1Q;pt_pin=lxxxxxx5;
|
||||||
|
- TG_BOT_TOKEN=130xxxx280:AAExxxxxxWP10zNf91WQ
|
||||||
|
- TG_USER_ID=12xxxx206
|
||||||
|
- CUSTOM_LIST_FILE=my_crontab_list.sh
|
||||||
|
jd_scripts5: #自定义覆盖默认
|
||||||
|
image: lxk0301/jd_scripts
|
||||||
|
restart: always
|
||||||
|
container_name: jd_scripts5
|
||||||
|
tty: true
|
||||||
|
volumes:
|
||||||
|
- ./logs5:/scripts/logs
|
||||||
|
- ./my_crontab_list5.sh:/scripts/docker/my_crontab_list.sh
|
||||||
|
environment:
|
||||||
|
- JD_COOKIE=pt_key=AAJfjaNrADAS8ygfgIsOxxxxxxxKpfDaZ2pSBOYTxtPqLK8U1Q;pt_pin=lxxxxxx5;
|
||||||
|
- TG_BOT_TOKEN=130xxxx280:AAExxxxxxWP10zNf91WQ
|
||||||
|
- TG_USER_ID=12xxxx206
|
||||||
|
- CUSTOM_LIST_FILE=my_crontab_list.sh
|
||||||
|
- CUSTOM_LIST_MERGE_TYPE=overwrite
|
|
@ -0,0 +1,20 @@
|
||||||
|
const notify = require('../sendNotify');
|
||||||
|
const fs = require('fs');
|
||||||
|
const notifyPath = '/scripts/logs/notify.txt';
|
||||||
|
async function image_update_notify() {
|
||||||
|
if (fs.existsSync(notifyPath)) {
|
||||||
|
const content = await fs.readFileSync(`${notifyPath}`, 'utf8');//读取notify.txt内容
|
||||||
|
if (process.env.NOTIFY_CONTENT && !content.includes(process.env.NOTIFY_CONTENT)) {
|
||||||
|
await notify.sendNotify("⚠️Docker镜像版本更新通知⚠️", process.env.NOTIFY_CONTENT);
|
||||||
|
await fs.writeFileSync(`${notifyPath}`, process.env.NOTIFY_CONTENT);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (process.env.NOTIFY_CONTENT) {
|
||||||
|
notify.sendNotify("⚠️Docker镜像版本更新通知⚠️", process.env.NOTIFY_CONTENT)
|
||||||
|
await fs.writeFileSync(`${notifyPath}`, process.env.NOTIFY_CONTENT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
!(async() => {
|
||||||
|
await image_update_notify();
|
||||||
|
})().catch((e) => console.log(e))
|
|
@ -0,0 +1,27 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [[ -f /usr/bin/jd_bot && -z "$DISABLE_SPNODE" ]]; then
|
||||||
|
CMD="spnode"
|
||||||
|
else
|
||||||
|
CMD="node"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "处理jd_crazy_joy_coin任务。。。"
|
||||||
|
if [ ! $CRZAY_JOY_COIN_ENABLE ]; then
|
||||||
|
echo "默认启用jd_crazy_joy_coin杀掉jd_crazy_joy_coin任务,并重启"
|
||||||
|
eval $(ps -ef | grep "jd_crazy_joy_coin" | grep -v "grep" | awk '{print "kill "$1}')
|
||||||
|
echo '' >/scripts/logs/jd_crazy_joy_coin.log
|
||||||
|
$CMD /scripts/jd_crazy_joy_coin.js | ts >>/scripts/logs/jd_crazy_joy_coin.log 2>&1 &
|
||||||
|
echo "默认jd_crazy_joy_coin重启完成"
|
||||||
|
else
|
||||||
|
if [ $CRZAY_JOY_COIN_ENABLE = "Y" ]; then
|
||||||
|
echo "配置启用jd_crazy_joy_coin,杀掉jd_crazy_joy_coin任务,并重启"
|
||||||
|
eval $(ps -ef | grep "jd_crazy_joy_coin" | grep -v "grep" | awk '{print "kill "$1}')
|
||||||
|
echo '' >/scripts/logs/jd_crazy_joy_coin.log
|
||||||
|
$CMD /scripts/jd_crazy_joy_coin.js | ts >>/scripts/logs/jd_crazy_joy_coin.log 2>&1 &
|
||||||
|
echo "配置jd_crazy_joy_coin重启完成"
|
||||||
|
else
|
||||||
|
eval $(ps -ef | grep "jd_crazy_joy_coin" | grep -v "grep" | awk '{print "kill "$1}')
|
||||||
|
echo "已配置不启用jd_crazy_joy_coin任务,仅杀掉"
|
||||||
|
fi
|
||||||
|
fi
|
|
@ -0,0 +1,341 @@
|
||||||
|
import axios from "axios"
|
||||||
|
import {Md5} from "ts-md5"
|
||||||
|
import * as dotenv from "dotenv"
|
||||||
|
import {existsSync, readFileSync} from "fs"
|
||||||
|
import {sendNotify} from './sendNotify'
|
||||||
|
|
||||||
|
dotenv.config()
|
||||||
|
|
||||||
|
let fingerprint: string | number, token: string = '', enCryptMethodJD: any
|
||||||
|
|
||||||
|
const USER_AGENTS: Array<string> = [
|
||||||
|
"jdapp;android;10.0.2;10;network/wifi;Mozilla/5.0 (Linux; Android 10; ONEPLUS A5010 Build/QKQ1.191014.012; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045230 Mobile Safari/537.36",
|
||||||
|
"jdapp;iPhone;10.0.2;14.3;network/4g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;android;10.0.2;9;network/4g;Mozilla/5.0 (Linux; Android 9; Mi Note 3 Build/PKQ1.181007.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/045131 Mobile Safari/537.36",
|
||||||
|
"jdapp;android;10.0.2;10;network/wifi;Mozilla/5.0 (Linux; Android 10; GM1910 Build/QKQ1.190716.003; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045230 Mobile Safari/537.36",
|
||||||
|
"jdapp;android;10.0.2;9;network/wifi;Mozilla/5.0 (Linux; Android 9; 16T Build/PKQ1.190616.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/044942 Mobile Safari/537.36",
|
||||||
|
"jdapp;iPhone;10.0.2;13.6;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 13_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;iPhone;10.0.2;13.6;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 13_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;iPhone;10.0.2;13.5;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 13_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;iPhone;10.0.2;14.1;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 14_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;iPhone;10.0.2;13.3;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 13_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;iPhone;10.0.2;13.7;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 13_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;iPhone;10.0.2;14.1;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 14_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;iPhone;10.0.2;13.3;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 13_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;iPhone;10.0.2;13.4;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 13_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;iPhone;10.0.2;14.3;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;android;10.0.2;9;network/wifi;Mozilla/5.0 (Linux; Android 9; MI 6 Build/PKQ1.190118.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/044942 Mobile Safari/537.36",
|
||||||
|
"jdapp;android;10.0.2;11;network/wifi;Mozilla/5.0 (Linux; Android 11; Redmi K30 5G Build/RKQ1.200826.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045511 Mobile Safari/537.36",
|
||||||
|
"jdapp;iPhone;10.0.2;11.4;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 11_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15F79",
|
||||||
|
"jdapp;android;10.0.2;10;;network/wifi;Mozilla/5.0 (Linux; Android 10; M2006J10C Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045230 Mobile Safari/537.36",
|
||||||
|
"jdapp;android;10.0.2;10;network/wifi;Mozilla/5.0 (Linux; Android 10; M2006J10C Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045230 Mobile Safari/537.36",
|
||||||
|
"jdapp;android;10.0.2;10;network/wifi;Mozilla/5.0 (Linux; Android 10; ONEPLUS A6000 Build/QKQ1.190716.003; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045224 Mobile Safari/537.36",
|
||||||
|
"jdapp;android;10.0.2;9;network/wifi;Mozilla/5.0 (Linux; Android 9; MHA-AL00 Build/HUAWEIMHA-AL00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/044942 Mobile Safari/537.36",
|
||||||
|
"jdapp;android;10.0.2;8.1.0;network/wifi;Mozilla/5.0 (Linux; Android 8.1.0; 16 X Build/OPM1.171019.026; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/044942 Mobile Safari/537.36",
|
||||||
|
"jdapp;android;10.0.2;8.0.0;network/wifi;Mozilla/5.0 (Linux; Android 8.0.0; HTC U-3w Build/OPR6.170623.013; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/044942 Mobile Safari/537.36",
|
||||||
|
"jdapp;iPhone;10.0.2;14.0.1;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 14_0_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;android;10.0.2;10;network/wifi;Mozilla/5.0 (Linux; Android 10; LYA-AL00 Build/HUAWEILYA-AL00L; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045230 Mobile Safari/537.36",
|
||||||
|
"jdapp;iPhone;10.0.2;14.2;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;iPhone;10.0.2;14.3;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;iPhone;10.0.2;14.2;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;android;10.0.2;8.1.0;network/wifi;Mozilla/5.0 (Linux; Android 8.1.0; MI 8 Build/OPM1.171019.026; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/045131 Mobile Safari/537.36",
|
||||||
|
"jdapp;android;10.0.2;10;network/wifi;Mozilla/5.0 (Linux; Android 10; Redmi K20 Pro Premium Edition Build/QKQ1.190825.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045227 Mobile Safari/537.36",
|
||||||
|
"jdapp;iPhone;10.0.2;14.3;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;iPhone;10.0.2;14.3;network/4g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;android;10.0.2;11;network/wifi;Mozilla/5.0 (Linux; Android 11; Redmi K20 Pro Premium Edition Build/RKQ1.200826.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045513 Mobile Safari/537.36",
|
||||||
|
"jdapp;android;10.0.2;10;network/wifi;Mozilla/5.0 (Linux; Android 10; MI 8 Build/QKQ1.190828.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045227 Mobile Safari/537.36",
|
||||||
|
"jdapp;iPhone;10.0.2;14.1;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 14_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
]
|
||||||
|
|
||||||
|
function TotalBean(cookie: string) {
|
||||||
|
return {
|
||||||
|
cookie: cookie,
|
||||||
|
isLogin: true,
|
||||||
|
nickName: ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getRandomNumberByRange(start: number, end: number) {
|
||||||
|
end <= start && (end = start + 100)
|
||||||
|
return Math.floor(Math.random() * (end - start) + start)
|
||||||
|
}
|
||||||
|
|
||||||
|
let USER_AGENT = USER_AGENTS[getRandomNumberByRange(0, USER_AGENTS.length)]
|
||||||
|
|
||||||
|
async function getBeanShareCode(cookie: string) {
|
||||||
|
let {data}: any = await axios.post('https://api.m.jd.com/client.action',
|
||||||
|
`functionId=plantBeanIndex&body=${encodeURIComponent(
|
||||||
|
JSON.stringify({version: "9.0.0.1", "monitor_source": "plant_app_plant_index", "monitor_refer": ""})
|
||||||
|
)}&appid=ld&client=apple&area=5_274_49707_49973&build=167283&clientVersion=9.1.0`, {
|
||||||
|
headers: {
|
||||||
|
Cookie: cookie,
|
||||||
|
Host: "api.m.jd.com",
|
||||||
|
Accept: "*/*",
|
||||||
|
Connection: "keep-alive",
|
||||||
|
"User-Agent": USER_AGENT
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (data.data?.jwordShareInfo?.shareUrl)
|
||||||
|
return data.data.jwordShareInfo.shareUrl.split('Uuid=')![1]
|
||||||
|
else
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getFarmShareCode(cookie: string) {
|
||||||
|
let {data}: any = await axios.post('https://api.m.jd.com/client.action?functionId=initForFarm', `body=${encodeURIComponent(JSON.stringify({"version": 4}))}&appid=wh5&clientVersion=9.1.0`, {
|
||||||
|
headers: {
|
||||||
|
"cookie": cookie,
|
||||||
|
"origin": "https://home.m.jd.com",
|
||||||
|
"referer": "https://home.m.jd.com/myJd/newhome.action",
|
||||||
|
"User-Agent": USER_AGENT,
|
||||||
|
"Content-Type": "application/x-www-form-urlencoded"
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
if (data.farmUserPro)
|
||||||
|
return data.farmUserPro.shareCode
|
||||||
|
else
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
|
||||||
|
async function requireConfig(check: boolean = false): Promise<string[]> {
|
||||||
|
let cookiesArr: string[] = []
|
||||||
|
const jdCookieNode = require('../jdCookie.js')
|
||||||
|
let keys: string[] = Object.keys(jdCookieNode)
|
||||||
|
for (let i = 0; i < keys.length; i++) {
|
||||||
|
let cookie = jdCookieNode[keys[i]]
|
||||||
|
if (!check) {
|
||||||
|
cookiesArr.push(cookie)
|
||||||
|
} else {
|
||||||
|
if (await checkCookie(cookie)) {
|
||||||
|
cookiesArr.push(cookie)
|
||||||
|
} else {
|
||||||
|
let username = decodeURIComponent(jdCookieNode[keys[i]].match(/pt_pin=([^;]*)/)![1])
|
||||||
|
console.log('Cookie失效', username)
|
||||||
|
await sendNotify('Cookie失效', '【京东账号】' + username)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log(`共${cookiesArr.length}个京东账号\n`)
|
||||||
|
return cookiesArr
|
||||||
|
}
|
||||||
|
|
||||||
|
async function checkCookie(cookie) {
|
||||||
|
await wait(1000)
|
||||||
|
try {
|
||||||
|
let {data}: any = await axios.get(`https://api.m.jd.com/client.action?functionId=GetJDUserInfoUnion&appid=jd-cphdeveloper-m&body=${encodeURIComponent(JSON.stringify({"orgFlag": "JD_PinGou_New", "callSource": "mainorder", "channel": 4, "isHomewhite": 0, "sceneval": 2}))}&loginType=2&_=${Date.now()}&sceneval=2&g_login_type=1&callback=GetJDUserInfoUnion&g_ty=ls`, {
|
||||||
|
headers: {
|
||||||
|
'authority': 'api.m.jd.com',
|
||||||
|
'user-agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/10.0 Mobile/14E304 Safari/602.1',
|
||||||
|
'referer': 'https://home.m.jd.com/',
|
||||||
|
'cookie': cookie
|
||||||
|
}
|
||||||
|
})
|
||||||
|
data = JSON.parse(data.match(/GetJDUserInfoUnion\((.*)\)/)[1])
|
||||||
|
return data.retcode === '0';
|
||||||
|
} catch (e) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function wait(timeout: number) {
|
||||||
|
return new Promise(resolve => {
|
||||||
|
setTimeout(resolve, timeout)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
async function requestAlgo(appId: number = 10032) {
|
||||||
|
fingerprint = generateFp()
|
||||||
|
return new Promise<void>(async resolve => {
|
||||||
|
let {data}: any = await axios.post('https://cactus.jd.com/request_algo?g_ty=ajax', {
|
||||||
|
"version": "1.0",
|
||||||
|
"fp": fingerprint,
|
||||||
|
"appId": appId,
|
||||||
|
"timestamp": Date.now(),
|
||||||
|
"platform": "web",
|
||||||
|
"expandParams": ""
|
||||||
|
}, {
|
||||||
|
"headers": {
|
||||||
|
'Authority': 'cactus.jd.com',
|
||||||
|
'Pragma': 'no-cache',
|
||||||
|
'Cache-Control': 'no-cache',
|
||||||
|
'Accept': 'application/json',
|
||||||
|
'User-Agent': USER_AGENT,
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Origin': 'https://st.jingxi.com',
|
||||||
|
'Sec-Fetch-Site': 'cross-site',
|
||||||
|
'Sec-Fetch-Mode': 'cors',
|
||||||
|
'Sec-Fetch-Dest': 'empty',
|
||||||
|
'Referer': 'https://st.jingxi.com/',
|
||||||
|
'Accept-Language': 'zh-CN,zh;q=0.9,zh-TW;q=0.8,en;q=0.7'
|
||||||
|
},
|
||||||
|
})
|
||||||
|
if (data['status'] === 200) {
|
||||||
|
token = data.data.result.tk
|
||||||
|
let enCryptMethodJDString = data.data.result.algo
|
||||||
|
if (enCryptMethodJDString) enCryptMethodJD = new Function(`return ${enCryptMethodJDString}`)()
|
||||||
|
} else {
|
||||||
|
console.log(`fp: ${fingerprint}`)
|
||||||
|
console.log('request_algo 签名参数API请求失败:')
|
||||||
|
}
|
||||||
|
resolve()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function generateFp() {
|
||||||
|
let e = "0123456789"
|
||||||
|
let a = 13
|
||||||
|
let i = ''
|
||||||
|
for (; a--;)
|
||||||
|
i += e[Math.random() * e.length | 0]
|
||||||
|
return (i + Date.now()).slice(0, 16)
|
||||||
|
}
|
||||||
|
|
||||||
|
function getJxToken(cookie: string, phoneId: string = '') {
|
||||||
|
function generateStr(input: number) {
|
||||||
|
let src = 'abcdefghijklmnopqrstuvwxyz1234567890'
|
||||||
|
let res = ''
|
||||||
|
for (let i = 0; i < input; i++) {
|
||||||
|
res += src[Math.floor(src.length * Math.random())]
|
||||||
|
}
|
||||||
|
return res
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!phoneId)
|
||||||
|
phoneId = generateStr(40)
|
||||||
|
let timestamp = Date.now().toString()
|
||||||
|
let nickname = cookie.match(/pt_pin=([^;]*)/)![1]
|
||||||
|
let jstoken = Md5.hashStr('' + decodeURIComponent(nickname) + timestamp + phoneId + 'tPOamqCuk9NLgVPAljUyIHcPRmKlVxDy')
|
||||||
|
return {
|
||||||
|
'strPgtimestamp': timestamp,
|
||||||
|
'strPhoneID': phoneId,
|
||||||
|
'strPgUUNum': jstoken
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function exceptCookie(filename: string = 'x.ts') {
|
||||||
|
let except: any = []
|
||||||
|
if (existsSync('./utils/exceptCookie.json')) {
|
||||||
|
try {
|
||||||
|
except = JSON.parse(readFileSync('./utils/exceptCookie.json').toString() || '{}')[filename] || []
|
||||||
|
} catch (e) {
|
||||||
|
console.log('./utils/exceptCookie.json JSON格式错误')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return except
|
||||||
|
}
|
||||||
|
|
||||||
|
function randomString(e: number, word?: number) {
|
||||||
|
e = e || 32
|
||||||
|
let t = word === 26 ? "012345678abcdefghijklmnopqrstuvwxyz" : "0123456789abcdef", a = t.length, n = ""
|
||||||
|
for (let i = 0; i < e; i++)
|
||||||
|
n += t.charAt(Math.floor(Math.random() * a))
|
||||||
|
return n
|
||||||
|
}
|
||||||
|
|
||||||
|
function o2s(arr: object, title: string = '') {
|
||||||
|
title ? console.log(title, JSON.stringify(arr)) : console.log(JSON.stringify(arr))
|
||||||
|
}
|
||||||
|
|
||||||
|
function randomNumString(e: number) {
|
||||||
|
e = e || 32
|
||||||
|
let t = '0123456789', a = t.length, n = ""
|
||||||
|
for (let i = 0; i < e; i++)
|
||||||
|
n += t.charAt(Math.floor(Math.random() * a))
|
||||||
|
return n
|
||||||
|
}
|
||||||
|
|
||||||
|
function randomWord(n: number = 1) {
|
||||||
|
let t = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', a = t.length
|
||||||
|
let rnd: string = ''
|
||||||
|
for (let i = 0; i < n; i++) {
|
||||||
|
rnd += t.charAt(Math.floor(Math.random() * a))
|
||||||
|
}
|
||||||
|
return rnd
|
||||||
|
}
|
||||||
|
|
||||||
|
function obj2str(obj: object) {
|
||||||
|
return JSON.stringify(obj)
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getDevice() {
|
||||||
|
let {data} = await axios.get('https://betahub.cn/api/apple/devices/iPhone', {
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
data = data[getRandomNumberByRange(0, 16)]
|
||||||
|
return data.identifier
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getVersion(device: string) {
|
||||||
|
let {data} = await axios.get(`https://betahub.cn/api/apple/firmwares/${device}`, {
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
data = data[getRandomNumberByRange(0, data.length)]
|
||||||
|
return data.firmware_info.version
|
||||||
|
}
|
||||||
|
|
||||||
|
async function jdpingou() {
|
||||||
|
let device: string, version: string;
|
||||||
|
device = await getDevice();
|
||||||
|
version = await getVersion(device);
|
||||||
|
return `jdpingou;iPhone;5.19.0;${version};${randomString(40)};network/wifi;model/${device};appBuild/100833;ADID/;supportApplePay/1;hasUPPay/0;pushNoticeIsOpen/0;hasOCPay/0;supportBestPay/0;session/${getRandomNumberByRange(10, 90)};pap/JA2019_3111789;brand/apple;supportJDSHWK/1;Mozilla/5.0 (iPhone; CPU iPhone OS 14_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148`
|
||||||
|
}
|
||||||
|
|
||||||
|
function get(url: string, headers?: any): Promise<any> {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
axios.get(url, {
|
||||||
|
headers: headers
|
||||||
|
}).then(res => {
|
||||||
|
if (typeof res.data === 'string' && res.data.includes('jsonpCBK')) {
|
||||||
|
resolve(JSON.parse(res.data.match(/jsonpCBK.?\(([\w\W]*)\);?/)[1]))
|
||||||
|
} else {
|
||||||
|
resolve(res.data)
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
reject({
|
||||||
|
code: err?.response?.status || -1,
|
||||||
|
msg: err?.response?.statusText || err.message || 'error'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function post(url: string, prarms?: string | object, headers?: any): Promise<any> {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
axios.post(url, prarms, {
|
||||||
|
headers: headers
|
||||||
|
}).then(res => {
|
||||||
|
resolve(res.data)
|
||||||
|
}).catch(err => {
|
||||||
|
reject({
|
||||||
|
code: err?.response?.status || -1,
|
||||||
|
msg: err?.response?.statusText || err.message || 'error'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export default USER_AGENT
|
||||||
|
export {
|
||||||
|
TotalBean,
|
||||||
|
getBeanShareCode,
|
||||||
|
getFarmShareCode,
|
||||||
|
requireConfig,
|
||||||
|
wait,
|
||||||
|
getRandomNumberByRange,
|
||||||
|
requestAlgo,
|
||||||
|
getJxToken,
|
||||||
|
randomString,
|
||||||
|
o2s,
|
||||||
|
randomNumString,
|
||||||
|
getShareCodePool,
|
||||||
|
randomWord,
|
||||||
|
obj2str,
|
||||||
|
jdpingou,
|
||||||
|
get,
|
||||||
|
post
|
||||||
|
}
|
|
@ -0,0 +1,270 @@
|
||||||
|
let request = require('request');
|
||||||
|
let CryptoJS = require('crypto-js');
|
||||||
|
let qs = require('querystring');
|
||||||
|
let urls = require('url');
|
||||||
|
let path = require('path');
|
||||||
|
let notify = require('./sendNotify');
|
||||||
|
let mainEval = require("./eval");
|
||||||
|
let assert = require('assert');
|
||||||
|
let jxAlgo = require("./jxAlgo");
|
||||||
|
let config = require("./config");
|
||||||
|
let user = {}
|
||||||
|
try {
|
||||||
|
user = require("./user")
|
||||||
|
} catch (e) {}
|
||||||
|
class env {
|
||||||
|
constructor(name) {
|
||||||
|
this.config = { ...config,
|
||||||
|
...process.env,
|
||||||
|
...user,
|
||||||
|
};
|
||||||
|
this.name = name;
|
||||||
|
this.message = [];
|
||||||
|
this.sharecode = [];
|
||||||
|
this.code = [];
|
||||||
|
this.timestamp = new Date().getTime();
|
||||||
|
this.time = this.start = parseInt(this.timestamp / 1000);
|
||||||
|
this.options = {
|
||||||
|
'headers': {}
|
||||||
|
};
|
||||||
|
console.log(`\n🔔${this.name}, 开始!\n`)
|
||||||
|
console.log(`=========== 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000).toLocaleString()} ===========\n`)
|
||||||
|
}
|
||||||
|
done() {
|
||||||
|
let timestamp = new Date().getTime();
|
||||||
|
let work = ((timestamp - this.timestamp) / 1000).toFixed(2)
|
||||||
|
console.log(`=========================脚本执行完成,耗时${work}s============================\n`)
|
||||||
|
console.log(`🔔${this.name}, 结束!\n`)
|
||||||
|
}
|
||||||
|
notify(array) {
|
||||||
|
let text = '';
|
||||||
|
for (let i of array) {
|
||||||
|
text += `${i.user} -- ${i.msg}\n`
|
||||||
|
}
|
||||||
|
console.log(`\n=============================开始发送提醒消息=============================`)
|
||||||
|
notify.sendNotify(this.name + "消息提醒", text)
|
||||||
|
}
|
||||||
|
wait(t) {
|
||||||
|
return new Promise(e => setTimeout(e, t))
|
||||||
|
}
|
||||||
|
setOptions(params) {
|
||||||
|
this.options = params;
|
||||||
|
}
|
||||||
|
setCookie(cookie) {
|
||||||
|
this.options.headers.cookie = cookie
|
||||||
|
}
|
||||||
|
jsonParse(str) {
|
||||||
|
try {
|
||||||
|
return JSON.parse(str);
|
||||||
|
} catch (e) {
|
||||||
|
try {
|
||||||
|
let data = this.match([/try\s*\{\w+\s*\(([^\)]+)/, /\w+\s*\(([^\)]+)/], str)
|
||||||
|
return JSON.parse(data);
|
||||||
|
} catch (ee) {
|
||||||
|
try {
|
||||||
|
let cb = this.match(/try\s*\{\s*(\w+)/, str)
|
||||||
|
if (cb) {
|
||||||
|
let func = "";
|
||||||
|
let data = str.replace(cb, `func=`)
|
||||||
|
eval(data);
|
||||||
|
return func
|
||||||
|
}
|
||||||
|
} catch (eee) {
|
||||||
|
return str
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
curl(params, extra = '') {
|
||||||
|
if (typeof(params) != 'object') {
|
||||||
|
params = {
|
||||||
|
'url': params
|
||||||
|
}
|
||||||
|
}
|
||||||
|
params = Object.assign({ ...this.options
|
||||||
|
}, params);
|
||||||
|
params.method = params.body ? 'POST' : 'GET';
|
||||||
|
if (params.hasOwnProperty('cookie')) {
|
||||||
|
params.headers.cookie = params.cookie
|
||||||
|
}
|
||||||
|
if (params.hasOwnProperty('ua') || params.hasOwnProperty('useragent')) {
|
||||||
|
params.headers['user-agent'] = params.ua
|
||||||
|
}
|
||||||
|
if (params.hasOwnProperty('referer')) {
|
||||||
|
params.headers.referer = params.referer
|
||||||
|
}
|
||||||
|
if (params.hasOwnProperty('params')) {
|
||||||
|
params.url += '?' + qs.stringify(params.params)
|
||||||
|
}
|
||||||
|
if (params.hasOwnProperty('form')) {
|
||||||
|
params.method = 'POST'
|
||||||
|
}
|
||||||
|
return new Promise(resolve => {
|
||||||
|
request(params, async (err, resp, data) => {
|
||||||
|
try {
|
||||||
|
if (params.console) {
|
||||||
|
console.log(data)
|
||||||
|
}
|
||||||
|
this.source = this.jsonParse(data);
|
||||||
|
if (extra) {
|
||||||
|
this[extra] = this.source
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e, resp)
|
||||||
|
} finally {
|
||||||
|
resolve(data);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
dumps(dict) {
|
||||||
|
return JSON.stringify(dict)
|
||||||
|
}
|
||||||
|
loads(str) {
|
||||||
|
return JSON.parse(str)
|
||||||
|
}
|
||||||
|
notice(msg) {
|
||||||
|
this.message.push({
|
||||||
|
'index': this.index,
|
||||||
|
'user': this.user,
|
||||||
|
'msg': msg
|
||||||
|
})
|
||||||
|
}
|
||||||
|
notices(msg, user, index = '') {
|
||||||
|
this.message.push({
|
||||||
|
'user': user,
|
||||||
|
'msg': msg,
|
||||||
|
'index': index
|
||||||
|
})
|
||||||
|
}
|
||||||
|
urlparse(url) {
|
||||||
|
return urls.parse(url, true, true)
|
||||||
|
}
|
||||||
|
md5(encryptString) {
|
||||||
|
return CryptoJS.MD5(encryptString).toString()
|
||||||
|
}
|
||||||
|
haskey(data, key, value) {
|
||||||
|
value = typeof value !== 'undefined' ? value : '';
|
||||||
|
var spl = key.split('.');
|
||||||
|
for (var i of spl) {
|
||||||
|
i = !isNaN(i) ? parseInt(i) : i;
|
||||||
|
try {
|
||||||
|
data = data[i];
|
||||||
|
} catch (error) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (data == undefined) {
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
if (value !== '') {
|
||||||
|
return data === value ? true : false;
|
||||||
|
} else {
|
||||||
|
return data
|
||||||
|
}
|
||||||
|
}
|
||||||
|
match(pattern, string) {
|
||||||
|
pattern = (pattern instanceof Array) ? pattern : [pattern];
|
||||||
|
for (let pat of pattern) {
|
||||||
|
// var match = string.match(pat);
|
||||||
|
var match = pat.exec(string)
|
||||||
|
if (match) {
|
||||||
|
var len = match.length;
|
||||||
|
if (len == 1) {
|
||||||
|
return match;
|
||||||
|
} else if (len == 2) {
|
||||||
|
return match[1];
|
||||||
|
} else {
|
||||||
|
var r = [];
|
||||||
|
for (let i = 1; i < len; i++) {
|
||||||
|
r.push(match[i])
|
||||||
|
}
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// console.log(pat.exec(string))
|
||||||
|
}
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
matchall(pattern, string) {
|
||||||
|
pattern = (pattern instanceof Array) ? pattern : [pattern];
|
||||||
|
var match;
|
||||||
|
var result = [];
|
||||||
|
for (var pat of pattern) {
|
||||||
|
while ((match = pat.exec(string)) != null) {
|
||||||
|
var len = match.length;
|
||||||
|
if (len == 1) {
|
||||||
|
result.push(match);
|
||||||
|
} else if (len == 2) {
|
||||||
|
result.push(match[1]);
|
||||||
|
} else {
|
||||||
|
var r = [];
|
||||||
|
for (let i = 1; i < len; i++) {
|
||||||
|
r.push(match[i])
|
||||||
|
}
|
||||||
|
result.push(r);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
compare(property) {
|
||||||
|
return function(a, b) {
|
||||||
|
var value1 = a[property];
|
||||||
|
var value2 = b[property];
|
||||||
|
return value1 - value2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
filename(file, rename = '') {
|
||||||
|
if (!this.runfile) {
|
||||||
|
this.runfile = path.basename(file).replace(".js", '').replace(/-/g, '_')
|
||||||
|
}
|
||||||
|
if (rename) {
|
||||||
|
rename = `_${rename}`;
|
||||||
|
}
|
||||||
|
return path.basename(file).replace(".js", rename).replace(/-/g, '_');
|
||||||
|
}
|
||||||
|
rand(n, m) {
|
||||||
|
var random = Math.floor(Math.random() * (m - n + 1) + n);
|
||||||
|
return random;
|
||||||
|
}
|
||||||
|
random(arr, num) {
|
||||||
|
var temp_array = new Array();
|
||||||
|
for (var index in arr) {
|
||||||
|
temp_array.push(arr[index]);
|
||||||
|
}
|
||||||
|
var return_array = new Array();
|
||||||
|
for (var i = 0; i < num; i++) {
|
||||||
|
if (temp_array.length > 0) {
|
||||||
|
var arrIndex = Math.floor(Math.random() * temp_array.length);
|
||||||
|
return_array[i] = temp_array[arrIndex];
|
||||||
|
temp_array.splice(arrIndex, 1);
|
||||||
|
} else {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return return_array;
|
||||||
|
}
|
||||||
|
compact(lists, keys) {
|
||||||
|
let array = {};
|
||||||
|
for (let i of keys) {
|
||||||
|
if (lists[i]) {
|
||||||
|
array[i] = lists[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return array;
|
||||||
|
}
|
||||||
|
unique(arr) {
|
||||||
|
return Array.from(new Set(arr));
|
||||||
|
}
|
||||||
|
end(args) {
|
||||||
|
return args[args.length - 1]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
module.exports = {
|
||||||
|
env,
|
||||||
|
eval: mainEval,
|
||||||
|
assert,
|
||||||
|
jxAlgo,
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
module.exports = {"ThreadJs":[],"invokeKey":"RtKLB8euDo7KwsO0"}
|
|
@ -0,0 +1,83 @@
|
||||||
|
function mainEval($) {
|
||||||
|
return `
|
||||||
|
!(async () => {
|
||||||
|
jdcookie = process.env.JD_COOKIE ? process.env.JD_COOKIE.split("&") : require("./function/jdcookie").cookie;
|
||||||
|
cookies={
|
||||||
|
'all':jdcookie,
|
||||||
|
'help': typeof(help) != 'undefined' ? [...jdcookie].splice(0,parseInt(help)):[]
|
||||||
|
}
|
||||||
|
$.sleep=cookies['all'].length * 500
|
||||||
|
taskCookie=cookies['all']
|
||||||
|
jxAlgo = new common.jxAlgo();
|
||||||
|
if ($.readme) {
|
||||||
|
console.log(\`使用说明:\\n\${$.readme}\\n以上内容仅供参考,有需求自行添加\\n\`,)
|
||||||
|
}
|
||||||
|
console.log(\`======================本次任务共\${taskCookie.length}个京东账户Cookie======================\\n\`)
|
||||||
|
try{
|
||||||
|
await prepare();
|
||||||
|
|
||||||
|
if ($.sharecode.length > 0) {
|
||||||
|
$.sharecode = $.sharecode.filter(d=>d && JSON.stringify(d)!='{}')
|
||||||
|
console.log('助力码', $.sharecode )
|
||||||
|
}
|
||||||
|
}catch(e1){console.log("初始函数不存在,将继续执行主函数Main\\n")}
|
||||||
|
if (typeof(main) != 'undefined') {
|
||||||
|
try{
|
||||||
|
for (let i = 0; i < taskCookie.filter(d => d).length; i++) {
|
||||||
|
$.cookie = taskCookie[i];
|
||||||
|
$.user = decodeURIComponent($.cookie.match(/pt_pin=([^;]+)/)[1])
|
||||||
|
$.index = parseInt(i) + 1;
|
||||||
|
let info = {
|
||||||
|
'index': $.index,
|
||||||
|
'user': $.user,
|
||||||
|
'cookie': $.cookie
|
||||||
|
}
|
||||||
|
if (!$.thread) {
|
||||||
|
console.log(\`\n******开始【京东账号\${$.index}】\${$.user} 任务*********\n\`);
|
||||||
|
}
|
||||||
|
if ($.config[\`\${$.runfile}_except\`] && $.config[\`\${$.runfile}_except\`].includes(\$.user)) {
|
||||||
|
console.log(\`全局变量\${$.runfile}_except中配置了该账号pt_pin,跳过此次任务\`)
|
||||||
|
}else{
|
||||||
|
$.setCookie($.cookie)
|
||||||
|
try{
|
||||||
|
if ($.sharecode.length > 0) {
|
||||||
|
for (let smp of $.sharecode) {
|
||||||
|
smp = Object.assign({ ...info}, smp);
|
||||||
|
$.thread ? main(smp) : await main(smp);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$.thread ? main(info) : await main(info);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch(em){
|
||||||
|
console.log(em.message)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}catch(em){console.log(em.message)}
|
||||||
|
if ($.thread) {
|
||||||
|
await $.wait($.sleep)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (typeof(extra) != 'undefined') {
|
||||||
|
console.log(\`============================开始运行额外任务============================\`)
|
||||||
|
try{
|
||||||
|
await extra();
|
||||||
|
}catch(e4){console.log(e4.message)}
|
||||||
|
}
|
||||||
|
})().catch((e) => {
|
||||||
|
console.log(e.message)
|
||||||
|
}).finally(() => {
|
||||||
|
if ($.message.length > 0) {
|
||||||
|
$.notify($.message)
|
||||||
|
}
|
||||||
|
$.done();
|
||||||
|
});
|
||||||
|
|
||||||
|
`
|
||||||
|
}
|
||||||
|
module.exports = {
|
||||||
|
mainEval
|
||||||
|
}
|
|
@ -0,0 +1,73 @@
|
||||||
|
import axios from "axios"
|
||||||
|
import {format} from "date-fns"
|
||||||
|
|
||||||
|
const CryptoJS = require("crypto-js")
|
||||||
|
|
||||||
|
class H5ST {
|
||||||
|
tk: string;
|
||||||
|
timestamp: string;
|
||||||
|
rd: string;
|
||||||
|
appId: string;
|
||||||
|
fp: string;
|
||||||
|
time: number;
|
||||||
|
ua: string
|
||||||
|
enc: string;
|
||||||
|
|
||||||
|
constructor(appId: string, ua: string, fp: string) {
|
||||||
|
this.appId = appId
|
||||||
|
this.ua = ua
|
||||||
|
this.fp = fp || this.__genFp()
|
||||||
|
}
|
||||||
|
|
||||||
|
__genFp() {
|
||||||
|
let e = "0123456789";
|
||||||
|
let a = 13;
|
||||||
|
let i = '';
|
||||||
|
for (; a--;)
|
||||||
|
i += e[Math.random() * e.length | 0];
|
||||||
|
return (i + Date.now()).slice(0, 16)
|
||||||
|
}
|
||||||
|
|
||||||
|
async __genAlgo() {
|
||||||
|
this.time = Date.now()
|
||||||
|
this.timestamp = format(this.time, "yyyyMMddHHmmssSSS")
|
||||||
|
let {data} = await axios.post(`https://cactus.jd.com/request_algo?g_ty=ajax`, {
|
||||||
|
'version': '3.0',
|
||||||
|
'fp': this.fp,
|
||||||
|
'appId': this.appId.toString(),
|
||||||
|
'timestamp': this.time,
|
||||||
|
'platform': 'web',
|
||||||
|
'expandParams': ''
|
||||||
|
}, {
|
||||||
|
headers: {
|
||||||
|
'Host': 'cactus.jd.com',
|
||||||
|
'accept': 'application/json',
|
||||||
|
'content-type': 'application/json',
|
||||||
|
'user-agent': this.ua,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.tk = data.data.result.tk
|
||||||
|
this.rd = data.data.result.algo.match(/rd='(.*)'/)[1]
|
||||||
|
this.enc = data.data.result.algo.match(/algo\.(.*)\(/)[1]
|
||||||
|
}
|
||||||
|
|
||||||
|
__genKey(tk, fp, ts, ai, algo) {
|
||||||
|
let str = `${tk}${fp}${ts}${ai}${this.rd}`;
|
||||||
|
return algo[this.enc](str, tk)
|
||||||
|
}
|
||||||
|
|
||||||
|
__genH5st(body: object) {
|
||||||
|
let y = this.__genKey(this.tk, this.fp, this.timestamp, this.appId, CryptoJS).toString(CryptoJS.enc.Hex)
|
||||||
|
let s = ''
|
||||||
|
for (let i in body) {
|
||||||
|
i === 'body' ? s += `${i}:${CryptoJS.SHA256(body[i]).toString(CryptoJS.enc.Hex)}&` : s += `${i}:${body[i]}&`
|
||||||
|
}
|
||||||
|
s = s.slice(0, -1)
|
||||||
|
s = CryptoJS.HmacSHA256(s, y).toString(CryptoJS.enc.Hex)
|
||||||
|
return encodeURIComponent(`${this.timestamp};${this.fp};${this.appId.toString()};${this.tk};${s};3.0;${this.time.toString()}`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export {
|
||||||
|
H5ST
|
||||||
|
}
|
|
@ -0,0 +1,466 @@
|
||||||
|
const https = require('https');
|
||||||
|
const http = require('http');
|
||||||
|
const stream = require('stream');
|
||||||
|
const zlib = require('zlib');
|
||||||
|
const vm = require('vm');
|
||||||
|
const PNG = require('png-js');
|
||||||
|
const UA = 'jdapp;iPhone;9.4.6;14.2;965af808880443e4c1306a54afdd5d5ae771de46;network/wifi;supportApplePay/0;hasUPPay/0;hasOCPay/0;model/iPhone8,4;addressid/;supportBestPay/0;appBuild/167618;jdSupportDarkMode/0;Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1';
|
||||||
|
Math.avg = function average() {
|
||||||
|
var sum = 0;
|
||||||
|
var len = this.length;
|
||||||
|
for (var i = 0; i < len; i++) {
|
||||||
|
sum += this[i];
|
||||||
|
}
|
||||||
|
return sum / len;
|
||||||
|
};
|
||||||
|
|
||||||
|
function sleep(timeout) {
|
||||||
|
return new Promise((resolve) => setTimeout(resolve, timeout));
|
||||||
|
}
|
||||||
|
class PNGDecoder extends PNG {
|
||||||
|
constructor(args) {
|
||||||
|
super(args);
|
||||||
|
this.pixels = [];
|
||||||
|
}
|
||||||
|
decodeToPixels() {
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
this.decode((pixels) => {
|
||||||
|
this.pixels = pixels;
|
||||||
|
resolve();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
getImageData(x, y, w, h) {
|
||||||
|
const {
|
||||||
|
pixels
|
||||||
|
} = this;
|
||||||
|
const len = w * h * 4;
|
||||||
|
const startIndex = x * 4 + y * (w * 4);
|
||||||
|
return {
|
||||||
|
data: pixels.slice(startIndex, startIndex + len)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const PUZZLE_GAP = 8;
|
||||||
|
const PUZZLE_PAD = 10;
|
||||||
|
class PuzzleRecognizer {
|
||||||
|
constructor(bg, patch, y) {
|
||||||
|
// console.log(bg);
|
||||||
|
const imgBg = new PNGDecoder(Buffer.from(bg, 'base64'));
|
||||||
|
const imgPatch = new PNGDecoder(Buffer.from(patch, 'base64'));
|
||||||
|
// console.log(imgBg);
|
||||||
|
this.bg = imgBg;
|
||||||
|
this.patch = imgPatch;
|
||||||
|
this.rawBg = bg;
|
||||||
|
this.rawPatch = patch;
|
||||||
|
this.y = y;
|
||||||
|
this.w = imgBg.width;
|
||||||
|
this.h = imgBg.height;
|
||||||
|
}
|
||||||
|
async run() {
|
||||||
|
await this.bg.decodeToPixels();
|
||||||
|
await this.patch.decodeToPixels();
|
||||||
|
return this.recognize();
|
||||||
|
}
|
||||||
|
recognize() {
|
||||||
|
const {
|
||||||
|
ctx,
|
||||||
|
w: width,
|
||||||
|
bg
|
||||||
|
} = this;
|
||||||
|
const {
|
||||||
|
width: patchWidth,
|
||||||
|
height: patchHeight
|
||||||
|
} = this.patch;
|
||||||
|
const posY = this.y + PUZZLE_PAD + ((patchHeight - PUZZLE_PAD) / 2) - (PUZZLE_GAP / 2);
|
||||||
|
// const cData = ctx.getImageData(0, a.y + 10 + 20 - 4, 360, 8).data;
|
||||||
|
const cData = bg.getImageData(0, posY, width, PUZZLE_GAP).data;
|
||||||
|
const lumas = [];
|
||||||
|
for (let x = 0; x < width; x++) {
|
||||||
|
var sum = 0;
|
||||||
|
// y xais
|
||||||
|
for (let y = 0; y < PUZZLE_GAP; y++) {
|
||||||
|
var idx = x * 4 + y * (width * 4);
|
||||||
|
var r = cData[idx];
|
||||||
|
var g = cData[idx + 1];
|
||||||
|
var b = cData[idx + 2];
|
||||||
|
var luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;
|
||||||
|
sum += luma;
|
||||||
|
}
|
||||||
|
lumas.push(sum / PUZZLE_GAP);
|
||||||
|
}
|
||||||
|
const n = 2; // minium macroscopic image width (px)
|
||||||
|
const margin = patchWidth - PUZZLE_PAD;
|
||||||
|
const diff = 20; // macroscopic brightness difference
|
||||||
|
const radius = PUZZLE_PAD;
|
||||||
|
for (let i = 0, len = lumas.length - 2 * 4; i < len; i++) {
|
||||||
|
const left = (lumas[i] + lumas[i + 1]) / n;
|
||||||
|
const right = (lumas[i + 2] + lumas[i + 3]) / n;
|
||||||
|
const mi = margin + i;
|
||||||
|
const mLeft = (lumas[mi] + lumas[mi + 1]) / n;
|
||||||
|
const mRigth = (lumas[mi + 2] + lumas[mi + 3]) / n;
|
||||||
|
if (left - right > diff && mLeft - mRigth < -diff) {
|
||||||
|
const pieces = lumas.slice(i + 2, margin + i + 2);
|
||||||
|
const median = pieces.sort((x1, x2) => x1 - x2)[20];
|
||||||
|
const avg = Math.avg(pieces);
|
||||||
|
// noise reducation
|
||||||
|
if (median > left || median > mRigth) return;
|
||||||
|
if (avg > 100) return;
|
||||||
|
// console.table({left,right,mLeft,mRigth,median});
|
||||||
|
// ctx.fillRect(i+n-radius, 0, 1, 360);
|
||||||
|
// console.log(i+n-radius);
|
||||||
|
return i + n - radius;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// not found
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
runWithCanvas() {
|
||||||
|
const {
|
||||||
|
createCanvas,
|
||||||
|
Image
|
||||||
|
} = require('canvas');
|
||||||
|
const canvas = createCanvas();
|
||||||
|
const ctx = canvas.getContext('2d');
|
||||||
|
const imgBg = new Image();
|
||||||
|
const imgPatch = new Image();
|
||||||
|
const prefix = 'data:image/png;base64,';
|
||||||
|
imgBg.src = prefix + this.rawBg;
|
||||||
|
imgPatch.src = prefix + this.rawPatch;
|
||||||
|
const {
|
||||||
|
naturalWidth: w,
|
||||||
|
naturalHeight: h
|
||||||
|
} = imgBg;
|
||||||
|
canvas.width = w;
|
||||||
|
canvas.height = h;
|
||||||
|
ctx.clearRect(0, 0, w, h);
|
||||||
|
ctx.drawImage(imgBg, 0, 0, w, h);
|
||||||
|
const width = w;
|
||||||
|
const {
|
||||||
|
naturalWidth,
|
||||||
|
naturalHeight
|
||||||
|
} = imgPatch;
|
||||||
|
const posY = this.y + PUZZLE_PAD + ((naturalHeight - PUZZLE_PAD) / 2) - (PUZZLE_GAP / 2);
|
||||||
|
// const cData = ctx.getImageData(0, a.y + 10 + 20 - 4, 360, 8).data;
|
||||||
|
const cData = ctx.getImageData(0, posY, width, PUZZLE_GAP).data;
|
||||||
|
const lumas = [];
|
||||||
|
for (let x = 0; x < width; x++) {
|
||||||
|
var sum = 0;
|
||||||
|
// y xais
|
||||||
|
for (let y = 0; y < PUZZLE_GAP; y++) {
|
||||||
|
var idx = x * 4 + y * (width * 4);
|
||||||
|
var r = cData[idx];
|
||||||
|
var g = cData[idx + 1];
|
||||||
|
var b = cData[idx + 2];
|
||||||
|
var luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;
|
||||||
|
sum += luma;
|
||||||
|
}
|
||||||
|
lumas.push(sum / PUZZLE_GAP);
|
||||||
|
}
|
||||||
|
const n = 2; // minium macroscopic image width (px)
|
||||||
|
const margin = naturalWidth - PUZZLE_PAD;
|
||||||
|
const diff = 20; // macroscopic brightness difference
|
||||||
|
const radius = PUZZLE_PAD;
|
||||||
|
for (let i = 0, len = lumas.length - 2 * 4; i < len; i++) {
|
||||||
|
const left = (lumas[i] + lumas[i + 1]) / n;
|
||||||
|
const right = (lumas[i + 2] + lumas[i + 3]) / n;
|
||||||
|
const mi = margin + i;
|
||||||
|
const mLeft = (lumas[mi] + lumas[mi + 1]) / n;
|
||||||
|
const mRigth = (lumas[mi + 2] + lumas[mi + 3]) / n;
|
||||||
|
if (left - right > diff && mLeft - mRigth < -diff) {
|
||||||
|
const pieces = lumas.slice(i + 2, margin + i + 2);
|
||||||
|
const median = pieces.sort((x1, x2) => x1 - x2)[20];
|
||||||
|
const avg = Math.avg(pieces);
|
||||||
|
// noise reducation
|
||||||
|
if (median > left || median > mRigth) return;
|
||||||
|
if (avg > 100) return;
|
||||||
|
// console.table({left,right,mLeft,mRigth,median});
|
||||||
|
// ctx.fillRect(i+n-radius, 0, 1, 360);
|
||||||
|
// console.log(i+n-radius);
|
||||||
|
return i + n - radius;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// not found
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const DATA = {
|
||||||
|
"appId": "17839d5db83",
|
||||||
|
"scene": "cww",
|
||||||
|
"product": "embed",
|
||||||
|
"lang": "zh_CN",
|
||||||
|
};
|
||||||
|
let SERVER = 'iv.jd.com';
|
||||||
|
if (process.env.JDJR_SERVER) {
|
||||||
|
SERVER = process.env.JDJR_SERVER
|
||||||
|
}
|
||||||
|
class JDJRValidator {
|
||||||
|
constructor() {
|
||||||
|
this.data = {};
|
||||||
|
this.x = 0;
|
||||||
|
this.t = Date.now();
|
||||||
|
this.n = 0;
|
||||||
|
}
|
||||||
|
async run() {
|
||||||
|
const tryRecognize = async () => {
|
||||||
|
const x = await this.recognize();
|
||||||
|
if (x > 0) {
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
// retry
|
||||||
|
return await tryRecognize();
|
||||||
|
};
|
||||||
|
const puzzleX = await tryRecognize();
|
||||||
|
console.log(puzzleX);
|
||||||
|
const pos = new MousePosFaker(puzzleX).run();
|
||||||
|
const d = getCoordinate(pos);
|
||||||
|
// console.log(pos[pos.length-1][2] -Date.now());
|
||||||
|
await sleep(3000);
|
||||||
|
//await sleep(pos[pos.length - 1][2] - Date.now());
|
||||||
|
const result = await JDJRValidator.jsonp('/slide/s.html', {
|
||||||
|
d,
|
||||||
|
...this.data
|
||||||
|
});
|
||||||
|
if (result.message === 'success') {
|
||||||
|
// console.log(result);
|
||||||
|
// console.log('JDJRValidator: %fs', (Date.now() - this.t) / 1000);
|
||||||
|
return result;
|
||||||
|
} else {
|
||||||
|
if (this.n > 60) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.n++;
|
||||||
|
return await this.run();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
async recognize() {
|
||||||
|
const data = await JDJRValidator.jsonp('/slide/g.html', {
|
||||||
|
e: ''
|
||||||
|
});
|
||||||
|
const {
|
||||||
|
bg,
|
||||||
|
patch,
|
||||||
|
y
|
||||||
|
} = data;
|
||||||
|
// const uri = 'data:image/png;base64,';
|
||||||
|
// const re = new PuzzleRecognizer(uri+bg, uri+patch, y);
|
||||||
|
const re = new PuzzleRecognizer(bg, patch, y);
|
||||||
|
const puzzleX = await re.run();
|
||||||
|
if (puzzleX > 0) {
|
||||||
|
this.data = {
|
||||||
|
c: data.challenge,
|
||||||
|
w: re.w,
|
||||||
|
e: '',
|
||||||
|
s: '',
|
||||||
|
o: '',
|
||||||
|
};
|
||||||
|
this.x = puzzleX;
|
||||||
|
}
|
||||||
|
return puzzleX;
|
||||||
|
}
|
||||||
|
async report(n) {
|
||||||
|
console.time('PuzzleRecognizer');
|
||||||
|
let count = 0;
|
||||||
|
for (let i = 0; i < n; i++) {
|
||||||
|
const x = await this.recognize();
|
||||||
|
if (x > 0) count++;
|
||||||
|
if (i % 50 === 0) {
|
||||||
|
console.log('%f\%', (i / n) * 100);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log('successful: %f\%', (count / n) * 100);
|
||||||
|
console.timeEnd('PuzzleRecognizer');
|
||||||
|
}
|
||||||
|
static jsonp(api, data = {}) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
const fnId = `jsonp_${String(Math.random()).replace('.', '')}`;
|
||||||
|
const extraData = {
|
||||||
|
callback: fnId
|
||||||
|
};
|
||||||
|
const query = new URLSearchParams({ ...DATA,
|
||||||
|
...extraData,
|
||||||
|
...data
|
||||||
|
}).toString();
|
||||||
|
const url = `http://${SERVER}${api}?${query}`;
|
||||||
|
const headers = {
|
||||||
|
'Accept': '*/*',
|
||||||
|
'Accept-Encoding': 'gzip,deflate,br',
|
||||||
|
'Accept-Language': 'zh-CN,en-US',
|
||||||
|
'Connection': 'keep-alive',
|
||||||
|
'Host': SERVER,
|
||||||
|
'Proxy-Connection': 'keep-alive',
|
||||||
|
'Referer': 'https://h5.m.jd.com/babelDiy/Zeus/2wuqXrZrhygTQzYA7VufBEpj4amH/index.html',
|
||||||
|
'User-Agent': UA,
|
||||||
|
};
|
||||||
|
const req = http.get(url, {
|
||||||
|
headers
|
||||||
|
}, (response) => {
|
||||||
|
let res = response;
|
||||||
|
if (res.headers['content-encoding'] === 'gzip') {
|
||||||
|
const unzipStream = new stream.PassThrough();
|
||||||
|
stream.pipeline(response, zlib.createGunzip(), unzipStream, reject, );
|
||||||
|
res = unzipStream;
|
||||||
|
}
|
||||||
|
res.setEncoding('utf8');
|
||||||
|
let rawData = '';
|
||||||
|
res.on('data', (chunk) => rawData += chunk);
|
||||||
|
res.on('end', () => {
|
||||||
|
try {
|
||||||
|
const ctx = {
|
||||||
|
[fnId]: (data) => ctx.data = data,
|
||||||
|
data: {},
|
||||||
|
};
|
||||||
|
vm.createContext(ctx);
|
||||||
|
vm.runInContext(rawData, ctx);
|
||||||
|
// console.log(ctx.data);
|
||||||
|
res.resume();
|
||||||
|
resolve(ctx.data);
|
||||||
|
} catch (e) {
|
||||||
|
reject(e);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
req.on('error', reject);
|
||||||
|
req.end();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getCoordinate(c) {
|
||||||
|
function string10to64(d) {
|
||||||
|
var c = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-~".split(""),
|
||||||
|
b = c.length,
|
||||||
|
e = +d,
|
||||||
|
a = [];
|
||||||
|
do {
|
||||||
|
mod = e % b;
|
||||||
|
e = (e - mod) / b;
|
||||||
|
a.unshift(c[mod])
|
||||||
|
} while (e);
|
||||||
|
return a.join("")
|
||||||
|
}
|
||||||
|
|
||||||
|
function prefixInteger(a, b) {
|
||||||
|
return (Array(b).join(0) + a).slice(-b)
|
||||||
|
}
|
||||||
|
|
||||||
|
function pretreatment(d, c, b) {
|
||||||
|
var e = string10to64(Math.abs(d));
|
||||||
|
var a = "";
|
||||||
|
if (!b) {
|
||||||
|
a += (d > 0 ? "1" : "0")
|
||||||
|
}
|
||||||
|
a += prefixInteger(e, c);
|
||||||
|
return a
|
||||||
|
}
|
||||||
|
var b = new Array();
|
||||||
|
for (var e = 0; e < c.length; e++) {
|
||||||
|
if (e == 0) {
|
||||||
|
b.push(pretreatment(c[e][0] < 262143 ? c[e][0] : 262143, 3, true));
|
||||||
|
b.push(pretreatment(c[e][1] < 16777215 ? c[e][1] : 16777215, 4, true));
|
||||||
|
b.push(pretreatment(c[e][2] < 4398046511103 ? c[e][2] : 4398046511103, 7, true))
|
||||||
|
} else {
|
||||||
|
var a = c[e][0] - c[e - 1][0];
|
||||||
|
var f = c[e][1] - c[e - 1][1];
|
||||||
|
var d = c[e][2] - c[e - 1][2];
|
||||||
|
b.push(pretreatment(a < 4095 ? a : 4095, 2, false));
|
||||||
|
b.push(pretreatment(f < 4095 ? f : 4095, 2, false));
|
||||||
|
b.push(pretreatment(d < 16777215 ? d : 16777215, 4, true))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return b.join("")
|
||||||
|
}
|
||||||
|
const HZ = 32;
|
||||||
|
class MousePosFaker {
|
||||||
|
constructor(puzzleX) {
|
||||||
|
this.x = parseInt(Math.random() * 20 + 20, 10);
|
||||||
|
this.y = parseInt(Math.random() * 80 + 80, 10);
|
||||||
|
this.t = Date.now();
|
||||||
|
this.pos = [
|
||||||
|
[this.x, this.y, this.t]
|
||||||
|
];
|
||||||
|
this.minDuration = parseInt(1000 / HZ, 10);
|
||||||
|
// this.puzzleX = puzzleX;
|
||||||
|
this.puzzleX = puzzleX + parseInt(Math.random() * 2 - 1, 10);
|
||||||
|
this.STEP = parseInt(Math.random() * 6 + 5, 10);
|
||||||
|
this.DURATION = parseInt(Math.random() * 7 + 12, 10) * 100;
|
||||||
|
// [9,1600] [10,1400]
|
||||||
|
this.STEP = 9;
|
||||||
|
// this.DURATION = 2000;
|
||||||
|
console.log(this.STEP, this.DURATION);
|
||||||
|
}
|
||||||
|
run() {
|
||||||
|
const perX = this.puzzleX / this.STEP;
|
||||||
|
const perDuration = this.DURATION / this.STEP;
|
||||||
|
const firstPos = [this.x - parseInt(Math.random() * 6, 10), this.y + parseInt(Math.random() * 11, 10), this.t];
|
||||||
|
this.pos.unshift(firstPos);
|
||||||
|
this.stepPos(perX, perDuration);
|
||||||
|
this.fixPos();
|
||||||
|
const reactTime = parseInt(60 + Math.random() * 100, 10);
|
||||||
|
const lastIdx = this.pos.length - 1;
|
||||||
|
const lastPos = [this.pos[lastIdx][0], this.pos[lastIdx][1], this.pos[lastIdx][2] + reactTime];
|
||||||
|
this.pos.push(lastPos);
|
||||||
|
return this.pos;
|
||||||
|
}
|
||||||
|
stepPos(x, duration) {
|
||||||
|
let n = 0;
|
||||||
|
const sqrt2 = Math.sqrt(2);
|
||||||
|
for (let i = 1; i <= this.STEP; i++) {
|
||||||
|
n += 1 / i;
|
||||||
|
}
|
||||||
|
for (let i = 0; i < this.STEP; i++) {
|
||||||
|
x = this.puzzleX / (n * (i + 1));
|
||||||
|
const currX = parseInt((Math.random() * 30 - 15) + x, 10);
|
||||||
|
const currY = parseInt(Math.random() * 7 - 3, 10);
|
||||||
|
const currDuration = parseInt((Math.random() * 0.4 + 0.8) * duration, 10);
|
||||||
|
this.moveToAndCollect({
|
||||||
|
x: currX,
|
||||||
|
y: currY,
|
||||||
|
duration: currDuration,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fixPos() {
|
||||||
|
const actualX = this.pos[this.pos.length - 1][0] - this.pos[1][0];
|
||||||
|
const deviation = this.puzzleX - actualX;
|
||||||
|
if (Math.abs(deviation) > 4) {
|
||||||
|
this.moveToAndCollect({
|
||||||
|
x: deviation,
|
||||||
|
y: parseInt(Math.random() * 8 - 3, 10),
|
||||||
|
duration: 100,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
moveToAndCollect({
|
||||||
|
x,
|
||||||
|
y,
|
||||||
|
duration
|
||||||
|
}) {
|
||||||
|
let movedX = 0;
|
||||||
|
let movedY = 0;
|
||||||
|
let movedT = 0;
|
||||||
|
const times = duration / this.minDuration;
|
||||||
|
let perX = x / times;
|
||||||
|
let perY = y / times;
|
||||||
|
let padDuration = 0;
|
||||||
|
if (Math.abs(perX) < 1) {
|
||||||
|
padDuration = duration / Math.abs(x) - this.minDuration;
|
||||||
|
perX = 1;
|
||||||
|
perY = y / Math.abs(x);
|
||||||
|
}
|
||||||
|
while (Math.abs(movedX) < Math.abs(x)) {
|
||||||
|
const rDuration = parseInt(padDuration + Math.random() * 16 - 4, 10);
|
||||||
|
movedX += perX + Math.random() * 2 - 1;
|
||||||
|
movedY += perY;
|
||||||
|
movedT += this.minDuration + rDuration;
|
||||||
|
const currX = parseInt(this.x + 20, 10);
|
||||||
|
const currY = parseInt(this.y + 20, 10);
|
||||||
|
const currT = this.t + movedT;
|
||||||
|
this.pos.push([currX, currY, currT]);
|
||||||
|
}
|
||||||
|
this.x += x;
|
||||||
|
this.y += y;
|
||||||
|
this.t += Math.max(duration, movedT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exports.JDJRValidator = JDJRValidator
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,6 @@
|
||||||
|
// 本地测试在这边填写cookie
|
||||||
|
let cookie = [
|
||||||
|
];
|
||||||
|
module.exports = {
|
||||||
|
cookie
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
let logs = [
|
||||||
|
'"random":"34038984","log":"1649609592095~18RCD4zkS04d41d8cd98f00b204e9800998ecf8427e~1,1~E97F477EB64B001195F05A4D48067CD6C272595D~0doi8po~C~TRpGXBAPbWUeE0ZbWxoIam8ZFF9AXxAPBxQQQkEXDBoDBwYMAw8KBgcAAw4KAgEMABoeE0VQUhoIE0ZBQkxGV0dTFBQQRldUFAIQRVRBV01TRFMXGhpCVVwXDGMGHQIZBhQBHQAZB2UeE1hfFAIDHRBWRRoIEwVQUFpQAFABAAgEVAZTD1sGBwABUw9RCQMHDw1WCQAFFBQQX0IXDBp+WFxAThhKCQRqAAwQHRBBFAIQAAQBDw4CCAcMBAgLBBAZFFJZEwgXVxoeE1RFVBoIExAZFFZEEwgXcVddVl5QFnFcUhwXGhpcUEQXDBoLAwsGBRoeE0FWRBoIagQDARQBBgdoGhpAXhAPbRpTEx4XVxoeE1MXGhpTEx4XVxoeE1MXGhpTE28ZFFFdUBAPFF5UV1RTUExGEx4XV1IQCxBAFBQQUlsXDBpFAhwHGAwQHRBWUGdEEwgXBggQHRBXUhoIE0BUWFxdXA8GAggBCQsNAhoeE19fFAJpAR4FGghvHRBXWldVEwgXVxoeE19GURoIE1MXSw==~04y5u3i"',
|
||||||
|
|
||||||
|
|
||||||
|
]
|
||||||
|
|
||||||
|
export {
|
||||||
|
logs
|
||||||
|
}
|
|
@ -0,0 +1,204 @@
|
||||||
|
let request = require("request");
|
||||||
|
let CryptoJS = require('crypto-js');
|
||||||
|
let qs = require("querystring");
|
||||||
|
Date.prototype.Format = function(fmt) {
|
||||||
|
var e,
|
||||||
|
n = this,
|
||||||
|
d = fmt,
|
||||||
|
l = {
|
||||||
|
"M+": n.getMonth() + 1,
|
||||||
|
"d+": n.getDate(),
|
||||||
|
"D+": n.getDate(),
|
||||||
|
"h+": n.getHours(),
|
||||||
|
"H+": n.getHours(),
|
||||||
|
"m+": n.getMinutes(),
|
||||||
|
"s+": n.getSeconds(),
|
||||||
|
"w+": n.getDay(),
|
||||||
|
"q+": Math.floor((n.getMonth() + 3) / 3),
|
||||||
|
"S+": n.getMilliseconds()
|
||||||
|
};
|
||||||
|
/(y+)/i.test(d) && (d = d.replace(RegExp.$1, "".concat(n.getFullYear()).substr(4 - RegExp.$1.length)));
|
||||||
|
for (var k in l) {
|
||||||
|
if (new RegExp("(".concat(k, ")")).test(d)) {
|
||||||
|
var t, a = "S+" === k ? "000" : "00";
|
||||||
|
d = d.replace(RegExp.$1, 1 == RegExp.$1.length ? l[k] : ("".concat(a) + l[k]).substr("".concat(l[k]).length))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return d;
|
||||||
|
}
|
||||||
|
|
||||||
|
function generateFp() {
|
||||||
|
let e = "0123456789";
|
||||||
|
let a = 13;
|
||||||
|
let i = '';
|
||||||
|
for (; a--;) i += e[Math.random() * e.length | 0];
|
||||||
|
return (i + Date.now()).slice(0, 16)
|
||||||
|
}
|
||||||
|
|
||||||
|
function getUrlData(url, name) {
|
||||||
|
if (typeof URL !== "undefined") {
|
||||||
|
let urls = new URL(url);
|
||||||
|
let data = urls.searchParams.get(name);
|
||||||
|
return data ? data : '';
|
||||||
|
} else {
|
||||||
|
const query = url.match(/\?.*/)[0].substring(1)
|
||||||
|
const vars = query.split('&')
|
||||||
|
for (let i = 0; i < vars.length; i++) {
|
||||||
|
const pair = vars[i].split('=')
|
||||||
|
if (pair[0] === name) {
|
||||||
|
return vars[i].substr(vars[i].indexOf('=') + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
class jxAlgo {
|
||||||
|
constructor(params = {}) {
|
||||||
|
this.appId = 10001
|
||||||
|
this.result = {}
|
||||||
|
this.timestamp = Date.now();
|
||||||
|
for (let i in params) {
|
||||||
|
this[i] = params[i]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
set(params = {}) {
|
||||||
|
for (let i in params) {
|
||||||
|
this[i] = params[i]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
get(key) {
|
||||||
|
return this[key]
|
||||||
|
}
|
||||||
|
async dec(url) {
|
||||||
|
if (!this.tk) {
|
||||||
|
this.fingerprint = generateFp();
|
||||||
|
await this.requestAlgo()
|
||||||
|
}
|
||||||
|
let obj = qs.parse(url.split("?")[1]);
|
||||||
|
let stk = obj['_stk'];
|
||||||
|
return this.h5st(this.timestamp, stk, url)
|
||||||
|
}
|
||||||
|
h5st(time, stk, url) {
|
||||||
|
stk = stk || (url ? getUrlData(url, '_stk') : '')
|
||||||
|
const timestamp = new Date(time).Format("yyyyMMddhhmmssSSS");
|
||||||
|
let hash1 = this.enCryptMethodJD(this.tk, this.fingerprint.toString(), timestamp.toString(), this.appId.toString(), CryptoJS).toString(CryptoJS.enc.Hex);
|
||||||
|
let st = '';
|
||||||
|
stk.split(',').map((item, index) => {
|
||||||
|
st += `${item}:${getUrlData(url, item)}${index === stk.split(',').length - 1 ? '' : '&'}`;
|
||||||
|
})
|
||||||
|
const hash2 = CryptoJS.HmacSHA256(st, hash1.toString()).toString(CryptoJS.enc.Hex);
|
||||||
|
const enc = (["".concat(timestamp.toString()), "".concat(this.fingerprint.toString()), "".concat(this.appId.toString()), "".concat(this.tk), "".concat(hash2)].join(";"))
|
||||||
|
this.result['fingerprint'] = this.fingerprint;
|
||||||
|
this.result['timestamp'] = this.timestamp
|
||||||
|
this.result['stk'] = stk;
|
||||||
|
this.result['h5st'] = enc
|
||||||
|
let sp = url.split("?");
|
||||||
|
let obj = qs.parse(sp[1])
|
||||||
|
if (obj.callback) {
|
||||||
|
delete obj.callback
|
||||||
|
}
|
||||||
|
let params = Object.assign(obj, {
|
||||||
|
'_time': this.timestamp,
|
||||||
|
'_': this.timestamp,
|
||||||
|
'timestamp': this.timestamp,
|
||||||
|
'sceneval': 2,
|
||||||
|
'g_login_type': 1,
|
||||||
|
'h5st': enc,
|
||||||
|
})
|
||||||
|
this.result['url'] = `${sp[0]}?${qs.stringify(params)}`
|
||||||
|
return this.result
|
||||||
|
}
|
||||||
|
token(user) {
|
||||||
|
let nickname = user.includes('pt_pin') ? user.match(/pt_pin=([^;]+)/)[1] : user;
|
||||||
|
let phoneId = this.createuuid(40, 'lc');
|
||||||
|
|
||||||
|
let token = this.md5(decodeURIComponent(nickname) + this.timestamp + phoneId + 'tPOamqCuk9NLgVPAljUyIHcPRmKlVxDy');
|
||||||
|
return {
|
||||||
|
'strPgtimestamp': this.timestamp,
|
||||||
|
'strPhoneID': phoneId,
|
||||||
|
'strPgUUNum': token
|
||||||
|
}
|
||||||
|
}
|
||||||
|
md5(encryptString) {
|
||||||
|
return CryptoJS.MD5(encryptString).toString()
|
||||||
|
}
|
||||||
|
createuuid(a, c) {
|
||||||
|
switch (c) {
|
||||||
|
case "a":
|
||||||
|
c = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
||||||
|
break;
|
||||||
|
case "n":
|
||||||
|
c = "0123456789";
|
||||||
|
break;
|
||||||
|
case "c":
|
||||||
|
c = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||||
|
break;
|
||||||
|
case "l":
|
||||||
|
c = "abcdefghijklmnopqrstuvwxyz";
|
||||||
|
break;
|
||||||
|
case 'cn':
|
||||||
|
case 'nc':
|
||||||
|
c = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
|
||||||
|
break;
|
||||||
|
case "lc":
|
||||||
|
case "cl":
|
||||||
|
c = "abcdefghijklmnopqrstuvwxyz0123456789";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
c = "0123456789abcdef"
|
||||||
|
}
|
||||||
|
var e = "";
|
||||||
|
for (var g = 0; g < a; g++) e += c[Math.ceil(1E8 * Math.random()) % c.length];
|
||||||
|
return e
|
||||||
|
}
|
||||||
|
async requestAlgo() {
|
||||||
|
const options = {
|
||||||
|
"url": `https://cactus.jd.com/request_algo?g_ty=ajax`,
|
||||||
|
"headers": {
|
||||||
|
'Authority': 'cactus.jd.com',
|
||||||
|
'Pragma': 'no-cache',
|
||||||
|
'Cache-Control': 'no-cache',
|
||||||
|
'Accept': 'application/json',
|
||||||
|
'User-Agent': 'jdpingou;iPhone;4.9.4;12.4;ae49fae72d0a8976f5155267f56ec3a5b0da75c3;network/wifi;model/iPhone8,4;appBuild/100579;ADID/00000000-0000-0000-0000-000000000000;supportApplePay/1;hasUPPay/0;pushNoticeIsOpen/0;hasOCPay/0;supportBestPay/0;session/1;pap/JA2019_3111789;brand/apple;supportJDSHWK/1;Mozilla/5.0 (iPhone; CPU iPhone OS 14_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Origin': 'https://st.jingxi.com',
|
||||||
|
'Sec-Fetch-Site': 'cross-site',
|
||||||
|
'Sec-Fetch-Mode': 'cors',
|
||||||
|
'Sec-Fetch-Dest': 'empty',
|
||||||
|
'Referer': 'https://st.jingxi.com/pingou/dream_factory/index.html?ptag=7155.9.4',
|
||||||
|
'Accept-Language': 'zh-CN,zh;q=0.9,zh-TW;q=0.8,en;q=0.7'
|
||||||
|
},
|
||||||
|
'body': JSON.stringify({
|
||||||
|
"version": "1.0",
|
||||||
|
"fp": this.fingerprint,
|
||||||
|
"appId": this.appId.toString(),
|
||||||
|
"timestamp": this.timestamp,
|
||||||
|
"platform": "web",
|
||||||
|
"expandParams": ""
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return new Promise(async resolve => {
|
||||||
|
request.post(options, (err, resp, data) => {
|
||||||
|
try {
|
||||||
|
if (data) {
|
||||||
|
data = JSON.parse(data);
|
||||||
|
if (data['status'] === 200) {
|
||||||
|
let result = data.data.result
|
||||||
|
this.tk = result.tk;
|
||||||
|
let enCryptMethodJDString = result.algo;
|
||||||
|
if (enCryptMethodJDString) {
|
||||||
|
this.enCryptMethodJD = new Function(`return ${enCryptMethodJDString}`)();
|
||||||
|
}
|
||||||
|
this.result = result
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e)
|
||||||
|
} finally {
|
||||||
|
resolve(this.result);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
module.exports = jxAlgo
|
|
@ -0,0 +1,204 @@
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
const got = require('got');
|
||||||
|
require('dotenv').config();
|
||||||
|
const { readFile } = require('fs/promises');
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
const qlDir = '/ql';
|
||||||
|
const fs = require('fs');
|
||||||
|
let Fileexists = fs.existsSync('/ql/data/config/auth.json');
|
||||||
|
let authFile="";
|
||||||
|
if (Fileexists)
|
||||||
|
authFile="/ql/data/config/auth.json"
|
||||||
|
else
|
||||||
|
authFile="/ql/config/auth.json"
|
||||||
|
//const authFile = path.join(qlDir, 'config/auth.json');
|
||||||
|
|
||||||
|
const api = got.extend({
|
||||||
|
prefixUrl: 'http://127.0.0.1:5600',
|
||||||
|
retry: { limit: 0 },
|
||||||
|
});
|
||||||
|
|
||||||
|
async function getToken() {
|
||||||
|
const authConfig = JSON.parse(await readFile(authFile));
|
||||||
|
return authConfig.token;
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports.getEnvs = async () => {
|
||||||
|
const token = await getToken();
|
||||||
|
const body = await api({
|
||||||
|
url: 'api/envs',
|
||||||
|
searchParams: {
|
||||||
|
searchValue: 'JD_COOKIE',
|
||||||
|
t: Date.now(),
|
||||||
|
},
|
||||||
|
headers: {
|
||||||
|
Accept: 'application/json',
|
||||||
|
authorization: `Bearer ${token}`,
|
||||||
|
},
|
||||||
|
}).json();
|
||||||
|
return body.data;
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports.getEnvsCount = async () => {
|
||||||
|
const data = await this.getEnvs();
|
||||||
|
return data.length;
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports.addEnv = async (cookie, remarks) => {
|
||||||
|
const token = await getToken();
|
||||||
|
const body = await api({
|
||||||
|
method: 'post',
|
||||||
|
url: 'api/envs',
|
||||||
|
params: { t: Date.now() },
|
||||||
|
json: [{
|
||||||
|
name: 'JD_COOKIE',
|
||||||
|
value: cookie,
|
||||||
|
remarks,
|
||||||
|
}],
|
||||||
|
headers: {
|
||||||
|
Accept: 'application/json',
|
||||||
|
authorization: `Bearer ${token}`,
|
||||||
|
'Content-Type': 'application/json;charset=UTF-8',
|
||||||
|
},
|
||||||
|
}).json();
|
||||||
|
return body;
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports.updateEnv = async (cookie, eid, remarks) => {
|
||||||
|
const token = await getToken();
|
||||||
|
const body = await api({
|
||||||
|
method: 'put',
|
||||||
|
url: 'api/envs',
|
||||||
|
params: { t: Date.now() },
|
||||||
|
json: {
|
||||||
|
name: 'JD_COOKIE',
|
||||||
|
value: cookie,
|
||||||
|
_id: eid,
|
||||||
|
remarks,
|
||||||
|
},
|
||||||
|
headers: {
|
||||||
|
Accept: 'application/json',
|
||||||
|
authorization: `Bearer ${token}`,
|
||||||
|
'Content-Type': 'application/json;charset=UTF-8',
|
||||||
|
},
|
||||||
|
}).json();
|
||||||
|
return body;
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports.updateEnv11 = async (cookie, eid, remarks) => {
|
||||||
|
const token = await getToken();
|
||||||
|
const body = await api({
|
||||||
|
method: 'put',
|
||||||
|
url: 'api/envs',
|
||||||
|
params: { t: Date.now() },
|
||||||
|
json: {
|
||||||
|
name: 'JD_COOKIE',
|
||||||
|
value: cookie,
|
||||||
|
id: eid,
|
||||||
|
remarks,
|
||||||
|
},
|
||||||
|
headers: {
|
||||||
|
Accept: 'application/json',
|
||||||
|
authorization: `Bearer ${token}`,
|
||||||
|
'Content-Type': 'application/json;charset=UTF-8',
|
||||||
|
},
|
||||||
|
}).json();
|
||||||
|
return body;
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports.DisableCk = async (eid) => {
|
||||||
|
const token = await getToken();
|
||||||
|
const body = await api({
|
||||||
|
method: 'put',
|
||||||
|
url: 'api/envs/disable',
|
||||||
|
params: { t: Date.now() },
|
||||||
|
body: JSON.stringify([eid]),
|
||||||
|
headers: {
|
||||||
|
Accept: 'application/json',
|
||||||
|
authorization: `Bearer ${token}`,
|
||||||
|
'Content-Type': 'application/json;charset=UTF-8',
|
||||||
|
},
|
||||||
|
}).json();
|
||||||
|
return body;
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports.EnableCk = async (eid) => {
|
||||||
|
const token = await getToken();
|
||||||
|
const body = await api({
|
||||||
|
method: 'put',
|
||||||
|
url: 'api/envs/enable',
|
||||||
|
params: { t: Date.now() },
|
||||||
|
body: JSON.stringify([eid]),
|
||||||
|
headers: {
|
||||||
|
Accept: 'application/json',
|
||||||
|
authorization: `Bearer ${token}`,
|
||||||
|
'Content-Type': 'application/json;charset=UTF-8',
|
||||||
|
},
|
||||||
|
}).json();
|
||||||
|
return body;
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports.getstatus = async(eid) => {
|
||||||
|
const envs = await this.getEnvs();
|
||||||
|
var tempid = 0;
|
||||||
|
for (let i = 0; i < envs.length; i++) {
|
||||||
|
tempid = 0;
|
||||||
|
if (envs[i]._id) {
|
||||||
|
tempid = envs[i]._id;
|
||||||
|
}
|
||||||
|
if (envs[i].id) {
|
||||||
|
tempid = envs[i].id;
|
||||||
|
}
|
||||||
|
if (tempid == eid) {
|
||||||
|
return envs[i].status;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 99;
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports.getEnvById = async(eid) => {
|
||||||
|
const envs = await this.getEnvs();
|
||||||
|
var tempid = 0;
|
||||||
|
for (let i = 0; i < envs.length; i++) {
|
||||||
|
tempid = 0;
|
||||||
|
if (envs[i]._id) {
|
||||||
|
tempid = envs[i]._id;
|
||||||
|
}
|
||||||
|
if (envs[i].id) {
|
||||||
|
tempid = envs[i].id;
|
||||||
|
}
|
||||||
|
if (tempid == eid) {
|
||||||
|
return envs[i].value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports.getEnvByPtPin = async (Ptpin) => {
|
||||||
|
const envs = await this.getEnvs();
|
||||||
|
for (let i = 0; i < envs.length; i++) {
|
||||||
|
var tempptpin = decodeURIComponent(envs[i].value.match(/pt_pin=([^; ]+)(?=;?)/) && envs[i].value.match(/pt_pin=([^; ]+)(?=;?)/)[1]);
|
||||||
|
if(tempptpin==Ptpin){
|
||||||
|
return envs[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports.delEnv = async (eid) => {
|
||||||
|
const token = await getToken();
|
||||||
|
const body = await api({
|
||||||
|
method: 'delete',
|
||||||
|
url: 'api/envs',
|
||||||
|
params: { t: Date.now() },
|
||||||
|
body: JSON.stringify([eid]),
|
||||||
|
headers: {
|
||||||
|
Accept: 'application/json',
|
||||||
|
authorization: `Bearer ${token}`,
|
||||||
|
'Content-Type': 'application/json;charset=UTF-8',
|
||||||
|
},
|
||||||
|
}).json();
|
||||||
|
return body;
|
||||||
|
};
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,40 @@
|
||||||
|
//'use strict';
|
||||||
|
exports.main_handler = async (event, context, callback) => {
|
||||||
|
try {
|
||||||
|
const { TENCENTSCF_SOURCE_TYPE, TENCENTSCF_SOURCE_URL } = process.env
|
||||||
|
//如果想在一个定时触发器里面执行多个js文件需要在定时触发器的【附加信息】里面填写对应的名称,用 & 链接
|
||||||
|
//例如我想一个定时触发器里执行jd_speed.js和jd_bean_change.js,在定时触发器的【附加信息】里面就填写 jd_speed&jd_bean_change
|
||||||
|
for (const v of event["Message"].split("&")) {
|
||||||
|
console.log(v);
|
||||||
|
var request = require('request');
|
||||||
|
switch (TENCENTSCF_SOURCE_TYPE) {
|
||||||
|
case 'local':
|
||||||
|
//1.执行自己上传的js文件
|
||||||
|
delete require.cache[require.resolve('./'+v+'.js')];
|
||||||
|
require('./'+v+'.js')
|
||||||
|
break;
|
||||||
|
case 'git':
|
||||||
|
//2.执行github远端的js文件(因github的raw类型的文件被墙,此方法云函数不推荐)
|
||||||
|
request(`https://raw.githubusercontent.com/xxx/jd_scripts/master/${v}.js`, function (error, response, body) {
|
||||||
|
eval(response.body)
|
||||||
|
})
|
||||||
|
break;
|
||||||
|
case 'custom':
|
||||||
|
//3.执行自定义远端js文件网址
|
||||||
|
if (!TENCENTSCF_SOURCE_URL) return console.log('自定义模式需要设置TENCENTSCF_SOURCE_URL变量')
|
||||||
|
request(`${TENCENTSCF_SOURCE_URL}${v}.js`, function (error, response, body) {
|
||||||
|
eval(response.body)
|
||||||
|
})
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
//4.执行国内gitee远端的js文件(如果部署在国内节点,选择1或3。默认使用gitee的方式)
|
||||||
|
request(`${v}.js`, function (error, response, body) {
|
||||||
|
eval(response.body)
|
||||||
|
})
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e)
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,101 @@
|
||||||
|
/*
|
||||||
|
================================================================================
|
||||||
|
魔改自 https://github.com/shufflewzc/faker2/blob/main/jdCookie.js
|
||||||
|
修改内容:与task_before.sh配合,由task_before.sh设置要设置要做互助的活动的 ShareCodeConfigName 和 ShareCodeEnvName 环境变量,
|
||||||
|
然后在这里实际解析/ql/log/.ShareCode中该活动对应的配置信息(由code.sh生成和维护),注入到nodejs的环境变量中
|
||||||
|
修改原因:原先的task_before.sh直接将互助信息注入到shell的env中,在ck超过45以上时,互助码环境变量过大会导致调用一些系统命令
|
||||||
|
(如date/cat)时报 Argument list too long,而在node中修改环境变量不会受这个限制,也不会影响外部shell环境,确保脚本可以正常运行
|
||||||
|
魔改作者:风之凌殇
|
||||||
|
================================================================================
|
||||||
|
|
||||||
|
此文件为Node.js专用。其他用户请忽略
|
||||||
|
*/
|
||||||
|
//此处填写京东账号cookie。
|
||||||
|
let CookieJDs = [
|
||||||
|
]
|
||||||
|
// 判断环境变量里面是否有京东ck
|
||||||
|
if (process.env.JD_COOKIE) {
|
||||||
|
if (process.env.JD_COOKIE.indexOf('&') > -1) {
|
||||||
|
CookieJDs = process.env.JD_COOKIE.split('&');
|
||||||
|
} else if (process.env.JD_COOKIE.indexOf('\n') > -1) {
|
||||||
|
CookieJDs = process.env.JD_COOKIE.split('\n');
|
||||||
|
} else {
|
||||||
|
CookieJDs = [process.env.JD_COOKIE];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (JSON.stringify(process.env).indexOf('GITHUB')>-1) {
|
||||||
|
console.log(`请勿使用github action运行此脚本,无论你是从你自己的私库还是其他哪里拉取的源代码,都会导致我被封号\n`);
|
||||||
|
!(async () => {
|
||||||
|
await require('./sendNotify').sendNotify('提醒', `请勿使用github action、滥用github资源会封我仓库以及账号`)
|
||||||
|
await process.exit(0);
|
||||||
|
})()
|
||||||
|
}
|
||||||
|
CookieJDs = [...new Set(CookieJDs.filter(item => !!item))]
|
||||||
|
console.log(`\n====================共${CookieJDs.length}个京东账号Cookie=========\n`);
|
||||||
|
console.log(`==================脚本执行- 北京时间(UTC+8):${new Date(new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000).toLocaleString('zh', {hour12: false}).replace(' 24:',' 00:')}=====================\n`)
|
||||||
|
if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {};
|
||||||
|
for (let i = 0; i < CookieJDs.length; i++) {
|
||||||
|
if (!CookieJDs[i].match(/pt_pin=(.+?);/) || !CookieJDs[i].match(/pt_key=(.+?);/)) console.log(`\n提示:京东cookie 【${CookieJDs[i]}】填写不规范,可能会影响部分脚本正常使用。正确格式为: pt_key=xxx;pt_pin=xxx;(分号;不可少)\n`);
|
||||||
|
const index = (i + 1 === 1) ? '' : (i + 1);
|
||||||
|
exports['CookieJD' + index] = CookieJDs[i].trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 以下为注入互助码环境变量(仅nodejs内起效)的代码
|
||||||
|
function SetShareCodesEnv(nameConfig = "", envName = "") {
|
||||||
|
let rawCodeConfig = {}
|
||||||
|
|
||||||
|
// 读取互助码
|
||||||
|
shareCodeLogPath = `${process.env.QL_DIR}/log/.ShareCode/${nameConfig}.log`
|
||||||
|
let fs = require('fs')
|
||||||
|
if (fs.existsSync(shareCodeLogPath)) {
|
||||||
|
// 因为faker2目前没有自带ini,改用已有的dotenv来解析
|
||||||
|
// // 利用ini模块读取原始互助码和互助组信息
|
||||||
|
// let ini = require('ini')
|
||||||
|
// rawCodeConfig = ini.parse(fs.readFileSync(shareCodeLogPath, 'utf-8'))
|
||||||
|
|
||||||
|
// 使用env模块
|
||||||
|
require('dotenv').config({path: shareCodeLogPath})
|
||||||
|
rawCodeConfig = process.env
|
||||||
|
}
|
||||||
|
|
||||||
|
// 解析每个用户的互助码
|
||||||
|
codes = {}
|
||||||
|
Object.keys(rawCodeConfig).forEach(function (key) {
|
||||||
|
if (key.startsWith(`My${nameConfig}`)) {
|
||||||
|
codes[key] = rawCodeConfig[key]
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// 解析每个用户要帮助的互助码组,将用户实际的互助码填充进去
|
||||||
|
let helpOtherCodes = {}
|
||||||
|
Object.keys(rawCodeConfig).forEach(function (key) {
|
||||||
|
if (key.startsWith(`ForOther${nameConfig}`)) {
|
||||||
|
helpCode = rawCodeConfig[key]
|
||||||
|
for (const [codeEnv, codeVal] of Object.entries(codes)) {
|
||||||
|
helpCode = helpCode.replace("${" + codeEnv + "}", codeVal)
|
||||||
|
}
|
||||||
|
|
||||||
|
helpOtherCodes[key] = helpCode
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// 按顺序用&拼凑到一起,并放入环境变量,供目标脚本使用
|
||||||
|
let shareCodes = []
|
||||||
|
let totalCodeCount = Object.keys(helpOtherCodes).length
|
||||||
|
for (let idx = 1; idx <= totalCodeCount; idx++) {
|
||||||
|
shareCodes.push(helpOtherCodes[`ForOther${nameConfig}${idx}`])
|
||||||
|
}
|
||||||
|
let shareCodesStr = shareCodes.join('&')
|
||||||
|
process.env[envName] = shareCodesStr
|
||||||
|
|
||||||
|
console.info(`【风之凌殇】 友情提示:为避免ck超过45以上时,互助码环境变量过大而导致调用一些系统命令(如date/cat)时报 Argument list too long,改为在nodejs中设置 ${nameConfig} 的 互助码环境变量 ${envName},共计 ${totalCodeCount} 组互助码,总大小为 ${shareCodesStr.length}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 若在task_before.sh 中设置了要设置互助码环境变量的活动名称和环境变量名称信息,则在nodejs中处理,供活动使用
|
||||||
|
let nameConfig = process.env.ShareCodeConfigName
|
||||||
|
let envName = process.env.ShareCodeEnvName
|
||||||
|
if (nameConfig && envName) {
|
||||||
|
SetShareCodesEnv(nameConfig, envName)
|
||||||
|
} else {
|
||||||
|
console.debug(`OKYYDS 友情提示:您的脚本正常运行中`)
|
||||||
|
}
|
|
@ -0,0 +1,37 @@
|
||||||
|
/*
|
||||||
|
京喜工厂互助码
|
||||||
|
此文件为Node.js专用。其他用户请忽略
|
||||||
|
支持京东N个账号
|
||||||
|
*/
|
||||||
|
//云服务器腾讯云函数等NOde.js用户在此处填写东东萌宠的好友码。
|
||||||
|
// 同一个京东账号的好友互助码用@符号隔开,不同京东账号之间用&符号或者换行隔开,下面给一个示例
|
||||||
|
// 如: 京东账号1的shareCode1@京东账号1的shareCode2&京东账号2的shareCode1@京东账号2的shareCode2
|
||||||
|
let shareCodes = [
|
||||||
|
'V5LkjP4WRyjeCKR9VRwcRX0bBuTz7MEK0-E99EJ7u0k=@Bo-jnVs_m9uBvbRzraXcSA==@-OvElMzqeyeGBWazWYjI1Q==',//账号一的好友shareCode,不同好友中间用@符号隔开
|
||||||
|
'-OvElMzqeyeGBWazWYjI1Q==',//账号二的好友shareCode,不同好友中间用@符号隔开
|
||||||
|
]
|
||||||
|
|
||||||
|
// 从日志获取互助码
|
||||||
|
// const logShareCodes = require('./utils/jdShareCodes');
|
||||||
|
// if (logShareCodes.DREAM_FACTORY_SHARE_CODES.length > 0 && !process.env.DREAM_FACTORY_SHARE_CODES) {
|
||||||
|
// process.env.DREAM_FACTORY_SHARE_CODES = logShareCodes.DREAM_FACTORY_SHARE_CODES.join('&');
|
||||||
|
// }
|
||||||
|
|
||||||
|
// 判断环境变量里面是否有京喜工厂互助码
|
||||||
|
if (process.env.DREAM_FACTORY_SHARE_CODES) {
|
||||||
|
if (process.env.DREAM_FACTORY_SHARE_CODES.indexOf('&') > -1) {
|
||||||
|
console.log(`您的互助码选择的是用&隔开\n`)
|
||||||
|
shareCodes = process.env.DREAM_FACTORY_SHARE_CODES.split('&');
|
||||||
|
} else if (process.env.DREAM_FACTORY_SHARE_CODES.indexOf('\n') > -1) {
|
||||||
|
console.log(`您的互助码选择的是用换行隔开\n`)
|
||||||
|
shareCodes = process.env.DREAM_FACTORY_SHARE_CODES.split('\n');
|
||||||
|
} else {
|
||||||
|
shareCodes = process.env.DREAM_FACTORY_SHARE_CODES.split();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log(`由于您环境变量(DREAM_FACTORY_SHARE_CODES)里面未提供助力码,故此处运行将会给脚本内置的码进行助力,请知晓!`)
|
||||||
|
}
|
||||||
|
for (let i = 0; i < shareCodes.length; i++) {
|
||||||
|
const index = (i + 1 === 1) ? '' : (i + 1);
|
||||||
|
exports['shareCodes' + index] = shareCodes[i];
|
||||||
|
}
|
|
@ -0,0 +1,67 @@
|
||||||
|
import os
|
||||||
|
import random
|
||||||
|
import re
|
||||||
|
|
||||||
|
|
||||||
|
def env(key):
|
||||||
|
return os.environ.get(key)
|
||||||
|
|
||||||
|
|
||||||
|
# 宠汪汪
|
||||||
|
JD_JOY_REWARD_NAME = 500 # 默认500
|
||||||
|
if env("JD_JOY_REWARD_NAME"):
|
||||||
|
JD_JOY_REWARD_NAME = int(env("JD_JOY_REWARD_NAME"))
|
||||||
|
|
||||||
|
# Cookie
|
||||||
|
cookies = []
|
||||||
|
if env("JD_COOKIE"):
|
||||||
|
cookies.extend(env("JD_COOKIE").split('&'))
|
||||||
|
|
||||||
|
# UA
|
||||||
|
USER_AGENTS = [
|
||||||
|
"jdapp;android;10.0.2;10;network/wifi;Mozilla/5.0 (Linux; Android 10; ONEPLUS A5010 Build/QKQ1.191014.012; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045230 Mobile Safari/537.36",
|
||||||
|
"jdapp;iPhone;10.0.2;14.3;network/4g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;android;10.0.2;9;network/4g;Mozilla/5.0 (Linux; Android 9; Mi Note 3 Build/PKQ1.181007.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/045131 Mobile Safari/537.36",
|
||||||
|
"jdapp;android;10.0.2;10;network/wifi;Mozilla/5.0 (Linux; Android 10; GM1910 Build/QKQ1.190716.003; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045230 Mobile Safari/537.36",
|
||||||
|
"jdapp;android;10.0.2;9;network/wifi;Mozilla/5.0 (Linux; Android 9; 16T Build/PKQ1.190616.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/044942 Mobile Safari/537.36",
|
||||||
|
"jdapp;iPhone;10.0.2;13.6;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 13_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;iPhone;10.0.2;13.6;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 13_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;iPhone;10.0.2;13.5;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 13_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;iPhone;10.0.2;14.1;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 14_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;iPhone;10.0.2;13.3;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 13_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;iPhone;10.0.2;13.7;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 13_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;iPhone;10.0.2;14.1;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 14_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;iPhone;10.0.2;13.3;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 13_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;iPhone;10.0.2;13.4;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 13_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;iPhone;10.0.2;14.3;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;android;10.0.2;9;network/wifi;Mozilla/5.0 (Linux; Android 9; MI 6 Build/PKQ1.190118.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/044942 Mobile Safari/537.36",
|
||||||
|
"jdapp;android;10.0.2;11;network/wifi;Mozilla/5.0 (Linux; Android 11; Redmi K30 5G Build/RKQ1.200826.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045511 Mobile Safari/537.36",
|
||||||
|
"jdapp;iPhone;10.0.2;11.4;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 11_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15F79",
|
||||||
|
"jdapp;android;10.0.2;10;;network/wifi;Mozilla/5.0 (Linux; Android 10; M2006J10C Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045230 Mobile Safari/537.36",
|
||||||
|
"jdapp;android;10.0.2;10;network/wifi;Mozilla/5.0 (Linux; Android 10; M2006J10C Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045230 Mobile Safari/537.36",
|
||||||
|
"jdapp;android;10.0.2;10;network/wifi;Mozilla/5.0 (Linux; Android 10; ONEPLUS A6000 Build/QKQ1.190716.003; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045224 Mobile Safari/537.36",
|
||||||
|
"jdapp;android;10.0.2;9;network/wifi;Mozilla/5.0 (Linux; Android 9; MHA-AL00 Build/HUAWEIMHA-AL00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/044942 Mobile Safari/537.36",
|
||||||
|
"jdapp;android;10.0.2;8.1.0;network/wifi;Mozilla/5.0 (Linux; Android 8.1.0; 16 X Build/OPM1.171019.026; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/044942 Mobile Safari/537.36",
|
||||||
|
"jdapp;android;10.0.2;8.0.0;network/wifi;Mozilla/5.0 (Linux; Android 8.0.0; HTC U-3w Build/OPR6.170623.013; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/044942 Mobile Safari/537.36",
|
||||||
|
"jdapp;iPhone;10.0.2;14.0.1;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 14_0_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;android;10.0.2;10;network/wifi;Mozilla/5.0 (Linux; Android 10; LYA-AL00 Build/HUAWEILYA-AL00L; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045230 Mobile Safari/537.36",
|
||||||
|
"jdapp;iPhone;10.0.2;14.2;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;iPhone;10.0.2;14.3;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;iPhone;10.0.2;14.2;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;android;10.0.2;8.1.0;network/wifi;Mozilla/5.0 (Linux; Android 8.1.0; MI 8 Build/OPM1.171019.026; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/045131 Mobile Safari/537.36",
|
||||||
|
"jdapp;android;10.0.2;10;network/wifi;Mozilla/5.0 (Linux; Android 10; Redmi K20 Pro Premium Edition Build/QKQ1.190825.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045227 Mobile Safari/537.36",
|
||||||
|
"jdapp;iPhone;10.0.2;14.3;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;iPhone;10.0.2;14.3;network/4g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
"jdapp;android;10.0.2;11;network/wifi;Mozilla/5.0 (Linux; Android 11; Redmi K20 Pro Premium Edition Build/RKQ1.200826.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045513 Mobile Safari/537.36",
|
||||||
|
"jdapp;android;10.0.2;10;network/wifi;Mozilla/5.0 (Linux; Android 10; MI 8 Build/QKQ1.190828.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045227 Mobile Safari/537.36",
|
||||||
|
"jdapp;iPhone;10.0.2;14.1;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 14_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
]
|
||||||
|
USER_AGENTS = USER_AGENTS[random.randint(0, len(USER_AGENTS) - 1)]
|
||||||
|
|
||||||
|
|
||||||
|
def root():
|
||||||
|
if 'Options:' in os.popen('sudo -h').read() or re.match(r'[C-Z]:.*', os.getcwd()):
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
print('珍爱ck,远离docker')
|
||||||
|
return False
|
|
@ -0,0 +1,37 @@
|
||||||
|
/*
|
||||||
|
东东工厂互助码
|
||||||
|
此文件为Node.js专用。其他用户请忽略
|
||||||
|
支持京东N个账号
|
||||||
|
*/
|
||||||
|
//云服务器腾讯云函数等NOde.js用户在此处填写东东萌宠的好友码。
|
||||||
|
// 同一个京东账号的好友互助码用@符号隔开,不同京东账号之间用&符号或者换行隔开,下面给一个示例
|
||||||
|
// 如: 京东账号1的shareCode1@京东账号1的shareCode2&京东账号2的shareCode1@京东账号2的shareCode2
|
||||||
|
let shareCodes = [
|
||||||
|
'',//账号一的好友shareCode,不同好友中间用@符号隔开
|
||||||
|
'',//账号二的好友shareCode,不同好友中间用@符号隔开
|
||||||
|
]
|
||||||
|
|
||||||
|
// 从日志获取互助码
|
||||||
|
// const logShareCodes = require('./utils/jdShareCodes');
|
||||||
|
// if (logShareCodes.DDFACTORY_SHARECODES.length > 0 && !process.env.DDFACTORY_SHARECODES) {
|
||||||
|
// process.env.DDFACTORY_SHARECODES = logShareCodes.DDFACTORY_SHARECODES.join('&');
|
||||||
|
// }
|
||||||
|
|
||||||
|
// 判断环境变量里面是否有东东工厂互助码
|
||||||
|
if (process.env.DDFACTORY_SHARECODES) {
|
||||||
|
if (process.env.DDFACTORY_SHARECODES.indexOf('&') > -1) {
|
||||||
|
console.log(`您的互助码选择的是用&隔开\n`)
|
||||||
|
shareCodes = process.env.DDFACTORY_SHARECODES.split('&');
|
||||||
|
} else if (process.env.DDFACTORY_SHARECODES.indexOf('\n') > -1) {
|
||||||
|
console.log(`您的互助码选择的是用换行隔开\n`)
|
||||||
|
shareCodes = process.env.DDFACTORY_SHARECODES.split('\n');
|
||||||
|
} else {
|
||||||
|
shareCodes = process.env.DDFACTORY_SHARECODES.split();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log(`由于您环境变量(DDFACTORY_SHARECODES)里面未提供助力码,故此处运行将会给脚本内置的码进行助力,请知晓!`)
|
||||||
|
}
|
||||||
|
for (let i = 0; i < shareCodes.length; i++) {
|
||||||
|
const index = (i + 1 === 1) ? '' : (i + 1);
|
||||||
|
exports['shareCodes' + index] = shareCodes[i];
|
||||||
|
}
|
|
@ -0,0 +1,37 @@
|
||||||
|
/*
|
||||||
|
东东农场互助码
|
||||||
|
此文件为Node.js专用。其他用户请忽略
|
||||||
|
支持京东N个账号
|
||||||
|
*/
|
||||||
|
//云服务器腾讯云函数等NOde.js用户在此处填写京东东农场的好友码。
|
||||||
|
// 同一个京东账号的好友互助码用@符号隔开,不同京东账号之间用&符号或者换行隔开,下面给一个示例
|
||||||
|
// 如: 京东账号1的shareCode1@京东账号1的shareCode2&京东账号2的shareCode1@京东账号2的shareCode2
|
||||||
|
let FruitShareCodes = [
|
||||||
|
'',//账号一的好友shareCode,不同好友中间用@符号隔开
|
||||||
|
'',//账号二的好友shareCode,不同好友中间用@符号隔开
|
||||||
|
]
|
||||||
|
|
||||||
|
// 从日志获取互助码
|
||||||
|
// const logShareCodes = require('./utils/jdShareCodes');
|
||||||
|
// if (logShareCodes.FRUITSHARECODES.length > 0 && !process.env.FRUITSHARECODES) {
|
||||||
|
// process.env.FRUITSHARECODES = logShareCodes.FRUITSHARECODES.join('&');
|
||||||
|
// }
|
||||||
|
|
||||||
|
// 判断github action里面是否有东东农场互助码
|
||||||
|
if (process.env.FRUITSHARECODES) {
|
||||||
|
if (process.env.FRUITSHARECODES.indexOf('&') > -1) {
|
||||||
|
console.log(`您的东东农场互助码选择的是用&隔开\n`)
|
||||||
|
FruitShareCodes = process.env.FRUITSHARECODES.split('&');
|
||||||
|
} else if (process.env.FRUITSHARECODES.indexOf('\n') > -1) {
|
||||||
|
console.log(`您的东东农场互助码选择的是用换行隔开\n`)
|
||||||
|
FruitShareCodes = process.env.FRUITSHARECODES.split('\n');
|
||||||
|
} else {
|
||||||
|
FruitShareCodes = process.env.FRUITSHARECODES.split();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log(`由于您环境变量(FRUITSHARECODES)里面未提供助力码,故此处运行将会给脚本内置的码进行助力,请知晓!`)
|
||||||
|
}
|
||||||
|
for (let i = 0; i < FruitShareCodes.length; i++) {
|
||||||
|
const index = (i + 1 === 1) ? '' : (i + 1);
|
||||||
|
exports['FruitShareCode' + index] = FruitShareCodes[i];
|
||||||
|
}
|
|
@ -0,0 +1,37 @@
|
||||||
|
/*
|
||||||
|
京喜农场助力码
|
||||||
|
此助力码要求种子 active 相同才能助力,多个账号的话可以种植同样的种子,如果种子不同的话,会自动跳过使用云端助力
|
||||||
|
此文件为Node.js专用。其他用户请忽略
|
||||||
|
支持京东N个账号
|
||||||
|
*/
|
||||||
|
//云服务器腾讯云函数等NOde.js用户在此处填写京京喜农场的好友码。
|
||||||
|
// 同一个京东账号的好友助力码用@符号隔开,不同京东账号之间用&符号或者换行隔开,下面给一个示例
|
||||||
|
// 如: 京东账号1的shareCode1@京东账号1的shareCode2&京东账号2的shareCode1@京东账号2的shareCode2
|
||||||
|
// 注意:京喜农场 种植种子发生变化的时候,互助码也会变!!
|
||||||
|
// 注意:京喜农场 种植种子发生变化的时候,互助码也会变!!
|
||||||
|
// 注意:京喜农场 种植种子发生变化的时候,互助码也会变!!
|
||||||
|
// 每个账号 shareCdoe 是一个 json,示例如下
|
||||||
|
// {"smp":"22bdadsfaadsfadse8a","active":"jdnc_1_btorange210113_2","joinnum":"1"}
|
||||||
|
let JxncShareCodes = [
|
||||||
|
'',//账号一的好友shareCode,不同好友中间用@符号隔开
|
||||||
|
'',//账号二的好友shareCode,不同好友中间用@符号隔开
|
||||||
|
]
|
||||||
|
// 判断github action里面是否有京喜农场助力码
|
||||||
|
if (process.env.JXNC_SHARECODES) {
|
||||||
|
if (process.env.JXNC_SHARECODES.indexOf('&') > -1) {
|
||||||
|
console.log(`您的京喜农场助力码选择的是用&隔开\n`)
|
||||||
|
JxncShareCodes = process.env.JXNC_SHARECODES.split('&');
|
||||||
|
} else if (process.env.JXNC_SHARECODES.indexOf('\n') > -1) {
|
||||||
|
console.log(`您的京喜农场助力码选择的是用换行隔开\n`)
|
||||||
|
JxncShareCodes = process.env.JXNC_SHARECODES.split('\n');
|
||||||
|
} else {
|
||||||
|
JxncShareCodes = process.env.JXNC_SHARECODES.split();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log(`由于您环境变量里面(JXNC_SHARECODES)未提供助力码,故此处运行将会给脚本内置的码进行助力,请知晓!`)
|
||||||
|
}
|
||||||
|
JxncShareCodes = JxncShareCodes.filter(item => !!item);
|
||||||
|
for (let i = 0; i < JxncShareCodes.length; i++) {
|
||||||
|
const index = (i + 1 === 1) ? '' : (i + 1);
|
||||||
|
exports['JxncShareCode' + index] = JxncShareCodes[i];
|
||||||
|
}
|
|
@ -0,0 +1,37 @@
|
||||||
|
/*
|
||||||
|
东东萌宠互助码
|
||||||
|
此文件为Node.js专用。其他用户请忽略
|
||||||
|
支持京东N个账号
|
||||||
|
*/
|
||||||
|
//云服务器腾讯云函数等NOde.js用户在此处填写东东萌宠的好友码。
|
||||||
|
// 同一个京东账号的好友互助码用@符号隔开,不同京东账号之间用&符号或者换行隔开,下面给一个示例
|
||||||
|
// 如: 京东账号1的shareCode1@京东账号1的shareCode2&京东账号2的shareCode1@京东账号2的shareCode2
|
||||||
|
let PetShareCodes = [
|
||||||
|
'MTAxODc2NTEzNTAwMDAwMDAwMjg3MDg2MA==@MTAxODc2NTEzMzAwMDAwMDAyNzUwMDA4MQ==@MTAxODc2NTEzMjAwMDAwMDAzMDI3MTMyOQ==@MTAxODc2NTEzNDAwMDAwMDAzMDI2MDI4MQ==',//账号一的好友shareCode,不同好友中间用@符号隔开
|
||||||
|
'MTAxODc2NTEzMjAwMDAwMDAzMDI3MTMyOQ==@MTAxODcxOTI2NTAwMDAwMDAyNjA4ODQyMQ==@MTAxODc2NTEzOTAwMDAwMDAyNzE2MDY2NQ==',//账号二的好友shareCode,不同好友中间用@符号隔开
|
||||||
|
]
|
||||||
|
|
||||||
|
// 从日志获取互助码
|
||||||
|
// const logShareCodes = require('./utils/jdShareCodes');
|
||||||
|
// if (logShareCodes.PETSHARECODES.length > 0 && !process.env.PETSHARECODES) {
|
||||||
|
// process.env.PETSHARECODES = logShareCodes.PETSHARECODES.join('&');
|
||||||
|
// }
|
||||||
|
|
||||||
|
// 判断github action里面是否有东东萌宠互助码
|
||||||
|
if (process.env.PETSHARECODES) {
|
||||||
|
if (process.env.PETSHARECODES.indexOf('&') > -1) {
|
||||||
|
console.log(`您的东东萌宠互助码选择的是用&隔开\n`)
|
||||||
|
PetShareCodes = process.env.PETSHARECODES.split('&');
|
||||||
|
} else if (process.env.PETSHARECODES.indexOf('\n') > -1) {
|
||||||
|
console.log(`您的东东萌宠互助码选择的是用换行隔开\n`)
|
||||||
|
PetShareCodes = process.env.PETSHARECODES.split('\n');
|
||||||
|
} else {
|
||||||
|
PetShareCodes = process.env.PETSHARECODES.split();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log(`由于您环境变量(PETSHARECODES)里面未提供助力码,故此处运行将会给脚本内置的码进行助力,请知晓!`)
|
||||||
|
}
|
||||||
|
for (let i = 0; i < PetShareCodes.length; i++) {
|
||||||
|
const index = (i + 1 === 1) ? '' : (i + 1);
|
||||||
|
exports['PetShareCode' + index] = PetShareCodes[i];
|
||||||
|
}
|
|
@ -0,0 +1,37 @@
|
||||||
|
/*
|
||||||
|
京东种豆得豆互助码
|
||||||
|
此文件为Node.js专用。其他用户请忽略
|
||||||
|
支持京东N个账号
|
||||||
|
*/
|
||||||
|
//云服务器腾讯云函数等NOde.js用户在此处填写东东萌宠的好友码。
|
||||||
|
// 同一个京东账号的好友互助码用@符号隔开,不同京东账号之间用&符号或者换行隔开,下面给一个示例
|
||||||
|
// 如: 京东账号1的shareCode1@京东账号1的shareCode2&京东账号2的shareCode1@京东账号2的shareCode2
|
||||||
|
let PlantBeanShareCodes = [
|
||||||
|
'66j4yt3ebl5ierjljoszp7e4izzbzaqhi5k2unz2afwlyqsgnasq@olmijoxgmjutyrsovl2xalt2tbtfmg6sqldcb3q@e7lhibzb3zek27amgsvywffxx7hxgtzstrk2lba@olmijoxgmjutyx55upqaqxrblt7f3h26dgj2riy',//账号一的好友shareCode,不同好友中间用@符号隔开
|
||||||
|
'mlrdw3aw26j3wgzjipsxgonaoyr2evrdsifsziy@mlrdw3aw26j3wgzjipsxgonaoyr2evrdsifsziy',//账号二的好友shareCode,不同好友中间用@符号隔开
|
||||||
|
]
|
||||||
|
|
||||||
|
// 从日志获取互助码
|
||||||
|
// const logShareCodes = require('./utils/jdShareCodes');
|
||||||
|
// if (logShareCodes.PLANT_BEAN_SHARECODES.length > 0 && !process.env.PLANT_BEAN_SHARECODES) {
|
||||||
|
// process.env.PLANT_BEAN_SHARECODES = logShareCodes.PLANT_BEAN_SHARECODES.join('&');
|
||||||
|
// }
|
||||||
|
|
||||||
|
// 判断github action里面是否有种豆得豆互助码
|
||||||
|
if (process.env.PLANT_BEAN_SHARECODES) {
|
||||||
|
if (process.env.PLANT_BEAN_SHARECODES.indexOf('&') > -1) {
|
||||||
|
console.log(`您的种豆互助码选择的是用&隔开\n`)
|
||||||
|
PlantBeanShareCodes = process.env.PLANT_BEAN_SHARECODES.split('&');
|
||||||
|
} else if (process.env.PLANT_BEAN_SHARECODES.indexOf('\n') > -1) {
|
||||||
|
console.log(`您的种豆互助码选择的是用换行隔开\n`)
|
||||||
|
PlantBeanShareCodes = process.env.PLANT_BEAN_SHARECODES.split('\n');
|
||||||
|
} else {
|
||||||
|
PlantBeanShareCodes = process.env.PLANT_BEAN_SHARECODES.split();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log(`由于您环境变量(PLANT_BEAN_SHARECODES)里面未提供助力码,故此处运行将会给脚本内置的码进行助力,请知晓!`)
|
||||||
|
}
|
||||||
|
for (let i = 0; i < PlantBeanShareCodes.length; i++) {
|
||||||
|
const index = (i + 1 === 1) ? '' : (i + 1);
|
||||||
|
exports['PlantBeanShareCodes' + index] = PlantBeanShareCodes[i];
|
||||||
|
}
|
|
@ -0,0 +1,975 @@
|
||||||
|
/*
|
||||||
|
cron "30 * * * *" jd_CheckCK.js, tag:京东CK检测by-ccwav
|
||||||
|
*/
|
||||||
|
//详细说明参考 https://github.com/ccwav/QLScript2.
|
||||||
|
const $ = new Env('京东CK检测');
|
||||||
|
const notify = $.isNode() ? require('./sendNotify') : '';
|
||||||
|
//Node.js用户请在jdCookie.js处填写京东ck;
|
||||||
|
const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
|
||||||
|
const got = require('got');
|
||||||
|
const {
|
||||||
|
getEnvs,
|
||||||
|
getEnvById,
|
||||||
|
DisableCk,
|
||||||
|
EnableCk,
|
||||||
|
getstatus
|
||||||
|
} = require('./ql');
|
||||||
|
const api = got.extend({
|
||||||
|
retry: {
|
||||||
|
limit: 0
|
||||||
|
},
|
||||||
|
responseType: 'json',
|
||||||
|
});
|
||||||
|
|
||||||
|
let ShowSuccess = "false",
|
||||||
|
CKAlwaysNotify = "false",
|
||||||
|
CKAutoEnable = "true",
|
||||||
|
NoWarnError = "false";
|
||||||
|
|
||||||
|
let MessageUserGp2 = "";
|
||||||
|
let MessageUserGp3 = "";
|
||||||
|
let MessageUserGp4 = "";
|
||||||
|
|
||||||
|
let MessageGp2 = "";
|
||||||
|
let MessageGp3 = "";
|
||||||
|
let MessageGp4 = "";
|
||||||
|
let MessageAll = "";
|
||||||
|
|
||||||
|
let userIndex2 = -1;
|
||||||
|
let userIndex3 = -1;
|
||||||
|
let userIndex4 = -1;
|
||||||
|
|
||||||
|
let IndexGp2 = 0;
|
||||||
|
let IndexGp3 = 0;
|
||||||
|
let IndexGp4 = 0;
|
||||||
|
let IndexAll = 0;
|
||||||
|
|
||||||
|
let TempErrorMessage = '',
|
||||||
|
TempSuccessMessage = '',
|
||||||
|
TempDisableMessage = '',
|
||||||
|
TempEnableMessage = '',
|
||||||
|
TempOErrorMessage = '';
|
||||||
|
|
||||||
|
let allMessage = '',
|
||||||
|
ErrorMessage = '',
|
||||||
|
SuccessMessage = '',
|
||||||
|
DisableMessage = '',
|
||||||
|
EnableMessage = '',
|
||||||
|
OErrorMessage = '';
|
||||||
|
|
||||||
|
let allMessageGp2 = '',
|
||||||
|
ErrorMessageGp2 = '',
|
||||||
|
SuccessMessageGp2 = '',
|
||||||
|
DisableMessageGp2 = '',
|
||||||
|
EnableMessageGp2 = '',
|
||||||
|
OErrorMessageGp2 = '';
|
||||||
|
|
||||||
|
let allMessageGp3 = '',
|
||||||
|
ErrorMessageGp3 = '',
|
||||||
|
SuccessMessageGp3 = '',
|
||||||
|
DisableMessageGp3 = '',
|
||||||
|
EnableMessageGp3 = '',
|
||||||
|
OErrorMessageGp3 = '';
|
||||||
|
|
||||||
|
let allMessageGp4 = '',
|
||||||
|
ErrorMessageGp4 = '',
|
||||||
|
SuccessMessageGp4 = '',
|
||||||
|
DisableMessageGp4 = '',
|
||||||
|
EnableMessageGp4 = '',
|
||||||
|
OErrorMessageGp4 = '';
|
||||||
|
|
||||||
|
let strAllNotify = "";
|
||||||
|
let strNotifyOneTemp = "";
|
||||||
|
let WP_APP_TOKEN_ONE = "";
|
||||||
|
if ($.isNode() && process.env.WP_APP_TOKEN_ONE) {
|
||||||
|
WP_APP_TOKEN_ONE = process.env.WP_APP_TOKEN_ONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
let ReturnMessageTitle = '';
|
||||||
|
|
||||||
|
if ($.isNode() && process.env.BEANCHANGE_USERGP2) {
|
||||||
|
MessageUserGp2 = process.env.BEANCHANGE_USERGP2 ? process.env.BEANCHANGE_USERGP2.split('&') : [];
|
||||||
|
console.log(`检测到设定了分组推送2`);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($.isNode() && process.env.BEANCHANGE_USERGP3) {
|
||||||
|
MessageUserGp3 = process.env.BEANCHANGE_USERGP3 ? process.env.BEANCHANGE_USERGP3.split('&') : [];
|
||||||
|
console.log(`检测到设定了分组推送3`);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($.isNode() && process.env.BEANCHANGE_USERGP4) {
|
||||||
|
MessageUserGp4 = process.env.BEANCHANGE_USERGP4 ? process.env.BEANCHANGE_USERGP4.split('&') : [];
|
||||||
|
console.log(`检测到设定了分组推送4`);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($.isNode() && process.env.CHECKCK_SHOWSUCCESSCK) {
|
||||||
|
ShowSuccess = process.env.CHECKCK_SHOWSUCCESSCK;
|
||||||
|
}
|
||||||
|
if ($.isNode() && process.env.CHECKCK_CKALWAYSNOTIFY) {
|
||||||
|
CKAlwaysNotify = process.env.CHECKCK_CKALWAYSNOTIFY;
|
||||||
|
}
|
||||||
|
if ($.isNode() && process.env.CHECKCK_CKAUTOENABLE) {
|
||||||
|
CKAutoEnable = process.env.CHECKCK_CKAUTOENABLE;
|
||||||
|
}
|
||||||
|
if ($.isNode() && process.env.CHECKCK_CKNOWARNERROR) {
|
||||||
|
NoWarnError = process.env.CHECKCK_CKNOWARNERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($.isNode() && process.env.CHECKCK_ALLNOTIFY) {
|
||||||
|
|
||||||
|
strAllNotify = process.env.CHECKCK_ALLNOTIFY;
|
||||||
|
/* if (strTempNotify.length > 0) {
|
||||||
|
for (var TempNotifyl in strTempNotify) {
|
||||||
|
strAllNotify += strTempNotify[TempNotifyl] + '\n';
|
||||||
|
}
|
||||||
|
} */
|
||||||
|
console.log(`检测到设定了温馨提示,将在推送信息中置顶显示...`);
|
||||||
|
strAllNotify = `\n【✨✨✨✨温馨提示✨✨✨✨】\n` + strAllNotify;
|
||||||
|
console.log(strAllNotify);
|
||||||
|
}
|
||||||
|
|
||||||
|
!(async() => {
|
||||||
|
const envs = await getEnvs();
|
||||||
|
if (!envs[0]) {
|
||||||
|
$.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', {
|
||||||
|
"open-url": "https://bean.m.jd.com/bean/signIndex.action"
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let i = 0; i < envs.length; i++) {
|
||||||
|
if (envs[i].value) {
|
||||||
|
var tempid=0;
|
||||||
|
if(envs[i]._id){
|
||||||
|
tempid=envs[i]._id;
|
||||||
|
}
|
||||||
|
if(envs[i].id){
|
||||||
|
tempid=envs[i].id;
|
||||||
|
}
|
||||||
|
cookie = await getEnvById(tempid);
|
||||||
|
$.UserName = (cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1])
|
||||||
|
$.UserName2 = decodeURIComponent($.UserName);
|
||||||
|
$.index = i + 1;
|
||||||
|
$.isLogin = true;
|
||||||
|
$.error = '';
|
||||||
|
$.NoReturn = '';
|
||||||
|
$.nickName = "";
|
||||||
|
TempErrorMessage = '';
|
||||||
|
TempSuccessMessage = '';
|
||||||
|
TempDisableMessage = '';
|
||||||
|
TempEnableMessage = '';
|
||||||
|
TempOErrorMessage = '';
|
||||||
|
|
||||||
|
console.log(`开始检测【京东账号${$.index}】${$.UserName2} ....\n`);
|
||||||
|
if (MessageUserGp4) {
|
||||||
|
userIndex4 = MessageUserGp4.findIndex((item) => item === $.UserName);
|
||||||
|
}
|
||||||
|
if (MessageUserGp2) {
|
||||||
|
|
||||||
|
userIndex2 = MessageUserGp2.findIndex((item) => item === $.UserName);
|
||||||
|
}
|
||||||
|
if (MessageUserGp3) {
|
||||||
|
|
||||||
|
userIndex3 = MessageUserGp3.findIndex((item) => item === $.UserName);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (userIndex2 != -1) {
|
||||||
|
console.log(`账号属于分组2`);
|
||||||
|
IndexGp2 += 1;
|
||||||
|
ReturnMessageTitle = `【账号${IndexGp2}🆔】${$.UserName2}`;
|
||||||
|
}
|
||||||
|
if (userIndex3 != -1) {
|
||||||
|
console.log(`账号属于分组3`);
|
||||||
|
IndexGp3 += 1;
|
||||||
|
ReturnMessageTitle = `【账号${IndexGp3}🆔】${$.UserName2}`;
|
||||||
|
}
|
||||||
|
if (userIndex4 != -1) {
|
||||||
|
console.log(`账号属于分组4`);
|
||||||
|
IndexGp4 += 1;
|
||||||
|
ReturnMessageTitle = `【账号${IndexGp4}🆔】${$.UserName2}`;
|
||||||
|
}
|
||||||
|
if (userIndex4 == -1 && userIndex2 == -1 && userIndex3 == -1) {
|
||||||
|
console.log(`账号没有分组`);
|
||||||
|
IndexAll += 1;
|
||||||
|
ReturnMessageTitle = `【账号${IndexAll}🆔】${$.UserName2}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
await TotalBean();
|
||||||
|
if ($.NoReturn) {
|
||||||
|
console.log(`接口1检测失败,尝试使用接口2....\n`);
|
||||||
|
await isLoginByX1a0He();
|
||||||
|
} else {
|
||||||
|
if ($.isLogin) {
|
||||||
|
if (!$.nickName) {
|
||||||
|
console.log(`获取的别名为空,尝试使用接口2验证....\n`);
|
||||||
|
await isLoginByX1a0He();
|
||||||
|
} else {
|
||||||
|
console.log(`成功获取到别名: ${$.nickName},Pass!\n`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($.error) {
|
||||||
|
console.log(`有错误,跳出....`);
|
||||||
|
TempOErrorMessage = $.error;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
const strnowstatus = await getstatus(tempid);
|
||||||
|
if (strnowstatus == 99) {
|
||||||
|
strnowstatus = envs[i].status;
|
||||||
|
}
|
||||||
|
if (!$.isLogin) {
|
||||||
|
|
||||||
|
if (strnowstatus == 0) {
|
||||||
|
const DisableCkBody = await DisableCk(tempid);
|
||||||
|
if (DisableCkBody.code == 200) {
|
||||||
|
if ($.isNode() && WP_APP_TOKEN_ONE) {
|
||||||
|
strNotifyOneTemp = `京东账号: ${$.nickName || $.UserName2} 已失效,自动禁用成功!\n如果要继续挂机,请联系管理员重新登录账号,账号有效期为30天.`
|
||||||
|
|
||||||
|
if (strAllNotify)
|
||||||
|
strNotifyOneTemp += `\n` + strAllNotify;
|
||||||
|
|
||||||
|
await notify.sendNotifybyWxPucher(`${$.name}`, strNotifyOneTemp, `${$.UserName2}`);
|
||||||
|
}
|
||||||
|
console.log(`京东账号${$.index} : ${$.nickName || $.UserName2} 已失效,自动禁用成功!\n`);
|
||||||
|
TempDisableMessage = ReturnMessageTitle + ` (自动禁用成功!)\n`;
|
||||||
|
TempErrorMessage = ReturnMessageTitle + ` 已失效,自动禁用成功!\n`;
|
||||||
|
} else {
|
||||||
|
if ($.isNode() && WP_APP_TOKEN_ONE) {
|
||||||
|
strNotifyOneTemp = `京东账号: ${$.nickName || $.UserName2} 已失效!\n如果要继续挂机,请联系管理员重新登录账号,账号有效期为30天.`
|
||||||
|
|
||||||
|
if (strAllNotify)
|
||||||
|
strNotifyOneTemp += `\n` + strAllNotify;
|
||||||
|
|
||||||
|
await notify.sendNotifybyWxPucher(`${$.name}`, strNotifyOneTemp, `${$.UserName2}`);
|
||||||
|
}
|
||||||
|
console.log(`京东账号${$.index} : ${$.nickName || $.UserName2} 已失效,自动禁用失败!\n`);
|
||||||
|
TempDisableMessage = ReturnMessageTitle + ` (自动禁用失败!)\n`;
|
||||||
|
TempErrorMessage = ReturnMessageTitle + ` 已失效,自动禁用失败!\n`;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log(`京东账号${$.index} : ${$.nickName || $.UserName2} 已失效,已禁用!\n`);
|
||||||
|
TempErrorMessage = ReturnMessageTitle + ` 已失效,已禁用.\n`;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (strnowstatus == 1) {
|
||||||
|
|
||||||
|
if (CKAutoEnable == "true") {
|
||||||
|
const EnableCkBody = await EnableCk(tempid);
|
||||||
|
if (EnableCkBody.code == 200) {
|
||||||
|
if ($.isNode() && WP_APP_TOKEN_ONE) {
|
||||||
|
await notify.sendNotifybyWxPucher(`${$.name}`, `京东账号: ${$.nickName || $.UserName2} 已恢复,自动启用成功!\n祝您挂机愉快...`, `${$.UserName2}`);
|
||||||
|
}
|
||||||
|
console.log(`京东账号${$.index} : ${$.nickName || $.UserName2} 已恢复,自动启用成功!\n`);
|
||||||
|
TempEnableMessage = ReturnMessageTitle + ` (自动启用成功!)\n`;
|
||||||
|
TempSuccessMessage = ReturnMessageTitle + ` (自动启用成功!)\n`;
|
||||||
|
} else {
|
||||||
|
if ($.isNode() && WP_APP_TOKEN_ONE) {
|
||||||
|
await notify.sendNotifybyWxPucher(`${$.name}`, `京东账号: ${$.nickName || $.UserName2} 已恢复,但自动启用失败!\n请联系管理员处理...`, `${$.UserName2}`);
|
||||||
|
}
|
||||||
|
console.log(`京东账号${$.index} : ${$.nickName || $.UserName2} 已恢复,但自动启用失败!\n`);
|
||||||
|
TempEnableMessage = ReturnMessageTitle + ` (自动启用失败!)\n`;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log(`京东账号${$.index} : ${$.nickName || $.UserName2} 已恢复,可手动启用!\n`);
|
||||||
|
TempEnableMessage = ReturnMessageTitle + ` 已恢复,可手动启用.\n`;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log(`京东账号${$.index} : ${$.nickName || $.UserName2} 状态正常!\n`);
|
||||||
|
TempSuccessMessage = ReturnMessageTitle + `\n`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (userIndex2 != -1) {
|
||||||
|
ErrorMessageGp2 += TempErrorMessage;
|
||||||
|
SuccessMessageGp2 += TempSuccessMessage;
|
||||||
|
DisableMessageGp2 += TempDisableMessage;
|
||||||
|
EnableMessageGp2 += TempEnableMessage;
|
||||||
|
OErrorMessageGp2 += TempOErrorMessage;
|
||||||
|
}
|
||||||
|
if (userIndex3 != -1) {
|
||||||
|
ErrorMessageGp3 += TempErrorMessage;
|
||||||
|
SuccessMessageGp3 += TempSuccessMessage;
|
||||||
|
DisableMessageGp3 += TempDisableMessage;
|
||||||
|
EnableMessageGp3 += TempEnableMessage;
|
||||||
|
OErrorMessageGp3 += TempOErrorMessage;
|
||||||
|
}
|
||||||
|
if (userIndex4 != -1) {
|
||||||
|
ErrorMessageGp4 += TempErrorMessage;
|
||||||
|
SuccessMessageGp4 += TempSuccessMessage;
|
||||||
|
DisableMessageGp4 += TempDisableMessage;
|
||||||
|
EnableMessageGp4 += TempEnableMessage;
|
||||||
|
OErrorMessageGp4 += TempOErrorMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (userIndex4 == -1 && userIndex2 == -1 && userIndex3 == -1) {
|
||||||
|
ErrorMessage += TempErrorMessage;
|
||||||
|
SuccessMessage += TempSuccessMessage;
|
||||||
|
DisableMessage += TempDisableMessage;
|
||||||
|
EnableMessage += TempEnableMessage;
|
||||||
|
OErrorMessage += TempOErrorMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
console.log(`等待2秒....... \n`);
|
||||||
|
await $.wait(2 * 1000)
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($.isNode()) {
|
||||||
|
if (MessageUserGp2) {
|
||||||
|
if (OErrorMessageGp2) {
|
||||||
|
allMessageGp2 += `👇👇👇👇👇检测出错账号👇👇👇👇👇\n` + OErrorMessageGp2 + `\n\n`;
|
||||||
|
}
|
||||||
|
if (DisableMessageGp2) {
|
||||||
|
allMessageGp2 += `👇👇👇👇👇自动禁用账号👇👇👇👇👇\n` + DisableMessageGp2 + `\n\n`;
|
||||||
|
}
|
||||||
|
if (EnableMessageGp2) {
|
||||||
|
if (CKAutoEnable == "true") {
|
||||||
|
allMessageGp2 += `👇👇👇👇👇自动启用账号👇👇👇👇👇\n` + EnableMessageGp2 + `\n\n`;
|
||||||
|
} else {
|
||||||
|
allMessageGp2 += `👇👇👇👇👇账号已恢复👇👇👇👇👇\n` + EnableMessageGp2 + `\n\n`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ErrorMessageGp2) {
|
||||||
|
allMessageGp2 += `👇👇👇👇👇失效账号👇👇👇👇👇\n` + ErrorMessageGp2 + `\n\n`;
|
||||||
|
} else {
|
||||||
|
allMessageGp2 += `👇👇👇👇👇失效账号👇👇👇👇👇\n 一个失效的都没有呢,羡慕啊...\n\n`;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ShowSuccess == "true" && SuccessMessage) {
|
||||||
|
allMessageGp2 += `👇👇👇👇👇有效账号👇👇👇👇👇\n` + SuccessMessageGp2 + `\n`;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (NoWarnError == "true") {
|
||||||
|
OErrorMessageGp2 = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($.isNode() && (EnableMessageGp2 || DisableMessageGp2 || OErrorMessageGp2 || CKAlwaysNotify == "true")) {
|
||||||
|
console.log("京东CK检测#2:");
|
||||||
|
console.log(allMessageGp2);
|
||||||
|
|
||||||
|
if (strAllNotify)
|
||||||
|
allMessageGp2 += `\n` + strAllNotify;
|
||||||
|
|
||||||
|
await notify.sendNotify("京东CK检测#2", `${allMessageGp2}`, {
|
||||||
|
url: `https://bean.m.jd.com/beanDetail/index.action?resourceValue=bean`
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (MessageUserGp3) {
|
||||||
|
if (OErrorMessageGp3) {
|
||||||
|
allMessageGp3 += `👇👇👇👇👇检测出错账号👇👇👇👇👇\n` + OErrorMessageGp3 + `\n\n`;
|
||||||
|
}
|
||||||
|
if (DisableMessageGp3) {
|
||||||
|
allMessageGp3 += `👇👇👇👇👇自动禁用账号👇👇👇👇👇\n` + DisableMessageGp3 + `\n\n`;
|
||||||
|
}
|
||||||
|
if (EnableMessageGp3) {
|
||||||
|
if (CKAutoEnable == "true") {
|
||||||
|
allMessageGp3 += `👇👇👇👇👇自动启用账号👇👇👇👇👇\n` + EnableMessageGp3 + `\n\n`;
|
||||||
|
} else {
|
||||||
|
allMessageGp3 += `👇👇👇👇👇账号已恢复👇👇👇👇👇\n` + EnableMessageGp3 + `\n\n`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ErrorMessageGp3) {
|
||||||
|
allMessageGp3 += `👇👇👇👇👇失效账号👇👇👇👇👇\n` + ErrorMessageGp3 + `\n\n`;
|
||||||
|
} else {
|
||||||
|
allMessageGp3 += `👇👇👇👇👇失效账号👇👇👇👇👇\n 一个失效的都没有呢,羡慕啊...\n\n`;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ShowSuccess == "true" && SuccessMessage) {
|
||||||
|
allMessageGp3 += `👇👇👇👇👇有效账号👇👇👇👇👇\n` + SuccessMessageGp3 + `\n`;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (NoWarnError == "true") {
|
||||||
|
OErrorMessageGp3 = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($.isNode() && (EnableMessageGp3 || DisableMessageGp3 || OErrorMessageGp3 || CKAlwaysNotify == "true")) {
|
||||||
|
console.log("京东CK检测#3:");
|
||||||
|
console.log(allMessageGp3);
|
||||||
|
if (strAllNotify)
|
||||||
|
allMessageGp3 += `\n` + strAllNotify;
|
||||||
|
|
||||||
|
await notify.sendNotify("京东CK检测#3", `${allMessageGp3}`, {
|
||||||
|
url: `https://bean.m.jd.com/beanDetail/index.action?resourceValue=bean`
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (MessageUserGp4) {
|
||||||
|
if (OErrorMessageGp4) {
|
||||||
|
allMessageGp4 += `👇👇👇👇👇检测出错账号👇👇👇👇👇\n` + OErrorMessageGp4 + `\n\n`;
|
||||||
|
}
|
||||||
|
if (DisableMessageGp4) {
|
||||||
|
allMessageGp4 += `👇👇👇👇👇自动禁用账号👇👇👇👇👇\n` + DisableMessageGp4 + `\n\n`;
|
||||||
|
}
|
||||||
|
if (EnableMessageGp4) {
|
||||||
|
if (CKAutoEnable == "true") {
|
||||||
|
allMessageGp4 += `👇👇👇👇👇自动启用账号👇👇👇👇👇\n` + EnableMessageGp4 + `\n\n`;
|
||||||
|
} else {
|
||||||
|
allMessageGp4 += `👇👇👇👇👇账号已恢复👇👇👇👇👇\n` + EnableMessageGp4 + `\n\n`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ErrorMessageGp4) {
|
||||||
|
allMessageGp4 += `👇👇👇👇👇失效账号👇👇👇👇👇\n` + ErrorMessageGp4 + `\n\n`;
|
||||||
|
} else {
|
||||||
|
allMessageGp4 += `👇👇👇👇👇失效账号👇👇👇👇👇\n 一个失效的都没有呢,羡慕啊...\n\n`;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ShowSuccess == "true" && SuccessMessage) {
|
||||||
|
allMessageGp4 += `👇👇👇👇👇有效账号👇👇👇👇👇\n` + SuccessMessageGp4 + `\n`;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (NoWarnError == "true") {
|
||||||
|
OErrorMessageGp4 = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($.isNode() && (EnableMessageGp4 || DisableMessageGp4 || OErrorMessageGp4 || CKAlwaysNotify == "true")) {
|
||||||
|
console.log("京东CK检测#4:");
|
||||||
|
console.log(allMessageGp4);
|
||||||
|
if (strAllNotify)
|
||||||
|
allMessageGp4 += `\n` + strAllNotify;
|
||||||
|
|
||||||
|
await notify.sendNotify("京东CK检测#4", `${allMessageGp4}`, {
|
||||||
|
url: `https://bean.m.jd.com/beanDetail/index.action?resourceValue=bean`
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (OErrorMessage) {
|
||||||
|
allMessage += `👇👇👇👇👇检测出错账号👇👇👇👇👇\n` + OErrorMessage + `\n\n`;
|
||||||
|
}
|
||||||
|
if (DisableMessage) {
|
||||||
|
allMessage += `👇👇👇👇👇自动禁用账号👇👇👇👇👇\n` + DisableMessage + `\n\n`;
|
||||||
|
}
|
||||||
|
if (EnableMessage) {
|
||||||
|
if (CKAutoEnable == "true") {
|
||||||
|
allMessage += `👇👇👇👇👇自动启用账号👇👇👇👇👇\n` + EnableMessage + `\n\n`;
|
||||||
|
} else {
|
||||||
|
allMessage += `👇👇👇👇👇账号已恢复👇👇👇👇👇\n` + EnableMessage + `\n\n`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ErrorMessage) {
|
||||||
|
allMessage += `👇👇👇👇👇失效账号👇👇👇👇👇\n` + ErrorMessage + `\n\n`;
|
||||||
|
} else {
|
||||||
|
allMessage += `👇👇👇👇👇失效账号👇👇👇👇👇\n 一个失效的都没有呢,羡慕啊...\n\n`;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ShowSuccess == "true" && SuccessMessage) {
|
||||||
|
allMessage += `👇👇👇👇👇有效账号👇👇👇👇👇\n` + SuccessMessage + `\n`;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (NoWarnError == "true") {
|
||||||
|
OErrorMessage = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($.isNode() && (EnableMessage || DisableMessage || OErrorMessage || CKAlwaysNotify == "true")) {
|
||||||
|
console.log("京东CK检测:");
|
||||||
|
console.log(allMessage);
|
||||||
|
if (strAllNotify)
|
||||||
|
allMessage += `\n` + strAllNotify;
|
||||||
|
|
||||||
|
await notify.sendNotify(`${$.name}`, `${allMessage}`, {
|
||||||
|
url: `https://bean.m.jd.com/beanDetail/index.action?resourceValue=bean`
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
})()
|
||||||
|
.catch((e) => $.logErr(e))
|
||||||
|
.finally(() => $.done())
|
||||||
|
|
||||||
|
function TotalBean() {
|
||||||
|
return new Promise(async resolve => {
|
||||||
|
const options = {
|
||||||
|
url: "https://me-api.jd.com/user_new/info/GetJDUserInfoUnion",
|
||||||
|
headers: {
|
||||||
|
Host: "me-api.jd.com",
|
||||||
|
Accept: "*/*",
|
||||||
|
Connection: "keep-alive",
|
||||||
|
Cookie: cookie,
|
||||||
|
"User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.4.4;14.3;network/4g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1"),
|
||||||
|
"Accept-Language": "zh-cn",
|
||||||
|
"Referer": "https://home.m.jd.com/myJd/newhome.action?sceneval=2&ufc=&",
|
||||||
|
"Accept-Encoding": "gzip, deflate, br"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$.get(options, (err, resp, data) => {
|
||||||
|
try {
|
||||||
|
if (err) {
|
||||||
|
$.logErr(err)
|
||||||
|
$.nickName = decodeURIComponent($.UserName);
|
||||||
|
$.NoReturn = `${$.nickName} :` + `${JSON.stringify(err)}\n`;
|
||||||
|
} else {
|
||||||
|
if (data) {
|
||||||
|
data = JSON.parse(data);
|
||||||
|
if (data['retcode'] === "1001") {
|
||||||
|
$.isLogin = false; //cookie过期
|
||||||
|
$.nickName = decodeURIComponent($.UserName);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (data['retcode'] === "0" && data.data && data.data.hasOwnProperty("userInfo")) {
|
||||||
|
$.nickName = (data.data.userInfo.baseInfo.nickname);
|
||||||
|
} else {
|
||||||
|
$.nickName = decodeURIComponent($.UserName);
|
||||||
|
console.log("Debug Code:" + data['retcode']);
|
||||||
|
$.NoReturn = `${$.nickName} :` + `服务器返回未知状态,不做变动\n`;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$.nickName = decodeURIComponent($.UserName);
|
||||||
|
$.log('京东服务器返回空数据');
|
||||||
|
$.NoReturn = `${$.nickName} :` + `服务器返回空数据,不做变动\n`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
$.nickName = decodeURIComponent($.UserName);
|
||||||
|
$.logErr(e)
|
||||||
|
$.NoReturn = `${$.nickName} : 检测出错,不做变动\n`;
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
resolve();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
function isLoginByX1a0He() {
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
const options = {
|
||||||
|
url: 'https://plogin.m.jd.com/cgi-bin/ml/islogin',
|
||||||
|
headers: {
|
||||||
|
"Cookie": cookie,
|
||||||
|
"referer": "https://h5.m.jd.com/",
|
||||||
|
"User-Agent": "jdapp;iPhone;10.1.2;15.0;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
$.get(options, (err, resp, data) => {
|
||||||
|
try {
|
||||||
|
if (data) {
|
||||||
|
data = JSON.parse(data);
|
||||||
|
if (data.islogin === "1") {
|
||||||
|
console.log(`使用X1a0He写的接口加强检测: Cookie有效\n`)
|
||||||
|
} else if (data.islogin === "0") {
|
||||||
|
$.isLogin = false;
|
||||||
|
console.log(`使用X1a0He写的接口加强检测: Cookie无效\n`)
|
||||||
|
} else {
|
||||||
|
console.log(`使用X1a0He写的接口加强检测: 未知返回,不作变更...\n`)
|
||||||
|
$.error = `${$.nickName} :` + `使用X1a0He写的接口加强检测: 未知返回...\n`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e);
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
resolve();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function jsonParse(str) {
|
||||||
|
if (typeof str == "string") {
|
||||||
|
try {
|
||||||
|
return JSON.parse(str);
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e);
|
||||||
|
$.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie')
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// prettier-ignore
|
||||||
|
function Env(t, e) {
|
||||||
|
"undefined" != typeof process && JSON.stringify(process.env).indexOf("GITHUB") > -1 && process.exit(0);
|
||||||
|
class s {
|
||||||
|
constructor(t) {
|
||||||
|
this.env = t
|
||||||
|
}
|
||||||
|
send(t, e = "GET") {
|
||||||
|
t = "string" == typeof t ? {
|
||||||
|
url: t
|
||||||
|
}
|
||||||
|
: t;
|
||||||
|
let s = this.get;
|
||||||
|
return "POST" === e && (s = this.post),
|
||||||
|
new Promise((e, i) => {
|
||||||
|
s.call(this, t, (t, s, r) => {
|
||||||
|
t ? i(t) : e(s)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
get(t) {
|
||||||
|
return this.send.call(this.env, t)
|
||||||
|
}
|
||||||
|
post(t) {
|
||||||
|
return this.send.call(this.env, t, "POST")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return new class {
|
||||||
|
constructor(t, e) {
|
||||||
|
this.name = t,
|
||||||
|
this.http = new s(this),
|
||||||
|
this.data = null,
|
||||||
|
this.dataFile = "box.dat",
|
||||||
|
this.logs = [],
|
||||||
|
this.isMute = !1,
|
||||||
|
this.isNeedRewrite = !1,
|
||||||
|
this.logSeparator = "\n",
|
||||||
|
this.startTime = (new Date).getTime(),
|
||||||
|
Object.assign(this, e),
|
||||||
|
this.log("", `🔔${this.name}, 开始!`)
|
||||||
|
}
|
||||||
|
isNode() {
|
||||||
|
return "undefined" != typeof module && !!module.exports
|
||||||
|
}
|
||||||
|
isQuanX() {
|
||||||
|
return "undefined" != typeof $task
|
||||||
|
}
|
||||||
|
isSurge() {
|
||||||
|
return "undefined" != typeof $httpClient && "undefined" == typeof $loon
|
||||||
|
}
|
||||||
|
isLoon() {
|
||||||
|
return "undefined" != typeof $loon
|
||||||
|
}
|
||||||
|
toObj(t, e = null) {
|
||||||
|
try {
|
||||||
|
return JSON.parse(t)
|
||||||
|
} catch {
|
||||||
|
return e
|
||||||
|
}
|
||||||
|
}
|
||||||
|
toStr(t, e = null) {
|
||||||
|
try {
|
||||||
|
return JSON.stringify(t)
|
||||||
|
} catch {
|
||||||
|
return e
|
||||||
|
}
|
||||||
|
}
|
||||||
|
getjson(t, e) {
|
||||||
|
let s = e;
|
||||||
|
const i = this.getdata(t);
|
||||||
|
if (i)
|
||||||
|
try {
|
||||||
|
s = JSON.parse(this.getdata(t))
|
||||||
|
} catch {}
|
||||||
|
return s
|
||||||
|
}
|
||||||
|
setjson(t, e) {
|
||||||
|
try {
|
||||||
|
return this.setdata(JSON.stringify(t), e)
|
||||||
|
} catch {
|
||||||
|
return !1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
getScript(t) {
|
||||||
|
return new Promise(e => {
|
||||||
|
this.get({
|
||||||
|
url: t
|
||||||
|
}, (t, s, i) => e(i))
|
||||||
|
})
|
||||||
|
}
|
||||||
|
runScript(t, e) {
|
||||||
|
return new Promise(s => {
|
||||||
|
let i = this.getdata("@chavy_boxjs_userCfgs.httpapi");
|
||||||
|
i = i ? i.replace(/\n/g, "").trim() : i;
|
||||||
|
let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");
|
||||||
|
r = r ? 1 * r : 20,
|
||||||
|
r = e && e.timeout ? e.timeout : r;
|
||||||
|
const[o, h] = i.split("@"),
|
||||||
|
n = {
|
||||||
|
url: `http://${h}/v1/scripting/evaluate`,
|
||||||
|
body: {
|
||||||
|
script_text: t,
|
||||||
|
mock_type: "cron",
|
||||||
|
timeout: r
|
||||||
|
},
|
||||||
|
headers: {
|
||||||
|
"X-Key": o,
|
||||||
|
Accept: "*/*"
|
||||||
|
}
|
||||||
|
};
|
||||||
|
this.post(n, (t, e, i) => s(i))
|
||||||
|
}).catch(t => this.logErr(t))
|
||||||
|
}
|
||||||
|
loaddata() {
|
||||||
|
if (!this.isNode())
|
||||||
|
return {}; {
|
||||||
|
this.fs = this.fs ? this.fs : require("fs"),
|
||||||
|
this.path = this.path ? this.path : require("path");
|
||||||
|
const t = this.path.resolve(this.dataFile),
|
||||||
|
e = this.path.resolve(process.cwd(), this.dataFile),
|
||||||
|
s = this.fs.existsSync(t),
|
||||||
|
i = !s && this.fs.existsSync(e);
|
||||||
|
if (!s && !i)
|
||||||
|
return {}; {
|
||||||
|
const i = s ? t : e;
|
||||||
|
try {
|
||||||
|
return JSON.parse(this.fs.readFileSync(i))
|
||||||
|
} catch (t) {
|
||||||
|
return {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
writedata() {
|
||||||
|
if (this.isNode()) {
|
||||||
|
this.fs = this.fs ? this.fs : require("fs"),
|
||||||
|
this.path = this.path ? this.path : require("path");
|
||||||
|
const t = this.path.resolve(this.dataFile),
|
||||||
|
e = this.path.resolve(process.cwd(), this.dataFile),
|
||||||
|
s = this.fs.existsSync(t),
|
||||||
|
i = !s && this.fs.existsSync(e),
|
||||||
|
r = JSON.stringify(this.data);
|
||||||
|
s ? this.fs.writeFileSync(t, r) : i ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
lodash_get(t, e, s) {
|
||||||
|
const i = e.replace(/\[(\d+)\]/g, ".$1").split(".");
|
||||||
|
let r = t;
|
||||||
|
for (const t of i)
|
||||||
|
if (r = Object(r)[t], void 0 === r)
|
||||||
|
return s;
|
||||||
|
return r
|
||||||
|
}
|
||||||
|
lodash_set(t, e, s) {
|
||||||
|
return Object(t) !== t ? t : (Array.isArray(e) || (e = e.toString().match(/[^.[\]]+/g) || []), e.slice(0, -1).reduce((t, s, i) => Object(t[s]) === t[s] ? t[s] : t[s] = Math.abs(e[i + 1]) >> 0 == +e[i + 1] ? [] : {}, t)[e[e.length - 1]] = s, t)
|
||||||
|
}
|
||||||
|
getdata(t) {
|
||||||
|
let e = this.getval(t);
|
||||||
|
if (/^@/.test(t)) {
|
||||||
|
const[, s, i] = /^@(.*?)\.(.*?)$/.exec(t),
|
||||||
|
r = s ? this.getval(s) : "";
|
||||||
|
if (r)
|
||||||
|
try {
|
||||||
|
const t = JSON.parse(r);
|
||||||
|
e = t ? this.lodash_get(t, i, "") : e
|
||||||
|
} catch (t) {
|
||||||
|
e = ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return e
|
||||||
|
}
|
||||||
|
setdata(t, e) {
|
||||||
|
let s = !1;
|
||||||
|
if (/^@/.test(e)) {
|
||||||
|
const[, i, r] = /^@(.*?)\.(.*?)$/.exec(e),
|
||||||
|
o = this.getval(i),
|
||||||
|
h = i ? "null" === o ? null : o || "{}" : "{}";
|
||||||
|
try {
|
||||||
|
const e = JSON.parse(h);
|
||||||
|
this.lodash_set(e, r, t),
|
||||||
|
s = this.setval(JSON.stringify(e), i)
|
||||||
|
} catch (e) {
|
||||||
|
const o = {};
|
||||||
|
this.lodash_set(o, r, t),
|
||||||
|
s = this.setval(JSON.stringify(o), i)
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
s = this.setval(t, e);
|
||||||
|
return s
|
||||||
|
}
|
||||||
|
getval(t) {
|
||||||
|
return this.isSurge() || this.isLoon() ? $persistentStore.read(t) : this.isQuanX() ? $prefs.valueForKey(t) : this.isNode() ? (this.data = this.loaddata(), this.data[t]) : this.data && this.data[t] || null
|
||||||
|
}
|
||||||
|
setval(t, e) {
|
||||||
|
return this.isSurge() || this.isLoon() ? $persistentStore.write(t, e) : this.isQuanX() ? $prefs.setValueForKey(t, e) : this.isNode() ? (this.data = this.loaddata(), this.data[e] = t, this.writedata(), !0) : this.data && this.data[e] || null
|
||||||
|
}
|
||||||
|
initGotEnv(t) {
|
||||||
|
this.got = this.got ? this.got : require("got"),
|
||||||
|
this.cktough = this.cktough ? this.cktough : require("tough-cookie"),
|
||||||
|
this.ckjar = this.ckjar ? this.ckjar : new this.cktough.CookieJar,
|
||||||
|
t && (t.headers = t.headers ? t.headers : {}, void 0 === t.headers.Cookie && void 0 === t.cookieJar && (t.cookieJar = this.ckjar))
|
||||||
|
}
|
||||||
|
get(t, e = (() => {})) {
|
||||||
|
t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"]),
|
||||||
|
this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, {
|
||||||
|
"X-Surge-Skip-Scripting": !1
|
||||||
|
})), $httpClient.get(t, (t, s, i) => {
|
||||||
|
!t && s && (s.body = i, s.statusCode = s.status),
|
||||||
|
e(t, s, i)
|
||||||
|
})) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, {
|
||||||
|
hints: !1
|
||||||
|
})), $task.fetch(t).then(t => {
|
||||||
|
const {
|
||||||
|
statusCode: s,
|
||||||
|
statusCode: i,
|
||||||
|
headers: r,
|
||||||
|
body: o
|
||||||
|
} = t;
|
||||||
|
e(null, {
|
||||||
|
status: s,
|
||||||
|
statusCode: i,
|
||||||
|
headers: r,
|
||||||
|
body: o
|
||||||
|
}, o)
|
||||||
|
}, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => {
|
||||||
|
try {
|
||||||
|
if (t.headers["set-cookie"]) {
|
||||||
|
const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();
|
||||||
|
s && this.ckjar.setCookieSync(s, null),
|
||||||
|
e.cookieJar = this.ckjar
|
||||||
|
}
|
||||||
|
} catch (t) {
|
||||||
|
this.logErr(t)
|
||||||
|
}
|
||||||
|
}).then(t => {
|
||||||
|
const {
|
||||||
|
statusCode: s,
|
||||||
|
statusCode: i,
|
||||||
|
headers: r,
|
||||||
|
body: o
|
||||||
|
} = t;
|
||||||
|
e(null, {
|
||||||
|
status: s,
|
||||||
|
statusCode: i,
|
||||||
|
headers: r,
|
||||||
|
body: o
|
||||||
|
}, o)
|
||||||
|
}, t => {
|
||||||
|
const {
|
||||||
|
message: s,
|
||||||
|
response: i
|
||||||
|
} = t;
|
||||||
|
e(s, i, i && i.body)
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
post(t, e = (() => {})) {
|
||||||
|
if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon())
|
||||||
|
this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, {
|
||||||
|
"X-Surge-Skip-Scripting": !1
|
||||||
|
})), $httpClient.post(t, (t, s, i) => {
|
||||||
|
!t && s && (s.body = i, s.statusCode = s.status),
|
||||||
|
e(t, s, i)
|
||||||
|
});
|
||||||
|
else if (this.isQuanX())
|
||||||
|
t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, {
|
||||||
|
hints: !1
|
||||||
|
})), $task.fetch(t).then(t => {
|
||||||
|
const {
|
||||||
|
statusCode: s,
|
||||||
|
statusCode: i,
|
||||||
|
headers: r,
|
||||||
|
body: o
|
||||||
|
} = t;
|
||||||
|
e(null, {
|
||||||
|
status: s,
|
||||||
|
statusCode: i,
|
||||||
|
headers: r,
|
||||||
|
body: o
|
||||||
|
}, o)
|
||||||
|
}, t => e(t));
|
||||||
|
else if (this.isNode()) {
|
||||||
|
this.initGotEnv(t);
|
||||||
|
const {
|
||||||
|
url: s,
|
||||||
|
...i
|
||||||
|
} = t;
|
||||||
|
this.got.post(s, i).then(t => {
|
||||||
|
const {
|
||||||
|
statusCode: s,
|
||||||
|
statusCode: i,
|
||||||
|
headers: r,
|
||||||
|
body: o
|
||||||
|
} = t;
|
||||||
|
e(null, {
|
||||||
|
status: s,
|
||||||
|
statusCode: i,
|
||||||
|
headers: r,
|
||||||
|
body: o
|
||||||
|
}, o)
|
||||||
|
}, t => {
|
||||||
|
const {
|
||||||
|
message: s,
|
||||||
|
response: i
|
||||||
|
} = t;
|
||||||
|
e(s, i, i && i.body)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
time(t, e = null) {
|
||||||
|
const s = e ? new Date(e) : new Date;
|
||||||
|
let i = {
|
||||||
|
"M+": s.getMonth() + 1,
|
||||||
|
"d+": s.getDate(),
|
||||||
|
"H+": s.getHours(),
|
||||||
|
"m+": s.getMinutes(),
|
||||||
|
"s+": s.getSeconds(),
|
||||||
|
"q+": Math.floor((s.getMonth() + 3) / 3),
|
||||||
|
S: s.getMilliseconds()
|
||||||
|
};
|
||||||
|
/(y+)/.test(t) && (t = t.replace(RegExp.$1, (s.getFullYear() + "").substr(4 - RegExp.$1.length)));
|
||||||
|
for (let e in i)
|
||||||
|
new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? i[e] : ("00" + i[e]).substr(("" + i[e]).length)));
|
||||||
|
return t
|
||||||
|
}
|
||||||
|
msg(e = t, s = "", i = "", r) {
|
||||||
|
const o = t => {
|
||||||
|
if (!t)
|
||||||
|
return t;
|
||||||
|
if ("string" == typeof t)
|
||||||
|
return this.isLoon() ? t : this.isQuanX() ? {
|
||||||
|
"open-url": t
|
||||||
|
}
|
||||||
|
: this.isSurge() ? {
|
||||||
|
url: t
|
||||||
|
}
|
||||||
|
: void 0;
|
||||||
|
if ("object" == typeof t) {
|
||||||
|
if (this.isLoon()) {
|
||||||
|
let e = t.openUrl || t.url || t["open-url"],
|
||||||
|
s = t.mediaUrl || t["media-url"];
|
||||||
|
return {
|
||||||
|
openUrl: e,
|
||||||
|
mediaUrl: s
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (this.isQuanX()) {
|
||||||
|
let e = t["open-url"] || t.url || t.openUrl,
|
||||||
|
s = t["media-url"] || t.mediaUrl;
|
||||||
|
return {
|
||||||
|
"open-url": e,
|
||||||
|
"media-url": s
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (this.isSurge()) {
|
||||||
|
let e = t.url || t.openUrl || t["open-url"];
|
||||||
|
return {
|
||||||
|
url: e
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
if (this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))), !this.isMuteLog) {
|
||||||
|
let t = ["", "==============📣系统通知📣=============="];
|
||||||
|
t.push(e),
|
||||||
|
s && t.push(s),
|
||||||
|
i && t.push(i),
|
||||||
|
console.log(t.join("\n")),
|
||||||
|
this.logs = this.logs.concat(t)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
log(...t) {
|
||||||
|
t.length > 0 && (this.logs = [...this.logs, ...t]),
|
||||||
|
console.log(t.join(this.logSeparator))
|
||||||
|
}
|
||||||
|
logErr(t, e) {
|
||||||
|
const s = !this.isSurge() && !this.isQuanX() && !this.isLoon();
|
||||||
|
s ? this.log("", `❗️${this.name}, 错误!`, t.stack) : this.log("", `❗️${this.name}, 错误!`, t)
|
||||||
|
}
|
||||||
|
wait(t) {
|
||||||
|
return new Promise(e => setTimeout(e, t))
|
||||||
|
}
|
||||||
|
done(t = {}) {
|
||||||
|
const e = (new Date).getTime(),
|
||||||
|
s = (e - this.startTime) / 1e3;
|
||||||
|
this.log("", `🔔${this.name}, 结束! 🕛 ${s} 秒`),
|
||||||
|
this.log(),
|
||||||
|
(this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
(t, e)
|
||||||
|
}
|
|
@ -0,0 +1,531 @@
|
||||||
|
/*
|
||||||
|
cron "0 0 * * *" jd_CheckCkSeq.js, tag:CK顺序调试工具by-ccwav
|
||||||
|
*/
|
||||||
|
const $ = new Env("CK顺序调试工具");
|
||||||
|
const {
|
||||||
|
getEnvs
|
||||||
|
} = require('./ql');
|
||||||
|
const notify = $.isNode() ? require('./sendNotify') : '';
|
||||||
|
const jdCookieNode = $.isNode() ? require("./jdCookie.js") : "";
|
||||||
|
let cookiesArr = [];
|
||||||
|
if ($.isNode()) {
|
||||||
|
Object.keys(jdCookieNode).forEach((item) => {
|
||||||
|
cookiesArr.push(jdCookieNode[item])
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
let arrCkPtPin = [];
|
||||||
|
let arrEnvPtPin = [];
|
||||||
|
let arrEnvStatus = [];
|
||||||
|
let arrEnvOnebyOne = [];
|
||||||
|
let strCk = "";
|
||||||
|
let strNoFoundCk = "";
|
||||||
|
let strMessage = "";
|
||||||
|
|
||||||
|
const fs = require('fs');
|
||||||
|
let TempCKUid = [];
|
||||||
|
let strUidFile = '/ql/scripts/CK_WxPusherUid.json';
|
||||||
|
let UidFileexists = fs.existsSync(strUidFile);
|
||||||
|
if (UidFileexists) {
|
||||||
|
console.log("检测到一对一Uid文件WxPusherUid.json,载入...");
|
||||||
|
TempCKUid = fs.readFileSync(strUidFile, 'utf-8');
|
||||||
|
if (TempCKUid) {
|
||||||
|
TempCKUid = TempCKUid.toString();
|
||||||
|
TempCKUid = JSON.parse(TempCKUid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
!(async() => {
|
||||||
|
|
||||||
|
const envs = await getEnvs();
|
||||||
|
for (let i = 0; i < envs.length; i++) {
|
||||||
|
if (envs[i].value) {
|
||||||
|
var tempptpin = decodeURIComponent(envs[i].value.match(/pt_pin=([^; ]+)(?=;?)/) && envs[i].value.match(/pt_pin=([^; ]+)(?=;?)/)[1]);
|
||||||
|
arrEnvPtPin.push(tempptpin);
|
||||||
|
arrEnvStatus.push(envs[i].status);
|
||||||
|
var struuid=getuuid(envs[i].remarks,tempptpin)
|
||||||
|
arrEnvOnebyOne.push(struuid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let i = 0; i < cookiesArr.length; i++) {
|
||||||
|
if (cookiesArr[i]) {
|
||||||
|
cookie = cookiesArr[i];
|
||||||
|
var tempptpin = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1]);
|
||||||
|
var intSeq = inArray(tempptpin, arrEnvPtPin);
|
||||||
|
if (intSeq != -1) {
|
||||||
|
intSeq += 1;
|
||||||
|
arrCkPtPin.push(tempptpin);
|
||||||
|
strCk += "【"+intSeq + "】" + tempptpin ;
|
||||||
|
if (arrEnvOnebyOne[i]) {
|
||||||
|
strCk += "(账号已启用一对一推送)"
|
||||||
|
}
|
||||||
|
strCk +="\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let i = 0; i < arrEnvPtPin.length; i++) {
|
||||||
|
var tempptpin = arrEnvPtPin[i];
|
||||||
|
var intSeq = inArray(tempptpin, arrCkPtPin);
|
||||||
|
if (intSeq == -1) {
|
||||||
|
strNoFoundCk += "【"+(i + 1) + "】" + tempptpin;
|
||||||
|
if (arrEnvStatus[i] == 1) {
|
||||||
|
strNoFoundCk += "(状态已禁用)"
|
||||||
|
}
|
||||||
|
if (arrEnvOnebyOne[i]) {
|
||||||
|
strNoFoundCk += "(账号已启用一对一推送)"
|
||||||
|
}
|
||||||
|
strNoFoundCk +="\n";
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (strNoFoundCk) {
|
||||||
|
console.log("没有出现在今日CK队列中的账号: \n" + strNoFoundCk);
|
||||||
|
strMessage+="没有出现在今日CK队列中的账号: \n" + strNoFoundCk;
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log("\n今日执行任务的账号顺序: \n" + strCk);
|
||||||
|
strMessage+="\n今日执行任务的账号顺序: \n" + strCk;
|
||||||
|
|
||||||
|
if ($.isNode()) {
|
||||||
|
await notify.sendNotify(`${$.name}`, strMessage);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
})()
|
||||||
|
.catch((e) => $.logErr(e))
|
||||||
|
.finally(() => $.done());
|
||||||
|
|
||||||
|
function inArray(search, array) {
|
||||||
|
var lnSeq = -1;
|
||||||
|
for (var i in array) {
|
||||||
|
if (array[i] == search) {
|
||||||
|
lnSeq = i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return parseInt(lnSeq);
|
||||||
|
}
|
||||||
|
|
||||||
|
function getuuid(strRemark, PtPin) {
|
||||||
|
var strTempuuid = "";
|
||||||
|
if (strRemark) {
|
||||||
|
var Tempindex = strRemark.indexOf("@@");
|
||||||
|
if (Tempindex != -1) {
|
||||||
|
//console.log(PtPin + ": 检测到NVJDC的一对一格式,瑞思拜~!");
|
||||||
|
var TempRemarkList = strRemark.split("@@");
|
||||||
|
for (let j = 1; j < TempRemarkList.length; j++) {
|
||||||
|
if (TempRemarkList[j]) {
|
||||||
|
if (TempRemarkList[j].length > 4) {
|
||||||
|
if (TempRemarkList[j].substring(0, 4) == "UID_") {
|
||||||
|
strTempuuid = TempRemarkList[j];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!strTempuuid && TempCKUid) {
|
||||||
|
//console.log("正在从CK_WxPusherUid文件中检索资料...");
|
||||||
|
for (let j = 0; j < TempCKUid.length; j++) {
|
||||||
|
if (PtPin == decodeURIComponent(TempCKUid[j].pt_pin)) {
|
||||||
|
strTempuuid = TempCKUid[j].Uid;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return strTempuuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
// prettier-ignore
|
||||||
|
function Env(t, e) {
|
||||||
|
"undefined" != typeof process && JSON.stringify(process.env).indexOf("GITHUB") > -1 && process.exit(0);
|
||||||
|
class s {
|
||||||
|
constructor(t) {
|
||||||
|
this.env = t
|
||||||
|
}
|
||||||
|
send(t, e = "GET") {
|
||||||
|
t = "string" == typeof t ? {
|
||||||
|
url: t
|
||||||
|
}
|
||||||
|
: t;
|
||||||
|
let s = this.get;
|
||||||
|
return "POST" === e && (s = this.post),
|
||||||
|
new Promise((e, i) => {
|
||||||
|
s.call(this, t, (t, s, r) => {
|
||||||
|
t ? i(t) : e(s)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
get(t) {
|
||||||
|
return this.send.call(this.env, t)
|
||||||
|
}
|
||||||
|
post(t) {
|
||||||
|
return this.send.call(this.env, t, "POST")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return new class {
|
||||||
|
constructor(t, e) {
|
||||||
|
this.name = t,
|
||||||
|
this.http = new s(this),
|
||||||
|
this.data = null,
|
||||||
|
this.dataFile = "box.dat",
|
||||||
|
this.logs = [],
|
||||||
|
this.isMute = !1,
|
||||||
|
this.isNeedRewrite = !1,
|
||||||
|
this.logSeparator = "\n",
|
||||||
|
this.startTime = (new Date).getTime(),
|
||||||
|
Object.assign(this, e),
|
||||||
|
this.log("", `🔔${this.name}, 开始!`)
|
||||||
|
}
|
||||||
|
isNode() {
|
||||||
|
return "undefined" != typeof module && !!module.exports
|
||||||
|
}
|
||||||
|
isQuanX() {
|
||||||
|
return "undefined" != typeof $task
|
||||||
|
}
|
||||||
|
isSurge() {
|
||||||
|
return "undefined" != typeof $httpClient && "undefined" == typeof $loon
|
||||||
|
}
|
||||||
|
isLoon() {
|
||||||
|
return "undefined" != typeof $loon
|
||||||
|
}
|
||||||
|
toObj(t, e = null) {
|
||||||
|
try {
|
||||||
|
return JSON.parse(t)
|
||||||
|
} catch {
|
||||||
|
return e
|
||||||
|
}
|
||||||
|
}
|
||||||
|
toStr(t, e = null) {
|
||||||
|
try {
|
||||||
|
return JSON.stringify(t)
|
||||||
|
} catch {
|
||||||
|
return e
|
||||||
|
}
|
||||||
|
}
|
||||||
|
getjson(t, e) {
|
||||||
|
let s = e;
|
||||||
|
const i = this.getdata(t);
|
||||||
|
if (i)
|
||||||
|
try {
|
||||||
|
s = JSON.parse(this.getdata(t))
|
||||||
|
} catch {}
|
||||||
|
return s
|
||||||
|
}
|
||||||
|
setjson(t, e) {
|
||||||
|
try {
|
||||||
|
return this.setdata(JSON.stringify(t), e)
|
||||||
|
} catch {
|
||||||
|
return !1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
getScript(t) {
|
||||||
|
return new Promise(e => {
|
||||||
|
this.get({
|
||||||
|
url: t
|
||||||
|
}, (t, s, i) => e(i))
|
||||||
|
})
|
||||||
|
}
|
||||||
|
runScript(t, e) {
|
||||||
|
return new Promise(s => {
|
||||||
|
let i = this.getdata("@chavy_boxjs_userCfgs.httpapi");
|
||||||
|
i = i ? i.replace(/\n/g, "").trim() : i;
|
||||||
|
let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");
|
||||||
|
r = r ? 1 * r : 20,
|
||||||
|
r = e && e.timeout ? e.timeout : r;
|
||||||
|
const[o, h] = i.split("@"),
|
||||||
|
n = {
|
||||||
|
url: `http://${h}/v1/scripting/evaluate`,
|
||||||
|
body: {
|
||||||
|
script_text: t,
|
||||||
|
mock_type: "cron",
|
||||||
|
timeout: r
|
||||||
|
},
|
||||||
|
headers: {
|
||||||
|
"X-Key": o,
|
||||||
|
Accept: "*/*"
|
||||||
|
}
|
||||||
|
};
|
||||||
|
this.post(n, (t, e, i) => s(i))
|
||||||
|
}).catch(t => this.logErr(t))
|
||||||
|
}
|
||||||
|
loaddata() {
|
||||||
|
if (!this.isNode())
|
||||||
|
return {}; {
|
||||||
|
this.fs = this.fs ? this.fs : require("fs"),
|
||||||
|
this.path = this.path ? this.path : require("path");
|
||||||
|
const t = this.path.resolve(this.dataFile),
|
||||||
|
e = this.path.resolve(process.cwd(), this.dataFile),
|
||||||
|
s = this.fs.existsSync(t),
|
||||||
|
i = !s && this.fs.existsSync(e);
|
||||||
|
if (!s && !i)
|
||||||
|
return {}; {
|
||||||
|
const i = s ? t : e;
|
||||||
|
try {
|
||||||
|
return JSON.parse(this.fs.readFileSync(i))
|
||||||
|
} catch (t) {
|
||||||
|
return {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
writedata() {
|
||||||
|
if (this.isNode()) {
|
||||||
|
this.fs = this.fs ? this.fs : require("fs"),
|
||||||
|
this.path = this.path ? this.path : require("path");
|
||||||
|
const t = this.path.resolve(this.dataFile),
|
||||||
|
e = this.path.resolve(process.cwd(), this.dataFile),
|
||||||
|
s = this.fs.existsSync(t),
|
||||||
|
i = !s && this.fs.existsSync(e),
|
||||||
|
r = JSON.stringify(this.data);
|
||||||
|
s ? this.fs.writeFileSync(t, r) : i ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
lodash_get(t, e, s) {
|
||||||
|
const i = e.replace(/\[(\d+)\]/g, ".$1").split(".");
|
||||||
|
let r = t;
|
||||||
|
for (const t of i)
|
||||||
|
if (r = Object(r)[t], void 0 === r)
|
||||||
|
return s;
|
||||||
|
return r
|
||||||
|
}
|
||||||
|
lodash_set(t, e, s) {
|
||||||
|
return Object(t) !== t ? t : (Array.isArray(e) || (e = e.toString().match(/[^.[\]]+/g) || []), e.slice(0, -1).reduce((t, s, i) => Object(t[s]) === t[s] ? t[s] : t[s] = Math.abs(e[i + 1]) >> 0 == +e[i + 1] ? [] : {}, t)[e[e.length - 1]] = s, t)
|
||||||
|
}
|
||||||
|
getdata(t) {
|
||||||
|
let e = this.getval(t);
|
||||||
|
if (/^@/.test(t)) {
|
||||||
|
const[, s, i] = /^@(.*?)\.(.*?)$/.exec(t),
|
||||||
|
r = s ? this.getval(s) : "";
|
||||||
|
if (r)
|
||||||
|
try {
|
||||||
|
const t = JSON.parse(r);
|
||||||
|
e = t ? this.lodash_get(t, i, "") : e
|
||||||
|
} catch (t) {
|
||||||
|
e = ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return e
|
||||||
|
}
|
||||||
|
setdata(t, e) {
|
||||||
|
let s = !1;
|
||||||
|
if (/^@/.test(e)) {
|
||||||
|
const[, i, r] = /^@(.*?)\.(.*?)$/.exec(e),
|
||||||
|
o = this.getval(i),
|
||||||
|
h = i ? "null" === o ? null : o || "{}" : "{}";
|
||||||
|
try {
|
||||||
|
const e = JSON.parse(h);
|
||||||
|
this.lodash_set(e, r, t),
|
||||||
|
s = this.setval(JSON.stringify(e), i)
|
||||||
|
} catch (e) {
|
||||||
|
const o = {};
|
||||||
|
this.lodash_set(o, r, t),
|
||||||
|
s = this.setval(JSON.stringify(o), i)
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
s = this.setval(t, e);
|
||||||
|
return s
|
||||||
|
}
|
||||||
|
getval(t) {
|
||||||
|
return this.isSurge() || this.isLoon() ? $persistentStore.read(t) : this.isQuanX() ? $prefs.valueForKey(t) : this.isNode() ? (this.data = this.loaddata(), this.data[t]) : this.data && this.data[t] || null
|
||||||
|
}
|
||||||
|
setval(t, e) {
|
||||||
|
return this.isSurge() || this.isLoon() ? $persistentStore.write(t, e) : this.isQuanX() ? $prefs.setValueForKey(t, e) : this.isNode() ? (this.data = this.loaddata(), this.data[e] = t, this.writedata(), !0) : this.data && this.data[e] || null
|
||||||
|
}
|
||||||
|
initGotEnv(t) {
|
||||||
|
this.got = this.got ? this.got : require("got"),
|
||||||
|
this.cktough = this.cktough ? this.cktough : require("tough-cookie"),
|
||||||
|
this.ckjar = this.ckjar ? this.ckjar : new this.cktough.CookieJar,
|
||||||
|
t && (t.headers = t.headers ? t.headers : {}, void 0 === t.headers.Cookie && void 0 === t.cookieJar && (t.cookieJar = this.ckjar))
|
||||||
|
}
|
||||||
|
get(t, e = (() => {})) {
|
||||||
|
t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"]),
|
||||||
|
this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, {
|
||||||
|
"X-Surge-Skip-Scripting": !1
|
||||||
|
})), $httpClient.get(t, (t, s, i) => {
|
||||||
|
!t && s && (s.body = i, s.statusCode = s.status),
|
||||||
|
e(t, s, i)
|
||||||
|
})) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, {
|
||||||
|
hints: !1
|
||||||
|
})), $task.fetch(t).then(t => {
|
||||||
|
const {
|
||||||
|
statusCode: s,
|
||||||
|
statusCode: i,
|
||||||
|
headers: r,
|
||||||
|
body: o
|
||||||
|
} = t;
|
||||||
|
e(null, {
|
||||||
|
status: s,
|
||||||
|
statusCode: i,
|
||||||
|
headers: r,
|
||||||
|
body: o
|
||||||
|
}, o)
|
||||||
|
}, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => {
|
||||||
|
try {
|
||||||
|
if (t.headers["set-cookie"]) {
|
||||||
|
const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();
|
||||||
|
s && this.ckjar.setCookieSync(s, null),
|
||||||
|
e.cookieJar = this.ckjar
|
||||||
|
}
|
||||||
|
} catch (t) {
|
||||||
|
this.logErr(t)
|
||||||
|
}
|
||||||
|
}).then(t => {
|
||||||
|
const {
|
||||||
|
statusCode: s,
|
||||||
|
statusCode: i,
|
||||||
|
headers: r,
|
||||||
|
body: o
|
||||||
|
} = t;
|
||||||
|
e(null, {
|
||||||
|
status: s,
|
||||||
|
statusCode: i,
|
||||||
|
headers: r,
|
||||||
|
body: o
|
||||||
|
}, o)
|
||||||
|
}, t => {
|
||||||
|
const {
|
||||||
|
message: s,
|
||||||
|
response: i
|
||||||
|
} = t;
|
||||||
|
e(s, i, i && i.body)
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
post(t, e = (() => {})) {
|
||||||
|
if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon())
|
||||||
|
this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, {
|
||||||
|
"X-Surge-Skip-Scripting": !1
|
||||||
|
})), $httpClient.post(t, (t, s, i) => {
|
||||||
|
!t && s && (s.body = i, s.statusCode = s.status),
|
||||||
|
e(t, s, i)
|
||||||
|
});
|
||||||
|
else if (this.isQuanX())
|
||||||
|
t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, {
|
||||||
|
hints: !1
|
||||||
|
})), $task.fetch(t).then(t => {
|
||||||
|
const {
|
||||||
|
statusCode: s,
|
||||||
|
statusCode: i,
|
||||||
|
headers: r,
|
||||||
|
body: o
|
||||||
|
} = t;
|
||||||
|
e(null, {
|
||||||
|
status: s,
|
||||||
|
statusCode: i,
|
||||||
|
headers: r,
|
||||||
|
body: o
|
||||||
|
}, o)
|
||||||
|
}, t => e(t));
|
||||||
|
else if (this.isNode()) {
|
||||||
|
this.initGotEnv(t);
|
||||||
|
const {
|
||||||
|
url: s,
|
||||||
|
...i
|
||||||
|
} = t;
|
||||||
|
this.got.post(s, i).then(t => {
|
||||||
|
const {
|
||||||
|
statusCode: s,
|
||||||
|
statusCode: i,
|
||||||
|
headers: r,
|
||||||
|
body: o
|
||||||
|
} = t;
|
||||||
|
e(null, {
|
||||||
|
status: s,
|
||||||
|
statusCode: i,
|
||||||
|
headers: r,
|
||||||
|
body: o
|
||||||
|
}, o)
|
||||||
|
}, t => {
|
||||||
|
const {
|
||||||
|
message: s,
|
||||||
|
response: i
|
||||||
|
} = t;
|
||||||
|
e(s, i, i && i.body)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
time(t, e = null) {
|
||||||
|
const s = e ? new Date(e) : new Date;
|
||||||
|
let i = {
|
||||||
|
"M+": s.getMonth() + 1,
|
||||||
|
"d+": s.getDate(),
|
||||||
|
"H+": s.getHours(),
|
||||||
|
"m+": s.getMinutes(),
|
||||||
|
"s+": s.getSeconds(),
|
||||||
|
"q+": Math.floor((s.getMonth() + 3) / 3),
|
||||||
|
S: s.getMilliseconds()
|
||||||
|
};
|
||||||
|
/(y+)/.test(t) && (t = t.replace(RegExp.$1, (s.getFullYear() + "").substr(4 - RegExp.$1.length)));
|
||||||
|
for (let e in i)
|
||||||
|
new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? i[e] : ("00" + i[e]).substr(("" + i[e]).length)));
|
||||||
|
return t
|
||||||
|
}
|
||||||
|
msg(e = t, s = "", i = "", r) {
|
||||||
|
const o = t => {
|
||||||
|
if (!t)
|
||||||
|
return t;
|
||||||
|
if ("string" == typeof t)
|
||||||
|
return this.isLoon() ? t : this.isQuanX() ? {
|
||||||
|
"open-url": t
|
||||||
|
}
|
||||||
|
: this.isSurge() ? {
|
||||||
|
url: t
|
||||||
|
}
|
||||||
|
: void 0;
|
||||||
|
if ("object" == typeof t) {
|
||||||
|
if (this.isLoon()) {
|
||||||
|
let e = t.openUrl || t.url || t["open-url"],
|
||||||
|
s = t.mediaUrl || t["media-url"];
|
||||||
|
return {
|
||||||
|
openUrl: e,
|
||||||
|
mediaUrl: s
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (this.isQuanX()) {
|
||||||
|
let e = t["open-url"] || t.url || t.openUrl,
|
||||||
|
s = t["media-url"] || t.mediaUrl;
|
||||||
|
return {
|
||||||
|
"open-url": e,
|
||||||
|
"media-url": s
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (this.isSurge()) {
|
||||||
|
let e = t.url || t.openUrl || t["open-url"];
|
||||||
|
return {
|
||||||
|
url: e
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
if (this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))), !this.isMuteLog) {
|
||||||
|
let t = ["", "==============📣系统通知📣=============="];
|
||||||
|
t.push(e),
|
||||||
|
s && t.push(s),
|
||||||
|
i && t.push(i),
|
||||||
|
console.log(t.join("\n")),
|
||||||
|
this.logs = this.logs.concat(t)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
log(...t) {
|
||||||
|
t.length > 0 && (this.logs = [...this.logs, ...t]),
|
||||||
|
console.log(t.join(this.logSeparator))
|
||||||
|
}
|
||||||
|
logErr(t, e) {
|
||||||
|
const s = !this.isSurge() && !this.isQuanX() && !this.isLoon();
|
||||||
|
s ? this.log("", `❗️${this.name}, 错误!`, t.stack) : this.log("", `❗️${this.name}, 错误!`, t)
|
||||||
|
}
|
||||||
|
wait(t) {
|
||||||
|
return new Promise(e => setTimeout(e, t))
|
||||||
|
}
|
||||||
|
done(t = {}) {
|
||||||
|
const e = (new Date).getTime(),
|
||||||
|
s = (e - this.startTime) / 1e3;
|
||||||
|
this.log("", `🔔${this.name}, 结束! 🕛 ${s} 秒`),
|
||||||
|
this.log(),
|
||||||
|
(this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
(t, e)
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,521 @@
|
||||||
|
/*
|
||||||
|
cron "30 10 * * *" jd_UpdateUIDtoRemark.js, tag:Uid迁移工具
|
||||||
|
*/
|
||||||
|
|
||||||
|
const $ = new Env('WxPusherUid迁移工具');
|
||||||
|
const notify = $.isNode() ? require('./sendNotify') : '';
|
||||||
|
//Node.js用户请在jdCookie.js处填写京东ck;
|
||||||
|
const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
|
||||||
|
const got = require('got');
|
||||||
|
const {
|
||||||
|
getEnvs,
|
||||||
|
getEnvById,
|
||||||
|
DisableCk,
|
||||||
|
EnableCk,
|
||||||
|
updateEnv,
|
||||||
|
updateEnv11,
|
||||||
|
getstatus
|
||||||
|
} = require('./ql');
|
||||||
|
|
||||||
|
let strUidFile = '/ql/scripts/CK_WxPusherUid.json';
|
||||||
|
const fs = require('fs');
|
||||||
|
let UidFileexists = fs.existsSync(strUidFile);
|
||||||
|
let TempCKUid = [];
|
||||||
|
if (UidFileexists) {
|
||||||
|
console.log("检测到WxPusherUid文件,载入...");
|
||||||
|
TempCKUid = fs.readFileSync(strUidFile, 'utf-8');
|
||||||
|
if (TempCKUid) {
|
||||||
|
TempCKUid = TempCKUid.toString();
|
||||||
|
TempCKUid = JSON.parse(TempCKUid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
!(async() => {
|
||||||
|
const envs = await getEnvs();
|
||||||
|
if (!envs[0]) {
|
||||||
|
$.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', {
|
||||||
|
"open-url": "https://bean.m.jd.com/bean/signIndex.action"
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var struid = "";
|
||||||
|
var strRemark = "";
|
||||||
|
for (let i = 0; i < envs.length; i++) {
|
||||||
|
if (envs[i].value) {
|
||||||
|
var tempid = 0;
|
||||||
|
if(envs[i]._id)
|
||||||
|
tempid = envs[i]._id;
|
||||||
|
if(envs[i].id)
|
||||||
|
tempid = envs[i].id;
|
||||||
|
|
||||||
|
cookie = await getEnvById(tempid);
|
||||||
|
|
||||||
|
if(!cookie)
|
||||||
|
continue;
|
||||||
|
$.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1]);
|
||||||
|
$.index = i + 1;
|
||||||
|
console.log(`\n**********检测【京东账号${$.index}】${$.UserName}**********\n`);
|
||||||
|
strRemark = envs[i].remarks;
|
||||||
|
struid = getuuid(strRemark, $.UserName);
|
||||||
|
if (struid) {
|
||||||
|
//这是为了处理ninjia的remark格式
|
||||||
|
strRemark = strRemark.replace("remark=", "");
|
||||||
|
strRemark = strRemark.replace(";", "");
|
||||||
|
|
||||||
|
var Tempindex = strRemark.indexOf("@@");
|
||||||
|
if (Tempindex != -1) {
|
||||||
|
strRemark = strRemark + "@@" + struid;
|
||||||
|
} else {
|
||||||
|
var DateTimestamp = new Date(envs[i].timestamp);
|
||||||
|
strRemark = strRemark + "@@" + DateTimestamp.getTime() + "@@" + struid;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (envs[i]._id) {
|
||||||
|
var updateEnvBody = await updateEnv(cookie, envs[i]._id, strRemark);
|
||||||
|
|
||||||
|
if (updateEnvBody.code == 200)
|
||||||
|
console.log("更新Remark成功!");
|
||||||
|
else
|
||||||
|
console.log("更新Remark失败!");
|
||||||
|
}
|
||||||
|
if (envs[i].id) {
|
||||||
|
var updateEnvBody = await updateEnv11(cookie, envs[i].id, strRemark);
|
||||||
|
|
||||||
|
if (updateEnvBody.code == 200)
|
||||||
|
console.log("新版青龙更新Remark成功!");
|
||||||
|
else
|
||||||
|
console.log("新版青龙更新Remark失败!");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
})()
|
||||||
|
.catch((e) => $.logErr(e))
|
||||||
|
.finally(() => $.done())
|
||||||
|
|
||||||
|
function getuuid(strRemark, PtPin) {
|
||||||
|
var strTempuuid = "";
|
||||||
|
var strUid = "";
|
||||||
|
if (strRemark) {
|
||||||
|
var Tempindex = strRemark.indexOf("@@");
|
||||||
|
if (Tempindex != -1) {
|
||||||
|
var TempRemarkList = strRemark.split("@@");
|
||||||
|
for (let j = 1; j < TempRemarkList.length; j++) {
|
||||||
|
if (TempRemarkList[j]) {
|
||||||
|
if (TempRemarkList[j].length > 4) {
|
||||||
|
if (TempRemarkList[j].substring(0, 4) == "UID_") {
|
||||||
|
strTempuuid = TempRemarkList[j];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!strTempuuid && TempCKUid) {
|
||||||
|
console.log(`查询uid`);
|
||||||
|
for (let j = 0; j < TempCKUid.length; j++) {
|
||||||
|
if (PtPin == decodeURIComponent(TempCKUid[j].pt_pin)) {
|
||||||
|
strUid = TempCKUid[j].Uid;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log(`uid:`+strUid);
|
||||||
|
return strUid;
|
||||||
|
}
|
||||||
|
|
||||||
|
// prettier-ignore
|
||||||
|
function Env(t, e) {
|
||||||
|
"undefined" != typeof process && JSON.stringify(process.env).indexOf("GITHUB") > -1 && process.exit(0);
|
||||||
|
class s {
|
||||||
|
constructor(t) {
|
||||||
|
this.env = t
|
||||||
|
}
|
||||||
|
send(t, e = "GET") {
|
||||||
|
t = "string" == typeof t ? {
|
||||||
|
url: t
|
||||||
|
}
|
||||||
|
: t;
|
||||||
|
let s = this.get;
|
||||||
|
return "POST" === e && (s = this.post),
|
||||||
|
new Promise((e, i) => {
|
||||||
|
s.call(this, t, (t, s, r) => {
|
||||||
|
t ? i(t) : e(s)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
get(t) {
|
||||||
|
return this.send.call(this.env, t)
|
||||||
|
}
|
||||||
|
post(t) {
|
||||||
|
return this.send.call(this.env, t, "POST")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return new class {
|
||||||
|
constructor(t, e) {
|
||||||
|
this.name = t,
|
||||||
|
this.http = new s(this),
|
||||||
|
this.data = null,
|
||||||
|
this.dataFile = "box.dat",
|
||||||
|
this.logs = [],
|
||||||
|
this.isMute = !1,
|
||||||
|
this.isNeedRewrite = !1,
|
||||||
|
this.logSeparator = "\n",
|
||||||
|
this.startTime = (new Date).getTime(),
|
||||||
|
Object.assign(this, e),
|
||||||
|
this.log("", `🔔${this.name}, 开始!`)
|
||||||
|
}
|
||||||
|
isNode() {
|
||||||
|
return "undefined" != typeof module && !!module.exports
|
||||||
|
}
|
||||||
|
isQuanX() {
|
||||||
|
return "undefined" != typeof $task
|
||||||
|
}
|
||||||
|
isSurge() {
|
||||||
|
return "undefined" != typeof $httpClient && "undefined" == typeof $loon
|
||||||
|
}
|
||||||
|
isLoon() {
|
||||||
|
return "undefined" != typeof $loon
|
||||||
|
}
|
||||||
|
toObj(t, e = null) {
|
||||||
|
try {
|
||||||
|
return JSON.parse(t)
|
||||||
|
} catch {
|
||||||
|
return e
|
||||||
|
}
|
||||||
|
}
|
||||||
|
toStr(t, e = null) {
|
||||||
|
try {
|
||||||
|
return JSON.stringify(t)
|
||||||
|
} catch {
|
||||||
|
return e
|
||||||
|
}
|
||||||
|
}
|
||||||
|
getjson(t, e) {
|
||||||
|
let s = e;
|
||||||
|
const i = this.getdata(t);
|
||||||
|
if (i)
|
||||||
|
try {
|
||||||
|
s = JSON.parse(this.getdata(t))
|
||||||
|
} catch {}
|
||||||
|
return s
|
||||||
|
}
|
||||||
|
setjson(t, e) {
|
||||||
|
try {
|
||||||
|
return this.setdata(JSON.stringify(t), e)
|
||||||
|
} catch {
|
||||||
|
return !1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
getScript(t) {
|
||||||
|
return new Promise(e => {
|
||||||
|
this.get({
|
||||||
|
url: t
|
||||||
|
}, (t, s, i) => e(i))
|
||||||
|
})
|
||||||
|
}
|
||||||
|
runScript(t, e) {
|
||||||
|
return new Promise(s => {
|
||||||
|
let i = this.getdata("@chavy_boxjs_userCfgs.httpapi");
|
||||||
|
i = i ? i.replace(/\n/g, "").trim() : i;
|
||||||
|
let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");
|
||||||
|
r = r ? 1 * r : 20,
|
||||||
|
r = e && e.timeout ? e.timeout : r;
|
||||||
|
const[o, h] = i.split("@"),
|
||||||
|
n = {
|
||||||
|
url: `http://${h}/v1/scripting/evaluate`,
|
||||||
|
body: {
|
||||||
|
script_text: t,
|
||||||
|
mock_type: "cron",
|
||||||
|
timeout: r
|
||||||
|
},
|
||||||
|
headers: {
|
||||||
|
"X-Key": o,
|
||||||
|
Accept: "*/*"
|
||||||
|
}
|
||||||
|
};
|
||||||
|
this.post(n, (t, e, i) => s(i))
|
||||||
|
}).catch(t => this.logErr(t))
|
||||||
|
}
|
||||||
|
loaddata() {
|
||||||
|
if (!this.isNode())
|
||||||
|
return {}; {
|
||||||
|
this.fs = this.fs ? this.fs : require("fs"),
|
||||||
|
this.path = this.path ? this.path : require("path");
|
||||||
|
const t = this.path.resolve(this.dataFile),
|
||||||
|
e = this.path.resolve(process.cwd(), this.dataFile),
|
||||||
|
s = this.fs.existsSync(t),
|
||||||
|
i = !s && this.fs.existsSync(e);
|
||||||
|
if (!s && !i)
|
||||||
|
return {}; {
|
||||||
|
const i = s ? t : e;
|
||||||
|
try {
|
||||||
|
return JSON.parse(this.fs.readFileSync(i))
|
||||||
|
} catch (t) {
|
||||||
|
return {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
writedata() {
|
||||||
|
if (this.isNode()) {
|
||||||
|
this.fs = this.fs ? this.fs : require("fs"),
|
||||||
|
this.path = this.path ? this.path : require("path");
|
||||||
|
const t = this.path.resolve(this.dataFile),
|
||||||
|
e = this.path.resolve(process.cwd(), this.dataFile),
|
||||||
|
s = this.fs.existsSync(t),
|
||||||
|
i = !s && this.fs.existsSync(e),
|
||||||
|
r = JSON.stringify(this.data);
|
||||||
|
s ? this.fs.writeFileSync(t, r) : i ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
lodash_get(t, e, s) {
|
||||||
|
const i = e.replace(/\[(\d+)\]/g, ".$1").split(".");
|
||||||
|
let r = t;
|
||||||
|
for (const t of i)
|
||||||
|
if (r = Object(r)[t], void 0 === r)
|
||||||
|
return s;
|
||||||
|
return r
|
||||||
|
}
|
||||||
|
lodash_set(t, e, s) {
|
||||||
|
return Object(t) !== t ? t : (Array.isArray(e) || (e = e.toString().match(/[^.[\]]+/g) || []), e.slice(0, -1).reduce((t, s, i) => Object(t[s]) === t[s] ? t[s] : t[s] = Math.abs(e[i + 1]) >> 0 == +e[i + 1] ? [] : {}, t)[e[e.length - 1]] = s, t)
|
||||||
|
}
|
||||||
|
getdata(t) {
|
||||||
|
let e = this.getval(t);
|
||||||
|
if (/^@/.test(t)) {
|
||||||
|
const[, s, i] = /^@(.*?)\.(.*?)$/.exec(t),
|
||||||
|
r = s ? this.getval(s) : "";
|
||||||
|
if (r)
|
||||||
|
try {
|
||||||
|
const t = JSON.parse(r);
|
||||||
|
e = t ? this.lodash_get(t, i, "") : e
|
||||||
|
} catch (t) {
|
||||||
|
e = ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return e
|
||||||
|
}
|
||||||
|
setdata(t, e) {
|
||||||
|
let s = !1;
|
||||||
|
if (/^@/.test(e)) {
|
||||||
|
const[, i, r] = /^@(.*?)\.(.*?)$/.exec(e),
|
||||||
|
o = this.getval(i),
|
||||||
|
h = i ? "null" === o ? null : o || "{}" : "{}";
|
||||||
|
try {
|
||||||
|
const e = JSON.parse(h);
|
||||||
|
this.lodash_set(e, r, t),
|
||||||
|
s = this.setval(JSON.stringify(e), i)
|
||||||
|
} catch (e) {
|
||||||
|
const o = {};
|
||||||
|
this.lodash_set(o, r, t),
|
||||||
|
s = this.setval(JSON.stringify(o), i)
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
s = this.setval(t, e);
|
||||||
|
return s
|
||||||
|
}
|
||||||
|
getval(t) {
|
||||||
|
return this.isSurge() || this.isLoon() ? $persistentStore.read(t) : this.isQuanX() ? $prefs.valueForKey(t) : this.isNode() ? (this.data = this.loaddata(), this.data[t]) : this.data && this.data[t] || null
|
||||||
|
}
|
||||||
|
setval(t, e) {
|
||||||
|
return this.isSurge() || this.isLoon() ? $persistentStore.write(t, e) : this.isQuanX() ? $prefs.setValueForKey(t, e) : this.isNode() ? (this.data = this.loaddata(), this.data[e] = t, this.writedata(), !0) : this.data && this.data[e] || null
|
||||||
|
}
|
||||||
|
initGotEnv(t) {
|
||||||
|
this.got = this.got ? this.got : require("got"),
|
||||||
|
this.cktough = this.cktough ? this.cktough : require("tough-cookie"),
|
||||||
|
this.ckjar = this.ckjar ? this.ckjar : new this.cktough.CookieJar,
|
||||||
|
t && (t.headers = t.headers ? t.headers : {}, void 0 === t.headers.Cookie && void 0 === t.cookieJar && (t.cookieJar = this.ckjar))
|
||||||
|
}
|
||||||
|
get(t, e = (() => {})) {
|
||||||
|
t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"]),
|
||||||
|
this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, {
|
||||||
|
"X-Surge-Skip-Scripting": !1
|
||||||
|
})), $httpClient.get(t, (t, s, i) => {
|
||||||
|
!t && s && (s.body = i, s.statusCode = s.status),
|
||||||
|
e(t, s, i)
|
||||||
|
})) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, {
|
||||||
|
hints: !1
|
||||||
|
})), $task.fetch(t).then(t => {
|
||||||
|
const {
|
||||||
|
statusCode: s,
|
||||||
|
statusCode: i,
|
||||||
|
headers: r,
|
||||||
|
body: o
|
||||||
|
} = t;
|
||||||
|
e(null, {
|
||||||
|
status: s,
|
||||||
|
statusCode: i,
|
||||||
|
headers: r,
|
||||||
|
body: o
|
||||||
|
}, o)
|
||||||
|
}, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => {
|
||||||
|
try {
|
||||||
|
if (t.headers["set-cookie"]) {
|
||||||
|
const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();
|
||||||
|
s && this.ckjar.setCookieSync(s, null),
|
||||||
|
e.cookieJar = this.ckjar
|
||||||
|
}
|
||||||
|
} catch (t) {
|
||||||
|
this.logErr(t)
|
||||||
|
}
|
||||||
|
}).then(t => {
|
||||||
|
const {
|
||||||
|
statusCode: s,
|
||||||
|
statusCode: i,
|
||||||
|
headers: r,
|
||||||
|
body: o
|
||||||
|
} = t;
|
||||||
|
e(null, {
|
||||||
|
status: s,
|
||||||
|
statusCode: i,
|
||||||
|
headers: r,
|
||||||
|
body: o
|
||||||
|
}, o)
|
||||||
|
}, t => {
|
||||||
|
const {
|
||||||
|
message: s,
|
||||||
|
response: i
|
||||||
|
} = t;
|
||||||
|
e(s, i, i && i.body)
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
post(t, e = (() => {})) {
|
||||||
|
if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon())
|
||||||
|
this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, {
|
||||||
|
"X-Surge-Skip-Scripting": !1
|
||||||
|
})), $httpClient.post(t, (t, s, i) => {
|
||||||
|
!t && s && (s.body = i, s.statusCode = s.status),
|
||||||
|
e(t, s, i)
|
||||||
|
});
|
||||||
|
else if (this.isQuanX())
|
||||||
|
t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, {
|
||||||
|
hints: !1
|
||||||
|
})), $task.fetch(t).then(t => {
|
||||||
|
const {
|
||||||
|
statusCode: s,
|
||||||
|
statusCode: i,
|
||||||
|
headers: r,
|
||||||
|
body: o
|
||||||
|
} = t;
|
||||||
|
e(null, {
|
||||||
|
status: s,
|
||||||
|
statusCode: i,
|
||||||
|
headers: r,
|
||||||
|
body: o
|
||||||
|
}, o)
|
||||||
|
}, t => e(t));
|
||||||
|
else if (this.isNode()) {
|
||||||
|
this.initGotEnv(t);
|
||||||
|
const {
|
||||||
|
url: s,
|
||||||
|
...i
|
||||||
|
} = t;
|
||||||
|
this.got.post(s, i).then(t => {
|
||||||
|
const {
|
||||||
|
statusCode: s,
|
||||||
|
statusCode: i,
|
||||||
|
headers: r,
|
||||||
|
body: o
|
||||||
|
} = t;
|
||||||
|
e(null, {
|
||||||
|
status: s,
|
||||||
|
statusCode: i,
|
||||||
|
headers: r,
|
||||||
|
body: o
|
||||||
|
}, o)
|
||||||
|
}, t => {
|
||||||
|
const {
|
||||||
|
message: s,
|
||||||
|
response: i
|
||||||
|
} = t;
|
||||||
|
e(s, i, i && i.body)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
time(t, e = null) {
|
||||||
|
const s = e ? new Date(e) : new Date;
|
||||||
|
let i = {
|
||||||
|
"M+": s.getMonth() + 1,
|
||||||
|
"d+": s.getDate(),
|
||||||
|
"H+": s.getHours(),
|
||||||
|
"m+": s.getMinutes(),
|
||||||
|
"s+": s.getSeconds(),
|
||||||
|
"q+": Math.floor((s.getMonth() + 3) / 3),
|
||||||
|
S: s.getMilliseconds()
|
||||||
|
};
|
||||||
|
/(y+)/.test(t) && (t = t.replace(RegExp.$1, (s.getFullYear() + "").substr(4 - RegExp.$1.length)));
|
||||||
|
for (let e in i)
|
||||||
|
new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? i[e] : ("00" + i[e]).substr(("" + i[e]).length)));
|
||||||
|
return t
|
||||||
|
}
|
||||||
|
msg(e = t, s = "", i = "", r) {
|
||||||
|
const o = t => {
|
||||||
|
if (!t)
|
||||||
|
return t;
|
||||||
|
if ("string" == typeof t)
|
||||||
|
return this.isLoon() ? t : this.isQuanX() ? {
|
||||||
|
"open-url": t
|
||||||
|
}
|
||||||
|
: this.isSurge() ? {
|
||||||
|
url: t
|
||||||
|
}
|
||||||
|
: void 0;
|
||||||
|
if ("object" == typeof t) {
|
||||||
|
if (this.isLoon()) {
|
||||||
|
let e = t.openUrl || t.url || t["open-url"],
|
||||||
|
s = t.mediaUrl || t["media-url"];
|
||||||
|
return {
|
||||||
|
openUrl: e,
|
||||||
|
mediaUrl: s
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (this.isQuanX()) {
|
||||||
|
let e = t["open-url"] || t.url || t.openUrl,
|
||||||
|
s = t["media-url"] || t.mediaUrl;
|
||||||
|
return {
|
||||||
|
"open-url": e,
|
||||||
|
"media-url": s
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (this.isSurge()) {
|
||||||
|
let e = t.url || t.openUrl || t["open-url"];
|
||||||
|
return {
|
||||||
|
url: e
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
if (this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))), !this.isMuteLog) {
|
||||||
|
let t = ["", "==============📣系统通知📣=============="];
|
||||||
|
t.push(e),
|
||||||
|
s && t.push(s),
|
||||||
|
i && t.push(i),
|
||||||
|
console.log(t.join("\n")),
|
||||||
|
this.logs = this.logs.concat(t)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
log(...t) {
|
||||||
|
t.length > 0 && (this.logs = [...this.logs, ...t]),
|
||||||
|
console.log(t.join(this.logSeparator))
|
||||||
|
}
|
||||||
|
logErr(t, e) {
|
||||||
|
const s = !this.isSurge() && !this.isQuanX() && !this.isLoon();
|
||||||
|
s ? this.log("", `❗️${this.name}, 错误!`, t.stack) : this.log("", `❗️${this.name}, 错误!`, t)
|
||||||
|
}
|
||||||
|
wait(t) {
|
||||||
|
return new Promise(e => setTimeout(e, t))
|
||||||
|
}
|
||||||
|
done(t = {}) {
|
||||||
|
const e = (new Date).getTime(),
|
||||||
|
s = (e - this.startTime) / 1e3;
|
||||||
|
this.log("", `🔔${this.name}, 结束! 🕛 ${s} 秒`),
|
||||||
|
this.log(),
|
||||||
|
(this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
(t, e)
|
||||||
|
}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,218 @@
|
||||||
|
# -*- coding:utf-8 -*-
|
||||||
|
#pip install PyExecJS
|
||||||
|
|
||||||
|
|
||||||
|
"""
|
||||||
|
cron: 23 10 * * *
|
||||||
|
new Env('京东金融天天试手气');
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
import requests
|
||||||
|
import json
|
||||||
|
import time
|
||||||
|
import os
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
import random
|
||||||
|
import string
|
||||||
|
import urllib
|
||||||
|
|
||||||
|
try:
|
||||||
|
import execjs
|
||||||
|
except:
|
||||||
|
print('缺少依赖文件PyExecJS,请先去Python3安装PyExecJS后再执行')
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
|
def printf(text):
|
||||||
|
print(text)
|
||||||
|
sys.stdout.flush()
|
||||||
|
|
||||||
|
def load_send():
|
||||||
|
global send
|
||||||
|
cur_path = os.path.abspath(os.path.dirname(__file__))
|
||||||
|
sys.path.append(cur_path)
|
||||||
|
if os.path.exists(cur_path + "/sendNotify.py"):
|
||||||
|
try:
|
||||||
|
from sendNotify import send
|
||||||
|
except:
|
||||||
|
send=False
|
||||||
|
printf("加载通知服务失败~")
|
||||||
|
else:
|
||||||
|
send=False
|
||||||
|
printf("加载通知服务失败~")
|
||||||
|
load_send()
|
||||||
|
|
||||||
|
def get_remarkinfo():
|
||||||
|
url='http://127.0.0.1:5600/api/envs'
|
||||||
|
try:
|
||||||
|
with open('/ql/config/auth.json', 'r') as f:
|
||||||
|
token=json.loads(f.read())['token']
|
||||||
|
headers={
|
||||||
|
'Accept':'application/json',
|
||||||
|
'authorization':'Bearer '+token,
|
||||||
|
}
|
||||||
|
response=requests.get(url=url,headers=headers)
|
||||||
|
|
||||||
|
for i in range(len(json.loads(response.text)['data'])):
|
||||||
|
if json.loads(response.text)['data'][i]['name']=='JD_COOKIE':
|
||||||
|
try:
|
||||||
|
if json.loads(response.text)['data'][i]['remarks'].find('@@')==-1:
|
||||||
|
remarkinfos[json.loads(response.text)['data'][i]['value'].split(';')[1].replace('pt_pin=','')]=json.loads(response.text)['data'][i]['remarks'].replace('remark=','')
|
||||||
|
else:
|
||||||
|
remarkinfos[json.loads(response.text)['data'][i]['value'].split(';')[1].replace('pt_pin=','')]=json.loads(response.text)['data'][i]['remarks'].split("@@")[0].replace('remark=','').replace(';','')
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
except:
|
||||||
|
printf('读取auth.json文件出错,跳过获取备注')
|
||||||
|
|
||||||
|
def randomuserAgent():
|
||||||
|
global uuid,addressid,iosVer,iosV,clientVersion,iPhone,area,ADID,lng,lat
|
||||||
|
uuid=''.join(random.sample(['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9','a','b','c','z'], 40))
|
||||||
|
addressid = ''.join(random.sample('1234567898647', 10))
|
||||||
|
iosVer = ''.join(random.sample(["15.1.1","14.5.1", "14.4", "14.3", "14.2", "14.1", "14.0.1"], 1))
|
||||||
|
iosV = iosVer.replace('.', '_')
|
||||||
|
clientVersion=''.join(random.sample(["10.3.0", "10.2.7", "10.2.4"], 1))
|
||||||
|
iPhone = ''.join(random.sample(["8", "9", "10", "11", "12", "13"], 1))
|
||||||
|
area=''.join(random.sample('0123456789', 2)) + '_' + ''.join(random.sample('0123456789', 4)) + '_' + ''.join(random.sample('0123456789', 5)) + '_' + ''.join(random.sample('0123456789', 4))
|
||||||
|
ADID = ''.join(random.sample('0987654321ABCDEF', 8)) + '-' + ''.join(random.sample('0987654321ABCDEF', 4)) + '-' + ''.join(random.sample('0987654321ABCDEF', 4)) + '-' + ''.join(random.sample('0987654321ABCDEF', 4)) + '-' + ''.join(random.sample('0987654321ABCDEF', 12))
|
||||||
|
lng='119.31991256596'+str(random.randint(100,999))
|
||||||
|
lat='26.1187118976'+str(random.randint(100,999))
|
||||||
|
UserAgent=''
|
||||||
|
if not UserAgent:
|
||||||
|
return f'jdapp;iPhone;10.0.4;{iosVer};{uuid};network/wifi;ADID/{ADID};model/iPhone{iPhone},1;addressid/{addressid};appBuild/167707;jdSupportDarkMode/0;Mozilla/5.0 (iPhone; CPU iPhone OS {iosV} like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/null;supportJDSHWK/1'
|
||||||
|
else:
|
||||||
|
return UserAgent
|
||||||
|
|
||||||
|
def JDSignValidator(url):
|
||||||
|
with open('JDSignValidator.js', 'r', encoding='utf-8') as f:
|
||||||
|
jstext = f.read()
|
||||||
|
js = execjs.compile(jstext)
|
||||||
|
result = js.call('getBody', url)
|
||||||
|
fp=result['fp']
|
||||||
|
a=result['a']
|
||||||
|
d=result['d']
|
||||||
|
return fp,a,d
|
||||||
|
|
||||||
|
|
||||||
|
def geteid(a,d):
|
||||||
|
url=f'https://gia.jd.com/fcf.html?a={a}'
|
||||||
|
data=f'&d={d}'
|
||||||
|
headers={
|
||||||
|
'Host':'gia.jd.com',
|
||||||
|
'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8',
|
||||||
|
'Origin':'https://jrmkt.jd.com',
|
||||||
|
'Accept-Encoding':'gzip, deflate, br',
|
||||||
|
'Connection':'keep-alive',
|
||||||
|
'Accept':'*/*',
|
||||||
|
'User-Agent':UserAgent,
|
||||||
|
'Referer':'https://jrmkt.jd.com/',
|
||||||
|
'Content-Length':'376',
|
||||||
|
'Accept-Language':'zh-CN,zh-Hans;q=0.9',
|
||||||
|
}
|
||||||
|
response=requests.post(url=url,headers=headers,data=data)
|
||||||
|
return response.text
|
||||||
|
|
||||||
|
def getactivityid(ck):
|
||||||
|
homepageurl='https://ms.jr.jd.com/gw/generic/bt/h5/m/btJrFirstScreen'
|
||||||
|
data='reqData={"environment":"2","clientType":"ios","clientVersion":"6.2.60"}'
|
||||||
|
try:
|
||||||
|
headers={
|
||||||
|
'Host':'ms.jr.jd.com',
|
||||||
|
'Content-Type':'application/x-www-form-urlencoded',
|
||||||
|
'Origin':'https://mcr.jd.com',
|
||||||
|
'Accept-Encoding':'gzip, deflate, br',
|
||||||
|
'Cookie':ck,
|
||||||
|
'Connection':'keep-alive',
|
||||||
|
'Accept':'application/json, text/plain, */*',
|
||||||
|
'User-Agent':UserAgent,
|
||||||
|
'Referer':'https://mcr.jd.com/',
|
||||||
|
'Content-Length':'71',
|
||||||
|
'Accept-Language':'zh-CN,zh-Hans;q=0.9'
|
||||||
|
}
|
||||||
|
homepageresponse=requests.post(url=homepageurl,headers=headers,data=data)
|
||||||
|
for i in range(len(json.loads(homepageresponse.text)['resultData']['data']['activity']['data']['couponsRight'])):
|
||||||
|
if json.loads(homepageresponse.text)['resultData']['data']['activity']['data']['couponsRight'][i]['resName'].find('天天试手气')!=-1:
|
||||||
|
activityurl=json.loads(homepageresponse.text)['resultData']['data']['activity']['data']['couponsRight'][i]['jumpUrl']['jumpUrl']+'&jrcontainer=h5&jrlogin=true&jrcloseweb=false'
|
||||||
|
break
|
||||||
|
htmlheaders={
|
||||||
|
'accept':'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
|
||||||
|
'user-agent':UserAgent,
|
||||||
|
'accept-language':'zh-CN,zh-Hans;q=0.9',
|
||||||
|
'accept-encoding':'gzip, deflate, br'
|
||||||
|
}
|
||||||
|
activityhtml=requests.get(url=activityurl,headers=htmlheaders)
|
||||||
|
activityid=re.search(r"activityId=.{28}",activityhtml.text,re.M|re.I).group().replace('activityId=','')
|
||||||
|
print('活动id:'+activityid)
|
||||||
|
return activityid
|
||||||
|
except:
|
||||||
|
printf('获取活动id失败,程序即将退出')
|
||||||
|
os._exit(0)
|
||||||
|
def draw(activityid,eid,fp):
|
||||||
|
global sendNotifyflag
|
||||||
|
global prizeAward
|
||||||
|
sendNotifyflag=False
|
||||||
|
prizeAward=0
|
||||||
|
url='https://jrmkt.jd.com/activity/newPageTake/takePrize'
|
||||||
|
data=f'activityId={activityid}&eid={eid}&fp={fp}'
|
||||||
|
headers={
|
||||||
|
'Host':'jrmkt.jd.com',
|
||||||
|
'Accept':'application/json, text/javascript, */*; q=0.01',
|
||||||
|
'X-Requested-With':'XMLHttpRequest',
|
||||||
|
'Accept-Language':'zh-CN,zh-Hans;q=0.9',
|
||||||
|
'Accept-Encoding':'gzip, deflate, br',
|
||||||
|
'Content-Type':'application/x-www-form-urlencoded; charset=UTF-8',
|
||||||
|
'Origin':'https://jrmkt.jd.com',
|
||||||
|
'User-Agent':UserAgent,
|
||||||
|
'Connection':'keep-alive',
|
||||||
|
'Referer':'https://ms.jr.jd.com/gw/generic/bt/h5/m/btJrFirstScreen',
|
||||||
|
'Content-Length':str(len(data)),
|
||||||
|
'Cookie':ck
|
||||||
|
}
|
||||||
|
response=requests.post(url=url,headers=headers,data=data)
|
||||||
|
try:
|
||||||
|
if json.loads(response.text)['prizeModels'][0]['prizeAward'].find('元')!=-1:
|
||||||
|
printf('获得'+json.loads(response.text)['prizeModels'][0]['useLimit']+'的'+json.loads(response.text)['prizeModels'][0]['prizeName']+'\n金额:'+json.loads(response.text)['prizeModels'][0]['prizeAward']+'\n有效期:'+json.loads(response.text)['prizeModels'][0]['validTime']+'\n\n')
|
||||||
|
if int((json.loads(response.text)['prizeModels'][0]['prizeAward']).replace('.00元',''))>=5:
|
||||||
|
prizeAward=json.loads(response.text)['prizeModels'][0]['prizeAward']
|
||||||
|
sendNotifyflag=True
|
||||||
|
if json.loads(response.text)['prizeModels'][0]['prizeAward'].find('期')!=-1:
|
||||||
|
printf(response.text)
|
||||||
|
send('抽到白条分期券','去看日志')
|
||||||
|
except:
|
||||||
|
printf('出错啦,出错原因为:'+json.loads(response.text)['failDesc']+'\n\n')
|
||||||
|
|
||||||
|
time.sleep(5)
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
printf('游戏入口:京东金融-白条-天天试手气\n')
|
||||||
|
remarkinfos={}
|
||||||
|
get_remarkinfo()
|
||||||
|
UserAgent=randomuserAgent()
|
||||||
|
try:
|
||||||
|
cks = os.environ["JD_COOKIE"].split("&")
|
||||||
|
UserAgent=randomuserAgent()
|
||||||
|
activityid=getactivityid(cks[0])
|
||||||
|
except:
|
||||||
|
f = open("/jd/config/config.sh", "r", encoding='utf-8')
|
||||||
|
cks = re.findall(r'Cookie[0-9]*="(pt_key=.*?;pt_pin=.*?;)"', f.read())
|
||||||
|
f.close()
|
||||||
|
for ck in cks:
|
||||||
|
ptpin = re.findall(r"pt_pin=(.*?);", ck)[0]
|
||||||
|
try:
|
||||||
|
if remarkinfos[ptpin]!='':
|
||||||
|
printf("--账号:" + remarkinfos[ptpin] + "--")
|
||||||
|
username=remarkinfos[ptpin]
|
||||||
|
else:
|
||||||
|
printf("--无备注账号:" + urllib.parse.unquote(ptpin) + "--")
|
||||||
|
username=urllib.parse.unquote(ptpin)
|
||||||
|
except:
|
||||||
|
printf("--账号:" + urllib.parse.unquote(ptpin) + "--")
|
||||||
|
username=urllib.parse.unquote(ptpin)
|
||||||
|
UserAgent=randomuserAgent()
|
||||||
|
info=JDSignValidator('https://prodev.m.jd.com/mall/active/498THTs5KGNqK5nEaingGsKEi6Ao/index.html')
|
||||||
|
eid=json.loads(geteid(info[1],info[2]).split('_*')[1])['eid']
|
||||||
|
fp=info[0]
|
||||||
|
draw(activityid,eid,fp)
|
||||||
|
if sendNotifyflag:
|
||||||
|
send('京东白条抽奖通知',username+'抽到'+str(prizeAward)+'的优惠券了,速去京东金融-白条-天天试手气查看')
|
|
@ -0,0 +1,266 @@
|
||||||
|
# -*- coding:utf-8 -*-
|
||||||
|
#依赖管理-Python3-添加依赖PyExecJS
|
||||||
|
#想拿券的cookie环境变量JDJR_COOKIE,格式就是普通的cookie格式(pt_key=xxx;pt_pin=xxx)
|
||||||
|
#活动每天早上10点开始截止到这个月28号,建议corn 5 0 10 * * *
|
||||||
|
import execjs
|
||||||
|
import requests
|
||||||
|
import json
|
||||||
|
import time
|
||||||
|
import os
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
import random
|
||||||
|
import string
|
||||||
|
import urllib
|
||||||
|
from urllib.parse import quote
|
||||||
|
|
||||||
|
|
||||||
|
#以下部分参考Curtin的脚本:https://github.com/curtinlv/JD-Script
|
||||||
|
|
||||||
|
|
||||||
|
def randomuserAgent():
|
||||||
|
global uuid,addressid,iosVer,iosV,clientVersion,iPhone,ADID,area,lng,lat
|
||||||
|
|
||||||
|
uuid=''.join(random.sample(['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9','a','b','c','z'], 40))
|
||||||
|
addressid = ''.join(random.sample('1234567898647', 10))
|
||||||
|
iosVer = ''.join(random.sample(["15.1.1","14.5.1", "14.4", "14.3", "14.2", "14.1", "14.0.1"], 1))
|
||||||
|
iosV = iosVer.replace('.', '_')
|
||||||
|
clientVersion=''.join(random.sample(["10.3.0", "10.2.7", "10.2.4"], 1))
|
||||||
|
iPhone = ''.join(random.sample(["8", "9", "10", "11", "12", "13"], 1))
|
||||||
|
ADID = ''.join(random.sample('0987654321ABCDEF', 8)) + '-' + ''.join(random.sample('0987654321ABCDEF', 4)) + '-' + ''.join(random.sample('0987654321ABCDEF', 4)) + '-' + ''.join(random.sample('0987654321ABCDEF', 4)) + '-' + ''.join(random.sample('0987654321ABCDEF', 12))
|
||||||
|
|
||||||
|
|
||||||
|
area=''.join(random.sample('0123456789', 2)) + '_' + ''.join(random.sample('0123456789', 4)) + '_' + ''.join(random.sample('0123456789', 5)) + '_' + ''.join(random.sample('0123456789', 4))
|
||||||
|
lng='119.31991256596'+str(random.randint(100,999))
|
||||||
|
lat='26.1187118976'+str(random.randint(100,999))
|
||||||
|
|
||||||
|
|
||||||
|
UserAgent=''
|
||||||
|
if not UserAgent:
|
||||||
|
return f'jdapp;iPhone;10.0.4;{iosVer};{uuid};network/wifi;ADID/{ADID};model/iPhone{iPhone},1;addressid/{addressid};appBuild/167707;jdSupportDarkMode/0;Mozilla/5.0 (iPhone; CPU iPhone OS {iosV} like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/null;supportJDSHWK/1'
|
||||||
|
else:
|
||||||
|
return UserAgent
|
||||||
|
|
||||||
|
#以上部分参考Curtin的脚本:https://github.com/curtinlv/JD-Script
|
||||||
|
|
||||||
|
|
||||||
|
def printf(text):
|
||||||
|
print(text+'\n')
|
||||||
|
sys.stdout.flush()
|
||||||
|
|
||||||
|
|
||||||
|
def load_send():
|
||||||
|
global send
|
||||||
|
cur_path = os.path.abspath(os.path.dirname(__file__))
|
||||||
|
sys.path.append(cur_path)
|
||||||
|
if os.path.exists(cur_path + "/sendNotify.py"):
|
||||||
|
try:
|
||||||
|
from sendNotify import send
|
||||||
|
except:
|
||||||
|
send=False
|
||||||
|
printf("加载通知服务失败~")
|
||||||
|
else:
|
||||||
|
send=False
|
||||||
|
printf("加载通知服务失败~")
|
||||||
|
load_send()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def get_remarkinfo():
|
||||||
|
url='http://127.0.0.1:5600/api/envs'
|
||||||
|
try:
|
||||||
|
with open('/ql/config/auth.json', 'r') as f:
|
||||||
|
token=json.loads(f.read())['token']
|
||||||
|
headers={
|
||||||
|
'Accept':'application/json',
|
||||||
|
'authorization':'Bearer '+token,
|
||||||
|
}
|
||||||
|
response=requests.get(url=url,headers=headers)
|
||||||
|
|
||||||
|
for i in range(len(json.loads(response.text)['data'])):
|
||||||
|
if json.loads(response.text)['data'][i]['name']=='JD_COOKIE':
|
||||||
|
try:
|
||||||
|
if json.loads(response.text)['data'][i]['remarks'].find('@@')==-1:
|
||||||
|
remarkinfos[json.loads(response.text)['data'][i]['value'].split(';')[1].replace('pt_pin=','')]=json.loads(response.text)['data'][i]['remarks'].replace('remark=','')
|
||||||
|
else:
|
||||||
|
remarkinfos[json.loads(response.text)['data'][i]['value'].split(';')[1].replace('pt_pin=','')]=json.loads(response.text)['data'][i]['remarks'].split("@@")[0].replace('remark=','').replace(';','')
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
except:
|
||||||
|
printf('读取auth.json文件出错,跳过获取备注')
|
||||||
|
|
||||||
|
|
||||||
|
def JDSignValidator(url):
|
||||||
|
with open('JDSignValidator.js', 'r', encoding='utf-8') as f:
|
||||||
|
jstext = f.read()
|
||||||
|
ctx = execjs.compile(jstext)
|
||||||
|
result = ctx.call('getBody', url)
|
||||||
|
fp=result['fp']
|
||||||
|
a=result['a']
|
||||||
|
d=result['d']
|
||||||
|
return fp,a,d
|
||||||
|
|
||||||
|
|
||||||
|
def geteid(a,d):
|
||||||
|
url=f'https://gia.jd.com/fcf.html?a={a}'
|
||||||
|
data=f'&d={d}'
|
||||||
|
headers={
|
||||||
|
'Host':'gia.jd.com',
|
||||||
|
'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8',
|
||||||
|
'Origin':'https://jrmkt.jd.com',
|
||||||
|
'Accept-Encoding':'gzip, deflate, br',
|
||||||
|
'Connection':'keep-alive',
|
||||||
|
'Accept':'*/*',
|
||||||
|
'User-Agent':UserAgent,
|
||||||
|
'Referer':'https://jrmkt.jd.com/',
|
||||||
|
'Content-Length':'376',
|
||||||
|
'Accept-Language':'zh-CN,zh-Hans;q=0.9',
|
||||||
|
}
|
||||||
|
response=requests.post(url=url,headers=headers,data=data)
|
||||||
|
return response.text
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def gettoken():
|
||||||
|
url='https://gia.jd.com/m.html'
|
||||||
|
headers={'User-Agent':UserAgent}
|
||||||
|
response=requests.get(url=url,headers=headers)
|
||||||
|
return response.text.split(';')[0].replace('var jd_risk_token_id = \'','').replace('\'','')
|
||||||
|
|
||||||
|
|
||||||
|
def getsharetasklist(ck,eid,fp,token):
|
||||||
|
url='https://ms.jr.jd.com/gw/generic/bt/h5/m/getShareTaskList'
|
||||||
|
data='reqData='+quote('{"extMap":{"eid":"%s","fp":"%s","sdkToken":"","token":"%s","appType":"1","pageUrl":"https://btfront.jd.com/release/shareCouponRedemption/helpList/?channelId=17&channelName=pdy&jrcontainer=h5&jrlogin=true&jrcloseweb=false"},"channelId":"17","bizGroup":18}'%(eid,fp,token))
|
||||||
|
headers={
|
||||||
|
'Host':'ms.jr.jd.com',
|
||||||
|
'Content-Type':'application/x-www-form-urlencoded',
|
||||||
|
'Origin':'https://btfront.jd.com',
|
||||||
|
'Accept-Encoding':'gzip, deflate, br',
|
||||||
|
'Cookie':ck,
|
||||||
|
'Connection':'keep-alive',
|
||||||
|
'Accept':'application/json, text/plain, */*',
|
||||||
|
'User-Agent':UserAgent,
|
||||||
|
'Referer':'https://btfront.jd.com/',
|
||||||
|
'Content-Length':str(len(data)),
|
||||||
|
'Accept-Language':'zh-CN,zh-Hans;q=0.9'
|
||||||
|
}
|
||||||
|
try:
|
||||||
|
response=requests.post(url=url,headers=headers,data=data)
|
||||||
|
for i in range(len(json.loads(response.text)['resultData']['data'])):
|
||||||
|
if json.loads(response.text)['resultData']['data'][i]['couponBigWord']=='12' and json.loads(response.text)['resultData']['data'][i]['couponSmallWord']=='期':
|
||||||
|
printf('12期免息券活动id:'+str(json.loads(response.text)['resultData']['data'][i]['activityId']))
|
||||||
|
return json.loads(response.text)['resultData']['data'][i]['activityId']
|
||||||
|
break
|
||||||
|
except:
|
||||||
|
printf('获取任务信息出错,程序即将退出!')
|
||||||
|
os._exit(0)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def obtainsharetask(ck,eid,fp,token,activityid):
|
||||||
|
url='https://ms.jr.jd.com/gw/generic/bt/h5/m/obtainShareTask'
|
||||||
|
data='reqData='+quote('{"extMap":{"eid":"%s","fp":"%s","sdkToken":"","token":"%s","appType":"1","pageUrl":"https://btfront.jd.com/release/shareCouponRedemption/helpList/?channelId=17&channelName=pdy&jrcontainer=h5&jrlogin=true&jrcloseweb=false"},"activityId":%s}'%(eid,fp,token,activityid))
|
||||||
|
headers={
|
||||||
|
'Host':'ms.jr.jd.com',
|
||||||
|
'Content-Type':'application/x-www-form-urlencoded',
|
||||||
|
'Origin':'https://btfront.jd.com',
|
||||||
|
'Accept-Encoding':'gzip, deflate, br',
|
||||||
|
'Cookie':ck,
|
||||||
|
'Connection':'keep-alive',
|
||||||
|
'Accept':'application/json, text/plain, */*',
|
||||||
|
'User-Agent':UserAgent,
|
||||||
|
'Referer':'https://btfront.jd.com/',
|
||||||
|
'Content-Length':str(len(data)),
|
||||||
|
'Accept-Language':'zh-CN,zh-Hans;q=0.9'
|
||||||
|
}
|
||||||
|
try:
|
||||||
|
response=requests.post(url=url,headers=headers,data=data)
|
||||||
|
printf('obtainActivityId:'+json.loads(response.text)['resultData']['data']['obtainActivityId'])
|
||||||
|
printf('inviteCode:'+json.loads(response.text)['resultData']['data']['inviteCode'])
|
||||||
|
return json.loads(response.text)['resultData']['data']['obtainActivityId']+'@'+json.loads(response.text)['resultData']['data']['inviteCode']
|
||||||
|
except:
|
||||||
|
printf('开启任务出错,程序即将退出!')
|
||||||
|
os._exit(0)
|
||||||
|
|
||||||
|
|
||||||
|
def assist(ck,eid,fp,token,obtainActivityid,invitecode):
|
||||||
|
url='https://ms.jr.jd.com/gw/generic/bt/h5/m/helpFriend'
|
||||||
|
data='reqData='+quote('{"extMap":{"eid":"%s","fp":"%s","sdkToken":"","token":"%s","appType":"10","pageUrl":"https://btfront.jd.com/release/shareCouponRedemption/sharePage/?obtainActivityId=%s&channelId=17&channelName=pdy&jrcontainer=h5&jrcloseweb=false&jrlogin=true&inviteCode=%s"},"obtainActivityId":"%s","inviteCode":"%s"}'%(eid,fp,token,obtainActivityid,invitecode,obtainActivityid,invitecode))
|
||||||
|
headers={
|
||||||
|
'Host':'ms.jr.jd.com',
|
||||||
|
'Content-Type':'application/x-www-form-urlencoded',
|
||||||
|
'Origin':'https://btfront.jd.com',
|
||||||
|
'Accept-Encoding':'gzip, deflate, br',
|
||||||
|
'Cookie':ck,
|
||||||
|
'Connection':'keep-alive',
|
||||||
|
'Accept':'application/json, text/plain, */*',
|
||||||
|
'User-Agent':UserAgent,
|
||||||
|
'Referer':'https://btfront.jd.com/',
|
||||||
|
'Content-Length':str(len(data)),
|
||||||
|
'Accept-Language':'zh-CN,zh-Hans;q=0.9'
|
||||||
|
}
|
||||||
|
try:
|
||||||
|
response=requests.post(url=url,headers=headers,data=data)
|
||||||
|
if response.text.find('本次助力活动已完成')!=-1:
|
||||||
|
send('京东白条12期免息优惠券助力完成','去京东金融-白条-我的-我的优惠券看看吧')
|
||||||
|
printf('助力完成,程序即将退出!')
|
||||||
|
os._exit(0)
|
||||||
|
else:
|
||||||
|
if json.loads(response.text)['resultData']['result']['code']=='0000':
|
||||||
|
printf('助力成功')
|
||||||
|
elif json.loads(response.text)['resultData']['result']['code']=='M1003':
|
||||||
|
printf('该用户未开启白条,助力失败!')
|
||||||
|
elif json.loads(response.text)['resultData']['result']['code']=='U0002':
|
||||||
|
printf('该用户白条账户异常,助力失败!')
|
||||||
|
elif json.loads(response.text)['resultData']['result']['code']=='E0004':
|
||||||
|
printf('该活动仅限受邀用户参与,助力失败!')
|
||||||
|
else:
|
||||||
|
print(response.text)
|
||||||
|
except:
|
||||||
|
try:
|
||||||
|
print(response.text)
|
||||||
|
except:
|
||||||
|
printf('助力出错,可能是cookie过期了')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
remarkinfos={}
|
||||||
|
get_remarkinfo()
|
||||||
|
|
||||||
|
|
||||||
|
jdjrcookie=os.environ["JDJR_COOKIE"]
|
||||||
|
|
||||||
|
UserAgent=randomuserAgent()
|
||||||
|
info=JDSignValidator('https://jrmfp.jr.jd.com/')
|
||||||
|
eid=json.loads(geteid(info[1],info[2]).split('_*')[1])['eid']
|
||||||
|
fp=info[0]
|
||||||
|
token=gettoken()
|
||||||
|
activityid=getsharetasklist(jdjrcookie,eid,fp,token)
|
||||||
|
inviteinfo=obtainsharetask(jdjrcookie,eid,fp,token,activityid)
|
||||||
|
|
||||||
|
|
||||||
|
try:
|
||||||
|
cks = os.environ["JD_COOKIE"].split("&")
|
||||||
|
except:
|
||||||
|
f = open("/jd/config/config.sh", "r", encoding='utf-8')
|
||||||
|
cks = re.findall(r'Cookie[0-9]*="(pt_key=.*?;pt_pin=.*?;)"', f.read())
|
||||||
|
f.close()
|
||||||
|
for ck in cks:
|
||||||
|
ptpin = re.findall(r"pt_pin=(.*?);", ck)[0]
|
||||||
|
try:
|
||||||
|
if remarkinfos[ptpin]!='':
|
||||||
|
printf("--账号:" + remarkinfos[ptpin] + "--")
|
||||||
|
username=remarkinfos[ptpin]
|
||||||
|
else:
|
||||||
|
printf("--无备注账号:" + urllib.parse.unquote(ptpin) + "--")
|
||||||
|
username=urllib.parse.unquote(ptpin)
|
||||||
|
except:
|
||||||
|
printf("--账号:" + urllib.parse.unquote(ptpin) + "--")
|
||||||
|
username=urllib.parse.unquote(ptpin)
|
||||||
|
UserAgent=randomuserAgent()
|
||||||
|
info=JDSignValidator('https://jrmfp.jr.jd.com/')
|
||||||
|
eid=json.loads(geteid(info[1],info[2]).split('_*')[1])['eid']
|
||||||
|
fp=info[0]
|
||||||
|
token=gettoken()
|
||||||
|
assist(ck,eid,fp,token,inviteinfo.split('@')[0],inviteinfo.split('@')[1])
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,402 @@
|
||||||
|
/*
|
||||||
|
京东超级盒子
|
||||||
|
更新时间:2022-1-9
|
||||||
|
活动入口:京东APP-搜索-超级盒子
|
||||||
|
脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js
|
||||||
|
============Quantumultx===============
|
||||||
|
[task_local]
|
||||||
|
#京东超级盒子
|
||||||
|
24 3,13 * * * https://raw.githubusercontent.com/msechen/script/main/jd_cjhz.js, tag=京东超级盒子, img-url=https://github.com/58xinian/icon/raw/master/jdgc.png, enabled=true
|
||||||
|
|
||||||
|
================Loon==============
|
||||||
|
[Script]
|
||||||
|
cron "24 3,13 * * *" script-path=https://raw.githubusercontent.com/msechen/script/main/jd_cjhz.js,tag=京东超级盒子
|
||||||
|
|
||||||
|
===============Surge=================
|
||||||
|
京东超级盒子 = type=cron,cronexp="24 3,13 * * *",wake-system=1,timeout=3600,script-path=https://raw.githubusercontent.com/msechen/script/main/jd_cjhz.js
|
||||||
|
|
||||||
|
============小火箭=========
|
||||||
|
京东超级盒子 = type=cron,script-path=https://raw.githubusercontent.com/msechen/script/main/jd_cjhz.js, cronexpr="24 3,13 * * *", timeout=3600, enable=true
|
||||||
|
*/
|
||||||
|
|
||||||
|
const $ = new Env('京东超级盒子');
|
||||||
|
//Node.js用户请在jdCookie.js处填写京东ck;
|
||||||
|
const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
|
||||||
|
//IOS等用户直接用NobyDa的jd cookie
|
||||||
|
let cookiesArr = [],
|
||||||
|
cookie = '',
|
||||||
|
secretp = '',
|
||||||
|
joyToken = "";
|
||||||
|
$.shareCoseList = [];
|
||||||
|
if ($.isNode()) {
|
||||||
|
Object.keys(jdCookieNode).forEach((item) => {
|
||||||
|
cookiesArr.push(jdCookieNode[item])
|
||||||
|
})
|
||||||
|
if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {};
|
||||||
|
} else {
|
||||||
|
cookiesArr = [$.getdata('CookieJD'), $.getdata('CookieJD2'), ...jsonParse($.getdata('CookiesJD') || "[]").map(item => item.cookie)].filter(item => !!item);
|
||||||
|
}
|
||||||
|
|
||||||
|
const JD_API_HOST = `https://api.m.jd.com/client.action`;
|
||||||
|
!(async () => {
|
||||||
|
console.log('活动入口:京东APP-搜索-超级盒子')
|
||||||
|
console.log('开箱目前结果为空气和红包,没发现豆子')
|
||||||
|
if (!cookiesArr[0]) {
|
||||||
|
$.msg($.name, '【提示】请先获取cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', { "open-url": "https://bean.m.jd.com/bean/signIndex.action" });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
await getToken();
|
||||||
|
cookiesArr = cookiesArr.map(ck => ck + `joyytoken=50084${joyToken};`)
|
||||||
|
$.CryptoJS = $.isNode() ? require('crypto-js') : CryptoJS
|
||||||
|
for (let i = 0; i < cookiesArr.length; i++) {
|
||||||
|
cookie = cookiesArr[i];
|
||||||
|
if (cookie) {
|
||||||
|
$.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1])
|
||||||
|
$.index = i + 1;
|
||||||
|
$.isLogin = true;
|
||||||
|
$.nickName = '';
|
||||||
|
if (!$.isLogin) {
|
||||||
|
$.msg($.name, `【提示】cookie已失效`, `京东账号${$.index} ${$.nickName || $.UserName}\n请重新登录获取\nhttps://bean.m.jd.com/bean/signIndex.action`, { "open-url": "https://bean.m.jd.com/bean/signIndex.action" });
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
console.log(`\n******开始【京东账号${$.index}】${$.nickName || $.UserName}*********\n`);
|
||||||
|
console.log(`\n入口:app主页搜超级盒子\n`);
|
||||||
|
await main()
|
||||||
|
}
|
||||||
|
};
|
||||||
|
$.shareCoseList = [...new Set([...$.shareCoseList,''])]
|
||||||
|
//去助力与开箱
|
||||||
|
for (let i = 0; i < cookiesArr.length; i++) {
|
||||||
|
cookie = cookiesArr[i];
|
||||||
|
if (cookie) {
|
||||||
|
$.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1])
|
||||||
|
$.index = i + 1;
|
||||||
|
$.isLogin = true;
|
||||||
|
$.nickName = '';
|
||||||
|
if (!$.isLogin) {
|
||||||
|
$.msg($.name, `【提示】cookie已失效`, `京东账号${$.index} ${$.nickName || $.UserName}\n请重新登录获取\nhttps://bean.m.jd.com/bean/signIndex.action`, { "open-url": "https://bean.m.jd.com/bean/signIndex.action" });
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if ($.shareCoseList.length >= 2) {
|
||||||
|
for (let y = 0; y < $.shareCoseList.length; y++) {
|
||||||
|
console.log(`京东账号${$.index} ${$.nickName || $.UserName}去助力${$.shareCoseList[y]}`)
|
||||||
|
await helpShare({ "taskId": $.helpId, "linkId": "Ll3Qb2mhCXSEWxruhv8qIw", "encryptPin": $.shareCoseList[y] });
|
||||||
|
await $.wait(1000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (let i = 0; i < cookiesArr.length; i++) {
|
||||||
|
cookie = cookiesArr[i];
|
||||||
|
if (cookie) {
|
||||||
|
$.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1])
|
||||||
|
$.index = i + 1;
|
||||||
|
$.isLogin = true;
|
||||||
|
$.nickName = '';
|
||||||
|
if (!$.isLogin) {
|
||||||
|
$.msg($.name, `【提示】cookie已失效`, `京东账号${$.index} ${$.nickName || $.UserName}\n请重新登录获取\nhttps://bean.m.jd.com/bean/signIndex.action`, { "open-url": "https://bean.m.jd.com/bean/signIndex.action" });
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
//开箱
|
||||||
|
console.log(`京东账号${$.index}去开箱`)
|
||||||
|
for (let y = 0; y < $.lotteryNumber; y++) {
|
||||||
|
console.log(`可以开箱${$.lotteryNumber}次 ==>>第${y+1}次开箱`)
|
||||||
|
await openBox({ "linkId": "Ll3Qb2mhCXSEWxruhv8qIw", "encryptPin": "" });
|
||||||
|
await $.wait(1000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})()
|
||||||
|
.catch((e) => $.logErr(e))
|
||||||
|
.finally(() => $.done())
|
||||||
|
|
||||||
|
async function main() {
|
||||||
|
await superboxSupBoxHomePage({ "taskId": "", "linkId": "Ll3Qb2mhCXSEWxruhv8qIw", "encryptPin": "" })
|
||||||
|
console.log(`【京东账号${$.index}】${$.nickName || $.UserName}互助码:${$.encryptPin}`)
|
||||||
|
await $.wait(1000);
|
||||||
|
await apTaskList({ "linkId": "Ll3Qb2mhCXSEWxruhv8qIw", "encryptPin": $.encryptPin });
|
||||||
|
if ($.allList) {
|
||||||
|
for (let i = 0; i < $.allList.length; i++) {
|
||||||
|
$.oneTask = $.allList[i];
|
||||||
|
if (["SHARE_INVITE"].includes($.oneTask.taskType)) {
|
||||||
|
$.helpId = $.oneTask.id;
|
||||||
|
$.helpLimit = $.oneTask.taskLimitTimes;
|
||||||
|
};
|
||||||
|
if (["BROWSE_SHOP"].includes($.oneTask.taskType) && $.oneTask.taskFinished === false) {
|
||||||
|
await apTaskDetail({ "taskId": $.oneTask.id, "taskType": $.oneTask.taskType, "channel": 4, "linkId": "Ll3Qb2mhCXSEWxruhv8qIw", "encryptPin": "7pcfSWHrAG9MKu3RKLl127VL5L4aIE1sZ1eRRdphpl8" });
|
||||||
|
await $.wait(1000)
|
||||||
|
for (let y = 0; y < ($.doList.status.finishNeed - $.doList.status.userFinishedTimes); y++) {
|
||||||
|
$.startList = $.doList.taskItemList[y];
|
||||||
|
$.itemName = $.doList.taskItemList[y].itemName;
|
||||||
|
console.log(`去浏览${$.itemName}`)
|
||||||
|
await apDoTask({ "taskId": $.allList[i].id, "taskType": $.allList[i].taskType, "channel": 4, "itemId": $.startList.itemId, "linkId": "Ll3Qb2mhCXSEWxruhv8qIw", "encryptPin": "7pcfSWHrAG9MKu3RKLl127VL5L4aIE1sZ1eRRdphpl8" })
|
||||||
|
await $.wait(1000)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log(`任务全部完成`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//活动主页
|
||||||
|
function superboxSupBoxHomePage(body) {
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
$.get(taskGetUrl('superboxSupBoxHomePage', body), (err, resp, data) => {
|
||||||
|
try {
|
||||||
|
if (err) {
|
||||||
|
console.log(`${JSON.stringify(err)}`)
|
||||||
|
console.log(`${$.name} superboxSupBoxHomePage API请求失败,请检查网路重试`)
|
||||||
|
} else {
|
||||||
|
data = JSON.parse(data);
|
||||||
|
if (data.code === 0) {
|
||||||
|
$.encryptPin = data.data.encryptPin;
|
||||||
|
$.shareCoseList.push($.encryptPin)
|
||||||
|
$.lotteryNumber = data.data.lotteryNumber
|
||||||
|
} else {
|
||||||
|
console.log(`superboxSupBoxHomePage:${JSON.stringify(data)}\n`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
$.logErr(e, resp);
|
||||||
|
} finally {
|
||||||
|
resolve();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//获取任务列表
|
||||||
|
function apTaskList(body) {
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
$.get(taskGetUrl('apTaskList', body), (err, resp, data) => {
|
||||||
|
try {
|
||||||
|
if (err) {
|
||||||
|
console.log(`${JSON.stringify(err)}`)
|
||||||
|
console.log(`${$.name} apTaskList API请求失败,请检查网路重试`)
|
||||||
|
} else {
|
||||||
|
data = JSON.parse(data);
|
||||||
|
if (data.code === 0) {
|
||||||
|
$.allList = data.data
|
||||||
|
//console.log(JSON.stringify($.allList[1]));
|
||||||
|
} else {
|
||||||
|
console.log(`apTaskList错误:${JSON.stringify(data)}\n`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
$.logErr(e, resp);
|
||||||
|
} finally {
|
||||||
|
resolve();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取任务分表
|
||||||
|
function apTaskDetail(body) {
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
$.get(taskGetUrl('apTaskDetail', body), (err, resp, data) => {
|
||||||
|
try {
|
||||||
|
if (err) {
|
||||||
|
console.log(`${JSON.stringify(err)}`)
|
||||||
|
console.log(`${$.name} apTaskDetail API请求失败,请检查网路重试`)
|
||||||
|
} else {
|
||||||
|
data = JSON.parse(data);
|
||||||
|
if (data.code === 0) {
|
||||||
|
$.doList = data.data
|
||||||
|
//console.log(JSON.stringify($.doList));
|
||||||
|
} else {
|
||||||
|
console.log(`apTaskDetail错误:${JSON.stringify(data)}\n`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
$.logErr(e, resp);
|
||||||
|
} finally {
|
||||||
|
resolve();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//做任务
|
||||||
|
function apDoTask(body) {
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
$.post(taskPostUrl('apDoTask', body), (err, resp, data) => {
|
||||||
|
try {
|
||||||
|
if (err) {
|
||||||
|
console.log(`${JSON.stringify(err)}`)
|
||||||
|
console.log(`${$.name} apDoTask API请求失败,请检查网路重试`)
|
||||||
|
} else {
|
||||||
|
data = JSON.parse(data);
|
||||||
|
//console.log(JSON.stringify(data));
|
||||||
|
if (data.success === true && data.code === 0) {
|
||||||
|
console.log(`浏览${$.itemName}完成\n已完成${data.data.userFinishedTimes}次\n`)
|
||||||
|
} else if (data.success === false && data.code === 2005) {
|
||||||
|
console.log(`${data.data.errMsg}${data.data.userFinishedTimes}次`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
$.logErr(e, resp);
|
||||||
|
} finally {
|
||||||
|
resolve();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//助力
|
||||||
|
function helpShare(body) {
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
$.get(taskGetUrl('superboxSupBoxHomePage', body), (err, resp, data) => {
|
||||||
|
try {
|
||||||
|
if (err) {
|
||||||
|
console.log(`${JSON.stringify(err)}`)
|
||||||
|
console.log(`${$.name} superboxSupBoxHomePage API请求失败,请检查网路重试`)
|
||||||
|
} else {
|
||||||
|
data = JSON.parse(data);
|
||||||
|
//console.log(JSON.stringify(data));
|
||||||
|
if (data.success === true && data.code === 0) {
|
||||||
|
console.log(`助力成功\n\n`)
|
||||||
|
} else {
|
||||||
|
console.log(`助力失败:${JSON.stringify(data)}\n\n`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
$.logErr(e, resp);
|
||||||
|
} finally {
|
||||||
|
resolve();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//开盲盒
|
||||||
|
function openBox(body) {
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
$.get(taskGetUrl('superboxOrdinaryLottery', body), (err, resp, data) => {
|
||||||
|
try {
|
||||||
|
if (err) {
|
||||||
|
console.log(`${JSON.stringify(err)}`)
|
||||||
|
console.log(`${$.name} superboxOrdinaryLottery API请求失败,请检查网路重试`)
|
||||||
|
} else {
|
||||||
|
data = JSON.parse(data);
|
||||||
|
//console.log(JSON.stringify(data));
|
||||||
|
if (data.success === true && data.code === 0 && data.data.rewardType === 2) {
|
||||||
|
console.log(`开箱成功获得${data.data.discount}元红包\n\n`)
|
||||||
|
} else if (data.success === true && data.code === 0 && data.data.rewardType !== 2) {
|
||||||
|
console.log(`开箱成功应该获得了空气${JSON.stringify(data.data)}\n\n`)
|
||||||
|
} else {
|
||||||
|
console.log(`失败:${JSON.stringify(data)}\n\n`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
$.logErr(e, resp);
|
||||||
|
} finally {
|
||||||
|
resolve();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function getToken(timeout = 0) {
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
setTimeout(() => {
|
||||||
|
let url = {
|
||||||
|
url: `https://bh.m.jd.com/gettoken`,
|
||||||
|
headers: {
|
||||||
|
'Content-Type': `text/plain;charset=UTF-8`
|
||||||
|
},
|
||||||
|
body: `content={"appname":"50084","whwswswws":"","jdkey":"","body":{"platform":"1"}}`
|
||||||
|
}
|
||||||
|
$.post(url, async (err, resp, data) => {
|
||||||
|
try {
|
||||||
|
data = JSON.parse(data);
|
||||||
|
joyToken = data.joyytoken;
|
||||||
|
console.log(`joyToken = ${data.joyytoken}`)
|
||||||
|
} catch (e) {
|
||||||
|
$.logErr(e, resp);
|
||||||
|
} finally {
|
||||||
|
resolve()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}, timeout)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function taskGetUrl(functionId, body = {}) {
|
||||||
|
return {
|
||||||
|
url: `${JD_API_HOST}?functionId=${functionId}&body=${JSON.stringify(body)}&_t=${Date.now()}&appid=activities_platform&client=wh5&clientVersion=1.0.0`,
|
||||||
|
//body: `functionId=${functionId}&body=${JSON.stringify(body)}&client=wh5&clientVersion=1.0.0&uuid=ef746bc0663f7ca06cdd1fa724c15451900039cf`,
|
||||||
|
headers: {
|
||||||
|
'User-Agent': $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.4.4;14.3;network/4g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1"),
|
||||||
|
'Content-Type': 'application/x-www-form-urlencoded',
|
||||||
|
'Host': 'api.m.jd.com',
|
||||||
|
'Cookie': cookie,
|
||||||
|
'Origin': 'https://prodev.m.jd.com',
|
||||||
|
'Referer': 'https://pro.m.jd.com/mall/active/j8U2SMhmw3aKgfWwYQfoRR4idTT/index.html?',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function taskPostUrl(functionId, body = {}) {
|
||||||
|
return {
|
||||||
|
url: `${JD_API_HOST}?functionId=${functionId}`,
|
||||||
|
body: `functionId=${functionId}&body=${JSON.stringify(body)}&_t=${Date.now()}&appid=activities_platform&client=wh5&clientVersion=1.0.0`,
|
||||||
|
headers: {
|
||||||
|
'User-Agent': $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.4.4;14.3;network/4g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1"),
|
||||||
|
'Content-Type': 'application/x-www-form-urlencoded',
|
||||||
|
'Host': 'api.m.jd.com',
|
||||||
|
'Cookie': cookie,
|
||||||
|
'Origin': 'https://prodev.m.jd.com',
|
||||||
|
'Referer': 'https://pro.m.jd.com/mall/active/j8U2SMhmw3aKgfWwYQfoRR4idTT/index.html?',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function jsonParse(str) {
|
||||||
|
if (typeof str == "string") {
|
||||||
|
try {
|
||||||
|
return JSON.parse(str);
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e);
|
||||||
|
$.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie')
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// prettier-ignore
|
||||||
|
function Env(t, e) { "undefined" != typeof process && JSON.stringify(process.env).indexOf("GITHUB") > -1 && process.exit(0);
|
||||||
|
class s { constructor(t) { this.env = t } send(t, e = "GET") { t = "string" == typeof t ? { url: t } : t; let s = this.get; return "POST" === e && (s = this.post), new Promise((e, i) => { s.call(this, t, (t, s, r) => { t ? i(t) : e(s) }) }) } get(t) { return this.send.call(this.env, t) } post(t) { return this.send.call(this.env, t, "POST") } } return new class { constructor(t, e) { this.name = t, this.http = new s(this), this.data = null, this.dataFile = "box.dat", this.logs = [], this.isMute = !1, this.isNeedRewrite = !1, this.logSeparator = "\n", this.startTime = (new Date).getTime(), Object.assign(this, e), this.log("", `🔔${this.name}, 开始!`) } isNode() { return "undefined" != typeof module && !!module.exports } isQuanX() { return "undefined" != typeof $task } isSurge() { return "undefined" != typeof $httpClient && "undefined" == typeof $loon } isLoon() { return "undefined" != typeof $loon } toObj(t, e = null) { try { return JSON.parse(t) } catch { return e } } toStr(t, e = null) { try { return JSON.stringify(t) } catch { return e } } getjson(t, e) { let s = e; const i = this.getdata(t); if (i) try { s = JSON.parse(this.getdata(t)) } catch {}
|
||||||
|
return s } setjson(t, e) { try { return this.setdata(JSON.stringify(t), e) } catch { return !1 } } getScript(t) { return new Promise(e => { this.get({ url: t }, (t, s, i) => e(i)) }) } runScript(t, e) { return new Promise(s => { let i = this.getdata("@chavy_boxjs_userCfgs.httpapi");
|
||||||
|
i = i ? i.replace(/\n/g, "").trim() : i; let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");
|
||||||
|
r = r ? 1 * r : 20, r = e && e.timeout ? e.timeout : r; const [o, h] = i.split("@"), n = { url: `http://${h}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": o, Accept: "*/*" } };
|
||||||
|
this.post(n, (t, e, i) => s(i)) }).catch(t => this.logErr(t)) } loaddata() { if (!this.isNode()) return {}; { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile),
|
||||||
|
e = this.path.resolve(process.cwd(), this.dataFile),
|
||||||
|
s = this.fs.existsSync(t),
|
||||||
|
i = !s && this.fs.existsSync(e); if (!s && !i) return {}; { const i = s ? t : e; try { return JSON.parse(this.fs.readFileSync(i)) } catch (t) { return {} } } } } writedata() { if (this.isNode()) { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile),
|
||||||
|
e = this.path.resolve(process.cwd(), this.dataFile),
|
||||||
|
s = this.fs.existsSync(t),
|
||||||
|
i = !s && this.fs.existsSync(e),
|
||||||
|
r = JSON.stringify(this.data);
|
||||||
|
s ? this.fs.writeFileSync(t, r) : i ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r) } } lodash_get(t, e, s) { const i = e.replace(/\[(\d+)\]/g, ".$1").split("."); let r = t; for (const t of i)
|
||||||
|
if (r = Object(r)[t], void 0 === r) return s; return r } lodash_set(t, e, s) { return Object(t) !== t ? t : (Array.isArray(e) || (e = e.toString().match(/[^.[\]]+/g) || []), e.slice(0, -1).reduce((t, s, i) => Object(t[s]) === t[s] ? t[s] : t[s] = Math.abs(e[i + 1]) >> 0 == +e[i + 1] ? [] : {}, t)[e[e.length - 1]] = s, t) } getdata(t) { let e = this.getval(t); if (/^@/.test(t)) { const [, s, i] = /^@(.*?)\.(.*?)$/.exec(t), r = s ? this.getval(s) : ""; if (r) try { const t = JSON.parse(r);
|
||||||
|
e = t ? this.lodash_get(t, i, "") : e } catch (t) { e = "" } } return e } setdata(t, e) { let s = !1; if (/^@/.test(e)) { const [, i, r] = /^@(.*?)\.(.*?)$/.exec(e), o = this.getval(i), h = i ? "null" === o ? null : o || "{}" : "{}"; try { const e = JSON.parse(h);
|
||||||
|
this.lodash_set(e, r, t), s = this.setval(JSON.stringify(e), i) } catch (e) { const o = {};
|
||||||
|
this.lodash_set(o, r, t), s = this.setval(JSON.stringify(o), i) } } else s = this.setval(t, e); return s } getval(t) { return this.isSurge() || this.isLoon() ? $persistentStore.read(t) : this.isQuanX() ? $prefs.valueForKey(t) : this.isNode() ? (this.data = this.loaddata(), this.data[t]) : this.data && this.data[t] || null } setval(t, e) { return this.isSurge() || this.isLoon() ? $persistentStore.write(t, e) : this.isQuanX() ? $prefs.setValueForKey(t, e) : this.isNode() ? (this.data = this.loaddata(), this.data[e] = t, this.writedata(), !0) : this.data && this.data[e] || null } initGotEnv(t) { this.got = this.got ? this.got : require("got"), this.cktough = this.cktough ? this.cktough : require("tough-cookie"), this.ckjar = this.ckjar ? this.ckjar : new this.cktough.CookieJar, t && (t.headers = t.headers ? t.headers : {}, void 0 === t.headers.Cookie && void 0 === t.cookieJar && (t.cookieJar = this.ckjar)) } get(t, e = (() => {})) { t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, i) => {!t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t;
|
||||||
|
e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { try { if (t.headers["set-cookie"]) { const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();
|
||||||
|
s && this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar } } catch (t) { this.logErr(t) } }).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t;
|
||||||
|
e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t;
|
||||||
|
e(s, i, i && i.body) })) } post(t, e = (() => {})) { if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.post(t, (t, s, i) => {!t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) });
|
||||||
|
else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t;
|
||||||
|
e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t));
|
||||||
|
else if (this.isNode()) { this.initGotEnv(t); const { url: s, ...i } = t;
|
||||||
|
this.got.post(s, i).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t;
|
||||||
|
e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t;
|
||||||
|
e(s, i, i && i.body) }) } } time(t, e = null) { const s = e ? new Date(e) : new Date; let i = { "M+": s.getMonth() + 1, "d+": s.getDate(), "H+": s.getHours(), "m+": s.getMinutes(), "s+": s.getSeconds(), "q+": Math.floor((s.getMonth() + 3) / 3), S: s.getMilliseconds() }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, (s.getFullYear() + "").substr(4 - RegExp.$1.length))); for (let e in i) new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? i[e] : ("00" + i[e]).substr(("" + i[e]).length))); return t } msg(e = t, s = "", i = "", r) { const o = t => { if (!t) return t; if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? { "open-url": t } : this.isSurge() ? { url: t } : void 0; if ("object" == typeof t) { if (this.isLoon()) { let e = t.openUrl || t.url || t["open-url"],
|
||||||
|
s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } if (this.isQuanX()) { let e = t["open-url"] || t.url || t.openUrl,
|
||||||
|
s = t["media-url"] || t.mediaUrl; return { "open-url": e, "media-url": s } } if (this.isSurge()) { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } } }; if (this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))), !this.isMuteLog) { let t = ["", "==============📣系统通知📣=============="];
|
||||||
|
t.push(e), s && t.push(s), i && t.push(i), console.log(t.join("\n")), this.logs = this.logs.concat(t) } } log(...t) { t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator)) } logErr(t, e) { const s = !this.isSurge() && !this.isQuanX() && !this.isLoon();
|
||||||
|
s ? this.log("", `❗️${this.name}, 错误!`, t.stack) : this.log("", `❗️${this.name}, 错误!`, t) } wait(t) { return new Promise(e => setTimeout(e, t)) } done(t = {}) { const e = (new Date).getTime(),
|
||||||
|
s = (e - this.startTime) / 1e3;
|
||||||
|
this.log("", `🔔${this.name}, 结束! 🕛 ${s} 秒`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) } }(t, e) }
|
|
@ -0,0 +1,643 @@
|
||||||
|
/*
|
||||||
|
* @Author: X1a0He
|
||||||
|
* @Contact: https://t.me/X1a0He
|
||||||
|
* @Github: https://github.com/X1a0He/jd_scripts_fixed
|
||||||
|
* 清空购物车,支持环境变量设置关键字,用@分隔,使用前请认真看对应注释
|
||||||
|
* 由于不是用app来进行购物车删除,所以可能会出现部分购物车数据无法删除的问题,例如预购商品,属于正常
|
||||||
|
*/
|
||||||
|
const $ = new Env('清空购物车');
|
||||||
|
//Node.js用户请在jdCookie.js处填写京东ck;
|
||||||
|
const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
|
||||||
|
const notify = $.isNode() ? require('./sendNotify') : '';
|
||||||
|
let cookiesArr = [], cookie = '', postBody = '', venderCart, error = false;
|
||||||
|
let args_xh = {
|
||||||
|
/*
|
||||||
|
* 跳过某个指定账号,默认为全部账号清空
|
||||||
|
* 填写规则:例如当前Cookie1为pt_key=key; pt_pin=pin1;则环境变量填写pin1即可,此时pin1的购物车将不会被清空
|
||||||
|
* 若有更多,则按照pin1@pin2@pin3进行填写
|
||||||
|
* 环境变量名称:XH_CLEAN_EXCEPT
|
||||||
|
*/
|
||||||
|
except: process.env.XH_CLEAN_EXCEPT && process.env.XH_CLEAN_EXCEPT.split('@') || [],
|
||||||
|
/*
|
||||||
|
* 控制脚本是否执行,设置为true时才会执行删除购物车
|
||||||
|
* 环境变量名称:JD_CART
|
||||||
|
*/
|
||||||
|
clean: process.env.JD_CART === 'true' || false,
|
||||||
|
/*
|
||||||
|
* 控制脚本运行一次取消多少条购物车数据,为0则不删除,默认为100
|
||||||
|
* 环境变量名称:XH_CLEAN_REMOVESIZE
|
||||||
|
*/
|
||||||
|
removeSize: process.env.XH_CLEAN_REMOVESIZE * 1 || 100,
|
||||||
|
/*
|
||||||
|
* 关键字/关键词设置,当购物车商品标题包含关键字/关键词时,跳过该条数据,多个则用@分隔,例如 旺仔牛奶@红外线@紫光
|
||||||
|
* 环境变量名称:XH_CLEAN_KEYWORDS
|
||||||
|
*/
|
||||||
|
keywords: process.env.XH_CLEAN_KEYWORDS && process.env.XH_CLEAN_KEYWORDS.split('@') || [],
|
||||||
|
}
|
||||||
|
console.log('使用前请确保你认真看了注释,看完注释有问题就带着你的问题来找我')
|
||||||
|
console.log('tg: https://t.me/X1a0He')
|
||||||
|
console.log('=====环境变量配置如下=====')
|
||||||
|
console.log(`except: ${typeof args_xh.except}, ${args_xh.except}`)
|
||||||
|
console.log(`clean: ${typeof args_xh.clean}, ${args_xh.clean}`)
|
||||||
|
console.log(`removeSize: ${typeof args_xh.removeSize}, ${args_xh.removeSize}`)
|
||||||
|
console.log(`keywords: ${typeof args_xh.keywords}, ${args_xh.keywords}`)
|
||||||
|
console.log('=======================')
|
||||||
|
console.log()
|
||||||
|
if ($.isNode()) {
|
||||||
|
Object.keys(jdCookieNode).forEach((item) => {
|
||||||
|
cookiesArr.push(jdCookieNode[item])
|
||||||
|
})
|
||||||
|
if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => { };
|
||||||
|
} else cookiesArr = [$.getdata('CookieJD'), $.getdata('CookieJD2'), ...jsonParse($.getdata('CookiesJD') || "[]").map(item => item.cookie)].filter(item => !!item);
|
||||||
|
!(async () => {
|
||||||
|
if (args_xh.clean) {
|
||||||
|
if (!cookiesArr[0]) {
|
||||||
|
$.msg('【京东账号一】移除购物车失败', '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', {
|
||||||
|
"open-url": "https://bean.m.jd.com/bean/signIndex.action"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
for (let i = 0; i < cookiesArr.length; i++) {
|
||||||
|
if (cookiesArr[i]) {
|
||||||
|
cookie = cookiesArr[i];
|
||||||
|
$.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1])
|
||||||
|
$.index = i + 1;
|
||||||
|
$.isLogin = true;
|
||||||
|
$.nickName = '';
|
||||||
|
$.error = false;
|
||||||
|
await TotalBean();
|
||||||
|
console.log(`****开始【京东账号${$.index}】${$.nickName || $.UserName}****`);
|
||||||
|
if (args_xh.except.includes($.UserName)) {
|
||||||
|
console.log(`跳过账号:${$.nickName || $.UserName}`)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if (!$.isLogin) {
|
||||||
|
$.msg($.name, `【提示】cookie已失效`, `京东账号${$.index} ${$.nickName || $.UserName}\n请重新登录获取\nhttps://bean.m.jd.com/bean/signIndex.action`, {
|
||||||
|
"open-url": "https://bean.m.jd.com/bean/signIndex.action"
|
||||||
|
});
|
||||||
|
if ($.isNode()) {
|
||||||
|
await notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`);
|
||||||
|
}
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if (args_xh.removeSize === 0) continue;
|
||||||
|
do {
|
||||||
|
await getCart_xh();
|
||||||
|
$.keywordsNum = 0
|
||||||
|
if ($.beforeRemove !== "0") {
|
||||||
|
await cartFilter_xh(venderCart);
|
||||||
|
$.retry = 0;
|
||||||
|
if (parseInt($.beforeRemove) !== $.keywordsNum) await removeCart();
|
||||||
|
if($.retry = 2) break;
|
||||||
|
else {
|
||||||
|
console.log('\n由于购物车内的商品均包含关键字,本次执行将不删除购物车数据')
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else break;
|
||||||
|
} while (!$.error && $.keywordsNum !== parseInt($.beforeRemove))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log("你设置了不删除购物车数据,要删除请设置环境变量 JD_CART 为 true")
|
||||||
|
}
|
||||||
|
})().catch((e) => {
|
||||||
|
$.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '')
|
||||||
|
}).finally(() => {
|
||||||
|
$.done();
|
||||||
|
})
|
||||||
|
|
||||||
|
function getCart_xh() {
|
||||||
|
console.log('正在获取购物车数据...')
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
const option = {
|
||||||
|
url: 'https://p.m.jd.com/cart/cart.action?fromnav=1&sceneval=2',
|
||||||
|
headers: {
|
||||||
|
"Cookie": cookie,
|
||||||
|
"User-Agent": "jdapp;JD4iPhone/167724 (iPhone; iOS 15.0; Scale/3.00)",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
$.get(option, async (err, resp, data) => {
|
||||||
|
try {
|
||||||
|
data = JSON.parse(data.match(/window\.cartData = ([^;]*)/)[1])
|
||||||
|
$.areaId = data.areaId; // locationId的传值
|
||||||
|
$.traceId = data.traceId; // traceid的传值
|
||||||
|
venderCart = data.cart.venderCart;
|
||||||
|
postBody = 'pingouchannel=0&commlist=';
|
||||||
|
$.beforeRemove = data.cart.currentCount ? data.cart.currentCount : 0;
|
||||||
|
console.log(`获取到购物车数据 ${$.beforeRemove} 条`)
|
||||||
|
} catch (e) {
|
||||||
|
$.logErr(e, resp);
|
||||||
|
} finally {
|
||||||
|
resolve(data);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function cartFilter_xh(cartData) {
|
||||||
|
console.log("正在整理数据...")
|
||||||
|
let pid;
|
||||||
|
$.pushed = 0
|
||||||
|
for (let cartJson of cartData) {
|
||||||
|
if ($.pushed === args_xh.removeSize) break;
|
||||||
|
for (let sortedItem of cartJson.sortedItems) {
|
||||||
|
if ($.pushed === args_xh.removeSize) break;
|
||||||
|
pid = typeof (sortedItem.polyItem.promotion) !== "undefined" ? sortedItem.polyItem.promotion.pid : ""
|
||||||
|
for (let product of sortedItem.polyItem.products) {
|
||||||
|
if ($.pushed === args_xh.removeSize) break;
|
||||||
|
let mainSkuName = product.mainSku.name
|
||||||
|
$.isKeyword = false
|
||||||
|
$.isPush = true
|
||||||
|
for (let keyword of args_xh.keywords) {
|
||||||
|
if (mainSkuName.indexOf(keyword) !== -1) {
|
||||||
|
$.keywordsNum += 1
|
||||||
|
$.isPush = false
|
||||||
|
$.keyword = keyword;
|
||||||
|
break;
|
||||||
|
} else $.isPush = true
|
||||||
|
}
|
||||||
|
if ($.isPush) {
|
||||||
|
let skuUuid = product.skuUuid;
|
||||||
|
let mainSkuId = product.mainSku.id
|
||||||
|
if (pid === "") postBody += `${mainSkuId},,1,${mainSkuId},1,,0,skuUuid:${skuUuid}@@useUuid:0$`
|
||||||
|
else postBody += `${mainSkuId},,1,${mainSkuId},11,${pid},0,skuUuid:${skuUuid}@@useUuid:0$`
|
||||||
|
$.pushed += 1;
|
||||||
|
} else {
|
||||||
|
console.log(`\n${mainSkuName}`)
|
||||||
|
console.log(`商品已被过滤,原因:包含关键字 ${$.keyword}`)
|
||||||
|
$.isKeyword = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
postBody += `&type=0&checked=0&locationid=${$.areaId}&templete=1®=1&scene=0&version=20190418&traceid=${$.traceId}&tabMenuType=1&sceneval=2`
|
||||||
|
}
|
||||||
|
|
||||||
|
function removeCart() {
|
||||||
|
console.log('正在删除购物车数据...')
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
const option = {
|
||||||
|
url: 'https://wq.jd.com/deal/mshopcart/rmvCmdy?sceneval=2&g_login_type=1&g_ty=ajax',
|
||||||
|
body: postBody,
|
||||||
|
headers: {
|
||||||
|
"Cookie": cookie,
|
||||||
|
"User-Agent": "jdapp;JD4iPhone/167724 (iPhone; iOS 15.0; Scale/3.00)",
|
||||||
|
"referer": "https://p.m.jd.com/",
|
||||||
|
"origin": "https://p.m.jd.com/"
|
||||||
|
},
|
||||||
|
}
|
||||||
|
$.post(option, async (err, resp, data) => {
|
||||||
|
try {
|
||||||
|
data = JSON.parse(data);
|
||||||
|
$.afterRemove = data.cartJson.num
|
||||||
|
if ($.afterRemove < $.beforeRemove) {
|
||||||
|
console.log(`删除成功,当前购物车剩余数据 ${$.afterRemove} 条\n`)
|
||||||
|
$.beforeRemove = $.afterRemove
|
||||||
|
} else {
|
||||||
|
console.log('删除失败')
|
||||||
|
console.log(data.errMsg)
|
||||||
|
$.error = true;
|
||||||
|
$.retry++;
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
$.logErr(e, resp);
|
||||||
|
} finally {
|
||||||
|
resolve(data);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function TotalBean() {
|
||||||
|
return new Promise(async resolve => {
|
||||||
|
const options = {
|
||||||
|
"url": `https://wq.jd.com/user/info/QueryJDUserInfo?sceneval=2`,
|
||||||
|
"headers": {
|
||||||
|
"Accept": "application/json,text/plain, */*",
|
||||||
|
"Content-Type": "application/x-www-form-urlencoded",
|
||||||
|
"Accept-Encoding": "gzip, deflate, br",
|
||||||
|
"Accept-Language": "zh-cn",
|
||||||
|
"Connection": "keep-alive",
|
||||||
|
"Cookie": cookie,
|
||||||
|
"Referer": "https://wqs.jd.com/my/jingdou/my.shtml?sceneval=2",
|
||||||
|
"User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.4.4;14.3;network/4g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$.post(options, (err, resp, data) => {
|
||||||
|
try {
|
||||||
|
if (err) {
|
||||||
|
console.log(`${JSON.stringify(err)}`)
|
||||||
|
console.log(`${$.name} API请求失败,请检查网路重试`)
|
||||||
|
} else {
|
||||||
|
if (data) {
|
||||||
|
data = JSON.parse(data);
|
||||||
|
if (data['retcode'] === 13) {
|
||||||
|
$.isLogin = false; //cookie过期
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (data['retcode'] === 0) {
|
||||||
|
$.nickName = (data['base'] && data['base'].nickname) || $.UserName;
|
||||||
|
} else {
|
||||||
|
$.nickName = $.UserName
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log(`京东服务器返回空数据`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
$.logErr(e, resp)
|
||||||
|
} finally {
|
||||||
|
resolve();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function jsonParse(str) {
|
||||||
|
if (typeof str == "string") {
|
||||||
|
try {
|
||||||
|
return JSON.parse(str);
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e);
|
||||||
|
$.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie')
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// prettier-ignore
|
||||||
|
function Env(t, e) {
|
||||||
|
"undefined" != typeof process && JSON.stringify(process.env).indexOf("GITHUB") > -1 && process.exit(0);
|
||||||
|
|
||||||
|
class s {
|
||||||
|
constructor(t) {
|
||||||
|
this.env = t
|
||||||
|
}
|
||||||
|
|
||||||
|
send(t, e = "GET") {
|
||||||
|
t = "string" == typeof t ? {
|
||||||
|
url: t
|
||||||
|
} : t;
|
||||||
|
let s = this.get;
|
||||||
|
return "POST" === e && (s = this.post), new Promise((e, i) => {
|
||||||
|
s.call(this, t, (t, s, r) => {
|
||||||
|
t ? i(t) : e(s)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
get(t) {
|
||||||
|
return this.send.call(this.env, t)
|
||||||
|
}
|
||||||
|
|
||||||
|
post(t) {
|
||||||
|
return this.send.call(this.env, t, "POST")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return new class {
|
||||||
|
constructor(t, e) {
|
||||||
|
this.name = t, this.http = new s(this), this.data = null, this.dataFile = "box.dat", this.logs = [], this.isMute = !1, this.isNeedRewrite = !1, this.logSeparator = "\n", this.startTime = (new Date).getTime(), Object.assign(this, e), this.log("", `🔔${this.name}, 开始!`)
|
||||||
|
}
|
||||||
|
|
||||||
|
isNode() {
|
||||||
|
return "undefined" != typeof module && !!module.exports
|
||||||
|
}
|
||||||
|
|
||||||
|
isQuanX() {
|
||||||
|
return "undefined" != typeof $task
|
||||||
|
}
|
||||||
|
|
||||||
|
isSurge() {
|
||||||
|
return "undefined" != typeof $httpClient && "undefined" == typeof $loon
|
||||||
|
}
|
||||||
|
|
||||||
|
isLoon() {
|
||||||
|
return "undefined" != typeof $loon
|
||||||
|
}
|
||||||
|
|
||||||
|
toObj(t, e = null) {
|
||||||
|
try {
|
||||||
|
return JSON.parse(t)
|
||||||
|
} catch {
|
||||||
|
return e
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
toStr(t, e = null) {
|
||||||
|
try {
|
||||||
|
return JSON.stringify(t)
|
||||||
|
} catch {
|
||||||
|
return e
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
getjson(t, e) {
|
||||||
|
let s = e;
|
||||||
|
const i = this.getdata(t);
|
||||||
|
if (i) try {
|
||||||
|
s = JSON.parse(this.getdata(t))
|
||||||
|
} catch { }
|
||||||
|
return s
|
||||||
|
}
|
||||||
|
|
||||||
|
setjson(t, e) {
|
||||||
|
try {
|
||||||
|
return this.setdata(JSON.stringify(t), e)
|
||||||
|
} catch {
|
||||||
|
return !1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
getScript(t) {
|
||||||
|
return new Promise(e => {
|
||||||
|
this.get({
|
||||||
|
url: t
|
||||||
|
}, (t, s, i) => e(i))
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
runScript(t, e) {
|
||||||
|
return new Promise(s => {
|
||||||
|
let i = this.getdata("@chavy_boxjs_userCfgs.httpapi");
|
||||||
|
i = i ? i.replace(/\n/g, "").trim() : i;
|
||||||
|
let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");
|
||||||
|
r = r ? 1 * r : 20, r = e && e.timeout ? e.timeout : r;
|
||||||
|
const [o, h] = i.split("@"), n = {
|
||||||
|
url: `http://${h}/v1/scripting/evaluate`,
|
||||||
|
body: {
|
||||||
|
script_text: t,
|
||||||
|
mock_type: "cron",
|
||||||
|
timeout: r
|
||||||
|
},
|
||||||
|
headers: {
|
||||||
|
"X-Key": o,
|
||||||
|
Accept: "*/*"
|
||||||
|
}
|
||||||
|
};
|
||||||
|
this.post(n, (t, e, i) => s(i))
|
||||||
|
}).catch(t => this.logErr(t))
|
||||||
|
}
|
||||||
|
|
||||||
|
loaddata() {
|
||||||
|
if (!this.isNode()) return {};
|
||||||
|
{
|
||||||
|
this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path");
|
||||||
|
const t = this.path.resolve(this.dataFile),
|
||||||
|
e = this.path.resolve(process.cwd(), this.dataFile),
|
||||||
|
s = this.fs.existsSync(t),
|
||||||
|
i = !s && this.fs.existsSync(e);
|
||||||
|
if (!s && !i) return {};
|
||||||
|
{
|
||||||
|
const i = s ? t : e;
|
||||||
|
try {
|
||||||
|
return JSON.parse(this.fs.readFileSync(i))
|
||||||
|
} catch (t) {
|
||||||
|
return {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
writedata() {
|
||||||
|
if (this.isNode()) {
|
||||||
|
this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path");
|
||||||
|
const t = this.path.resolve(this.dataFile),
|
||||||
|
e = this.path.resolve(process.cwd(), this.dataFile),
|
||||||
|
s = this.fs.existsSync(t),
|
||||||
|
i = !s && this.fs.existsSync(e),
|
||||||
|
r = JSON.stringify(this.data);
|
||||||
|
s ? this.fs.writeFileSync(t, r) : i ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
lodash_get(t, e, s) {
|
||||||
|
const i = e.replace(/\[(\d+)\]/g, ".$1").split(".");
|
||||||
|
let r = t;
|
||||||
|
for (const t of i)
|
||||||
|
if (r = Object(r)[t], void 0 === r) return s;
|
||||||
|
return r
|
||||||
|
}
|
||||||
|
|
||||||
|
lodash_set(t, e, s) {
|
||||||
|
return Object(t) !== t ? t : (Array.isArray(e) || (e = e.toString().match(/[^.[\]]+/g) || []), e.slice(0, -1).reduce((t, s, i) => Object(t[s]) === t[s] ? t[s] : t[s] = Math.abs(e[i + 1]) >> 0 == +e[i + 1] ? [] : {}, t)[e[e.length - 1]] = s, t)
|
||||||
|
}
|
||||||
|
|
||||||
|
getdata(t) {
|
||||||
|
let e = this.getval(t);
|
||||||
|
if (/^@/.test(t)) {
|
||||||
|
const [, s, i] = /^@(.*?)\.(.*?)$/.exec(t), r = s ? this.getval(s) : "";
|
||||||
|
if (r) try {
|
||||||
|
const t = JSON.parse(r);
|
||||||
|
e = t ? this.lodash_get(t, i, "") : e
|
||||||
|
} catch (t) {
|
||||||
|
e = ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return e
|
||||||
|
}
|
||||||
|
|
||||||
|
setdata(t, e) {
|
||||||
|
let s = !1;
|
||||||
|
if (/^@/.test(e)) {
|
||||||
|
const [, i, r] = /^@(.*?)\.(.*?)$/.exec(e), o = this.getval(i),
|
||||||
|
h = i ? "null" === o ? null : o || "{}" : "{}";
|
||||||
|
try {
|
||||||
|
const e = JSON.parse(h);
|
||||||
|
this.lodash_set(e, r, t), s = this.setval(JSON.stringify(e), i)
|
||||||
|
} catch (e) {
|
||||||
|
const o = {};
|
||||||
|
this.lodash_set(o, r, t), s = this.setval(JSON.stringify(o), i)
|
||||||
|
}
|
||||||
|
} else s = this.setval(t, e);
|
||||||
|
return s
|
||||||
|
}
|
||||||
|
|
||||||
|
getval(t) {
|
||||||
|
return this.isSurge() || this.isLoon() ? $persistentStore.read(t) : this.isQuanX() ? $prefs.valueForKey(t) : this.isNode() ? (this.data = this.loaddata(), this.data[t]) : this.data && this.data[t] || null
|
||||||
|
}
|
||||||
|
|
||||||
|
setval(t, e) {
|
||||||
|
return this.isSurge() || this.isLoon() ? $persistentStore.write(t, e) : this.isQuanX() ? $prefs.setValueForKey(t, e) : this.isNode() ? (this.data = this.loaddata(), this.data[e] = t, this.writedata(), !0) : this.data && this.data[e] || null
|
||||||
|
}
|
||||||
|
|
||||||
|
initGotEnv(t) {
|
||||||
|
this.got = this.got ? this.got : require("got"), this.cktough = this.cktough ? this.cktough : require("tough-cookie"), this.ckjar = this.ckjar ? this.ckjar : new this.cktough.CookieJar, t && (t.headers = t.headers ? t.headers : {}, void 0 === t.headers.Cookie && void 0 === t.cookieJar && (t.cookieJar = this.ckjar))
|
||||||
|
}
|
||||||
|
|
||||||
|
get(t, e = (() => { })) {
|
||||||
|
t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, {
|
||||||
|
"X-Surge-Skip-Scripting": !1
|
||||||
|
})), $httpClient.get(t, (t, s, i) => {
|
||||||
|
!t && s && (s.body = i, s.statusCode = s.status), e(t, s, i)
|
||||||
|
})) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, {
|
||||||
|
hints: !1
|
||||||
|
})), $task.fetch(t).then(t => {
|
||||||
|
const {
|
||||||
|
statusCode: s,
|
||||||
|
statusCode: i,
|
||||||
|
headers: r,
|
||||||
|
body: o
|
||||||
|
} = t;
|
||||||
|
e(null, {
|
||||||
|
status: s,
|
||||||
|
statusCode: i,
|
||||||
|
headers: r,
|
||||||
|
body: o
|
||||||
|
}, o)
|
||||||
|
}, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => {
|
||||||
|
try {
|
||||||
|
if (t.headers["set-cookie"]) {
|
||||||
|
const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();
|
||||||
|
s && this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar
|
||||||
|
}
|
||||||
|
} catch (t) {
|
||||||
|
this.logErr(t)
|
||||||
|
}
|
||||||
|
}).then(t => {
|
||||||
|
const {
|
||||||
|
statusCode: s,
|
||||||
|
statusCode: i,
|
||||||
|
headers: r,
|
||||||
|
body: o
|
||||||
|
} = t;
|
||||||
|
e(null, {
|
||||||
|
status: s,
|
||||||
|
statusCode: i,
|
||||||
|
headers: r,
|
||||||
|
body: o
|
||||||
|
}, o)
|
||||||
|
}, t => {
|
||||||
|
const {
|
||||||
|
message: s,
|
||||||
|
response: i
|
||||||
|
} = t;
|
||||||
|
e(s, i, i && i.body)
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
|
||||||
|
post(t, e = (() => { })) {
|
||||||
|
if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, {
|
||||||
|
"X-Surge-Skip-Scripting": !1
|
||||||
|
})), $httpClient.post(t, (t, s, i) => {
|
||||||
|
!t && s && (s.body = i, s.statusCode = s.status), e(t, s, i)
|
||||||
|
});
|
||||||
|
else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, {
|
||||||
|
hints: !1
|
||||||
|
})), $task.fetch(t).then(t => {
|
||||||
|
const {
|
||||||
|
statusCode: s,
|
||||||
|
statusCode: i,
|
||||||
|
headers: r,
|
||||||
|
body: o
|
||||||
|
} = t;
|
||||||
|
e(null, {
|
||||||
|
status: s,
|
||||||
|
statusCode: i,
|
||||||
|
headers: r,
|
||||||
|
body: o
|
||||||
|
}, o)
|
||||||
|
}, t => e(t));
|
||||||
|
else if (this.isNode()) {
|
||||||
|
this.initGotEnv(t);
|
||||||
|
const {
|
||||||
|
url: s,
|
||||||
|
...i
|
||||||
|
} = t;
|
||||||
|
this.got.post(s, i).then(t => {
|
||||||
|
const {
|
||||||
|
statusCode: s,
|
||||||
|
statusCode: i,
|
||||||
|
headers: r,
|
||||||
|
body: o
|
||||||
|
} = t;
|
||||||
|
e(null, {
|
||||||
|
status: s,
|
||||||
|
statusCode: i,
|
||||||
|
headers: r,
|
||||||
|
body: o
|
||||||
|
}, o)
|
||||||
|
}, t => {
|
||||||
|
const {
|
||||||
|
message: s,
|
||||||
|
response: i
|
||||||
|
} = t;
|
||||||
|
e(s, i, i && i.body)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
time(t, e = null) {
|
||||||
|
const s = e ? new Date(e) : new Date;
|
||||||
|
let i = {
|
||||||
|
"M+": s.getMonth() + 1,
|
||||||
|
"d+": s.getDate(),
|
||||||
|
"H+": s.getHours(),
|
||||||
|
"m+": s.getMinutes(),
|
||||||
|
"s+": s.getSeconds(),
|
||||||
|
"q+": Math.floor((s.getMonth() + 3) / 3),
|
||||||
|
S: s.getMilliseconds()
|
||||||
|
};
|
||||||
|
/(y+)/.test(t) && (t = t.replace(RegExp.$1, (s.getFullYear() + "").substr(4 - RegExp.$1.length)));
|
||||||
|
for (let e in i) new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? i[e] : ("00" + i[e]).substr(("" + i[e]).length)));
|
||||||
|
return t
|
||||||
|
}
|
||||||
|
|
||||||
|
msg(e = t, s = "", i = "", r) {
|
||||||
|
const o = t => {
|
||||||
|
if (!t) return t;
|
||||||
|
if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? {
|
||||||
|
"open-url": t
|
||||||
|
} : this.isSurge() ? {
|
||||||
|
url: t
|
||||||
|
} : void 0;
|
||||||
|
if ("object" == typeof t) {
|
||||||
|
if (this.isLoon()) {
|
||||||
|
let e = t.openUrl || t.url || t["open-url"],
|
||||||
|
s = t.mediaUrl || t["media-url"];
|
||||||
|
return {
|
||||||
|
openUrl: e,
|
||||||
|
mediaUrl: s
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (this.isQuanX()) {
|
||||||
|
let e = t["open-url"] || t.url || t.openUrl,
|
||||||
|
s = t["media-url"] || t.mediaUrl;
|
||||||
|
return {
|
||||||
|
"open-url": e,
|
||||||
|
"media-url": s
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (this.isSurge()) {
|
||||||
|
let e = t.url || t.openUrl || t["open-url"];
|
||||||
|
return {
|
||||||
|
url: e
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
if (this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))), !this.isMuteLog) {
|
||||||
|
let t = ["", "==============📣系统通知📣=============="];
|
||||||
|
t.push(e), s && t.push(s), i && t.push(i), console.log(t.join("\n")), this.logs = this.logs.concat(t)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
log(...t) {
|
||||||
|
t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator))
|
||||||
|
}
|
||||||
|
|
||||||
|
logErr(t, e) {
|
||||||
|
const s = !this.isSurge() && !this.isQuanX() && !this.isLoon();
|
||||||
|
s ? this.log("", `❗️${this.name}, 错误!`, t.stack) : this.log("", `❗️${this.name}, 错误!`, t)
|
||||||
|
}
|
||||||
|
|
||||||
|
wait(t) {
|
||||||
|
return new Promise(e => setTimeout(e, t))
|
||||||
|
}
|
||||||
|
|
||||||
|
done(t = {}) {
|
||||||
|
const e = (new Date).getTime(),
|
||||||
|
s = (e - this.startTime) / 1e3;
|
||||||
|
this.log("", `🔔${this.name}, 结束! 🕛 ${s} 秒`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t)
|
||||||
|
}
|
||||||
|
}(t, e)
|
||||||
|
}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,734 @@
|
||||||
|
/*
|
||||||
|
粉丝互动
|
||||||
|
cron 10 1 * * * https://raw.githubusercontent.com/star261/jd/main/scripts/jd_fan.js
|
||||||
|
蚊子腿活动,不定时更新
|
||||||
|
环境变量:RUHUI,是否自动入会,开卡算法已失效,默认不开卡了
|
||||||
|
环境变量:RUNCK,执行多少CK,默认全执行,设置RUNCK=10,则脚本只会运行前10个CK
|
||||||
|
* */
|
||||||
|
const $ = new Env('粉丝互动-加密');
|
||||||
|
const notify = $.isNode() ? require('./sendNotify') : '';
|
||||||
|
const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
|
||||||
|
const RUHUI = '888'
|
||||||
|
const RUNCK = $.isNode() ? (process.env.RUNCK ? process.env.RUNCK : `9999`):`9999`;
|
||||||
|
let cookiesArr = [],message = '';
|
||||||
|
if ($.isNode()) {
|
||||||
|
Object.keys(jdCookieNode).forEach((item) => {
|
||||||
|
cookiesArr.push(jdCookieNode[item])
|
||||||
|
});
|
||||||
|
if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {};
|
||||||
|
} else {
|
||||||
|
cookiesArr = [
|
||||||
|
$.getdata("CookieJD"),
|
||||||
|
$.getdata("CookieJD2"),
|
||||||
|
...$.toObj($.getdata("CookiesJD") || "[]").map((item) => item.cookie)].filter((item) => !!item);
|
||||||
|
}
|
||||||
|
let activityList = [
|
||||||
|
{'id':'a5af3f9c0af6450bbb93fef7d5f98ce','endTime':1656626274000},//
|
||||||
|
{'id':'cdce9f67e577420084fcf7a749a86241','endTime':1656626274000},//
|
||||||
|
{'id':'b7ec89d5067f4f86bb77c8c371832280','endTime':1656626274000},//
|
||||||
|
{'id':'c923f03a1cc144edab77975e6c792436','endTime':1656626274000},//
|
||||||
|
{'id':'afc7e69486954594987afc57a055c6a9','endTime':1656626274000},//
|
||||||
|
|
||||||
|
|
||||||
|
];
|
||||||
|
!(async()=>{
|
||||||
|
activityList=getRandomArrayElements(activityList,activityList.length);
|
||||||
|
$.helpFalg=true;
|
||||||
|
for(let _0x2e674b=0;_0x2e674b<activityList.length;_0x2e674b++){
|
||||||
|
let _0x38a02d=activityList[_0x2e674b].id;
|
||||||
|
let _0x58a1ac=Date.now();
|
||||||
|
if(_0x58a1ac<activityList[_0x2e674b].endTime){
|
||||||
|
let _0x3d2098='https://lzkjdz-isv.isvjcloud.com/wxFansInterActionActivity/activity/'+_0x38a02d+'?activityId='+_0x38a02d;
|
||||||
|
console.log('\n活动URL:'+_0x3d2098);
|
||||||
|
$.thisActivityUrl=_0x3d2098;
|
||||||
|
$.host='lzkjdz-isv.isvjcloud.com';
|
||||||
|
await main($);
|
||||||
|
await $.wait(3000);
|
||||||
|
}else{
|
||||||
|
console.log('\n活动ID:'+_0x38a02d+',已过期');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})().catch(_0xce13bb=>{
|
||||||
|
$.log('','❌ '+$.name+', 失败! 原因: '+_0xce13bb+'!','');
|
||||||
|
}).finally(()=>{
|
||||||
|
$.done();
|
||||||
|
});
|
||||||
|
async function main(_0x3f7ec5){
|
||||||
|
_0x3f7ec5.cookiesArr=cookiesArr;
|
||||||
|
message='';
|
||||||
|
_0x3f7ec5.activityId=getUrlData(_0x3f7ec5.thisActivityUrl,'activityId');
|
||||||
|
_0x3f7ec5.runFlag=true;
|
||||||
|
if(_0x3f7ec5.helpFalg){
|
||||||
|
doInfo();
|
||||||
|
}for(let _0x42703b=0;_0x42703b<_0x3f7ec5.cookiesArr.length&&(_0x42703b<RUNCK)&&_0x3f7ec5.activityId&&_0x3f7ec5.runFlag;_0x42703b++){
|
||||||
|
_0x3f7ec5.cookie=_0x3f7ec5.cookiesArr[_0x42703b];
|
||||||
|
_0x3f7ec5.UserName=decodeURIComponent(_0x3f7ec5.cookie.match(/pt_pin=(.+?);/)&&_0x3f7ec5.cookie.match(/pt_pin=(.+?);/)[1]);
|
||||||
|
_0x3f7ec5.index=(_0x42703b+1);
|
||||||
|
console.log('\n********开始【京东账号'+_0x3f7ec5.index+'】'+_0x3f7ec5.UserName+'********\n');
|
||||||
|
try{
|
||||||
|
await runMain(_0x3f7ec5);
|
||||||
|
}catch(_0x404e8e){}
|
||||||
|
await _0x3f7ec5.wait(3000);
|
||||||
|
}if(message){
|
||||||
|
await notify.sendNotify('粉丝互动ID:'+_0x3f7ec5.activityId,message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
async function doInfo(){
|
||||||
|
$.helpFalg=false;
|
||||||
|
for(let _0x32dca4=0;_0x32dca4<cookiesArr.length;_0x32dca4++){
|
||||||
|
let _0x3e263a=['yu7sDDcldBJVg53L5e1xVvA+83L/sWpkWyh/yXCX0UU=','hYYKRXiBsc/D9xrdJEaeuA==','CiCGftfyPYj6+NL6vvQ+DA==','Vl30/Mq7awAL+YJtVisq+w=='];
|
||||||
|
let _0x429f0a=getRandomArrayElements(_0x3e263a,1)[0];
|
||||||
|
await invite3(cookiesArr[_0x32dca4],_0x429f0a);
|
||||||
|
await invite4(cookiesArr[_0x32dca4],_0x429f0a);
|
||||||
|
await invite(cookiesArr[_0x32dca4],_0x429f0a);
|
||||||
|
await invite2(cookiesArr[_0x32dca4],_0x429f0a);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
async function invite(_0x8baf4c,_0x3fd6b4){
|
||||||
|
let _0x11b30c=Date.now();
|
||||||
|
var _0x5156ef={
|
||||||
|
'Host':'api.m.jd.com','accept':'application/json, text/plain, */*','content-type':'application/x-www-form-urlencoded','origin':'https://invite-reward.jd.com','accept-language':'zh-cn','user-agent':$.isNode()?process.env.JS_USER_AGENT?process.env.JS_USER_AGENT:require('./JS_USER_AGENTS').USER_AGENT:$.getdata('JSUA')?$.getdata('JSUA'):'\'jdltapp;iPad;3.1.0;14.4;network/wifi;Mozilla/5.0 (iPad; CPU OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1','referer':'https://invite-reward.jd.com/','Cookie':_0x8baf4c
|
||||||
|
};
|
||||||
|
var _0xd439b2='functionId=InviteFriendApiService&body={"method":"attendInviteActivity","data":{"inviterPin":"'+encodeURIComponent(_0x3fd6b4)+'","channel":1,"token":"","frontendInitStatus":""}}&referer=-1&eid=eidIf3dd8121b7sdmiBLGdxRR46OlWyh62kFAZogTJFnYqqRkwgr63%2BdGmMlcv7EQJ5v0HBic81xHXzXLwKM6fh3i963zIa7Ym2v5ehnwo2B7uDN92Q0&aid=&client=ios&clientVersion=14.4&networkType=wifi&fp=-1&appid=market-task-h5&_t='+_0x11b30c;
|
||||||
|
var _0x2ef366={'url':'https://api.m.jd.com/?t='+Date.now(),'headers':_0x5156ef,'body':_0xd439b2};
|
||||||
|
$.post(_0x2ef366,(_0x2d0d4b,_0x2fae2e,_0x252f14)=>{});
|
||||||
|
}
|
||||||
|
async function invite2(_0x36e51c,_0x97b630){
|
||||||
|
let _0x577470=Date.now();
|
||||||
|
let _0x24b1af={
|
||||||
|
'Host':'api.m.jd.com','accept':'application/json, text/plain, */*','content-type':'application/x-www-form-urlencoded','origin':'https://assignment.jd.com','accept-language':'zh-cn','user-agent':$.isNode()?process.env.JS_USER_AGENT?process.env.JS_USER_AGENT:require('./JS_USER_AGENTS').USER_AGENT:$.getdata('JSUA')?$.getdata('JSUA'):'\'jdltapp;iPad;3.1.0;14.4;network/wifi;Mozilla/5.0 (iPad; CPU OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1','referer':'https://assignment.jd.com/?inviterId='+encodeURIComponent(_0x97b630),'Cookie':_0x36e51c
|
||||||
|
};
|
||||||
|
let _0x33c1bd='functionId=TaskInviteService&body={"method":"participateInviteTask","data":{"channel":"1","encryptionInviterPin":"'+encodeURIComponent(_0x97b630)+'","type":1}}&appid=market-task-h5&uuid=&_t='+_0x577470;
|
||||||
|
var _0x30d5e1={'url':'https://api.m.jd.com/','headers':_0x24b1af,'body':_0x33c1bd};
|
||||||
|
$.post(_0x30d5e1,(_0x36a3f1,_0x5a5a0a,_0x1fe685)=>{});
|
||||||
|
}
|
||||||
|
function invite3(_0x124be8,_0x95cb67){
|
||||||
|
let _0x243f31=+new Date();
|
||||||
|
let _0x5e0330={'url':'https://api.m.jd.com/?t='+_0x243f31,'body':'functionId=InviteFriendChangeAssertsService&body='+JSON.stringify({'method':'attendInviteActivity','data':{'inviterPin':encodeURIComponent(_0x95cb67),'channel':1,'token':'','frontendInitStatus':''}})+'&referer=-1&eid=eidI9b2981202fsec83iRW1nTsOVzCocWda3YHPN471AY78%2FQBhYbXeWtdg%2F3TCtVTMrE1JjM8Sqt8f2TqF1Z5P%2FRPGlzA1dERP0Z5bLWdq5N5B2VbBO&aid=&client=ios&clientVersion=14.4.2&networkType=wifi&fp=-1&uuid=ab048084b47df24880613326feffdf7eee471488&osVersion=14.4.2&d_brand=iPhone&d_model=iPhone10,2&agent=-1&pageClickKey=-1&platform=3&lang=zh_CN&appid=market-task-h5&_t='+_0x243f31,'headers':{
|
||||||
|
'Host':'api.m.jd.com','Accept':'application/json, text/plain, */*','Content-type':'application/x-www-form-urlencoded','Origin':'https://invite-reward.jd.com','Accept-Language':'zh-CN,zh-Hans;q=0.9','User-Agent':$.isNode()?process.env.JS_USER_AGENT?process.env.JS_USER_AGENT:require('./JS_USER_AGENTS').USER_AGENT:$.getdata('JSUA')?$.getdata('JSUA'):'\'jdltapp;iPad;3.1.0;14.4;network/wifi;Mozilla/5.0 (iPad; CPU OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1','Referer':'https://invite-reward.jd.com/','Accept-Encoding':'gzip, deflate, br','Cookie':_0x124be8
|
||||||
|
}};
|
||||||
|
$.post(_0x5e0330,(_0x53cb25,_0x3d3420,_0x345c93)=>{});
|
||||||
|
}
|
||||||
|
function invite4(_0x4ce7d3,_0x13691e){
|
||||||
|
let _0x67f7ab={'url':'https://api.m.jd.com/','body':'functionId=TaskInviteService&body='+JSON.stringify({'method':'participateInviteTask','data':{'channel':'1','encryptionInviterPin':encodeURIComponent(_0x13691e),'type':1}})+'&appid=market-task-h5&uuid=&_t='+Date.now(),'headers':{
|
||||||
|
'Host':'api.m.jd.com','Accept':'application/json, text/plain, */*','Content-Type':'application/x-www-form-urlencoded','Origin':'https://assignment.jd.com','Accept-Language':'zh-CN,zh-Hans;q=0.9','User-Agent':$.isNode()?process.env.JS_USER_AGENT?process.env.JS_USER_AGENT:require('./JS_USER_AGENTS').USER_AGENT:$.getdata('JSUA')?$.getdata('JSUA'):'\'jdltapp;iPad;3.1.0;14.4;network/wifi;Mozilla/5.0 (iPad; CPU OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1','Referer':'https://assignment.jd.com/','Accept-Encoding':'gzip, deflate, br','Cookie':_0x4ce7d3
|
||||||
|
}};
|
||||||
|
$.post(_0x67f7ab,(_0x29e91a,_0x5baf9c,_0x467f38)=>{});
|
||||||
|
}
|
||||||
|
async function runMain(_0x40ebb9){
|
||||||
|
_0x40ebb9.UA=_0x40ebb9.isNode()?process.env.JD_USER_AGENT?process.env.JD_USER_AGENT:require('./USER_AGENTS').USER_AGENT:_0x40ebb9.getdata('JDUA')?_0x40ebb9.getdata('JDUA'):'jdapp;iPhone;9.4.4;14.3;network/4g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',_0x40ebb9.token='';
|
||||||
|
_0x40ebb9.LZ_TOKEN_KEY='';
|
||||||
|
_0x40ebb9.LZ_TOKEN_VALUE='';
|
||||||
|
_0x40ebb9.lz_jdpin_token='';
|
||||||
|
_0x40ebb9.pin='';
|
||||||
|
_0x40ebb9.nickname='';
|
||||||
|
_0x40ebb9.venderId='';
|
||||||
|
_0x40ebb9.activityType='';
|
||||||
|
_0x40ebb9.attrTouXiang='https://img10.360buyimg.com/imgzone/jfs/t1/7020/27/13511/6142/5c5138d8E4df2e764/5a1216a3a5043c5d.png';
|
||||||
|
console.log('活动地址:'+_0x40ebb9.thisActivityUrl);
|
||||||
|
_0x40ebb9.body='body=%7B%22url%22%3A%22https%3A%2F%2Flzkjdz-isv.isvjcloud.com%22%2C%22id%22%3A%22%22%7D&clientVersion=9.2.2&build=89568&client=android&uuid=b4d0d21978ef8579305f30d52065ffedcc573c2d&st=1643784769190&sign=d6ab868c42dcc3d04c2b95b2aea9014c&sv=111';
|
||||||
|
_0x40ebb9.token=await getToken(_0x40ebb9);
|
||||||
|
if(!_0x40ebb9.token){
|
||||||
|
console.log('获取token失败');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
await getHtml(_0x40ebb9);
|
||||||
|
if(!_0x40ebb9.LZ_TOKEN_KEY||!_0x40ebb9.LZ_TOKEN_VALUE){
|
||||||
|
console.log('初始化失败1');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let _0x4c9e98=await takePostRequest(_0x40ebb9,'customer/getSimpleActInfoVo');
|
||||||
|
_0x40ebb9.venderId=_0x4c9e98.data.venderId||'';
|
||||||
|
_0x40ebb9.activityType=_0x4c9e98.data.activityType||'';
|
||||||
|
console.log('venderId:'+_0x40ebb9.venderId);
|
||||||
|
let _0xfab866=await takePostRequest(_0x40ebb9,'customer/getMyPing');
|
||||||
|
_0x40ebb9.pin=_0xfab866.data.secretPin;
|
||||||
|
_0x40ebb9.nickname=_0xfab866.data.nickname;
|
||||||
|
if(!_0x40ebb9.pin){
|
||||||
|
console.log('获取pin失败,该账号可能是黑号');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
await takePostRequest(_0x40ebb9,'common/accessLogWithAD');
|
||||||
|
let _0x851536=await takePostRequest(_0x40ebb9,'wxActionCommon/getUserInfo');
|
||||||
|
let _0x3343be=await takePostRequest(_0x40ebb9,'wxActionCommon/getShopInfoVO');
|
||||||
|
let _0x174237=await takePostRequest(_0x40ebb9,'wxCommonInfo/getActMemberInfo');
|
||||||
|
if(_0x851536&&_0x851536.data&&_0x851536.data.yunMidImageUrl){
|
||||||
|
_0x40ebb9.attrTouXiang=_0x851536.data.yunMidImageUrl;
|
||||||
|
}
|
||||||
|
let _0x11a7bd=await takePostRequest(_0x40ebb9,'wxFansInterActionActivity/activityContent');
|
||||||
|
_0x40ebb9.activityData=_0x11a7bd.data||{};
|
||||||
|
_0x40ebb9.actinfo=_0x40ebb9.activityData.actInfo;
|
||||||
|
_0x40ebb9.actorInfo=_0x40ebb9.activityData.actorInfo;
|
||||||
|
_0x40ebb9.nowUseValue=(Number(_0x40ebb9.actorInfo.fansLoveValue)+Number(_0x40ebb9.actorInfo.energyValue));
|
||||||
|
if(JSON.stringify(_0x40ebb9.activityData)==='{}'){
|
||||||
|
console.log('获取活动信息失败');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let _0x452779=new Date(_0x40ebb9.activityData.actInfo.endTime);
|
||||||
|
let _0x3b061a=(_0x452779.getFullYear()+'-'+_0x452779.getMonth()<10?('0'+_0x452779.getMonth()+1):(_0x452779.getMonth()+1)+'-'+_0x452779.getDate()<10?'0'+_0x452779.getDate():_0x452779.getDate());
|
||||||
|
_0x452779=new Date(_0x40ebb9.activityData.actInfo.startTime);
|
||||||
|
let _0x29384a=(_0x452779.getFullYear()+'-'+_0x452779.getMonth()<10?'0'+(_0x452779.getMonth()+1):(_0x452779.getMonth()+1))+'-'+((_0x452779.getDate()<10)?('0'+_0x452779.getDate()):_0x452779.getDate());
|
||||||
|
console.log(_0x40ebb9.actinfo.actName+','+_0x3343be.data.shopName+',当前积分:'+_0x40ebb9.nowUseValue+',活动时间:'+_0x29384a+'---'+_0x3b061a+','+_0x40ebb9.activityData.actInfo.endTime);
|
||||||
|
let _0x14474d=[];
|
||||||
|
let _0x3fea64=['One','Two','Three'];
|
||||||
|
for(let _0x377d67=0;_0x377d67<_0x3fea64.length;_0x377d67++){
|
||||||
|
let _0xc7c5a0=_0x40ebb9.activityData.actInfo['giftLevel'+_0x3fea64[_0x377d67]]||'';
|
||||||
|
if(_0xc7c5a0){
|
||||||
|
_0xc7c5a0=JSON.parse(_0xc7c5a0);
|
||||||
|
_0x14474d.push(_0xc7c5a0[0].name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log('奖品列表:'+_0x14474d.toString());
|
||||||
|
if(_0x40ebb9.actorInfo.prizeOneStatus&&_0x40ebb9.actorInfo.prizeTwoStatus&&_0x40ebb9.actorInfo.prizeThreeStatus){
|
||||||
|
console.log('已完成抽奖');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if((_0x174237.data.actMemberStatus===1)&&!_0x174237.data.openCard){
|
||||||
|
console.log('活动需要入会后才能参与');
|
||||||
|
if(Number(RUHUI)===1){
|
||||||
|
console.log('去入会');
|
||||||
|
await join(_0x40ebb9);
|
||||||
|
_0x11a7bd=await takePostRequest(_0x40ebb9,'wxFansInterActionActivity/activityContent');
|
||||||
|
_0x40ebb9.activityData=_0x11a7bd.data||{};
|
||||||
|
await _0x40ebb9.wait(3000);
|
||||||
|
}else{
|
||||||
|
console.log('不执行入会,跳出');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}else if(_0x174237.data.openCard){
|
||||||
|
console.log('已入会');
|
||||||
|
}
|
||||||
|
if(_0x40ebb9.activityData.actorInfo&&!_0x40ebb9.activityData.actorInfo.follow){
|
||||||
|
console.log('去关注店铺');
|
||||||
|
_0x40ebb9.body='activityId='+_0x40ebb9.activityId+'&uuid='+_0x40ebb9.activityData.actorInfo.uuid;
|
||||||
|
let _0x477c01=await takePostRequest(_0x40ebb9,'wxFansInterActionActivity/followShop',_0x40ebb9.body);
|
||||||
|
console.log(JSON.stringify(_0x477c01));
|
||||||
|
await _0x40ebb9.wait(3000);
|
||||||
|
}
|
||||||
|
_0x40ebb9.upFlag=false;
|
||||||
|
await doTask(_0x40ebb9);
|
||||||
|
await luckDraw(_0x40ebb9);
|
||||||
|
}
|
||||||
|
async function luckDraw(_0x13737e){
|
||||||
|
if(_0x13737e.upFlag){
|
||||||
|
activityData=await takePostRequest(_0x13737e,'wxFansInterActionActivity/activityContent');
|
||||||
|
_0x13737e.activityData=activityData.data||{};
|
||||||
|
await _0x13737e.wait(3000);
|
||||||
|
}
|
||||||
|
let _0x2b7411=(Number(_0x13737e.activityData.actorInfo.fansLoveValue)+Number(_0x13737e.activityData.actorInfo.energyValue));
|
||||||
|
let _0x47ddad=['One','Two','Three'];
|
||||||
|
let _0x58a1c5={'One':'01','Two':'02','Three':'03'};
|
||||||
|
for(let _0x1b895e=0;_0x1b895e<_0x47ddad.length;_0x1b895e++){
|
||||||
|
if((_0x2b7411>=_0x13737e.activityData.actConfig['prizeScore'+_0x47ddad[_0x1b895e]])&&_0x13737e.activityData.actorInfo['prize'+_0x47ddad[_0x1b895e]+'Status']===false){
|
||||||
|
console.log('\n开始第'+Number(_0x58a1c5[_0x47ddad[_0x1b895e]])+'次抽奖');
|
||||||
|
_0x13737e.body='activityId='+_0x13737e.activityId+'&uuid='+_0x13737e.activityData.actorInfo.uuid+'&drawType='+_0x58a1c5[_0x47ddad[_0x1b895e]];
|
||||||
|
let _0x55478a=await takePostRequest(_0x13737e,'wxFansInterActionActivity/startDraw',_0x13737e.body);
|
||||||
|
if(_0x55478a.result&&_0x55478a.count===0){
|
||||||
|
let _0x5e600e=_0x55478a.data;
|
||||||
|
if(!_0x5e600e.drawOk){
|
||||||
|
console.log('抽奖获得:空气');
|
||||||
|
}else{
|
||||||
|
console.log('抽奖获得:'+_0x5e600e.name);
|
||||||
|
message+=_0x13737e.UserName+',获得:'+(_0x5e600e.name||'未知')+'\n';
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
console.log('抽奖异常');
|
||||||
|
}
|
||||||
|
console.log(JSON.stringify(_0x55478a));
|
||||||
|
await _0x13737e.wait(3000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
async function doTask(_0x23c295){
|
||||||
|
let _0x90a7c2=0;
|
||||||
|
if(_0x23c295.activityData.task2BrowGoods){
|
||||||
|
if(_0x23c295.activityData.task2BrowGoods.finishedCount!==_0x23c295.activityData.task2BrowGoods.upLimit){
|
||||||
|
_0x90a7c2=(Number(_0x23c295.activityData.task2BrowGoods.upLimit)-Number(_0x23c295.activityData.task2BrowGoods.finishedCount));
|
||||||
|
console.log('开始做浏览商品任务');
|
||||||
|
_0x23c295.upFlag=true;
|
||||||
|
for(let _0x57ea0c=0;_0x57ea0c<_0x23c295.activityData.task2BrowGoods.taskGoodList.length&&_0x90a7c2>0;_0x57ea0c++){
|
||||||
|
_0x23c295.oneGoodInfo=_0x23c295.activityData.task2BrowGoods.taskGoodList[_0x57ea0c];
|
||||||
|
if(_0x23c295.oneGoodInfo.finished===false){
|
||||||
|
console.log('浏览:'+(_0x23c295.oneGoodInfo.skuName||''));
|
||||||
|
_0x23c295.body='activityId='+_0x23c295.activityId+'&uuid='+_0x23c295.activityData.actorInfo.uuid+'&skuId='+_0x23c295.oneGoodInfo.skuId;
|
||||||
|
let _0x4858b5=await takePostRequest(_0x23c295,'wxFansInterActionActivity/doBrowGoodsTask',_0x23c295.body);
|
||||||
|
console.log(JSON.stringify(_0x4858b5));
|
||||||
|
await _0x23c295.wait(3000);
|
||||||
|
_0x90a7c2--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
console.log('浏览商品任务已完成');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(_0x23c295.activityData.task3AddCart){
|
||||||
|
if(_0x23c295.activityData.task3AddCart.finishedCount!==_0x23c295.activityData.task3AddCart.upLimit){
|
||||||
|
_0x90a7c2=(Number(_0x23c295.activityData.task3AddCart.upLimit)-Number(_0x23c295.activityData.task3AddCart.finishedCount));
|
||||||
|
console.log('开始做加购商品任务');
|
||||||
|
_0x23c295.upFlag=true;
|
||||||
|
for(let _0x2527f5=0;(_0x2527f5<_0x23c295.activityData.task3AddCart.taskGoodList.length)&&(_0x90a7c2>0);_0x2527f5++){
|
||||||
|
_0x23c295.oneGoodInfo=_0x23c295.activityData.task3AddCart.taskGoodList[_0x2527f5];
|
||||||
|
if(_0x23c295.oneGoodInfo.finished===false){
|
||||||
|
console.log('加购:'+(_0x23c295.oneGoodInfo.skuName||''));
|
||||||
|
_0x23c295.body='activityId='+_0x23c295.activityId+'&uuid='+_0x23c295.activityData.actorInfo.uuid+'&skuId='+_0x23c295.oneGoodInfo.skuId;
|
||||||
|
let _0x4858b5=await takePostRequest(_0x23c295,'wxFansInterActionActivity/doAddGoodsTask',_0x23c295.body);
|
||||||
|
console.log(JSON.stringify(_0x4858b5));
|
||||||
|
await _0x23c295.wait(3000);
|
||||||
|
_0x90a7c2--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
console.log('加购商品已完成');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(_0x23c295.activityData.task6GetCoupon){
|
||||||
|
if(_0x23c295.activityData.task6GetCoupon.finishedCount!==_0x23c295.activityData.task6GetCoupon.upLimit){
|
||||||
|
_0x90a7c2=(Number(_0x23c295.activityData.task6GetCoupon.upLimit)-Number(_0x23c295.activityData.task6GetCoupon.finishedCount));
|
||||||
|
console.log('开始做领取优惠券');
|
||||||
|
_0x23c295.upFlag=true;
|
||||||
|
for(let _0x48cbc6=0;(_0x48cbc6<_0x23c295.activityData.task6GetCoupon.taskCouponInfoList.length)&&(_0x90a7c2>0);_0x48cbc6++){
|
||||||
|
_0x23c295.oneCouponInfo=_0x23c295.activityData.task6GetCoupon.taskCouponInfoList[_0x48cbc6];
|
||||||
|
if(_0x23c295.oneCouponInfo.finished===false){
|
||||||
|
_0x23c295.body='activityId='+_0x23c295.activityId+'&uuid='+_0x23c295.activityData.actorInfo.uuid+'&couponId='+_0x23c295.oneCouponInfo.couponInfo.couponId;
|
||||||
|
let _0x4858b5=await takePostRequest(_0x23c295,'wxFansInterActionActivity/doGetCouponTask',_0x23c295.body);
|
||||||
|
console.log(JSON.stringify(_0x4858b5));
|
||||||
|
await _0x23c295.wait(3000);
|
||||||
|
_0x90a7c2--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
console.log('领取优惠券已完成');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_0x23c295.body='activityId='+_0x23c295.activityId+'&uuid='+_0x23c295.activityData.actorInfo.uuid;
|
||||||
|
if(_0x23c295.activityData.task1Sign&&_0x23c295.activityData.task1Sign.finishedCount===0){
|
||||||
|
console.log('执行每日签到');
|
||||||
|
let _0x3b44d4=await takePostRequest(_0x23c295,'wxFansInterActionActivity/doSign',_0x23c295.body);
|
||||||
|
console.log(JSON.stringify(_0x3b44d4));
|
||||||
|
await _0x23c295.wait(3000);
|
||||||
|
_0x23c295.upFlag=true;
|
||||||
|
}else{
|
||||||
|
console.log('已签到');
|
||||||
|
}if(_0x23c295.activityData.task4Share){
|
||||||
|
if(_0x23c295.activityData.task4Share.finishedCount!==_0x23c295.activityData.task4Share.upLimit){
|
||||||
|
_0x90a7c2=Number(_0x23c295.activityData.task4Share.upLimit)-Number(_0x23c295.activityData.task4Share.finishedCount);
|
||||||
|
console.log('开始做分享任务');
|
||||||
|
_0x23c295.upFlag=true;
|
||||||
|
for(let _0x107268=0;_0x107268<_0x90a7c2;_0x107268++){
|
||||||
|
console.log('执行第'+(_0x107268+1)+'次分享');
|
||||||
|
let _0x3b44d4=await takePostRequest(_0x23c295,'wxFansInterActionActivity/doShareTask',_0x23c295.body);
|
||||||
|
console.log(JSON.stringify(_0x3b44d4));
|
||||||
|
await _0x23c295.wait(3000);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
console.log('分享任务已完成');
|
||||||
|
}
|
||||||
|
}if(_0x23c295.activityData.task5Remind){
|
||||||
|
if(_0x23c295.activityData.task5Remind.finishedCount!==_0x23c295.activityData.task5Remind.upLimit){
|
||||||
|
console.log('执行设置活动提醒');
|
||||||
|
_0x23c295.upFlag=true;
|
||||||
|
let _0x204aab=await takePostRequest(_0x23c295,'wxFansInterActionActivity/doRemindTask',_0x23c295.body);
|
||||||
|
console.log(JSON.stringify(_0x204aab));
|
||||||
|
await _0x23c295.wait(3000);
|
||||||
|
}else{
|
||||||
|
console.log('设置活动提醒已完成');
|
||||||
|
}
|
||||||
|
}if(_0x23c295.activityData.task7MeetPlaceVo){
|
||||||
|
if(_0x23c295.activityData.task7MeetPlaceVo.finishedCount!==_0x23c295.activityData.task7MeetPlaceVo.upLimit){
|
||||||
|
console.log('执行逛会场');
|
||||||
|
_0x23c295.upFlag=true;
|
||||||
|
let _0x84bc88=await takePostRequest(_0x23c295,'wxFansInterActionActivity/doMeetingTask',_0x23c295.body);
|
||||||
|
console.log(JSON.stringify(_0x84bc88));
|
||||||
|
await _0x23c295.wait(3000);
|
||||||
|
}else{
|
||||||
|
console.log('逛会场已完成');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function getUrlData(_0x3c166f,_0x3dcbe9){
|
||||||
|
if(typeof URL!=='undefined'){
|
||||||
|
let _0xe4e3a4=new URL(_0x3c166f);
|
||||||
|
let _0x5ddc8d=_0xe4e3a4.searchParams.get(_0x3dcbe9);
|
||||||
|
return _0x5ddc8d?_0x5ddc8d:'';
|
||||||
|
}else{
|
||||||
|
const _0x114c48=_0x3c166f.match(/\?.*/)[0].substring(1);
|
||||||
|
const _0x1baacd=_0x114c48.split('&');
|
||||||
|
for(let _0x3113d1=0;_0x3113d1<_0x1baacd.length;_0x3113d1++){
|
||||||
|
const _0x414733=_0x1baacd[_0x3113d1].split('=');
|
||||||
|
if(_0x414733[0]===_0x3dcbe9){
|
||||||
|
return _0x1baacd[_0x3113d1].substr(_0x1baacd[_0x3113d1].indexOf('=')+1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return'';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
async function getToken(_0x3c9452){
|
||||||
|
let _0x575ad2={'url':'https://api.m.jd.com/client.action?functionId=isvObfuscator','body':_0x3c9452.body,'headers':{'Host':'api.m.jd.com','accept':'*/*','user-agent':'JD4iPhone/167490 (iPhone; iOS 14.2; Scale/3.00)','accept-language':'zh-Hans-JP;q=1, en-JP;q=0.9, zh-Hant-TW;q=0.8, ja-JP;q=0.7, en-US;q=0.6','content-type':'application/x-www-form-urlencoded','Cookie':_0x3c9452.cookie}};
|
||||||
|
return new Promise(_0x177e3a=>{
|
||||||
|
_0x3c9452.post(_0x575ad2,async(_0x846899,_0x5ddcd4,_0x58ed45)=>{
|
||||||
|
try{
|
||||||
|
if(_0x846899){
|
||||||
|
console.log(''+JSON.stringify(_0x846899));
|
||||||
|
console.log(_0x3c9452.name+' API请求失败,请检查网路重试');
|
||||||
|
}else{
|
||||||
|
_0x58ed45=JSON.parse(_0x58ed45);
|
||||||
|
}
|
||||||
|
}catch(_0x537dc9){
|
||||||
|
_0x3c9452.logErr(_0x537dc9,_0x5ddcd4);
|
||||||
|
}
|
||||||
|
finally{
|
||||||
|
_0x177e3a(_0x58ed45.token||'');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
async function getHtml(_0x4addca){
|
||||||
|
let _0x25eb03={'url':_0x4addca.thisActivityUrl,'headers':{'Host':_0x4addca.host,'Accept':'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8','Cookie':'IsvToken='+_0x4addca.token+';'+_0x4addca.cookie,'User-Agent':_0x4addca.UA,'Accept-Language':'zh-cn','Accept-Encoding':'gzip, deflate, br','Connection':'keep-alive'}};
|
||||||
|
return new Promise(_0x35175a=>{
|
||||||
|
_0x4addca.get(_0x25eb03,(_0x53f11b,_0x24beb3,_0x50a1a1)=>{
|
||||||
|
try{
|
||||||
|
dealCK(_0x4addca,_0x24beb3);
|
||||||
|
}catch(_0x182b52){
|
||||||
|
_0x4addca.logErr(_0x182b52,_0x24beb3);
|
||||||
|
}
|
||||||
|
finally{
|
||||||
|
_0x35175a(_0x50a1a1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function dealCK(_0x1ea343,_0x122b40){
|
||||||
|
if(_0x122b40===undefined){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let _0x3d9911=_0x122b40.headers['set-cookie']||_0x122b40.headers['Set-Cookie']||'';
|
||||||
|
if(_0x3d9911){
|
||||||
|
let _0x2fabb2=_0x3d9911.filter(_0x942508=>_0x942508.indexOf('lz_jdpin_token')!==-1)[0];
|
||||||
|
if(_0x2fabb2&&(_0x2fabb2.indexOf('lz_jdpin_token=')>-1)){
|
||||||
|
_0x1ea343.lz_jdpin_token=_0x2fabb2.split(';')&&(_0x2fabb2.split(';')[0]+';')||'';
|
||||||
|
}
|
||||||
|
let _0x23a7e9=_0x3d9911.filter(_0x41bf1f=>_0x41bf1f.indexOf('LZ_TOKEN_KEY')!==-1)[0];
|
||||||
|
if(_0x23a7e9&&(_0x23a7e9.indexOf('LZ_TOKEN_KEY=')>-1)){
|
||||||
|
let _0x22583b=_0x23a7e9.split(';')&&_0x23a7e9.split(';')[0]||'';
|
||||||
|
_0x1ea343.LZ_TOKEN_KEY=_0x22583b.replace('LZ_TOKEN_KEY=','');
|
||||||
|
}
|
||||||
|
let _0x381ba3=_0x3d9911.filter(_0x29a259=>_0x29a259.indexOf('LZ_TOKEN_VALUE')!==-1)[0];
|
||||||
|
if(_0x381ba3&&_0x381ba3.indexOf('LZ_TOKEN_VALUE=')>-1){
|
||||||
|
let _0x1f6cc4=_0x381ba3.split(';')&&_0x381ba3.split(';')[0]||'';
|
||||||
|
_0x1ea343.LZ_TOKEN_VALUE=_0x1f6cc4.replace('LZ_TOKEN_VALUE=','');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
async function takePostRequest(_0x22084a,_0x4d19d2,_0x4cee5b='activityId='+_0x22084a.activityId+'&pin='+encodeURIComponent(_0x22084a.pin)){
|
||||||
|
let _0x3e5e9='https://'+_0x22084a.host+'/'+_0x4d19d2;
|
||||||
|
switch(_0x4d19d2){
|
||||||
|
case 'customer/getSimpleActInfoVo':
|
||||||
|
case 'dz/common/getSimpleActInfoVo':
|
||||||
|
case 'wxCommonInfo/initActInfo':
|
||||||
|
case 'wxCollectionActivity/shopInfo':
|
||||||
|
case 'wxCollectCard/shopInfo':
|
||||||
|
case 'wxCollectCard/drawContent':
|
||||||
|
_0x4cee5b='activityId='+_0x22084a.activityId;
|
||||||
|
break;
|
||||||
|
case 'customer/getMyPing':
|
||||||
|
_0x4cee5b='userId='+_0x22084a.venderId+'&token='+encodeURIComponent(_0x22084a.token)+'&fromType=APP';
|
||||||
|
break;
|
||||||
|
case'common/accessLogWithAD':
|
||||||
|
case 'common/accessLog':
|
||||||
|
_0x4cee5b='venderId='+_0x22084a.venderId+'&code='+_0x22084a.activityType+'&pin='+encodeURIComponent(_0x22084a.pin)+'&activityId='+_0x22084a.activityId+'&pageUrl='+encodeURIComponent(_0x22084a.thisActivityUrl)+'&subType=app&adSource=null';
|
||||||
|
break;
|
||||||
|
case 'wxActionCommon/getUserInfo':
|
||||||
|
_0x4cee5b='pin='+encodeURIComponent(_0x22084a.pin);
|
||||||
|
break;
|
||||||
|
case'wxCommonInfo/getActMemberInfo':
|
||||||
|
_0x4cee5b='venderId='+_0x22084a.venderId+'&activityId='+_0x22084a.activityId+'&pin='+encodeURIComponent(_0x22084a.pin);
|
||||||
|
break;
|
||||||
|
case 'wxActionCommon/getShopInfoVO':
|
||||||
|
_0x4cee5b='userId='+_0x22084a.venderId;
|
||||||
|
break;
|
||||||
|
case '2222':
|
||||||
|
_0x4cee5b='222';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
const _0x2993f8={'X-Requested-With':'XMLHttpRequest','Connection':'keep-alive','Accept-Encoding':'gzip, deflate, br','Content-Type':'application/x-www-form-urlencoded','Origin':'https://'+_0x22084a.host,'User-Agent':_0x22084a.UA,'Cookie':_0x22084a.cookie+' LZ_TOKEN_KEY='+_0x22084a.LZ_TOKEN_KEY+'; LZ_TOKEN_VALUE='+_0x22084a.LZ_TOKEN_VALUE+'; AUTH_C_USER='+_0x22084a.pin+'; '+_0x22084a.lz_jdpin_token,'Host':_0x22084a.host,'Referer':_0x22084a.thisActivityUrl,'Accept-Language':'zh-cn','Accept':'application/json'};
|
||||||
|
let _0x1e0fb8={'url':_0x3e5e9,'method':'POST','headers':_0x2993f8,'body':_0x4cee5b};
|
||||||
|
return new Promise(async _0x4afe88=>{
|
||||||
|
_0x22084a.post(_0x1e0fb8,(_0xa06eab,_0x445f4b,_0x1ac3a4)=>{
|
||||||
|
try{
|
||||||
|
dealCK(_0x22084a,_0x445f4b);
|
||||||
|
if(_0x1ac3a4){
|
||||||
|
_0x1ac3a4=JSON.parse(_0x1ac3a4);
|
||||||
|
}
|
||||||
|
}catch(_0x174945){
|
||||||
|
console.log(_0x1ac3a4);
|
||||||
|
_0x22084a.logErr(_0x174945,_0x445f4b);
|
||||||
|
}
|
||||||
|
finally{
|
||||||
|
_0x4afe88(_0x1ac3a4);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
async function join(_0x20b776){
|
||||||
|
_0x20b776.shopactivityId='';
|
||||||
|
await _0x20b776.wait(1000);
|
||||||
|
await getshopactivityId(_0x20b776);
|
||||||
|
let _0x2c5d06='';
|
||||||
|
if(_0x20b776.shopactivityId)_0x2c5d06=',"activityId":'+_0x20b776.shopactivityId;
|
||||||
|
let _0x317371={'url':'https://api.m.jd.com/client.action?appid=jd_shop_member&functionId=bindWithVender&body={"venderId":"'+_0x20b776.venderId+'","shopId":"'+_0x20b776.venderId+'","bindByVerifyCodeFlag":1,"registerExtend":{},"writeChildFlag":0'+_0x2c5d06+',"channel":401}&client=H5&clientVersion=9.2.0&uuid=88888','headers':{'Content-Type':'text/plain; Charset=UTF-8','Origin':'https://api.m.jd.com','Host':'api.m.jd.com','accept':'*/*','User-Agent':_0x20b776.UA,'content-type':'application/x-www-form-urlencoded','Referer':'https://shopmember.m.jd.com/shopcard/?venderId='+_0x20b776.venderId+'&shopId='+_0x20b776.venderId,'Cookie':_0x20b776.cookie}};
|
||||||
|
return new Promise(async _0x373e23=>{
|
||||||
|
_0x20b776.get(_0x317371,async(_0x520d30,_0x1d78d3,_0x5a3bf2)=>{
|
||||||
|
try{
|
||||||
|
_0x5a3bf2=JSON.parse(_0x5a3bf2);
|
||||||
|
if(_0x5a3bf2.success==true){
|
||||||
|
_0x20b776.log(_0x5a3bf2.message);
|
||||||
|
if(_0x5a3bf2.result&&_0x5a3bf2.result.giftInfo){
|
||||||
|
for(let _0x57e5da of _0x5a3bf2.result.giftInfo.giftList){
|
||||||
|
console.log('入会获得:'+_0x57e5da.discountString+_0x57e5da.prizeName+_0x57e5da.secondLineDesc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else if(_0x5a3bf2.success==false){
|
||||||
|
_0x20b776.log(_0x5a3bf2.message);
|
||||||
|
}
|
||||||
|
}catch(_0x470238){
|
||||||
|
_0x20b776.logErr(_0x470238,_0x1d78d3);
|
||||||
|
}
|
||||||
|
finally{
|
||||||
|
_0x373e23(_0x5a3bf2);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
async function getshopactivityId(_0x42e0bc){
|
||||||
|
let _0x29a492={'url':'https://api.m.jd.com/client.action?appid=jd_shop_member&functionId=getShopOpenCardInfo&body=%7B%22venderId%22%3A%22'+_0x42e0bc.venderId+'%22%2C%22channel%22%3A401%7D&client=H5&clientVersion=9.2.0&uuid=88888','headers':{'Content-Type':'text/plain; Charset=UTF-8','Origin':'https://api.m.jd.com','Host':'api.m.jd.com','accept':'*/*','User-Agent':_0x42e0bc.UA,'content-type':'application/x-www-form-urlencoded','Referer':'https://shopmember.m.jd.com/shopcard/?venderId='+_0x42e0bc.venderId+'&shopId='+_0x42e0bc.venderId,'Cookie':_0x42e0bc.cookie}};
|
||||||
|
return new Promise(_0x49664a=>{
|
||||||
|
_0x42e0bc.get(_0x29a492,async(_0x5b3807,_0x5d61b1,_0x313fb3)=>{
|
||||||
|
try{
|
||||||
|
_0x313fb3=JSON.parse(_0x313fb3);
|
||||||
|
if(_0x313fb3.success==true){
|
||||||
|
console.log('入会:'+(_0x313fb3.result.shopMemberCardInfo.venderCardName||''));
|
||||||
|
_0x42e0bc.shopactivityId=_0x313fb3.result.interestsRuleList&&_0x313fb3.result.interestsRuleList[0]&&_0x313fb3.result.interestsRuleList[0].interestsInfo&&_0x313fb3.result.interestsRuleList[0].interestsInfo.activityId||'';
|
||||||
|
}
|
||||||
|
}catch(_0x254d1e){
|
||||||
|
_0x42e0bc.logErr(_0x254d1e,_0x5d61b1);
|
||||||
|
}
|
||||||
|
finally{
|
||||||
|
_0x49664a();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function getRandomArrayElements(_0x424ad7,_0x39bfd1){
|
||||||
|
var _0x4063b6=_0x424ad7.slice(0),_0x57a8d=_0x424ad7.length,_0x5dc753=_0x57a8d-_0x39bfd1,_0x3010ad,_0x581bb0;
|
||||||
|
while(_0x57a8d-->_0x5dc753){
|
||||||
|
_0x581bb0=Math.floor((_0x57a8d+1)*Math.random());
|
||||||
|
_0x3010ad=_0x4063b6[_0x581bb0];
|
||||||
|
_0x4063b6[_0x581bb0]=_0x4063b6[_0x57a8d];
|
||||||
|
_0x4063b6[_0x57a8d]=_0x3010ad;
|
||||||
|
}
|
||||||
|
return _0x4063b6.slice(_0x5dc753);
|
||||||
|
};
|
||||||
|
function Env(t,e){
|
||||||
|
"undefined"!=typeof process&&JSON.stringify(process.env).indexOf("GITHUB")>-1&&process.exit(0);
|
||||||
|
class s{
|
||||||
|
constructor(t){
|
||||||
|
this.env=t
|
||||||
|
}send(t,e="GET"){
|
||||||
|
t="string"==typeof t?{url:t}:t;
|
||||||
|
let s=this.get;
|
||||||
|
return"POST"===e&&(s=this.post),new Promise((e,i)=>{
|
||||||
|
s.call(this,t,(t,s,r)=>{t?i(t):e(s)})
|
||||||
|
})
|
||||||
|
}get(t){
|
||||||
|
return this.send.call(this.env,t)
|
||||||
|
}post(t){
|
||||||
|
return this.send.call(this.env,t,"POST")
|
||||||
|
}
|
||||||
|
}return new class{
|
||||||
|
constructor(t,e){
|
||||||
|
this.name=t,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.isNeedRewrite=!1,this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`🔔${this.name}, 开始!`)
|
||||||
|
}isNode(){
|
||||||
|
return"undefined"!=typeof module&&!!module.exports
|
||||||
|
}isQuanX(){
|
||||||
|
return"undefined"!=typeof $task
|
||||||
|
}isSurge(){
|
||||||
|
return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon
|
||||||
|
}isLoon(){
|
||||||
|
return"undefined"!=typeof $loon
|
||||||
|
}toObj(t,e=null){
|
||||||
|
try{
|
||||||
|
return JSON.parse(t)
|
||||||
|
}catch{
|
||||||
|
return e
|
||||||
|
}
|
||||||
|
}toStr(t,e=null){
|
||||||
|
try{
|
||||||
|
return JSON.stringify(t)
|
||||||
|
}catch{
|
||||||
|
return e
|
||||||
|
}
|
||||||
|
}getjson(t,e){
|
||||||
|
let s=e;
|
||||||
|
const i=this.getdata(t);
|
||||||
|
if(i)try{
|
||||||
|
s=JSON.parse(this.getdata(t))
|
||||||
|
}catch{}return s
|
||||||
|
}setjson(t,e){
|
||||||
|
try{
|
||||||
|
return this.setdata(JSON.stringify(t),e)
|
||||||
|
}catch{
|
||||||
|
return!1
|
||||||
|
}
|
||||||
|
}getScript(t){
|
||||||
|
return new Promise(e=>{
|
||||||
|
this.get({url:t},(t,s,i)=>e(i))
|
||||||
|
})
|
||||||
|
}runScript(t,e){
|
||||||
|
return new Promise(s=>{
|
||||||
|
let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");
|
||||||
|
i=i?i.replace(/\n/g,"").trim():i;
|
||||||
|
let r=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");
|
||||||
|
r=r?1*r:20,r=e&&e.timeout?e.timeout:r;
|
||||||
|
const[o,h]=i.split("@"),n={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};
|
||||||
|
this.post(n,(t,e,i)=>s(i))
|
||||||
|
}).catch(t=>this.logErr(t))
|
||||||
|
}loaddata(){
|
||||||
|
if(!this.isNode())return{};
|
||||||
|
{
|
||||||
|
this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");
|
||||||
|
const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e);
|
||||||
|
if(!s&&!i)return{};
|
||||||
|
{
|
||||||
|
const i=s?t:e;
|
||||||
|
try{
|
||||||
|
return JSON.parse(this.fs.readFileSync(i))
|
||||||
|
}catch(t){
|
||||||
|
return{}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}writedata(){
|
||||||
|
if(this.isNode()){
|
||||||
|
this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");
|
||||||
|
const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e),r=JSON.stringify(this.data);
|
||||||
|
s?this.fs.writeFileSync(t,r):i?this.fs.writeFileSync(e,r):this.fs.writeFileSync(t,r)
|
||||||
|
}
|
||||||
|
}lodash_get(t,e,s){
|
||||||
|
const i=e.replace(/\[(\d+)\]/g,".$1").split(".");
|
||||||
|
let r=t;
|
||||||
|
for(const t of i)if(r=Object(r)[t],void 0===r)return s;
|
||||||
|
return r
|
||||||
|
}lodash_set(t,e,s){return Object(t)!==t?t:(Array.isArray(e)||(e=e.toString().match(/[^.[\]]+/g)||[]),e.slice(0,-1).reduce((t,s,i)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[i+1])>>0==+e[i+1]?[]:{},t)[e[e.length-1]]=s,t)}getdata(t){
|
||||||
|
let e=this.getval(t);
|
||||||
|
if(/^@/.test(t)){
|
||||||
|
const[,s,i]=/^@(.*?)\.(.*?)$/.exec(t),r=s?this.getval(s):"";
|
||||||
|
if(r)try{
|
||||||
|
const t=JSON.parse(r);
|
||||||
|
e=t?this.lodash_get(t,i,""):e
|
||||||
|
}catch(t){
|
||||||
|
e=""
|
||||||
|
}
|
||||||
|
}return e
|
||||||
|
}setdata(t,e){
|
||||||
|
let s=!1;
|
||||||
|
if(/^@/.test(e)){
|
||||||
|
const[,i,r]=/^@(.*?)\.(.*?)$/.exec(e),o=this.getval(i),h=i?"null"===o?null:o||"{}":"{}";
|
||||||
|
try{
|
||||||
|
const e=JSON.parse(h);
|
||||||
|
this.lodash_set(e,r,t),s=this.setval(JSON.stringify(e),i)
|
||||||
|
}catch(e){
|
||||||
|
const o={};
|
||||||
|
this.lodash_set(o,r,t),s=this.setval(JSON.stringify(o),i)
|
||||||
|
}
|
||||||
|
}else s=this.setval(t,e);
|
||||||
|
return s
|
||||||
|
}getval(t){
|
||||||
|
return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null
|
||||||
|
}setval(t,e){
|
||||||
|
return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null
|
||||||
|
}initGotEnv(t){
|
||||||
|
this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))
|
||||||
|
}get(t,e=(()=>{})){
|
||||||
|
t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{
|
||||||
|
!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)
|
||||||
|
})):this.isQuanX()?(this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{
|
||||||
|
const{statusCode:s,statusCode:i,headers:r,body:o}=t;
|
||||||
|
e(null,{status:s,statusCode:i,headers:r,body:o},o)
|
||||||
|
},t=>e(t))):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{
|
||||||
|
try{
|
||||||
|
if(t.headers["set-cookie"]){
|
||||||
|
const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();
|
||||||
|
s&&this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar
|
||||||
|
}
|
||||||
|
}catch(t){
|
||||||
|
this.logErr(t)
|
||||||
|
}
|
||||||
|
}).then(t=>{
|
||||||
|
const{statusCode:s,statusCode:i,headers:r,body:o}=t;
|
||||||
|
e(null,{status:s,statusCode:i,headers:r,body:o},o)
|
||||||
|
},t=>{
|
||||||
|
const{message:s,response:i}=t;
|
||||||
|
e(s,i,i&&i.body)
|
||||||
|
}))
|
||||||
|
}post(t,e=(()=>{})){
|
||||||
|
if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{
|
||||||
|
!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)
|
||||||
|
});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{
|
||||||
|
const{statusCode:s,statusCode:i,headers:r,body:o}=t;
|
||||||
|
e(null,{status:s,statusCode:i,headers:r,body:o},o)
|
||||||
|
},t=>e(t));else if(this.isNode()){
|
||||||
|
this.initGotEnv(t);
|
||||||
|
const{
|
||||||
|
url:s,...i
|
||||||
|
}=t;
|
||||||
|
this.got.post(s,i).then(t=>{
|
||||||
|
const{statusCode:s,statusCode:i,headers:r,body:o}=t;
|
||||||
|
e(null,{status:s,statusCode:i,headers:r,body:o},o)
|
||||||
|
},t=>{
|
||||||
|
const{message:s,response:i}=t;
|
||||||
|
e(s,i,i&&i.body)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}time(t,e=null){
|
||||||
|
const s=e?new Date(e):new Date;
|
||||||
|
let i={"M+":s.getMonth()+1,"d+":s.getDate(),"H+":s.getHours(),"m+":s.getMinutes(),"s+":s.getSeconds(),"q+":Math.floor((s.getMonth()+3)/3),S:s.getMilliseconds()};
|
||||||
|
/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(s.getFullYear()+"").substr(4-RegExp.$1.length)));
|
||||||
|
for(let e in i)new RegExp("("+e+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?i[e]:("00"+i[e]).substr((""+i[e]).length)));
|
||||||
|
return t
|
||||||
|
}msg(e=t,s="",i="",r){
|
||||||
|
const o=t=>{
|
||||||
|
if(!t)return t;
|
||||||
|
if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}
|
||||||
|
:this.isSurge()?{url:t}:void 0;
|
||||||
|
if("object"==typeof t){
|
||||||
|
if(this.isLoon()){
|
||||||
|
let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];
|
||||||
|
return{openUrl:e,mediaUrl:s}
|
||||||
|
}
|
||||||
|
if(this.isQuanX()){
|
||||||
|
let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;
|
||||||
|
return{"open-url":e,"media-url":s}
|
||||||
|
}if(this.isSurge()){
|
||||||
|
let e=t.url||t.openUrl||t["open-url"];
|
||||||
|
return{url:e}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
if(this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r))),!this.isMuteLog){
|
||||||
|
let t=["","==============📣系统通知📣=============="];
|
||||||
|
t.push(e),s&&t.push(s),i&&t.push(i),console.log(t.join("\n")),this.logs=this.logs.concat(t)
|
||||||
|
}
|
||||||
|
}log(...t){
|
||||||
|
t.length>0&&(this.logs=[...this.logs,...t]),console.log(t.join(this.logSeparator))
|
||||||
|
}logErr(t,e){
|
||||||
|
const s=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();
|
||||||
|
s?this.log("",`❗️${this.name}, 错误!`,t.stack):this.log("",`❗️${this.name}, 错误!`,t)
|
||||||
|
}wait(t){
|
||||||
|
return new Promise(e=>setTimeout(e,t))
|
||||||
|
}done(t={}){
|
||||||
|
const e=(new Date).getTime(),s=(e-this.startTime)/1e3;
|
||||||
|
this.log("",`🔔${this.name}, 结束! 🕛 ${s} 秒`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)
|
||||||
|
}
|
||||||
|
}(t,e)
|
||||||
|
};
|
|
@ -0,0 +1,79 @@
|
||||||
|
//20 5,12,21 * * * m_jd_farm_automation.js
|
||||||
|
//问题反馈:https://t.me/Wall_E_Channel
|
||||||
|
const {Env} = require('./magic');
|
||||||
|
const $ = new Env('M农场自动化');
|
||||||
|
let level = process.env.M_JD_FARM_LEVEL ? process.env.M_JD_FARM_LEVEL * 1 : 2
|
||||||
|
$.log('默认种植2级种子,自行配置请配置 M_JD_FARM_LEVEL')
|
||||||
|
$.logic = async function () {
|
||||||
|
let info = await api('initForFarm',
|
||||||
|
{"version": 11, "channel": 3, "babelChannel": 0});
|
||||||
|
$.log(JSON.stringify(info));
|
||||||
|
if (!info?.farmUserPro?.treeState) {
|
||||||
|
$.log('可能没玩农场')
|
||||||
|
}
|
||||||
|
if (info.farmUserPro.treeState === 1) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (info.farmUserPro.treeState === 2) {
|
||||||
|
await $.wait(1000, 3000)
|
||||||
|
$.log(`${info.farmUserPro.name},种植时间:${$.formatDate(
|
||||||
|
info.farmUserPro.createTime)}`);
|
||||||
|
//成熟了
|
||||||
|
let coupon = await api('gotCouponForFarm',
|
||||||
|
{"version": 11, "channel": 3, "babelChannel": 0});
|
||||||
|
$.log(coupon)
|
||||||
|
info = await api('initForFarm',
|
||||||
|
{"version": 11, "channel": 3, "babelChannel": 0});
|
||||||
|
}
|
||||||
|
if (info.farmUserPro.treeState !== 3) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
let hongBao = info.myHongBaoInfo.hongBao;
|
||||||
|
$.putMsg(`${hongBao.discount}红包,${$.formatDate(hongBao.endTime)}过期`)
|
||||||
|
let element = info.farmLevelWinGoods[level][0];
|
||||||
|
await $.wait(1000, 3000)
|
||||||
|
info = await api('choiceGoodsForFarm', {
|
||||||
|
"imageUrl": '',
|
||||||
|
"nickName": '',
|
||||||
|
"shareCode": '',
|
||||||
|
"goodsType": element.type,
|
||||||
|
"type": "0",
|
||||||
|
"version": 11,
|
||||||
|
"channel": 3,
|
||||||
|
"babelChannel": 0
|
||||||
|
});
|
||||||
|
if (info.code * 1 === 0) {
|
||||||
|
$.putMsg(`已种【${info.farmUserPro.name}】`)
|
||||||
|
}
|
||||||
|
await api('gotStageAwardForFarm',
|
||||||
|
{"type": "4", "version": 11, "channel": 3, "babelChannel": 0});
|
||||||
|
await api('waterGoodForFarm',
|
||||||
|
{"type": "", "version": 11, "channel": 3, "babelChannel": 0});
|
||||||
|
await api('gotStageAwardForFarm',
|
||||||
|
{"type": "1", "version": 11, "channel": 3, "babelChannel": 0});
|
||||||
|
};
|
||||||
|
|
||||||
|
$.run({
|
||||||
|
wait: [20000, 30000], whitelist: ['1-15']
|
||||||
|
}).catch(
|
||||||
|
reason => $.log(reason));
|
||||||
|
|
||||||
|
// noinspection DuplicatedCode
|
||||||
|
async function api(fn, body) {
|
||||||
|
let url = `https://api.m.jd.com/client.action?functionId=${fn}&body=${JSON.stringify(
|
||||||
|
body)}&client=apple&clientVersion=10.0.4&osVersion=13.7&appid=wh5&loginType=2&loginWQBiz=interact`
|
||||||
|
//↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓请求头↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
|
||||||
|
let headers = {
|
||||||
|
"Cookie": $.cookie,
|
||||||
|
"Connection": "keep-alive",
|
||||||
|
"Accept": "*/*",
|
||||||
|
"Host": "api.m.jd.com",
|
||||||
|
'User-Agent': `Mozilla/5.0 (iPhone; CPU iPhone OS 14_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.4(0x1800042c) NetType/4G Language/zh_CN miniProgram`,
|
||||||
|
"Accept-Encoding": "gzip, deflate, br",
|
||||||
|
"Accept-Language": "zh-cn"
|
||||||
|
}
|
||||||
|
let {data} = await $.request(url, headers)
|
||||||
|
await $.wait(1000, 3000)
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,408 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
'''
|
||||||
|
cron: 1 1 1 1 *
|
||||||
|
new Env('发财挖宝');
|
||||||
|
活动入口: 京东极速版 > 我的 > 发财挖宝
|
||||||
|
最高可得总和为10元的微信零钱和红包
|
||||||
|
脚本功能为: 挖宝,提现,没有助力功能,当血量剩余 1 时停止挖宝,领取奖励并提现
|
||||||
|
|
||||||
|
目前需要完成逛一逛任务并且下单任务才能通关,不做的话大概可得1.5~2块的微信零钱
|
||||||
|
'''
|
||||||
|
import os,json,random,time,re,string,functools,asyncio
|
||||||
|
import sys
|
||||||
|
sys.path.append('../../tmp')
|
||||||
|
print('\n运行本脚本之前请手动进入游戏点击一个方块\n')
|
||||||
|
print('\n挖的如果都是0.01红包就是黑了,别挣扎了!\n')
|
||||||
|
print('\n默认自动领取奖励,关闭请在代码383行加上#号注释即可\n')
|
||||||
|
try:
|
||||||
|
import requests
|
||||||
|
except Exception as e:
|
||||||
|
print(str(e) + "\n缺少requests模块, 请执行命令:pip3 install requests\n")
|
||||||
|
requests.packages.urllib3.disable_warnings()
|
||||||
|
|
||||||
|
|
||||||
|
linkId="pTTvJeSTrpthgk9ASBVGsw"
|
||||||
|
|
||||||
|
|
||||||
|
# 获取pin
|
||||||
|
cookie_findall=re.compile(r'pt_pin=(.+?);')
|
||||||
|
def get_pin(cookie):
|
||||||
|
try:
|
||||||
|
return cookie_findall.findall(cookie)[0]
|
||||||
|
except:
|
||||||
|
print('ck格式不正确,请检查')
|
||||||
|
|
||||||
|
# 读取环境变量
|
||||||
|
def get_env(env):
|
||||||
|
try:
|
||||||
|
if env in os.environ:
|
||||||
|
a=os.environ[env]
|
||||||
|
elif '/ql' in os.path.abspath(os.path.dirname(__file__)):
|
||||||
|
try:
|
||||||
|
a=v4_env(env,'/ql/config/config.sh')
|
||||||
|
except:
|
||||||
|
a=eval(env)
|
||||||
|
elif '/jd' in os.path.abspath(os.path.dirname(__file__)):
|
||||||
|
try:
|
||||||
|
a=v4_env(env,'/jd/config/config.sh')
|
||||||
|
except:
|
||||||
|
a=eval(env)
|
||||||
|
else:
|
||||||
|
a=eval(env)
|
||||||
|
except:
|
||||||
|
a=''
|
||||||
|
return a
|
||||||
|
|
||||||
|
# v4
|
||||||
|
def v4_env(env,paths):
|
||||||
|
b=re.compile(r'(?:export )?'+env+r' ?= ?[\"\'](.*?)[\"\']', re.I)
|
||||||
|
with open(paths, 'r') as f:
|
||||||
|
for line in f.readlines():
|
||||||
|
try:
|
||||||
|
c=b.match(line).group(1)
|
||||||
|
break
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
return c
|
||||||
|
|
||||||
|
|
||||||
|
# 随机ua
|
||||||
|
def ua():
|
||||||
|
sys.path.append(os.path.abspath('.'))
|
||||||
|
try:
|
||||||
|
from jdEnv import USER_AGENTS as a
|
||||||
|
except:
|
||||||
|
a='jdpingou;android;5.5.0;11;network/wifi;model/M2102K1C;appBuild/18299;partner/lcjx11;session/110;pap/JA2019_3111789;brand/Xiaomi;Mozilla/5.0 (Linux; Android 11; M2102K1C Build/RKQ1.201112.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/92.0.4515.159 Mobile Safari/537.36'
|
||||||
|
return a
|
||||||
|
|
||||||
|
# 13位时间戳
|
||||||
|
def gettimestamp():
|
||||||
|
return str(int(time.time() * 1000))
|
||||||
|
|
||||||
|
## 获取cooie
|
||||||
|
class Judge_env(object):
|
||||||
|
def main_run(self):
|
||||||
|
if '/jd' in os.path.abspath(os.path.dirname(__file__)):
|
||||||
|
cookie_list=self.v4_cookie()
|
||||||
|
else:
|
||||||
|
cookie_list=os.environ["JD_COOKIE"].split('&') # 获取cookie_list的合集
|
||||||
|
if len(cookie_list)<1:
|
||||||
|
print('请填写环境变量JD_COOKIE\n')
|
||||||
|
return cookie_list
|
||||||
|
|
||||||
|
def v4_cookie(self):
|
||||||
|
a=[]
|
||||||
|
b=re.compile(r'Cookie'+'.*?=\"(.*?)\"', re.I)
|
||||||
|
with open('/jd/config/config.sh', 'r') as f:
|
||||||
|
for line in f.readlines():
|
||||||
|
try:
|
||||||
|
regular=b.match(line).group(1)
|
||||||
|
a.append(regular)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
return a
|
||||||
|
cookie_list=Judge_env().main_run()
|
||||||
|
|
||||||
|
|
||||||
|
def taskGetUrl(functionId, body, cookie):
|
||||||
|
url=f'https://api.m.jd.com/?functionId={functionId}&body={json.dumps(body)}&t={gettimestamp()}&appid=activities_platform&client=H5&clientVersion=1.0.0'
|
||||||
|
headers={
|
||||||
|
'Cookie': cookie,
|
||||||
|
'Host': 'api.m.jd.com',
|
||||||
|
'Connection': 'keep-alive',
|
||||||
|
'origin': 'https://bnzf.jd.com',
|
||||||
|
'Content-Type': 'application/x-www-form-urlencoded',
|
||||||
|
'accept': 'application/json, text/plain, */*',
|
||||||
|
"User-Agent": ua(),
|
||||||
|
'Accept-Language': 'zh-cn',
|
||||||
|
'Accept-Encoding': 'gzip, deflate, br',
|
||||||
|
}
|
||||||
|
for n in range(3):
|
||||||
|
try:
|
||||||
|
res=requests.get(url,headers=headers, timeout=10).json()
|
||||||
|
return res
|
||||||
|
except:
|
||||||
|
if n==2:
|
||||||
|
print('API请求失败,请检查网路重试❗\n')
|
||||||
|
|
||||||
|
|
||||||
|
# 剩余血量
|
||||||
|
def xueliang(cookie):
|
||||||
|
body={"linkId":linkId,"round":1}
|
||||||
|
res=taskGetUrl("happyDigHome", body, cookie)
|
||||||
|
if not res:
|
||||||
|
return
|
||||||
|
if res['code']==0:
|
||||||
|
if res['success']:
|
||||||
|
curRound=res['data']['curRound'] # 未知
|
||||||
|
blood=res['data']['blood'] # 剩余血量
|
||||||
|
return blood
|
||||||
|
|
||||||
|
def jinge(cookie,i):
|
||||||
|
body={"linkId":linkId}
|
||||||
|
res=taskGetUrl("happyDigHome", body, cookie)
|
||||||
|
if not res:
|
||||||
|
return
|
||||||
|
if res['code']==0:
|
||||||
|
if res['success']:
|
||||||
|
curRound=res['data']['curRound'] # 未知
|
||||||
|
blood=res['data']['blood'] # 剩余血量
|
||||||
|
roundList=res['data']['roundList'] # 3个总池子
|
||||||
|
roundList_n=roundList[0]
|
||||||
|
redAmount=roundList_n['redAmount'] # 当前池已得京东红包
|
||||||
|
cashAmount=roundList_n['cashAmount'] # 当前池已得微信红包
|
||||||
|
|
||||||
|
return [blood,redAmount,cashAmount]
|
||||||
|
|
||||||
|
# 页面数据
|
||||||
|
def happyDigHome(cookie):
|
||||||
|
body={"linkId":linkId,"round":1}
|
||||||
|
res=taskGetUrl("happyDigHome", body, cookie)
|
||||||
|
exit_flag = "false"
|
||||||
|
if not res:
|
||||||
|
return
|
||||||
|
if res['code']==0:
|
||||||
|
if res['success']:
|
||||||
|
curRound=res['data']['curRound'] # 未知
|
||||||
|
incep_blood=res['data']['blood'] # 剩余血量
|
||||||
|
roundList=res['data']['roundList'] # 3个总池子
|
||||||
|
for e,roundList_n in enumerate(roundList): # 迭代每个池子
|
||||||
|
roundid=roundList_n['round'] # 池序号
|
||||||
|
state=roundList_n['state']
|
||||||
|
rows=roundList_n['rows'] # 池规模,rows*rows
|
||||||
|
redAmount=roundList_n['redAmount'] # 当前池已得京东红包
|
||||||
|
cashAmount=roundList_n['cashAmount'] # 当前池已得微信红包
|
||||||
|
leftAmount=roundList_n['leftAmount'] # 剩余红包?
|
||||||
|
chunks=roundList_n['chunks'] # 当前池详情list
|
||||||
|
|
||||||
|
a=jinge(cookie,roundid)
|
||||||
|
if roundid==1:
|
||||||
|
print(f'\n开始 "入门" 难度关卡({rows}*{rows})')
|
||||||
|
elif roundid==2:
|
||||||
|
print(f'\n开始 "挑战" 难度关卡({rows}*{rows})')
|
||||||
|
elif roundid==3:
|
||||||
|
print(f'\n开始 "终极" 难度关卡({rows}*{rows})')
|
||||||
|
print(f'当前剩余血量 {a[0]}🩸')
|
||||||
|
## print(f'当前池已得京东红包 {a[2]}\n当前池已得微信红包 {a[1]}\n')
|
||||||
|
_blood=xueliang(cookie)
|
||||||
|
if _blood>1 or incep_blood>=21:
|
||||||
|
happyDigDo(cookie,roundid,0,0)
|
||||||
|
if e==0 or e==1:
|
||||||
|
roundid_n=4
|
||||||
|
else:
|
||||||
|
roundid_n=5
|
||||||
|
for n in range(roundid_n):
|
||||||
|
for i in range(roundid_n):
|
||||||
|
_blood=xueliang(cookie)
|
||||||
|
if _blood>1 or incep_blood>=21:
|
||||||
|
## print(f'当前血量为 {_blood}')
|
||||||
|
a=n+1
|
||||||
|
b=i+1
|
||||||
|
print(f'挖取坐标({a},{b})')
|
||||||
|
happyDigDo(cookie,roundid,n,i)
|
||||||
|
else:
|
||||||
|
a=jinge(cookie,roundid)
|
||||||
|
print(f'没血了,不挖了')
|
||||||
|
exit_flag = "true"
|
||||||
|
## print(f'当前池已得京东红包 {a[2]}\n当前池已得微信红包 {a[1]}\n')
|
||||||
|
break
|
||||||
|
|
||||||
|
if exit_flag == "true":
|
||||||
|
break
|
||||||
|
if exit_flag == "true":
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
print(f'获取数据失败\n{res}\n')
|
||||||
|
else:
|
||||||
|
print(f'获取数据失败\n{res}\n')
|
||||||
|
|
||||||
|
|
||||||
|
# 玩一玩
|
||||||
|
def apDoTask(cookie):
|
||||||
|
print('开始做玩一玩任务')
|
||||||
|
body={"linkId":linkId,"taskType":"BROWSE_CHANNEL","taskId":454,"channel":4,"itemId":"https%3A%2F%2Fsignfree.jd.com%2F%3FactivityId%3DPiuLvM8vamONsWzC0wqBGQ","checkVersion":False}
|
||||||
|
res=taskGetUrl('apDoTask', body, cookie)
|
||||||
|
if not res:
|
||||||
|
return
|
||||||
|
try:
|
||||||
|
if res['success']:
|
||||||
|
print('玩好了')
|
||||||
|
else:
|
||||||
|
print(f"{res['errMsg']}")
|
||||||
|
except:
|
||||||
|
print(f"错误\n{res}")
|
||||||
|
|
||||||
|
|
||||||
|
# 挖宝
|
||||||
|
def happyDigDo(cookie,roundid,rowIdx,colIdx):
|
||||||
|
body={"round":roundid,"rowIdx":rowIdx,"colIdx":colIdx,"linkId":linkId}
|
||||||
|
res=taskGetUrl("happyDigDo", body, cookie)
|
||||||
|
if not res:
|
||||||
|
return
|
||||||
|
if res['code']==0:
|
||||||
|
if res['success']:
|
||||||
|
typeid=res['data']['chunk']['type']
|
||||||
|
if typeid==2:
|
||||||
|
print(f"获得极速版红包 {res['data']['chunk']['value']} 🧧\n")
|
||||||
|
elif typeid==3:
|
||||||
|
print(f"🎉 获得微信零钱 {res['data']['chunk']['value']} 💰\n")
|
||||||
|
elif typeid==4:
|
||||||
|
print(f"💥Boom💥 挖到了炸弹 💣\n")
|
||||||
|
elif typeid==1:
|
||||||
|
print(f"获得优惠券 🎟️\n")
|
||||||
|
else:
|
||||||
|
print(f'不知道挖到了什么 🎁\n')
|
||||||
|
else:
|
||||||
|
print(f'{res}\n挖宝失败\n')
|
||||||
|
else:
|
||||||
|
print(f'{res}\n挖宝失败\n')
|
||||||
|
|
||||||
|
# # 助力码
|
||||||
|
# def inviteCode(cookie):
|
||||||
|
# global inviteCode_1_list,inviteCode_2_list
|
||||||
|
# body={"linkId":linkId}
|
||||||
|
# res=taskGetUrl("happyDigHome", body, cookie)
|
||||||
|
# if not res:
|
||||||
|
# return
|
||||||
|
# try:
|
||||||
|
# if res['success']:
|
||||||
|
# print(f"账号{get_pin(cookie)}助力码为{res['data']['inviteCode']}")
|
||||||
|
# inviteCode_1_list.append(res['data']['inviteCode'])
|
||||||
|
# print(f"账号{get_pin(cookie)}助力码为{res['data']['markedPin']}")
|
||||||
|
# inviteCode_2_list.append(res['data']['markedPin'])
|
||||||
|
# else:
|
||||||
|
# print('快去买买买吧')
|
||||||
|
# except:
|
||||||
|
# print(f"错误\n{res}\n")
|
||||||
|
|
||||||
|
# # 助力
|
||||||
|
# def happyDigHelp(cookie,fcwbinviter,fcwbinviteCode):
|
||||||
|
# print(f"账号 {get_pin(cookie)} 去助力{fcwbinviteCode}")
|
||||||
|
# xueliang(cookie)
|
||||||
|
# body={"linkId":linkId,"inviter":fcwbinviter,"inviteCode":fcwbinviteCode}
|
||||||
|
# res=taskGetUrl("happyDigHelp", body, cookie)
|
||||||
|
# if res['success']:
|
||||||
|
# print('助力成功')
|
||||||
|
# else:
|
||||||
|
# print(res['errMsg'])
|
||||||
|
|
||||||
|
# 领取奖励
|
||||||
|
def happyDigExchange(cookie):
|
||||||
|
for n in range(1,4):
|
||||||
|
xueliang(cookie)
|
||||||
|
print(f"\n开始领取第{n}场的奖励")
|
||||||
|
body={"round":n,"linkId":linkId}
|
||||||
|
res=taskGetUrl("happyDigExchange", body, cookie)
|
||||||
|
if not res:
|
||||||
|
return
|
||||||
|
if res['code']==0:
|
||||||
|
if res['success']:
|
||||||
|
try:
|
||||||
|
print(f"已领取极速版红包 {res['data']['redValue']} 🧧")
|
||||||
|
except:
|
||||||
|
print('')
|
||||||
|
if res['data']['wxValue'] != "0":
|
||||||
|
try:
|
||||||
|
print(f"可提现微信零钱 {res['data']['wxValue']} 💰")
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
print(res['errMsg'])
|
||||||
|
else:
|
||||||
|
print(res['errMsg'])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# 微信现金id
|
||||||
|
def spring_reward_list(cookie):
|
||||||
|
happyDigExchange(cookie)
|
||||||
|
xueliang(cookie)
|
||||||
|
|
||||||
|
body={"linkId":linkId,"pageNum":1,"pageSize":6}
|
||||||
|
res=taskGetUrl("spring_reward_list", body, cookie)
|
||||||
|
|
||||||
|
if res['code']==0:
|
||||||
|
if res['success']:
|
||||||
|
items=res['data']['items']
|
||||||
|
for _items in items:
|
||||||
|
amount=_items['amount'] # 金额
|
||||||
|
prizeDesc=_items['prizeDesc'] # 金额备注
|
||||||
|
amountid=_items['id'] # 金额id
|
||||||
|
poolBaseId=_items['poolBaseId']
|
||||||
|
prizeGroupId=_items['prizeGroupId']
|
||||||
|
prizeBaseId=_items['prizeBaseId']
|
||||||
|
if '红包' in f"{prizeDesc}":
|
||||||
|
continue
|
||||||
|
if '券' in f"{prizeDesc}":
|
||||||
|
continue
|
||||||
|
else:
|
||||||
|
print('\n去提现微信零钱 💰')
|
||||||
|
time.sleep(3.2)
|
||||||
|
wecat(cookie,amountid,poolBaseId,prizeGroupId,prizeBaseId)
|
||||||
|
else:
|
||||||
|
print(f'获取数据失败\n{res}\n')
|
||||||
|
else:
|
||||||
|
print(f'获取数据失败\n{res}\n')
|
||||||
|
|
||||||
|
# 微信提现
|
||||||
|
def wecat(cookie,amountid,poolBaseId,prizeGroupId,prizeBaseId):
|
||||||
|
xueliang(cookie)
|
||||||
|
|
||||||
|
url='https://api.m.jd.com'
|
||||||
|
headers={
|
||||||
|
'Cookie': cookie,
|
||||||
|
'Host': 'api.m.jd.com',
|
||||||
|
'Connection': 'keep-alive',
|
||||||
|
'origin': 'https://bnzf.jd.com',
|
||||||
|
'Content-Type': 'application/x-www-form-urlencoded',
|
||||||
|
"User-Agent": ua(),
|
||||||
|
'Accept-Language': 'zh-cn',
|
||||||
|
'Accept-Encoding': 'gzip, deflate, br',
|
||||||
|
}
|
||||||
|
body={"businessSource":"happyDiggerH5Cash","base":{"id":amountid,"business":"happyDigger","poolBaseId":poolBaseId,"prizeGroupId":prizeGroupId,"prizeBaseId":prizeBaseId,"prizeType":4},"linkId":linkId}
|
||||||
|
data=f"functionId=apCashWithDraw&body={json.dumps(body)}&t=1635596380119&appid=activities_platform&client=H5&clientVersion=1.0.0"
|
||||||
|
for n in range(3):
|
||||||
|
try:
|
||||||
|
res=requests.post(url,headers=headers,data=data,timeout=10).json()
|
||||||
|
break
|
||||||
|
except:
|
||||||
|
if n==2:
|
||||||
|
print('API请求失败,请检查网路重试❗\n')
|
||||||
|
try:
|
||||||
|
if res['code']==0:
|
||||||
|
if res['success']:
|
||||||
|
print(res['data']['message']+'\n')
|
||||||
|
except:
|
||||||
|
print(res)
|
||||||
|
print('')
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
print('🔔发财挖宝,开始!\n')
|
||||||
|
|
||||||
|
# print('获取助力码\n')
|
||||||
|
# global inviteCode_1_list,inviteCode_2_list
|
||||||
|
# inviteCode_1_list=list()
|
||||||
|
# inviteCode_2_list=list()
|
||||||
|
# for cookie in cookie_list:
|
||||||
|
# inviteCode(cookie)
|
||||||
|
|
||||||
|
# print('互助\n')
|
||||||
|
# inviteCode_2_list=inviteCode_2_list[:2]
|
||||||
|
# for e,fcwbinviter in enumerate(inviteCode_2_list):
|
||||||
|
# fcwbinviteCode=inviteCode_1_list[e]
|
||||||
|
# for cookie in cookie_list:
|
||||||
|
# happyDigHelp(cookie,fcwbinviter,fcwbinviteCode)
|
||||||
|
|
||||||
|
print(f'====================共{len(cookie_list)}京东个账号Cookie=========\n')
|
||||||
|
|
||||||
|
for e,cookie in enumerate(cookie_list,start=1):
|
||||||
|
print(f'******开始【账号 {e}】 {get_pin(cookie)} *********\n')
|
||||||
|
apDoTask(cookie)
|
||||||
|
happyDigHome(cookie)
|
||||||
|
spring_reward_list(cookie)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
|
@ -0,0 +1,125 @@
|
||||||
|
/*
|
||||||
|
7 7 7 7 7 m_jd_follow_shop.js
|
||||||
|
*/
|
||||||
|
let mode = __dirname.includes('magic')
|
||||||
|
const {Env} = mode ? require('./magic') : require('./magic')
|
||||||
|
const $ = new Env('M关注有礼');
|
||||||
|
$.followShopArgv = process.env.M_FOLLOW_SHOP_ARGV
|
||||||
|
? process.env.M_FOLLOW_SHOP_ARGV
|
||||||
|
: '';
|
||||||
|
if (mode) {
|
||||||
|
$.followShopArgv = '1000104168_1000104168'
|
||||||
|
}
|
||||||
|
$.logic = async function () {
|
||||||
|
let argv = $?.followShopArgv?.split('_');
|
||||||
|
$.shopId = argv?.[0];
|
||||||
|
$.venderId = argv?.[1];
|
||||||
|
if (!$.shopId || !$.venderId) {
|
||||||
|
$.log(`无效的参数${$.followShopArgv}`)
|
||||||
|
$.expire = true;
|
||||||
|
return
|
||||||
|
}
|
||||||
|
let actInfo = await getShopHomeActivityInfo();
|
||||||
|
if (actInfo?.code !== '0') {
|
||||||
|
$.log(JSON.stringify(actInfo))
|
||||||
|
if (actInfo?.message.includes('不匹配')) {
|
||||||
|
$.expire = true;
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
let actInfoData = actInfo?.result;
|
||||||
|
|
||||||
|
if (actInfoData?.shopGifts?.filter(o => o.rearWord.includes('京豆')).length
|
||||||
|
> 0) {
|
||||||
|
$.activityId = actInfoData?.activityId?.toString();
|
||||||
|
let gift = await drawShopGift();
|
||||||
|
if (gift?.code !== '0') {
|
||||||
|
$.log(JSON.stringify(gift))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
let giftData = gift?.result;
|
||||||
|
$.log(giftData)
|
||||||
|
for (let ele of
|
||||||
|
giftData?.alreadyReceivedGifts?.filter(o => o.prizeType === 4) || []) {
|
||||||
|
$.putMsg(`${ele.redWord}${ele.rearWord}`);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$.putMsg(`没有豆子`);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
let kv = {'jd': '京豆', 'jf': '积分', 'dq': 'q券'}
|
||||||
|
$.after = async function () {
|
||||||
|
$.msg.push(`\n${(await $.getShopInfo()).shopName}`);
|
||||||
|
if ($?.content) {
|
||||||
|
let message = `\n`;
|
||||||
|
for (let ele of $.content || []) {
|
||||||
|
message += ` ${ele.takeNum || ele.discount} ${kv[ele?.type]}\n`
|
||||||
|
}
|
||||||
|
$.msg.push(message)
|
||||||
|
$.msg.push($.activityUrl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$.run({whitelist: ['1-5'], wait: [1000, 3000]}).catch(reason => $.log(reason))
|
||||||
|
|
||||||
|
async function drawShopGift() {
|
||||||
|
$.log('店铺信息', $.shopId, $.venderId, $.activityId)
|
||||||
|
let sb = {
|
||||||
|
"follow": 0,
|
||||||
|
"shopId": $.shopId,
|
||||||
|
"activityId": $.activityId,
|
||||||
|
"sourceRpc": "shop_app_home_window",
|
||||||
|
"venderId": $.venderId
|
||||||
|
};
|
||||||
|
let newVar = await $.sign('drawShopGift', sb);
|
||||||
|
|
||||||
|
let headers = {
|
||||||
|
'J-E-H': '',
|
||||||
|
'Connection': 'keep-alive',
|
||||||
|
'Accept-Encoding': 'gzip, deflate, br',
|
||||||
|
'Content-Type': 'application/x-www-form-urlencoded',
|
||||||
|
'Host': 'api.m.jd.com',
|
||||||
|
'Referer': '',
|
||||||
|
'J-E-C': '',
|
||||||
|
'Accept-Language': 'zh-Hans-CN;q=1, en-CN;q=0.9',
|
||||||
|
'Accept': '*/*',
|
||||||
|
'User-Agent': 'JD4iPhone/167841 (iPhone; iOS; Scale/3.00)'
|
||||||
|
}
|
||||||
|
// noinspection DuplicatedCode
|
||||||
|
headers['Cookie'] = $.cookie
|
||||||
|
let url = `https://api.m.jd.com/client.action?functionId=` + newVar.fn
|
||||||
|
let {status, data} = await $.request(url, headers, newVar.sign);
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getShopHomeActivityInfo() {
|
||||||
|
let sb = {
|
||||||
|
"shopId": $.shopId,
|
||||||
|
"source": "app-shop",
|
||||||
|
"latWs": "0",
|
||||||
|
"lngWs": "0",
|
||||||
|
"displayWidth": "1098.000000",
|
||||||
|
"sourceRpc": "shop_app_home_home",
|
||||||
|
"lng": "0",
|
||||||
|
"lat": "0",
|
||||||
|
"venderId": $.venderId
|
||||||
|
}
|
||||||
|
let newVar = await $.sign('getShopHomeActivityInfo', sb);
|
||||||
|
let headers = {
|
||||||
|
'J-E-H': '',
|
||||||
|
'Connection': 'keep-alive',
|
||||||
|
'Accept-Encoding': 'gzip, deflate, br',
|
||||||
|
'Content-Type': 'application/x-www-form-urlencoded',
|
||||||
|
'Host': 'api.m.jd.com',
|
||||||
|
'Referer': '',
|
||||||
|
'J-E-C': '',
|
||||||
|
'Accept-Language': 'zh-Hans-CN;q=1, en-CN;q=0.9',
|
||||||
|
'Accept': '*/*',
|
||||||
|
'User-Agent': 'JD4iPhone/167841 (iPhone; iOS; Scale/3.00)'
|
||||||
|
}
|
||||||
|
// noinspection DuplicatedCode
|
||||||
|
headers['Cookie'] = $.cookie
|
||||||
|
let url = `https://api.m.jd.com/client.action?functionId=` + newVar.fn
|
||||||
|
let {status, data} = await $.request(url, headers, newVar.sign);
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,46 @@
|
||||||
|
/**
|
||||||
|
* 农场自动收+种4级
|
||||||
|
*/
|
||||||
|
|
||||||
|
import USER_AGENT, {o2s, requireConfig, wait} from "./TS_USER_AGENTS"
|
||||||
|
import axios from "axios";
|
||||||
|
|
||||||
|
let cookie: string = '', UserName: string, res: any
|
||||||
|
|
||||||
|
!(async () => {
|
||||||
|
let cookiesArr: string[] = await requireConfig(true)
|
||||||
|
for (let [index, value] of cookiesArr.entries()) {
|
||||||
|
cookie = value
|
||||||
|
UserName = decodeURIComponent(cookie.match(/pt_pin=([^;]*)/)![1])
|
||||||
|
console.log(`\n开始【京东账号${index + 1}】${UserName}\n`)
|
||||||
|
|
||||||
|
res = await api('initForFarm', {"version": 11, "channel": 3, "babelChannel": 0})
|
||||||
|
if (![2, 3].includes(res.farmUserPro.treeState)) {
|
||||||
|
console.log('正在种植...')
|
||||||
|
}
|
||||||
|
if (res.farmUserPro.treeState === 2) {
|
||||||
|
res = await api('gotCouponForFarm', {"version": 11, "channel": 3, "babelChannel": 0})
|
||||||
|
res = await api('initForFarm', {"version": 11, "channel": 3, "babelChannel": 0})
|
||||||
|
}
|
||||||
|
if (res.farmUserPro.treeState === 3) {
|
||||||
|
let element = res.farmLevelWinGoods[4][0];
|
||||||
|
res = await api('choiceGoodsForFarm', {"imageUrl": '', "nickName": '', "shareCode": '', "goodsType": element.type, "type": "0", "version": 11, "channel": 3, "babelChannel": 0});
|
||||||
|
o2s(res)
|
||||||
|
await api('gotStageAwardForFarm', {"type": "4", "version": 11, "channel": 3, "babelChannel": 0});
|
||||||
|
await api('waterGoodForFarm', {"type": "", "version": 11, "channel": 3, "babelChannel": 0});
|
||||||
|
await api('gotStageAwardForFarm', {"type": "1", "version": 11, "channel": 3, "babelChannel": 0});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})()
|
||||||
|
|
||||||
|
async function api(fn: string, body: object) {
|
||||||
|
let {data} = await axios.get(`https://api.m.jd.com/client.action?functionId=${fn}&body=${JSON.stringify(body)}&client=apple&clientVersion=10.0.4&osVersion=13.7&appid=wh5&loginType=2&loginWQBiz=interact`, {
|
||||||
|
headers: {
|
||||||
|
"Cookie": cookie,
|
||||||
|
"Host": "api.m.jd.com",
|
||||||
|
'User-Agent': USER_AGENT,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
await wait(1000)
|
||||||
|
return data
|
||||||
|
}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue