first commit
14
CK_WxPusherUid.json
Normal file
|
@ -0,0 +1,14 @@
|
|||
[
|
||||
{
|
||||
"pt_pin": "ptpin1",
|
||||
"Uid": "UID_AAAAAAAAAAAA"
|
||||
},
|
||||
{
|
||||
"pt_pin": "ptpin2",
|
||||
"Uid": "UID_BBBBBBBBBB"
|
||||
},
|
||||
{
|
||||
"pt_pin": "ptpin3",
|
||||
"Uid": "UID_CCCCCCCCC"
|
||||
}
|
||||
]
|
532
JDJRValidator_Pure.js
Normal file
|
@ -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;
|
2080
JDSignValidator.js
Normal file
119
JD_extra_cookie.js
Normal file
|
@ -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)}
|
92
JS_USER_AGENTS.js
Normal file
|
@ -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
|
||||
}
|
51
USER_AGENTS.js
Normal file
|
@ -0,0 +1,51 @@
|
|||
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",
|
||||
]
|
||||
/**
|
||||
* 生成随机数字
|
||||
* @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
|
||||
}
|
37
docker/Dockerfile
Normal file
|
@ -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" ]
|
264
docker/Readme.md
Normal file
|
@ -0,0 +1,264 @@
|
|||

|
||||
### 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` 可在日志每一行前面显示时间,如下图:
|
||||
> 
|
||||
- 目录文件配置好之后在 `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`。
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
### 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` |
|
155
docker/auto_help.sh
Normal file
|
@ -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"
|
BIN
docker/bot/jd.png
Normal file
After Width: | Height: | Size: 7.2 KiB |
1114
docker/bot/jd_bot
Normal file
5
docker/bot/requirements.txt
Normal file
|
@ -0,0 +1,5 @@
|
|||
python_telegram_bot==13.0
|
||||
requests==2.23.0
|
||||
MyQR==2.3.1
|
||||
telegram==0.0.1
|
||||
tzlocal<3.0
|
13
docker/bot/setup.py
Normal file
|
@ -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', ],
|
||||
)
|
229
docker/crontab_list.sh
Normal file
|
@ -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
|
252
docker/default_task.sh
Normal file
|
@ -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
|
57
docker/docker_entrypoint.sh
Normal file
|
@ -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
|
62
docker/example/custom-append.yml
Normal file
|
@ -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
|
||||
|
62
docker/example/custom-overwrite.yml
Normal file
|
@ -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
|
59
docker/example/default.yml
Normal file
|
@ -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
|
83
docker/example/docker多账户使用独立容器使用说明.md
Normal file
|
@ -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办法一`的基础上实现方式,其实就是不同账户创建不同的容器,他们互不干扰单独定时执行自己的任务。
|
||||
配置使用起来还是比较简单的,具体往下看
|
||||
### 文件夹目录参考
|
||||

|
||||
### 具体使用说明直接在图片标注了,文件参考[图片下方](https://github.com/LXK9301/jd_scripts/new/master/docker#docker-composeyml%E6%96%87%E4%BB%B6%E5%8F%82%E8%80%83),配置完成后的[执行命令]()
|
||||

|
||||
#### `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` 停止并删除容器;
|
||||

|
||||
|
||||
|
65
docker/example/jd_scripts.custom-append.syno.json
Normal file
|
@ -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"
|
||||
}
|
||||
]
|
||||
}
|
69
docker/example/jd_scripts.custom-overwrite.syno.json
Normal file
|
@ -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"
|
||||
}
|
||||
]
|
||||
}
|
83
docker/example/jd_scripts.syno.json
Normal file
|
@ -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"
|
||||
}
|
||||
]
|
||||
}
|
62
docker/example/multi.yml
Normal file
|
@ -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
|
20
docker/notify_docker_user.js
Normal file
|
@ -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))
|
27
docker/proc_file.sh
Normal file
|
@ -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
|
280
function/common.js
Normal file
|
@ -0,0 +1,280 @@
|
|||
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 = [];
|
||||
let type = 0
|
||||
for (let i of array) {
|
||||
text.push(`${i.user} -- ${i.msg}`)
|
||||
type = i.type
|
||||
}
|
||||
console.log(`\n=============================开始发送提醒消息=============================`)
|
||||
if (type == 1) {
|
||||
for (let i of text) {
|
||||
notify.sendNotify(this.name + "消息提醒", i)
|
||||
}
|
||||
} else {
|
||||
notify.sendNotify(this.name + "消息提醒", text.join('\n'))
|
||||
}
|
||||
}
|
||||
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, type = 0) {
|
||||
this.message.push({
|
||||
'index': this.index,
|
||||
'user': this.user,
|
||||
'msg': msg,
|
||||
type
|
||||
})
|
||||
}
|
||||
notices(msg, user, type = 0) {
|
||||
this.message.push({
|
||||
'user': user,
|
||||
'msg': msg,
|
||||
// 'index': index,
|
||||
type
|
||||
})
|
||||
}
|
||||
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,
|
||||
}
|
1
function/config.js
Normal file
|
@ -0,0 +1 @@
|
|||
module.exports = {"ThreadJs":[],"invokeKey":"RtKLB8euDo7KwsO0"}
|
86
function/eval.js
Normal file
|
@ -0,0 +1,86 @@
|
|||
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']
|
||||
if($.config[\`\${$.runfile}_limit\`]){
|
||||
taskCookie = cookies['all'].slice(0,parseInt($.config[\`\${$.runfile}_limit\`]))
|
||||
}
|
||||
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
|
||||
}
|
466
function/jdValidate.js
Normal file
|
@ -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
|
6
function/jdcookie.js
Normal file
|
@ -0,0 +1,6 @@
|
|||
// 本地测试在这边填写cookie
|
||||
let cookie = [
|
||||
];
|
||||
module.exports = {
|
||||
cookie
|
||||
}
|
204
function/jxAlgo.js
Normal file
|
@ -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
|
149
function/ql.js
Normal file
|
@ -0,0 +1,149 @@
|
|||
'use strict';
|
||||
|
||||
const got = require('got');
|
||||
require('dotenv').config();
|
||||
const { readFile } = require('fs/promises');
|
||||
const path = require('path');
|
||||
|
||||
const qlDir = '/ql';
|
||||
const authFile = path.join(qlDir, 'config/auth.json');
|
||||
|
||||
const api = got.extend({
|
||||
prefixUrl: 'http://localhost: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.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();
|
||||
for (let i = 0; i < envs.length; i++) {
|
||||
if(envs[i]._id==eid){
|
||||
return envs[i].status;
|
||||
}
|
||||
}
|
||||
return 99;
|
||||
};
|
||||
|
||||
module.exports.getEnvById = async (eid) => {
|
||||
const envs = await this.getEnvs();
|
||||
for (let i = 0; i < envs.length; i++) {
|
||||
if(envs[i]._id==eid){
|
||||
return envs[i].value;
|
||||
}
|
||||
}
|
||||
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;
|
||||
};
|
2499
function/sendNotify.js
Normal file
135
githubAction.md
Normal file
|
@ -0,0 +1,135 @@
|
|||
## 环境变量说明
|
||||
|
||||
##### 京东(必须)
|
||||
|
||||
| Name | 归属 | 属性 | 说明 |
|
||||
| :---------: | :--: | ---- | ------------------------------------------------------------ |
|
||||
| `JD_COOKIE` | 京东 | 必须 | 京东cookie,多个账号的cookie使用`&`隔开,例:`pt_key=XXX;pt_pin=XXX;&pt_key=XXX;pt_pin=XXX;&pt_key=XXX;pt_pin=XXX;`。具体获取参考[浏览器获取京东cookie教程](./backUp/GetJdCookie.md) 或者 [插件获取京东cookie教程](./backUp/GetJdCookie2.md) |
|
||||
|
||||
##### 京东隐私安全 环境变量
|
||||
|
||||
| Name | 归属 | 属性 | 默认值 | 说明 |
|
||||
| :-------------: | :---------: | :----: | :----: | ------------------------------------------------------------ |
|
||||
| `JD_DEBUG` | 脚本打印log | 非必须 | true | 运行脚本时,是否显示log,默认显示。改成false表示不显示,注重隐私的人可以设置 JD_DEBUG 为false |
|
||||
| `JD_USER_AGENT` | 京东 | 非必须 | | 自定义此库里京东系列脚本的UserAgent,不懂不知不会UserAgent的请不要随意填写内容。如需使用此功能建议填写京东APP的UA |
|
||||
|
||||
##### 推送通知环境变量(目前提供`微信server酱`、`pushplus(推送加)`、`iOS Bark APP`、`telegram机器人`、`钉钉机器人`、`企业微信机器人`、`iGot`、`企业微信应用消息`等通知方式)
|
||||
|
||||
| Name | 归属 | 属性 | 说明 |
|
||||
| :---------------: | :----------------------------------------------------------: | :----: | ------------------------------------------------------------ |
|
||||
| `PUSH_KEY` | 微信server酱推送 | 非必须 | server酱的微信通知[官方文档](http://sc.ftqq.com/3.version),已兼容 [Server酱·Turbo版](https://sct.ftqq.com/) |
|
||||
| `BARK_PUSH` | [BARK推送](https://apps.apple.com/us/app/bark-customed-notifications/id1403753865) | 非必须 | IOS用户下载BARK这个APP,填写内容是app提供的`设备码`,例如:https://api.day.app/123 ,那么此处的设备码就是`123`,再不懂看 [这个图](icon/bark.jpg)(注:支持自建填完整链接即可) |
|
||||
| `BARK_SOUND` | [BARK推送](https://apps.apple.com/us/app/bark-customed-notifications/id1403753865) | 非必须 | bark推送声音设置,例如`choo`,具体值请在`bark`-`推送铃声`-`查看所有铃声` |
|
||||
| `TG_BOT_TOKEN` | telegram推送 | 非必须 | tg推送(需设备可连接外网),`TG_BOT_TOKEN`和`TG_USER_ID`两者必需,填写自己申请[@BotFather](https://t.me/BotFather)的Token,如`10xxx4:AAFcqxxxxgER5uw` , [具体教程](./backUp/TG_PUSH.md) |
|
||||
| `TG_USER_ID` | telegram推送 | 非必须 | tg推送(需设备可连接外网),`TG_BOT_TOKEN`和`TG_USER_ID`两者必需,填写[@getuseridbot](https://t.me/getuseridbot)中获取到的纯数字ID, [具体教程](./backUp/TG_PUSH.md) |
|
||||
| `DD_BOT_TOKEN` | 钉钉推送 | 非必须 | 钉钉推送(`DD_BOT_TOKEN`和`DD_BOT_SECRET`两者必需)[官方文档](https://developers.dingtalk.com/document/app/custom-robot-access) ,只需`https://oapi.dingtalk.com/robot/send?access_token=XXX` 等于`=`符号后面的XXX即可 |
|
||||
| `DD_BOT_SECRET` | 钉钉推送 | 非必须 | (`DD_BOT_TOKEN`和`DD_BOT_SECRET`两者必需) ,密钥,机器人安全设置页面,加签一栏下面显示的SEC开头的`SECXXXXXXXXXX`等字符 , 注:钉钉机器人安全设置只需勾选`加签`即可,其他选项不要勾选,再不懂看 [这个图](icon/DD_bot.png) |
|
||||
| `QYWX_KEY` | 企业微信机器人推送 | 非必须 | 密钥,企业微信推送 webhook 后面的 key [详见官方说明文档](https://work.weixin.qq.com/api/doc/90000/90136/91770) |
|
||||
| `QYWX_AM` | 企业微信应用消息推送 | 非必须 | corpid,corpsecret,touser,agentid,素材库图片id [参考文档1](http://note.youdao.com/s/HMiudGkb) [参考文档2](http://note.youdao.com/noteshare?id=1a0c8aff284ad28cbd011b29b3ad0191)<br>素材库图片填0为图文消息, 填1为纯文本消息 |
|
||||
| `IGOT_PUSH_KEY` | iGot推送 | 非必须 | iGot聚合推送,支持多方式推送,确保消息可达。 [参考文档](https://wahao.github.io/Bark-MP-helper ) |
|
||||
| `PUSH_PLUS_TOKEN` | pushplus推送 | 非必须 | 微信扫码登录后一对一推送或一对多推送下面的token(您的Token) [官方网站](http://www.pushplus.plus/) |
|
||||
| `PUSH_PLUS_USER` | pushplus推送 | 非必须 | 一对多推送的“群组编码”(一对多推送下面->您的群组(如无则新建)->群组编码)注:(1、需订阅者扫描二维码 2、如果您是创建群组所属人,也需点击“查看二维码”扫描绑定,否则不能接受群组消息推送),只填`PUSH_PLUS_TOKEN`默认为一对一推送 |
|
||||
| `TG_PROXY_HOST` | Telegram 代理的 IP | 非必须 | 代理类型为 http。例子:http代理 http://127.0.0.1:1080 则填写 127.0.0.1 |
|
||||
| `TG_PROXY_PORT` | Telegram 代理的端口 | 非必须 | 例子:http代理 http://127.0.0.1:1080 则填写 1080 |
|
||||
| `TG_PROXY_AUTH` | Telegram 代理的认证参数 | 非必须 | 代理的认证参数 |
|
||||
| `TG_API_HOST` | Telegram api自建的反向代理地址 | 非必须 | 例子:反向代理地址 http://aaa.bbb.ccc 则填写 aaa.bbb.ccc [简略搭建教程](https://shimo.im/docs/JD38CJDQtYy3yTd8/read) |
|
||||
|
||||
|
||||
##### 互助码类环境变量
|
||||
|
||||
| Name | 归属 | 属性 | 需要助力次数/可提供助力次数 | 说明 |
|
||||
| :-------------------------: | :----------------: | :----: | :-----------------------: | ------------------------------------------------------------ |
|
||||
| `FRUITSHARECODES` | 东东农场<br>互助码 | 非必须 | 5/3 | 填写规则请看[jdFruitShareCodes.js](./jdFruitShareCodes.js)或见下方[互助码的填写规则](#互助码的填写规则) |
|
||||
| `PETSHARECODES` | 东东萌宠<br>互助码 | 非必须 | 5/5 | 填写规则和上面类似或见下方[互助码的填写规则](#互助码的填写规则) |
|
||||
| `PLANT_BEAN_SHARECODES` | 种豆得豆<br>互助码 | 非必须 | 9/3 | 填写规则和上面类似或见下方[互助码的填写规则](#互助码的填写规则) |
|
||||
| `DDFACTORY_SHARECODES` | 东东工厂<br>互助码 | 非必须 | 5/3 | 填写规则和上面类似或见下方[互助码的填写规则](#互助码的填写规则) |
|
||||
| `DREAM_FACTORY_SHARE_CODES` | 京喜工厂<br>互助码 | 非必须 | 不固定/3 | 填写规则和上面类似或见下方[互助码的填写规则](#互助码的填写规则) |
|
||||
| `JDZZ_SHARECODES` | 京东赚赚<br>互助码 | 非必须 | 5/2 | 填写规则和上面类似,或见下方[互助码的填写规则](#互助码的填写规则) |
|
||||
| `JDJOY_SHARECODES` | 疯狂的JOY<br>互助码 | 非必须 | 6/ | 填写规则和上面类似,或见下方[互助码的填写规则](#互助码的填写规则) |
|
||||
| `BOOKSHOP_SHARECODES` | 京东书店<br>互助码 | 非必须 | 10/ | 填写规则和上面类似,或见下方[互助码的填写规则](#互助码的填写规则) |
|
||||
| `JD_CASH_SHARECODES` | 签到领现金<br>互助码 | 非必须 | 10/ | 填写规则和上面类似,或见下方[互助码的填写规则](#互助码的填写规则) |
|
||||
| `JDSGMH_SHARECODES` | 闪购盲盒<br>互助码 | 非必须 | 10/ | 填写规则和上面类似,或见下方[互助码的填写规则](#互助码的填写规则) |
|
||||
| `JDCFD_SHARECODES` | 京喜财富岛<br>互助码 | 非必须 | 未知/未知 | 填写规则和上面类似,或见下方[互助码的填写规则](#互助码的填写规则) |
|
||||
| `JDHEALTH_SHARECODES` | 东东健康社区<br>互助码 | 非必须 | 未知/未知 | 填写规则和上面类似,或见下方[互助码的填写规则](#互助码的填写规则) |
|
||||
| `CITY_SHARECODES` | 城城领现金<br>互助码 | 非必须 | 未知/未知 | 填写规则和上面类似,或见下方[互助码的填写规则](#互助码的填写规则) |
|
||||
|
||||
##### 控制脚本功能环境变量
|
||||
|
||||
|
||||
| Name | 归属 | 属性 | 说明 |
|
||||
| :--------------------------: | :--------------------------: | :----: | ------------------------------------------------------------ |
|
||||
| `JD_BEAN_STOP` | 京东多合一签到 | 非必须 | `jd_bean_sign.js`自定义延迟签到,单位毫秒.默认分批并发无延迟,<br>延迟作用于每个签到接口,如填入延迟则切换顺序签到(耗时较长),<br>如需填写建议输入数字`1`,详见[此处说明](https://github.com/NobyDa/Script/blob/master/JD-DailyBonus/JD_DailyBonus.js#L93) |
|
||||
| `JD_BEAN_SIGN_STOP_NOTIFY` | 京东多合一签到 | 非必须 | `jd_bean_sign.js`脚本运行后不推送签到结果通知,默认推送,填`true`表示不发送通知 |
|
||||
| `JD_BEAN_SIGN_NOTIFY_SIMPLE` | 京东多合一签到 | 非必须 | `jd_bean_sign.js`脚本运行后推送签到结果简洁版通知,<br>默认推送签到简洁结果,填`true`表示推送简洁通知,[效果图](./icon/bean_sign_simple.jpg) |
|
||||
| `PET_NOTIFY_CONTROL` | 东东萌宠<br>推送开关 | 非必须 | 控制京东萌宠是否静默运行,<br>`false`为否(发送推送通知消息),`true`为是(即:不发送推送通知消息) |
|
||||
| `FRUIT_NOTIFY_CONTROL` | 东东农场<br>推送开关 | 非必须 | 控制京东农场是否静默运行,<br>`false`为否(发送推送通知消息),`true`为是(即:不发送推送通知消息) |
|
||||
| `CASH_NOTIFY_CONTROL` | 京东领现金<br>推送开关 | 非必须 | 控制京东领现金是否静默运行,<br>`false`为否(发送推送通知消息),`true`为是(即:不发送推送通知消息) |
|
||||
| `CASH_EXCHANGE` | 京东领现金<br>红包兑换京豆开关 | 非必须 | 控制京东领现金是否把红包兑换成京豆,<br>`false`为否,`true`为是(即:花费2元红包兑换200京豆,一周可换四次),默认为`false` |
|
||||
| `DDQ_NOTIFY_CONTROL` | 点点券<br>推送开关 | 非必须 | 控制点点券是否静默运行,<br>`false`为否(发送推送通知消息),`true`为是(即:不发送推送通知消息) |
|
||||
| `JDZZ_NOTIFY_CONTROL` | 京东赚赚小程序<br>推送开关 | 非必须 | 控制京东赚赚小程序是否静默运行,<br>`false`为否(发送推送通知消息),`true`为是(即:不发送推送通知消息) |
|
||||
| `MONEYTREE_NOTIFY_CONTROL` | 京东摇钱树<br>推送开关 | 非必须 | 控制京东摇钱树兑换0.07金贴后是否静默运行,<br>`false`为否(发送推送通知消息),`true`为是(即:不发送推送通知消息) |
|
||||
| `JD_JOY_REWARD_NOTIFY` | 宠汪汪<br>兑换京豆推送开关 | 非必须 | 控制`jd_joy_reward.js`脚本是否静默运行,<br>`false`为否(发送推送通知消息),`true`为是(即:不发送推送通知消息) |
|
||||
| `JOY_FEED_COUNT` | 宠汪汪喂食数量 | 非必须 | 控制`jd_joy_feedPets.js`脚本喂食数量,可以填的数字0,10,20,40,80,其他数字不可. |
|
||||
| `JOY_HELP_FEED` | 宠汪汪帮好友喂食 | 非必须 | 控制`jd_joy_steal.js`脚本是否给好友喂食,`false`为否,`true`为是(给好友喂食) |
|
||||
| `JOY_RUN_FLAG` | 宠汪汪是否赛跑 | 非必须 | 控制`jd_joy.js`脚本是否参加赛跑(默认参加双人赛跑),<br>`false`为否,`true`为是,脚本默认是`true` |
|
||||
| `JOY_TEAM_LEVEL` | 宠汪汪<br>参加什么级别的赛跑 | 非必须 | 控制`jd_joy.js`脚本参加几人的赛跑,可选数字为`2`,`10`,`50`,<br>其中2代表参加双人PK赛,10代表参加10人突围赛,<br>50代表参加50人挑战赛(注:此项功能在`JOY_RUN_FLAG`为true的时候才生效),<br>如若想设置不同账号参加不同类别的比赛则用&区分即可(如下三个账号:`2&10&50`) |
|
||||
| `JOY_RUN_NOTIFY` | 宠汪汪<br>宠汪汪赛跑获胜后是否推送通知 | 非必须 | 控制`jd_joy.js`脚本宠汪汪赛跑获胜后是否推送通知,<br>`false`为否(不推送通知消息),`true`为是(即:发送推送通知消息)<br> |
|
||||
| `JOY_RUN_HELP_MYSELF` | 宠汪汪<br>赛跑自己账号内部互助 | 非必须 | 输入`true`为开启内部互助 |
|
||||
| `JD_JOY_REWARD_NAME` | 宠汪汪<br>积分兑换多少京豆 | 非必须 | 目前可填值为`20`或者`500`,脚本默认`0`,`0`表示不兑换京豆 |
|
||||
| `JOY_RUN_TOKEN` | 宠汪汪<br>赛跑token | 非必须 | 需自行抓包,宠汪汪小程序获取token,点击`发现`或`我的`,寻找`^https:\/\/draw\.jdfcloud\.com(\/mirror)?\/\/api\/user\/user\/detail\?openId=`获取token |
|
||||
| `MARKET_COIN_TO_BEANS` | 东东超市<br>兑换京豆数量 | 非必须 | 控制`jd_blueCoin.js`兑换京豆数量,<br>可输入值为`20`或者`1000`的数字或者其他商品的名称,例如`碧浪洗衣凝珠` |
|
||||
| `MARKET_REWARD_NOTIFY` | 东东超市<br>兑换奖品推送开关 | 非必须 | 控制`jd_blueCoin.js`兑换奖品成功后是否静默运行,<br>`false`为否(发送推送通知消息),`true`为是(即:不发送推送通知消息) |
|
||||
| `JOIN_PK_TEAM` | 东东超市<br>自动参加PK队伍 | 非必须 | 每次pk活动参加作者创建的pk队伍,`true`表示参加,`false`表示不参加 |
|
||||
| `SUPERMARKET_LOTTERY` | 东东超市抽奖 | 非必须 | 每天运行脚本是否使用金币去抽奖,`true`表示抽奖,`false`表示不抽奖 |
|
||||
| `FRUIT_BEAN_CARD` | 东东农场<br>使用水滴换豆卡 | 非必须 | 东东农场使用水滴换豆卡(如果出现限时活动时100g水换20豆,此时比浇水划算,推荐换豆),<br>`true`表示换豆(不浇水),`false`表示不换豆(继续浇水),脚本默认是浇水 |
|
||||
| `UN_SUBSCRIBES` | jd_unsubscribe.js | 非必须 | 共四个参数,换行隔开.四个参数分别表示<br>`是否取关全部商品(0表示一个都不)`,`是否取关全部店铺数(0表示一个都不)`,`遇到此商品不再进行取关`,`遇到此店铺不再进行取关`,[具体使用往下看](#取关店铺环境变量的说明) |
|
||||
| `JDJOY_HELPSELF` | 疯狂的JOY<br>循环助力 | 非必须 | 疯狂的JOY循环助力,`true`表示循环助力,`false`表示不循环助力,默认不开启循环助力。 |
|
||||
| `JDJOY_APPLYJDBEAN` | 疯狂的JOY<br>京豆兑换 | 非必须 | 疯狂的JOY京豆兑换,目前最小值为2000京豆(详情请查看活动页面-提现京豆),<br>默认数字`0`不开启京豆兑换。 |
|
||||
| `BUY_JOY_LEVEL` | 疯狂的JOY<br>购买joy等级 | 非必须 | 疯狂的JOY自动购买什么等级的JOY |
|
||||
| `MONEY_TREE_SELL_FRUIT` | 摇钱树<br>是否卖出金果 | 非必须 | 控制摇钱树脚本是否自动卖出金果兑换成金币,`true`卖出,`false`不卖出,默认`false` |
|
||||
| `FACTORAY_WANTPRODUCT_NAME` | 东东工厂<br>心仪商品 | 非必须 | 提供心仪商品名称(请尽量填写完整和别的商品有区分度),达到条件后兑换,<br>如不提供则会兑换当前所选商品 |
|
||||
| `DREAMFACTORY_FORBID_ACCOUNT`| 京喜工厂<br>控制哪个京东账号不运行此脚本 | 非必须 | 输入`1`代表第一个京东账号不运行,多个使用`&`连接,例:`1&3`代表账号1和账号3不运行京喜工厂脚本,注:输入`0`,代表全部账号不运行京喜工厂脚本 |
|
||||
| `JDFACTORY_FORBID_ACCOUNT`| 东东工厂<br>控制哪个京东账号不运行此脚本 | 非必须 | 输入`1`代表第一个京东账号不运行,多个使用`&`连接,例:`1&3`代表账号1和账号3不运行东东工厂脚本,注:输入`0`,代表全部账号不运行东东工厂脚本 |
|
||||
| `CFD_NOTIFY_CONTROL` | 京喜财富岛<br>控制是否运行脚本后通知 | 非必须 | 输入`true`为通知,不填则为不通知 |
|
||||
| `JXNC_NOTIFY_LEVEL` | 京喜农场通知控制<br>推送开关,默认1 | 非必须 | 通知级别 0=只通知成熟;1=本次获得水滴>0;2=任务执行;3=任务执行+未种植种子 |
|
||||
| `PURCHASE_SHOPS` | 执行`lxk0301/jd_scripts`仓库的脚本是否做加物品至购物车任务。默认关闭不做加购物车任务 | 非必须 | 如需做此类型任务。请设置`true`,目前东东小窝(jd_small_home.js)脚本会有加购任务 |
|
||||
| `TUAN_ACTIVEID` | 京喜工厂拼团瓜分电力活动的`activeId`<br>默认读取作者设置的 | 非必须 | 如出现脚本开团提示失败:`活动已结束,请稍后再试~`,可自行抓包替换(开启抓包,进入拼团瓜分电力页面,寻找带有`tuan`的链接里面的`activeId=`) |
|
||||
| `HELP_AUTHOR` | 是否给作者助力 免费拿,极速版拆红包,省钱大赢家等活动.<br>默认是 | 非必须 | 填`false`可关闭此助力 |
|
||||
|
||||
|
||||
##### 互助码的填写规则
|
||||
|
||||
> 互助码如何获取:长期活动可在jd_get_share_code.js里面查找,短期活动需运行相应脚本后,在日志里面可以找到。
|
||||
|
||||
同一个京东账号的好友互助码用@隔开,不同京东账号互助码用&或者换行隔开,下面给一个文字示例和具体互助码示例说明
|
||||
|
||||
两个账号各两个互助码的文字示例:
|
||||
|
||||
```
|
||||
京东账号1的shareCode1@京东账号1的shareCode2&京东账号2的shareCode1@京东账号2的shareCode2
|
||||
```
|
||||
|
||||
两个账号各两个互助码的真实示例:
|
||||
```
|
||||
0a74407df5df4fa99672a037eec61f7e@dbb21614667246fabcfd9685b6f448f3&6fbd26cc27ac44d6a7fed34092453f77@61ff5c624949454aa88561f2cd721bf6&6fbd26cc27ac44d6a7fed34092453f77@61ff5c624949454aa88561f2cd721bf6
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### 取关店铺环境变量的说明
|
||||
|
||||
> 环境变量内容的意思依次是`是否取关全部商品(0表示一个都不)`,`是否取关全部店铺数(0表示一个都不)`,`遇到此商品不再进行取关`,`遇到此店铺不再进行取关`
|
||||
|
||||
例如1:不要取关任何商品和店铺,则输入`0&0`
|
||||
例如2:我想商品遇到关键字 `iPhone12` 停止取关,店铺遇到 `Apple京东自营旗舰店` 不再取关,则输入`10&10&iPhone12&Apple京东自营旗舰店`(前面两个参数非0即可)
|
||||
|
||||
#### 关于脚本推送通知频率
|
||||
|
||||
> 如果你填写了推送通知方式中的某一种通知所需环境变量,那么脚本通知情况如下:
|
||||
|
||||
> 目前默认只有jd_fruit.js,jd_pet.js,jd_bean_sign.js,jd_bean_change.js,jd_jxnc.js这些脚本(默认)每次运行后都通知
|
||||
|
||||
```
|
||||
其余的脚本平常运行都是不通知,只有在京东cookie失效以及达到部分条件后,才会推送通知
|
||||
```
|
||||
|
375
gua_cleancart_ddo.js
Normal file
1320
gua_wealth_island.js
Normal file
BIN
icon/DD_bot.png
Normal file
After Width: | Height: | Size: 54 KiB |
BIN
icon/Snipaste_2020-08-28_09-31-42.png
Normal file
After Width: | Height: | Size: 31 KiB |
BIN
icon/TG_PUSH1.png
Normal file
After Width: | Height: | Size: 46 KiB |
BIN
icon/TG_PUSH2.png
Normal file
After Width: | Height: | Size: 63 KiB |
BIN
icon/TG_PUSH3.png
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
icon/action1.png
Normal file
After Width: | Height: | Size: 79 KiB |
BIN
icon/action2.png
Normal file
After Width: | Height: | Size: 59 KiB |
BIN
icon/action3.png
Normal file
After Width: | Height: | Size: 95 KiB |
BIN
icon/bark.jpg
Normal file
After Width: | Height: | Size: 424 KiB |
BIN
icon/bean_sign_simple.jpg
Normal file
After Width: | Height: | Size: 34 KiB |
BIN
icon/disable-action.jpg
Normal file
After Width: | Height: | Size: 83 KiB |
BIN
icon/fork.png
Normal file
After Width: | Height: | Size: 87 KiB |
BIN
icon/git1.jpg
Normal file
After Width: | Height: | Size: 39 KiB |
BIN
icon/git10.jpg
Normal file
After Width: | Height: | Size: 39 KiB |
BIN
icon/git11.jpg
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
icon/git12.jpg
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
icon/git13.jpg
Normal file
After Width: | Height: | Size: 32 KiB |
BIN
icon/git14.jpg
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
icon/git2.jpg
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
icon/git3.jpg
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
icon/git4.jpg
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
icon/git5.jpg
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
icon/git6.jpg
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
icon/git7.png
Normal file
After Width: | Height: | Size: 160 KiB |
BIN
icon/git8.jpg
Normal file
After Width: | Height: | Size: 50 KiB |
BIN
icon/git9.jpg
Normal file
After Width: | Height: | Size: 31 KiB |
BIN
icon/iCloud1.png
Normal file
After Width: | Height: | Size: 32 KiB |
BIN
icon/iCloud2.png
Normal file
After Width: | Height: | Size: 32 KiB |
BIN
icon/iCloud3.png
Normal file
After Width: | Height: | Size: 41 KiB |
BIN
icon/iCloud4.png
Normal file
After Width: | Height: | Size: 31 KiB |
BIN
icon/iCloud5.png
Normal file
After Width: | Height: | Size: 57 KiB |
BIN
icon/iCloud6.png
Normal file
After Width: | Height: | Size: 52 KiB |
BIN
icon/iCloud7.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
icon/iCloud8.png
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
icon/jd1.jpg
Normal file
After Width: | Height: | Size: 625 KiB |
BIN
icon/jd2.jpg
Normal file
After Width: | Height: | Size: 208 KiB |
BIN
icon/jd3.jpg
Normal file
After Width: | Height: | Size: 163 KiB |
BIN
icon/jd4.jpg
Normal file
After Width: | Height: | Size: 256 KiB |
BIN
icon/jd5.png
Normal file
After Width: | Height: | Size: 108 KiB |
BIN
icon/jd6.png
Normal file
After Width: | Height: | Size: 78 KiB |
BIN
icon/jd7.png
Normal file
After Width: | Height: | Size: 131 KiB |
BIN
icon/jd8.png
Normal file
After Width: | Height: | Size: 311 KiB |
BIN
icon/jd_moneyTree.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
icon/jd_pet.png
Normal file
After Width: | Height: | Size: 9.2 KiB |
BIN
icon/qh1.png
Normal file
After Width: | Height: | Size: 173 KiB |
BIN
icon/qh2.png
Normal file
After Width: | Height: | Size: 42 KiB |
BIN
icon/qh3.png
Normal file
After Width: | Height: | Size: 136 KiB |
BIN
icon/txy.png
Normal file
After Width: | Height: | Size: 20 KiB |
101
jdCookie.js
Normal file
|
@ -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 友情提示:您的脚本正常运行中`)
|
||||
}
|
37
jdDreamFactoryShareCodes.js
Normal file
|
@ -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];
|
||||
}
|
67
jdEnv.py
Normal file
|
@ -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
|
37
jdFactoryShareCodes.js
Normal file
|
@ -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];
|
||||
}
|
37
jdFruitShareCodes.js
Normal file
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
东东农场互助码
|
||||
此文件为Node.js专用。其他用户请忽略
|
||||
支持京东N个账号
|
||||
*/
|
||||
//云服务器腾讯云函数等NOde.js用户在此处填写京东东农场的好友码。
|
||||
// 同一个京东账号的好友互助码用@符号隔开,不同京东账号之间用&符号或者换行隔开,下面给一个示例
|
||||
// 如: 京东账号1的shareCode1@京东账号1的shareCode2&京东账号2的shareCode1@京东账号2的shareCode2
|
||||
let FruitShareCodes = [
|
||||
'0a74407df5df4fa99672a037eec61f7e@dbb21614667246fabcfd9685b6f448f3@6fbd26cc27ac44d6a7fed34092453f77@61ff5c624949454aa88561f2cd721bf6@56db8e7bc5874668ba7d5195230d067a',//账号一的好友shareCode,不同好友中间用@符号隔开
|
||||
'6fbd26cc27ac44d6a7fed34092453f77@61ff5c624949454aa88561f2cd721bf6@9c52670d52ad4e1a812f894563c746ea@8175509d82504e96828afc8b1bbb9cb3',//账号二的好友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];
|
||||
}
|
37
jdJxncShareCodes.js
Normal file
|
@ -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];
|
||||
}
|
37
jdPetShareCodes.js
Normal file
|
@ -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];
|
||||
}
|
37
jdPlantBeanShareCodes.js
Normal file
|
@ -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];
|
||||
}
|
975
jd_CheckCK.js
Normal file
|
@ -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)
|
||||
}
|
1965
jd_DailyBonus_Mod.js
Normal file
490
jd_EsportsManager.js
Normal file
521
jd_UpdateUIDtoRemark.js
Normal file
|
@ -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)
|
||||
}
|
72
jd_aid_factory.js
Normal file
|
@ -0,0 +1,72 @@
|
|||
let common = require("./function/common");
|
||||
let $ = new common.env('京喜工厂助力');
|
||||
let min = 3,
|
||||
help = $.config[$.filename(__filename)] || Math.min(min, $.config.JdMain) || min;
|
||||
$.setOptions({
|
||||
headers: {
|
||||
'content-type': 'application/json',
|
||||
'user-agent': 'jdpingou;iPhone;4.8.2;13.7;a3b4e844090b28d5c38e7529af8115172079be4d;network/wifi;model/iPhone8,1;appBuild/100546;ADID/00000000-0000-0000-0000-000000000000;supportApplePay/1;hasUPPay/0;pushNoticeIsOpen/0;hasOCPay/0;supportBestPay/0;session/374;pap/JA2019_3111789;brand/apple;supportJDSHWK/1;Mozilla/5.0 (iPhone; CPU iPhone OS 13_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148',
|
||||
'referer': 'https://st.jingxi.com/pingou/dream_factory/divide.html?activeId=laD7IwPwDF1-Te-MvbW9Iw==&_close=1&jxsid=16232028831911667857',
|
||||
}
|
||||
});
|
||||
$.readme = `
|
||||
44 */6 * * * task ${$.runfile}
|
||||
export ${$.runfile}=2 #如需增加被助力账号,在这边修改人数
|
||||
`
|
||||
eval(common.eval.mainEval($));
|
||||
async function prepare() {
|
||||
let deramUrl = 'https://st.jingxi.com/pingou/dream_factory/index.html?ptag=7155.9.46'
|
||||
let html = await $.curl(deramUrl)
|
||||
try {
|
||||
ary = $.matchall(/activeId=([^\&\,]+)","bgImg".+?"start":"([^\"]+)"/g, html)
|
||||
dicts = {}
|
||||
for (let i of ary) {
|
||||
dicts[new Date(i[1]).getTime()] = i[0]
|
||||
}
|
||||
max = Math.max(...Object.keys(dicts).filter(d => parseInt(d) < $.timestamp))
|
||||
$.activeId = dicts[max]
|
||||
} catch (e) {
|
||||
$.activeId = 'yNtpovqFehHByNrt_lmb3g=='
|
||||
}
|
||||
console.log("开团ID:", $.activeId)
|
||||
let url = `https://m.jingxi.com/dreamfactory/tuan/QueryActiveConfig?activeId=${$.activeId}&tuanId=&_time=1623214804148&_stk=_time%2CactiveId%2CtuanId&_ste=1&sceneval=2&g_login_type=1&callback=jsonpCBKA&g_ty=ls`
|
||||
let dec = await jxAlgo.dec(url)
|
||||
for (let j of cookies['help']) {
|
||||
$.setCookie(j);
|
||||
await $.curl(dec.url)
|
||||
try {
|
||||
if ($.source.data.userTuanInfo.tuanId) {
|
||||
$.sharecode.push($.compact($.source.data.userTuanInfo, ['activeId', 'tuanId']))
|
||||
} else {}
|
||||
} catch (e) {}
|
||||
}
|
||||
}
|
||||
async function main(id) {
|
||||
common.assert(id.activeId, '没有开团ID')
|
||||
let url = `https://m.jingxi.com/dreamfactory/tuan/JoinTuan?activeId=${id.activeId}&tuanId=${id.tuanId}&_time=1623214617107&_stk=_time%2CactiveId%2CtuanId&_ste=1&sceneval=2&g_login_type=1&g_ty=ls`
|
||||
let dec = await jxAlgo.dec(url)
|
||||
let params = {
|
||||
'url': dec.url,
|
||||
'cookie': id.cookie
|
||||
}
|
||||
await $.curl(params)
|
||||
console.log($.source)
|
||||
}
|
||||
async function extra() {
|
||||
for (let j of cookies['help']) {
|
||||
$.setCookie(j);
|
||||
let url = `https://m.jingxi.com/dreamfactory/tuan/QueryActiveConfig?activeId=${$.activeId}&tuanId=&_time=1623214804148&_stk=_time%2CactiveId%2CtuanId&_ste=1&sceneval=2&g_login_type=1&callback=jsonpCBKA&g_ty=ls`
|
||||
let dec = await jxAlgo.dec(url)
|
||||
await $.curl(dec.url)
|
||||
url = `https://m.jingxi.com/dreamfactory/tuan/Award?activeId=${$.source.data.userTuanInfo.activeId}&tuanId=${$.source.data.userTuanInfo.tuanId}&_time=1623518911051&_stk=_time%2CactiveId%2CtuanId&_ste=1&_=1623518911082&sceneval=2&g_login_type=1&callback=jsonpCBKF&g_ty=ls`
|
||||
dec = await jxAlgo.dec(url)
|
||||
await $.curl(dec.url)
|
||||
console.log($.source)
|
||||
if ($.source.msg != '您还没有成团') {
|
||||
url = `https://m.jingxi.com/dreamfactory/tuan/CreateTuan?activeId=${$.activeId}&isOpenApp=1&_time=1624120758151&_stk=_time%2CactiveId%2CisOpenApp&_ste=1`
|
||||
dec = await jxAlgo.dec(url)
|
||||
await $.curl(dec.url)
|
||||
console.log($.source)
|
||||
}
|
||||
}
|
||||
}
|