This commit is contained in:
Faker 2023-05-27 22:29:20 +08:00
parent b24311f579
commit b749225a7a
10 changed files with 478 additions and 220 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -140,10 +140,14 @@ if(WP_APP_TOKEN_ONE)
else
console.log(`检测到未配置Wxpusher的Token禁用一对一推送...`);
let jdSignUrl = 'https://api.nolanstore.top/sign'
let jdSignUrl = 'https://api.nolanstore.cc/sign'
if (process.env.SIGNURL)
jdSignUrl = process.env.SIGNURL;
let epsignurl=""
if (process.env.epsignurl)
epsignurl = process.env.epsignurl;
if ($.isNode() && process.env.BEANCHANGE_PERSENT) {
intPerSent = parseInt(process.env.BEANCHANGE_PERSENT);
console.log(`检测到设定了分段通知:` + intPerSent);
@ -212,14 +216,6 @@ if ($.isNode()) {
strDisableList = process.env.BEANCHANGE_DISABLELIST ? process.env.BEANCHANGE_DISABLELIST.split('&') : [];
}
//喜豆查询
let EnableJxBeans=true;
DisableIndex=strDisableList.findIndex((item) => item === "喜豆查询");
if(DisableIndex!=-1){
console.log("检测到设定关闭喜豆查询");
EnableJxBeans=false
}
//东东农场
let EnableJdFruit=true;
DisableIndex = strDisableList.findIndex((item) => item === "东东农场");
@ -325,11 +321,6 @@ if(DisableIndex!=-1){
$.allincomeBean = 0; //月收入
$.allexpenseBean = 0; //月支出
$.beanChangeXi=0;
$.inJxBean=0;
$.OutJxBean=0;
$.todayinJxBean=0;
$.todayOutJxBean=0;
$.xibeanCount = 0;
$.YunFeiTitle="";
$.YunFeiQuan = 0;
$.YunFeiQuanEndTime = "";
@ -427,7 +418,6 @@ if(DisableIndex!=-1){
cash(), //特价金币
bean(), //京豆查询
jdCash(), //领现金
GetJxBeaninfo(), //喜豆查询
GetJoyRuninginfo(), //汪汪赛跑
queryScores()
])
@ -753,24 +743,6 @@ async function showMsg() {
}
}
if (EnableJxBeans) {
if ($.todayinJxBean || $.todayOutJxBean) {
ReturnMessage += `【今日喜豆】收${$.todayinJxBean}`;
if ($.todayOutJxBean != 0) {
ReturnMessage += `,支${$.todayOutJxBean}`;
}
ReturnMessage += `\n`;
}
if ($.inJxBean || $.OutJxBean) {
ReturnMessage += `【昨日喜豆】收${$.inJxBean}`;
if ($.OutJxBean != 0) {
ReturnMessage += `,支${$.OutJxBean}`;
}
ReturnMessage += `\n`;
}
ReturnMessage += `【当前喜豆】${$.xibeanCount}喜豆(≈${($.xibeanCount/ 100).toFixed(2)}元)\n`;
}
if ($.JDtotalcash) {
ReturnMessage += `【特价金币】${$.JDtotalcash}币(≈${($.JDtotalcash / 10000).toFixed(2)}元)\n`;
}
@ -1268,8 +1240,8 @@ function getJingBeanBalanceDetail(page) {
$.post(options, (err, resp, data) => {
try {
if (err) {
// console.log(`${JSON.stringify(err)}`)
// console.log(`${$.name} API请求失败请检查网路重试`)
console.log(`${JSON.stringify(err)}`)
console.log(`getJingBeanBalanceDetail API请求失败请检查网路重试`)
} else {
if (data) {
data = JSON.parse(data);
@ -1290,7 +1262,14 @@ function getJingBeanBalanceDetail(page) {
function jingBeanDetail() {
return new Promise(async resolve => {
setTimeout(async () => {
const strsign = await getSignfromNolan('jingBeanDetail', {"pageSize": "20", "page": "1"});
var strsign = "";
if (epsignurl) {
strsign = await getepsign('jingBeanDetail', { "pageSize": "20", "page": "1" });
strsign = strsign.body;
}
else
strsign = await getSignfromNolan('jingBeanDetail', { "pageSize": "20", "page": "1" });
const options = {
"url": `https://api.m.jd.com/client.action?functionId=jingBeanDetail`,
"body": strsign,
@ -1305,7 +1284,7 @@ function jingBeanDetail() {
try {
if (err) {
console.log(`${JSON.stringify(err)}`)
console.log(`${$.name} getJingBeanBalanceDetail API请求失败请检查网路重试`)
console.log(`${$.name} jingBeanDetail API请求失败请检查网路重试`)
} else {
if (data) {
data = JSON.parse(data);
@ -1320,7 +1299,10 @@ function jingBeanDetail() {
}
}
} catch (e) {
if (epsignurl)
$.logErr(e, resp)
else
console.log("因为没有指定带ep的Sign,获取过期豆子信息次数多了就会失败.")
} finally {
resolve(data);
}
@ -1329,6 +1311,31 @@ function jingBeanDetail() {
})
}
function getepsign(n, o, t = "sign") {
let e = {
url: epsignurl,
form: {
functionId: n, body: $.toStr(o),
}, headers: {
'Content-Type': 'application/x-www-form-urlencoded',
}
};
return new Promise(n => {
$.post(e, async (o, t, e) => {
try {
o ? console.log(o) : e = JSON.parse(e)
if (e.code === 200 && e.data) {
n({body: e.data.convertUrlNew})
}
} catch (n) {
$.logErr(n, t)
} finally {
n({body: e.convertUrlNew})
}
})
})
}
function getSignfromNolan(functionId, body) {
var strsign = '';
let data = {
@ -1708,12 +1715,6 @@ async function getjdfruitinfo() {
return;
}
async function GetJxBeaninfo() {
await GetJxBean(),
await jxbean();
return;
}
async function getjdfruit() {
return new Promise(resolve => {
const option = {
@ -1859,129 +1860,6 @@ function taskcashUrl(functionId, body = {}) {
}
}
function taskJxUrl(functionId, body = '') {
let url = ``;
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`;
if (body) {
url = `https://m.jingxi.com/activeapi/${functionId}?${body}`;
url += `&_=${Date.now() + 2}&sceneval=2&g_login_type=1&callback=jsonpCBK${String.fromCharCode(Math.floor(Math.random() * 26) + "A".charCodeAt(0))}&g_ty=ls`;
} else {
url = `https://m.jingxi.com/activeapi/${functionId}?_=${Date.now() + 2}&sceneval=2&g_login_type=1&callback=jsonpCBK${String.fromCharCode(Math.floor(Math.random() * 26) + "A".charCodeAt(0))}&g_ty=ls`;
}
return {
url,
headers: {
"Host": "m.jingxi.com",
"Accept": "*/*",
"Accept-Encoding": "gzip, deflate, br",
"User-Agent": UA,
"Accept-Language": "zh-CN,zh-Hans;q=0.9",
"Referer": "https://st.jingxi.com/",
"Cookie": cookie
},
timeout: 10000
}
}
function GetJxBeanDetailData() {
return new Promise((resolve) => {
$.get(taskJxUrl("queryuserjingdoudetail","pagesize=10&type=16"), async (err, resp, data) => {
try {
if (err) {
console.log(JSON.stringify(err));
console.log(`GetJxBeanDetailData请求失败请检查网路重试`);
} else {
data = JSON.parse(data.match(new RegExp(/jsonpCBK.?\((.*);*/))[1]);
}
} 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时间戳
const tm1 = parseInt((Date.now() + 28800000) / 86400000) * 86400000 - 28800000;
var JxYesterdayArr = [],
JxTodayArr = [];
var JxResponse = await GetJxBeanDetailData();
if (JxResponse && JxResponse.ret == "0") {
var Jxdetail = JxResponse.detail;
if (Jxdetail && Jxdetail.length > 0) {
for (let item of Jxdetail) {
const date = item.createdate.replace(/-/g, '/') + "+08:00";
if (new Date(date).getTime() >= tm1 && (!item['visibleinfo'].includes("退还") && !item['visibleinfo'].includes('扣赠'))) {
JxTodayArr.push(item);
} else if (tm <= new Date(date).getTime() && new Date(date).getTime() < tm1 && (!item['visibleinfo'].includes("退还") && !item['visibleinfo'].includes('扣赠'))) {
//昨日的
JxYesterdayArr.push(item);
} else if (tm > new Date(date).getTime()) {
break;
}
}
} else {
$.errorMsg = `数据异常`;
$.msg($.name, ``, `账号${$.index}${$.nickName}\n${$.errorMsg}`);
}
for (let item of JxYesterdayArr) {
if (Number(item.amount) > 0) {
$.inJxBean += Number(item.amount);
} else if (Number(item.amount) < 0) {
$.OutJxBean += Number(item.amount);
}
}
for (let item of JxTodayArr) {
if (Number(item.amount) > 0) {
$.todayinJxBean += Number(item.amount);
} else if (Number(item.amount) < 0) {
$.todayOutJxBean += Number(item.amount);
}
}
$.todayOutJxBean = -$.todayOutJxBean;
$.OutJxBean = -$.OutJxBean;
}
}
function GetJoyRuninginfo() {
if (!EnableJoyRun)
return;

353
jd_cleancartAll_nolan.js Normal file

File diff suppressed because one or more lines are too long

13
jd_cxj100help.js Normal file

File diff suppressed because one or more lines are too long

13
jd_cxj50help.js Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -21,7 +21,7 @@ export JD_TRY_SENDNUM="10" #每隔多少账号发送一次通知默认为4
export JD_TRY_UNIFIED="false" 默认采用不同试用组
export JD_TRY_NUM="7" 最多跑多少个CK默认10
cron "1 1 1 1 1" jd_try.js
cron "2 2 29 2 *" jd_try.js
*/
const $ = new Env('京东试用')
const URL = 'https://api.m.jd.com/client.action'
@ -716,7 +716,7 @@ function totalBean() {
}
function geth5st(body) {
let opt = {
url: `https://api.nolanstore.top/h5st`,
url: `https://api.nolanstore.cc/h5st`,
body: JSON.stringify({
"appId": "a8ade",
"functionId": "try_apply",

14
jx_cxjhelp.js Normal file

File diff suppressed because one or more lines are too long