mirror of
https://github.com/shufflewzc/faker2.git
synced 2025-04-08 20:07:08 +00:00
update
This commit is contained in:
parent
146de6b44e
commit
7103cdfd83
25
jd_CkSeq.js
25
jd_CkSeq.js
|
@ -13,6 +13,12 @@ if ($.isNode()) {
|
|||
cookiesArr.push(jdCookieNode[item])
|
||||
})
|
||||
}
|
||||
let WP_APP_TOKEN_ONE = "";
|
||||
if ($.isNode()) {
|
||||
if (process.env.WP_APP_TOKEN_ONE) {
|
||||
WP_APP_TOKEN_ONE = process.env.WP_APP_TOKEN_ONE;
|
||||
}
|
||||
}
|
||||
|
||||
let arrCkPtPin = [];
|
||||
let arrEnvPtPin = [];
|
||||
|
@ -21,6 +27,15 @@ let arrEnvOnebyOne = [];
|
|||
let strCk = "";
|
||||
let strNoFoundCk = "";
|
||||
let strMessage = "";
|
||||
let strNotify = "";
|
||||
if ($.isNode() && process.env.SEQCK_DisableCKNOTIFY) {
|
||||
strNotify=process.env.SEQCK_DisableCKNOTIFY;
|
||||
console.log(`检测到设定了公告,禁用的CK将推送信息...`);
|
||||
strNotify = `【✨✨✨✨公告✨✨✨✨】\n`+strNotify;
|
||||
console.log(strNotify+"\n");
|
||||
}else{
|
||||
WP_APP_TOKEN_ONE = "";
|
||||
}
|
||||
|
||||
const fs = require('fs');
|
||||
let TempCKUid = [];
|
||||
|
@ -69,14 +84,18 @@ if (UidFileexists) {
|
|||
var tempptpin = arrEnvPtPin[i];
|
||||
var intSeq = inArray(tempptpin, arrCkPtPin);
|
||||
if (intSeq == -1) {
|
||||
strNoFoundCk += "【"+(i + 1) + "】" + tempptpin;
|
||||
strNoFoundCk += "【" + (i + 1) + "】" + tempptpin;
|
||||
if (arrEnvStatus[i] == 1) {
|
||||
strNoFoundCk += "(状态已禁用)"
|
||||
if ($.isNode() && WP_APP_TOKEN_ONE) {
|
||||
await notify.sendNotifybyWxPucher("账号下线通知", strNotify, tempptpin);
|
||||
await $.wait(1000);
|
||||
}
|
||||
}
|
||||
if (arrEnvOnebyOne[i]) {
|
||||
if (arrEnvOnebyOne[i]) {
|
||||
strNoFoundCk += "(账号已启用一对一推送)"
|
||||
}
|
||||
strNoFoundCk +="\n";
|
||||
strNoFoundCk += "\n";
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -261,6 +261,22 @@ if(DisableIndex!=-1){
|
|||
EnableJDPet=false
|
||||
}
|
||||
|
||||
//7天过期京豆
|
||||
let EnableOverBean=true;
|
||||
DisableIndex=strDisableList.findIndex((item) => item === "过期京豆");
|
||||
if(DisableIndex!=-1){
|
||||
console.log("检测到设定关闭过期京豆查询");
|
||||
EnableOverBean=false
|
||||
}
|
||||
|
||||
//查优惠券
|
||||
let EnableChaQuan=true;
|
||||
DisableIndex=strDisableList.findIndex((item) => item === "查优惠券");
|
||||
if(DisableIndex!=-1){
|
||||
console.log("检测到设定关闭优惠券查询");
|
||||
EnableChaQuan=false
|
||||
}
|
||||
|
||||
DisableIndex=strDisableList.findIndex((item) => item === "活动攻略");
|
||||
if(DisableIndex!=-1){
|
||||
console.log("检测到设定关闭活动攻略显示");
|
||||
|
@ -332,8 +348,10 @@ if(DisableIndex!=-1){
|
|||
strGuoqi="";
|
||||
console.log(`******开始查询【京东账号${$.index}】${$.nickName || $.UserName}*********`);
|
||||
|
||||
await TotalBean();
|
||||
await TotalBean2();
|
||||
await Promise.all([
|
||||
TotalBean(),
|
||||
TotalBean2()])
|
||||
|
||||
if (!$.isLogin) {
|
||||
await isLoginByX1a0He();
|
||||
}
|
||||
|
@ -348,86 +366,20 @@ if(DisableIndex!=-1){
|
|||
continue
|
||||
}
|
||||
|
||||
//汪汪乐园
|
||||
if(EnableJoyPark)
|
||||
await getJoyBaseInfo();
|
||||
|
||||
//京东赚赚
|
||||
if(EnableJdZZ)
|
||||
await getJdZZ();
|
||||
|
||||
//京东秒杀
|
||||
if(EnableJdMs)
|
||||
await getMs();
|
||||
|
||||
//东东农场
|
||||
if (EnableJdFruit) {
|
||||
llgeterror = false;
|
||||
if (NowHour > 16) {
|
||||
await jdfruitRequest('taskInitForFarm', {
|
||||
"version": 14,
|
||||
"channel": 1,
|
||||
"babelChannel": "120"
|
||||
});
|
||||
}
|
||||
await getjdfruit();
|
||||
if (llgeterror) {
|
||||
console.log(`东东农场API查询失败,等待10秒后再次尝试...`)
|
||||
await $.wait(10 * 1000);
|
||||
await getjdfruit();
|
||||
}
|
||||
if (llgeterror) {
|
||||
console.log(`东东农场API查询失败,有空重启路由器换个IP吧.`)
|
||||
}
|
||||
|
||||
}
|
||||
//极速金币
|
||||
if(EnableJdSpeed)
|
||||
await cash();
|
||||
|
||||
//京喜牧场
|
||||
if(EnableJxMC){
|
||||
llgeterror = false;
|
||||
await requestAlgo();
|
||||
if(llgeterror){
|
||||
console.log(`等待10秒后再次尝试...`)
|
||||
await $.wait(10 * 1000);
|
||||
await requestAlgo();
|
||||
}
|
||||
await JxmcGetRequest();
|
||||
}
|
||||
|
||||
//京豆查询
|
||||
await bean();
|
||||
|
||||
if (llShowMonth) {
|
||||
console.log("开始获取月数据,请稍后...");
|
||||
await Monthbean();
|
||||
console.log("月数据获取完毕,暂停10秒防止IP被黑...");
|
||||
await $.wait(10 * 1000);
|
||||
}
|
||||
|
||||
//京喜工厂
|
||||
if(EnableJxGC)
|
||||
await getJxFactory();
|
||||
|
||||
// 京东工厂
|
||||
if(EnableJDGC)
|
||||
await getDdFactoryInfo();
|
||||
|
||||
//领现金
|
||||
if(EnableCash)
|
||||
await jdCash();
|
||||
|
||||
//喜豆查询
|
||||
if(EnableJxBeans){
|
||||
await GetJxBeanInfo();
|
||||
await jxbean();
|
||||
}
|
||||
|
||||
//金融养猪
|
||||
if(EnablePigPet)
|
||||
await GetPigPetInfo();
|
||||
await Promise.all([
|
||||
getJoyBaseInfo(), //汪汪乐园
|
||||
getJdZZ(), //京东赚赚
|
||||
getMs(), //京东秒杀
|
||||
getjdfruitinfo(), //东东农场
|
||||
cash(), //极速金币
|
||||
jdJxMCinfo(), //京喜牧场
|
||||
bean(), //京豆查询
|
||||
getJxFactory(), //京喜工厂
|
||||
getDdFactoryInfo(), // 京东工厂
|
||||
jdCash(), //领现金
|
||||
GetJxBeaninfo(), //喜豆查询
|
||||
GetPigPetInfo() //金融养猪
|
||||
])
|
||||
|
||||
await showMsg();
|
||||
if (intPerSent > 0) {
|
||||
|
@ -1050,7 +1002,7 @@ async function bean() {
|
|||
todayArr = [];
|
||||
do {
|
||||
let response = await getJingBeanBalanceDetail(page);
|
||||
await $.wait(2000);
|
||||
await $.wait(1000);
|
||||
// console.log(`第${page}页: ${JSON.stringify(response)}`);
|
||||
if (response && response.code === "0") {
|
||||
page++;
|
||||
|
@ -1101,18 +1053,20 @@ async function bean() {
|
|||
$.expenseBean = -$.expenseBean;
|
||||
|
||||
decExBean =0;
|
||||
await queryexpirejingdou();//过期京豆
|
||||
if(decExBean && doExJxBeans=="true"){
|
||||
var jxbeans = await exchangejxbeans(decExBean);
|
||||
if (jxbeans) {
|
||||
$.beanChangeXi=decExBean;
|
||||
console.log(`已为您将`+decExBean+`临期京豆转换成喜豆!`);
|
||||
strGuoqi += `已为您将`+decExBean+`临期京豆转换成喜豆!\n`;
|
||||
}
|
||||
if (EnableOverBean) {
|
||||
await queryexpirejingdou(); //过期京豆
|
||||
if (decExBean && doExJxBeans == "true") {
|
||||
var jxbeans = await exchangejxbeans(decExBean);
|
||||
if (jxbeans) {
|
||||
$.beanChangeXi = decExBean;
|
||||
console.log(`已为您将` + decExBean + `临期京豆转换成喜豆!`);
|
||||
strGuoqi += `已为您将` + decExBean + `临期京豆转换成喜豆!\n`;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
await redPacket();
|
||||
await getCoupon();
|
||||
await redPacket();
|
||||
if (EnableChaQuan)
|
||||
await getCoupon();
|
||||
}
|
||||
|
||||
async function Monthbean() {
|
||||
|
@ -1185,7 +1139,23 @@ async function Monthbean() {
|
|||
|
||||
}
|
||||
|
||||
async function jdJxMCinfo(){
|
||||
if (EnableJxMC) {
|
||||
llgeterror = false;
|
||||
await requestAlgo();
|
||||
if (llgeterror) {
|
||||
console.log(`等待10秒后再次尝试...`)
|
||||
await $.wait(10 * 1000);
|
||||
await requestAlgo();
|
||||
}
|
||||
await JxmcGetRequest();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
async function jdCash() {
|
||||
if (!EnableCash)
|
||||
return;
|
||||
let functionId = "cash_homePage";
|
||||
/* let body = {};
|
||||
console.log(`正在获取领现金任务签名...`);
|
||||
|
@ -1316,7 +1286,8 @@ function TotalBean() {
|
|||
|
||||
}
|
||||
if (data['retcode'] === '0' && data.data && data.data['assetInfo']) {
|
||||
$.beanCount = data.data && data.data['assetInfo']['beanNum'];
|
||||
if ($.beanCount == 0)
|
||||
$.beanCount = data.data && data.data['assetInfo']['beanNum'];
|
||||
} else {
|
||||
$.errorMsg = `数据异常`;
|
||||
}
|
||||
|
@ -1364,7 +1335,6 @@ function TotalBean2() {
|
|||
$.nickName = userInfo.petName;
|
||||
if ($.beanCount == 0) {
|
||||
$.beanCount = userInfo.jingBean;
|
||||
$.isPlusVip = 3;
|
||||
}
|
||||
$.JingXiang = userInfo.uclass;
|
||||
}
|
||||
|
@ -1662,7 +1632,10 @@ function getCoupon() {
|
|||
if (useable[i].platFormInfo)
|
||||
$.platFormInfo = useable[i].platFormInfo;
|
||||
|
||||
$.message += `【全品类券】满${useable[i].quota}减${useable[i].discount}元`;
|
||||
var decquota=parseFloat(useable[i].quota).toFixed(2);
|
||||
var decdisc= parseFloat(useable[i].discount).toFixed(2);
|
||||
|
||||
$.message += `【全品类券】满${decquota}减${decdisc}元`;
|
||||
|
||||
if (useable[i].endTime < $.todayEndTime) {
|
||||
$.message += `(今日过期,${$.platFormInfo})\n`;
|
||||
|
@ -1753,6 +1726,8 @@ function getCoupon() {
|
|||
}
|
||||
|
||||
function getJdZZ() {
|
||||
if (!EnableJdZZ)
|
||||
return;
|
||||
return new Promise(resolve => {
|
||||
$.get(taskJDZZUrl("interactTaskIndex"), async(err, resp, data) => {
|
||||
try {
|
||||
|
@ -1794,6 +1769,8 @@ function taskJDZZUrl(functionId, body = {}) {
|
|||
}
|
||||
|
||||
function getMs() {
|
||||
if (!EnableJdMs)
|
||||
return;
|
||||
return new Promise(resolve => {
|
||||
$.post(taskMsPostUrl('homePageV2', {}, 'appid=SecKill2020'), (err, resp, data) => {
|
||||
try {
|
||||
|
@ -1865,6 +1842,35 @@ function jdfruitRequest(function_id, body = {}, timeout = 1000) {
|
|||
})
|
||||
}
|
||||
|
||||
async function getjdfruitinfo() {
|
||||
if (EnableJdFruit) {
|
||||
llgeterror = false;
|
||||
|
||||
await jdfruitRequest('taskInitForFarm', {
|
||||
"version": 14,
|
||||
"channel": 1,
|
||||
"babelChannel": "120"
|
||||
});
|
||||
|
||||
await getjdfruit();
|
||||
if (llgeterror) {
|
||||
console.log(`东东农场API查询失败,等待10秒后再次尝试...`)
|
||||
await $.wait(10 * 1000);
|
||||
await getjdfruit();
|
||||
}
|
||||
if (llgeterror) {
|
||||
console.log(`东东农场API查询失败,有空重启路由器换个IP吧.`)
|
||||
}
|
||||
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
async function GetJxBeaninfo() {
|
||||
await GetJxBean(),
|
||||
await jxbean();
|
||||
return;
|
||||
}
|
||||
|
||||
async function getjdfruit() {
|
||||
return new Promise(resolve => {
|
||||
|
@ -1992,6 +1998,8 @@ function safeGet(data) {
|
|||
}
|
||||
|
||||
function cash() {
|
||||
if (!EnableJdSpeed)
|
||||
return;
|
||||
return new Promise(resolve => {
|
||||
$.get(taskcashUrl('MyAssetsService.execute', {
|
||||
"method": "userCashRecord",
|
||||
|
@ -2103,7 +2111,9 @@ async function JxmcGetRequest() {
|
|||
}
|
||||
|
||||
// 惊喜工厂信息查询
|
||||
function getJxFactory() {
|
||||
async function getJxFactory() {
|
||||
if (!EnableJxGC)
|
||||
return;
|
||||
return new Promise(async resolve => {
|
||||
let infoMsg = "";
|
||||
let strTemp = "";
|
||||
|
@ -2228,6 +2238,8 @@ function GetCommodityDetails() {
|
|||
|
||||
// 东东工厂信息查询
|
||||
async function getDdFactoryInfo() {
|
||||
if (!EnableJDGC)
|
||||
return;
|
||||
// 当心仪的商品存在,并且收集起来的电量满足当前商品所需,就投入
|
||||
let infoMsg = "";
|
||||
return new Promise(resolve => {
|
||||
|
@ -2308,6 +2320,8 @@ function ddFactoryTaskUrl(function_id, body = {}, function_id2) {
|
|||
}
|
||||
|
||||
async function getJoyBaseInfo(taskId = '', inviteType = '', inviterPin = '') {
|
||||
if (!EnableJoyPark)
|
||||
return;
|
||||
return new Promise(resolve => {
|
||||
$.post(taskPostClientActionUrl(`body={"taskId":"${taskId}","inviteType":"${inviteType}","inviterPin":"${inviterPin}","linkId":"LsQNxL7iWDlXUs6cFl-AAg"}&appid=activities_platform`), async(err, resp, data) => {
|
||||
try {
|
||||
|
@ -2390,33 +2404,38 @@ function GetJxBeanDetailData() {
|
|||
});
|
||||
});
|
||||
}
|
||||
function GetJxBeanInfo() {
|
||||
return new Promise((resolve) => {
|
||||
$.get(taskJxUrl("querybeanamount"), async (err, resp, data) => {
|
||||
try {
|
||||
if (err) {
|
||||
console.log(JSON.stringify(err));
|
||||
console.log(`GetJxBeanInfo请求失败,请检查网路重试`);
|
||||
} else {
|
||||
data = JSON.parse(data.match(new RegExp(/jsonpCBK.?\((.*);*/))[1]);
|
||||
if(data){
|
||||
if(data.errcode==0){
|
||||
$.xibeanCount=data.data.xibean;
|
||||
if(!$.beanCount){
|
||||
$.beanCount=data.data.jingbean;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
$.logErr(e, resp);
|
||||
} finally {
|
||||
resolve(data);
|
||||
}
|
||||
});
|
||||
});
|
||||
function GetJxBean() {
|
||||
if (!EnableJxBeans)
|
||||
return;
|
||||
return new Promise((resolve) => {
|
||||
$.get(taskJxUrl("querybeanamount"), async(err, resp, data) => {
|
||||
try {
|
||||
if (err) {
|
||||
console.log(JSON.stringify(err));
|
||||
console.log(`GetJxBean请求失败,请检查网路重试`);
|
||||
} else {
|
||||
data = JSON.parse(data.match(new RegExp(/jsonpCBK.?\((.*);*/))[1]);
|
||||
if (data) {
|
||||
if (data.errcode == 0) {
|
||||
$.xibeanCount = data.data.xibean;
|
||||
if (!$.beanCount) {
|
||||
$.beanCount = data.data.jingbean;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
$.logErr(e, resp);
|
||||
}
|
||||
finally {
|
||||
resolve(data);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
async function jxbean() {
|
||||
if (!EnableJxBeans)
|
||||
return;
|
||||
//前一天的0:0:0时间戳
|
||||
const tm = parseInt((Date.now() + 28800000) / 86400000) * 86400000 - 28800000 - (24 * 60 * 60 * 1000);
|
||||
// 今天0:0:0时间戳
|
||||
|
@ -2526,6 +2545,7 @@ Date.prototype.Format = function (fmt) {
|
|||
}
|
||||
|
||||
function decrypt(time, stk, type, url) {
|
||||
$.appId = 10028;
|
||||
stk = stk || (url ? getJxmcUrlData(url, '_stk') : '')
|
||||
if (stk) {
|
||||
const timestamp = new Date(time).Format("yyyyMMddhhmmssSSS");
|
||||
|
@ -2663,6 +2683,8 @@ function timeFormat(time) {
|
|||
|
||||
|
||||
function GetPigPetInfo() {
|
||||
if (!EnablePigPet)
|
||||
return;
|
||||
return new Promise(async resolve => {
|
||||
const body = {
|
||||
"shareId": "",
|
||||
|
@ -2697,6 +2719,7 @@ function GetPigPetInfo() {
|
|||
|
||||
|
||||
function taskPetPigUrl(function_id, body) {
|
||||
var UA = `jdpingou;iPhone;4.13.0;14.4.2;${randomString(40)};network/wifi;model/iPhone10,2;appBuild/100609;supportApplePay/1;hasUPPay/0;pushNoticeIsOpen/1;hasOCPay/0;supportBestPay/0;session/${Math.random * 98 + 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`;
|
||||
return {
|
||||
url: `https://ms.jr.jd.com/gw/generic/uc/h5/m/${function_id}?_=${Date.now()}`,
|
||||
body: `reqData=${encodeURIComponent(JSON.stringify(body))}`,
|
||||
|
|
Loading…
Reference in New Issue
Block a user