mirror of
https://github.com/okyyds/yyds.git
synced 2026-07-15 01:21:17 +08:00
Compare commits
109 Commits
9e1ef81fb1
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8cd038ce72 | ||
|
|
d89392d8a5 | ||
|
|
685591c208 | ||
|
|
59569ea66c | ||
|
|
857bb0cacd | ||
|
|
c5b865f786 | ||
|
|
cd00939dc9 | ||
|
|
86c88bbe84 | ||
|
|
73adc5865a | ||
|
|
89a7cd8d68 | ||
|
|
7084b6c3c6 | ||
|
|
cae8dfdd18 | ||
|
|
9a063e6ef3 | ||
|
|
2d7605fd25 | ||
|
|
d912fcd73d | ||
|
|
b6fc59e1d7 | ||
|
|
1b18295358 | ||
|
|
360d6175e3 | ||
|
|
ddb2b022cf | ||
|
|
7afceaa71a | ||
|
|
dbeb4be52b | ||
|
|
3850159a6b | ||
|
|
7d5bd99e23 | ||
|
|
c042dfc43f | ||
|
|
975d1d9cc1 | ||
|
|
7f14a6a3b6 | ||
|
|
eca94cae44 | ||
|
|
b283a3ac0e | ||
|
|
5b2bfb3bca | ||
|
|
cc1e0c0ef1 | ||
|
|
30ca3dad20 | ||
|
|
02a0a5921f | ||
|
|
543db37660 | ||
|
|
73a8eef650 | ||
|
|
89c886cef0 | ||
|
|
9007f97a2d | ||
|
|
24955732c5 | ||
|
|
6153505ba5 | ||
|
|
a0458956c9 | ||
|
|
88b92b21cc | ||
|
|
64b0bdf102 | ||
|
|
a4069a1da8 | ||
|
|
92aaee1333 | ||
|
|
0e734a3cbd | ||
|
|
fcaab7ddd7 | ||
|
|
4bd347a755 | ||
|
|
5ed2581eb7 | ||
|
|
d47fae11d1 | ||
|
|
f61177b903 | ||
|
|
984c9bf243 | ||
|
|
b412afb9d2 | ||
|
|
57a86d5160 | ||
|
|
9608085dc1 | ||
|
|
a0c5facff6 | ||
|
|
fbadd85c5d | ||
|
|
413bfe56bf | ||
|
|
b61be4ad18 | ||
|
|
3432610309 | ||
|
|
d8f4dd62e2 | ||
|
|
ff4447832f | ||
|
|
cacebb01d8 | ||
|
|
8121662e01 | ||
|
|
67c4549fe8 | ||
|
|
116f8d639c | ||
|
|
c8ae9d09e0 | ||
|
|
46d367afbc | ||
|
|
e6a6f15910 | ||
|
|
fadd50e1d0 | ||
|
|
90138f7ea5 | ||
|
|
f9b2cf9eb7 | ||
|
|
61d2adf6ea | ||
|
|
9960f0ba6e | ||
|
|
6a544d2e53 | ||
|
|
5a8a6cab11 | ||
|
|
83b99fcbaf | ||
|
|
92b027ca25 | ||
|
|
97a14528da | ||
|
|
1818a7515e | ||
|
|
c003b1c891 | ||
|
|
56fcaf5f60 | ||
|
|
1081da0721 | ||
|
|
816d00b509 | ||
|
|
eb262f0c3f | ||
|
|
222a39dcca | ||
|
|
8bc81f4111 | ||
|
|
bccf8c823d | ||
|
|
d6833b7a1f | ||
|
|
c339dff83a | ||
|
|
2b9f1f87c9 | ||
|
|
3b14da7b64 | ||
|
|
6efd07a6a2 | ||
|
|
070f4462b5 | ||
|
|
a6a29a8d12 | ||
|
|
9be766d484 | ||
|
|
c59e9377ba | ||
|
|
2b7f21d427 | ||
|
|
a1771f1d7d | ||
|
|
dab27cff28 | ||
|
|
e4466e479f | ||
|
|
36e041975f | ||
|
|
0093d3f3d8 | ||
|
|
e4c40ac850 | ||
|
|
f8d7f7889c | ||
|
|
806bcf45bb | ||
|
|
660ee5e613 | ||
|
|
afeabc9f3a | ||
|
|
3f1d308e81 | ||
|
|
5f6b549bc4 | ||
|
|
612005cfb7 |
4
docker/anjia.json
Normal file
4
docker/anjia.json
Normal file
@@ -0,0 +1,4 @@
|
||||
[
|
||||
"c014109359274de1b9c23371268183a8",
|
||||
"5d4514bbede8441fa1aa120657c987b9"
|
||||
]
|
||||
6
docker/ct.json
Normal file
6
docker/ct.json
Normal file
@@ -0,0 +1,6 @@
|
||||
[
|
||||
"29DREstWFlxSaSi2a-trM8tYTjk_1K03",
|
||||
"gIy4HsQLR1dRby_QfqQnMC2LnLox",
|
||||
"29DREcUBSlsFZXrsauxqNeQ1MBq1z10j"
|
||||
|
||||
]
|
||||
4
docker/flp.json
Normal file
4
docker/flp.json
Normal file
@@ -0,0 +1,4 @@
|
||||
[
|
||||
"a432d3701d9649d2bd56779d10876b89",
|
||||
"7e821ae933e74bda8fd845f3825685fb"
|
||||
]
|
||||
12
docker/tokens.json
Normal file
12
docker/tokens.json
Normal file
@@ -0,0 +1,12 @@
|
||||
[
|
||||
"DC0E5C0609D3003DC106B73B94A4EB4F",
|
||||
"776D3DAAD242B860E89DF11077F82169",
|
||||
"F95A1A59A36015BE04EE37236DB6CE87",
|
||||
"33D71DB237DA8C9D84DC3B34F74AAC07",
|
||||
"E969CCB6A0DF9392A021E3D604D892A2",
|
||||
"D4A243F51F645969EF77A35C93F686A5",
|
||||
"445AF0A22B42AFE6D6ABADDE2FD161C2",
|
||||
"43B0F3550B339D30B1DC1B85198F5871",
|
||||
"710F970D2C9D83AE4547C6CD97754DCB",
|
||||
"264D069FBD411345AC26F8173FB9ABDB"
|
||||
]
|
||||
4
docker/xay.json
Normal file
4
docker/xay.json
Normal file
@@ -0,0 +1,4 @@
|
||||
[
|
||||
"c8cf903edd264d8a9f9a71358f3e8f27",
|
||||
"bc489fe97b0a4965a542b69da05326b4"
|
||||
]
|
||||
2079
jd_11red.js
2079
jd_11red.js
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -13,6 +13,65 @@ const JXUserAgent = $.isNode() ? (process.env.JX_USER_AGENT ? process.env.JX_USE
|
||||
//Node.js用户请在jdCookie.js处填写京东ck;
|
||||
const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
|
||||
let NowHour = new Date().getHours();
|
||||
|
||||
//默认开启缓存模式
|
||||
let checkbeanDetailMode=1;
|
||||
if ($.isNode() && process.env.BEANCHANGE_BEANDETAILMODE){
|
||||
checkbeanDetailMode=process.env.BEANCHANGE_BEANDETAILMODE*1;
|
||||
}
|
||||
|
||||
const fs = require('fs');
|
||||
let matchtitle="昨日";
|
||||
let yesterday="";
|
||||
let TodayDate="";
|
||||
let startDate="";
|
||||
let endDate="";
|
||||
try {
|
||||
const moment = require("moment");
|
||||
yesterday = moment().subtract(1, 'days').format('YYYY-MM-DD');
|
||||
TodayDate = moment().format("YYYY-MM-DD");
|
||||
startDate = moment().startOf("month").format("YYYY_MM");
|
||||
endDate = moment().endOf("month").format("YYYY-MM-DD");
|
||||
} catch (e) {
|
||||
console.log("依赖缺失,请先安装依赖moment!");
|
||||
return
|
||||
}
|
||||
|
||||
if (!fs.existsSync("./BeanCache")) {
|
||||
fs.mkdirSync("./BeanCache");
|
||||
}
|
||||
|
||||
let strBeanCache = "./BeanCache/" + yesterday + ".json";
|
||||
let strNewBeanCache = "./BeanCache/" + TodayDate + ".json";
|
||||
let TodayCache = [];
|
||||
let Fileexists = fs.existsSync(strBeanCache);
|
||||
let TempBeanCache = [];
|
||||
if(!Fileexists){
|
||||
yesterday=TodayDate;
|
||||
strBeanCache=strNewBeanCache;
|
||||
Fileexists = fs.existsSync(strBeanCache);
|
||||
matchtitle="今日";
|
||||
}
|
||||
if (Fileexists) {
|
||||
console.log("检测到资产变动缓存文件"+yesterday+".json,载入...");
|
||||
TempBeanCache = fs.readFileSync(strBeanCache, 'utf-8');
|
||||
if (TempBeanCache) {
|
||||
TempBeanCache = TempBeanCache.toString();
|
||||
TempBeanCache = JSON.parse(TempBeanCache);
|
||||
}
|
||||
}
|
||||
|
||||
Fileexists = fs.existsSync(strNewBeanCache);
|
||||
if (Fileexists) {
|
||||
console.log("检测到资产变动缓存文件"+TodayDate+".json,载入...");
|
||||
TodayCache = fs.readFileSync(strNewBeanCache, 'utf-8');
|
||||
if (TodayCache) {
|
||||
TodayCache = TodayCache.toString();
|
||||
TodayCache = JSON.parse(TodayCache);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
let allMessage = '';
|
||||
let allMessage2 = '';
|
||||
let allReceiveMessage = '';
|
||||
@@ -247,7 +306,7 @@ if(DisableIndex!=-1){
|
||||
}
|
||||
|
||||
//金融养猪
|
||||
let EnablePigPet=true;
|
||||
let EnablePigPet=false;
|
||||
DisableIndex=strDisableList.findIndex((item) => item === "金融养猪");
|
||||
if(DisableIndex!=-1){
|
||||
console.log("检测到设定关闭金融养猪查询");
|
||||
@@ -291,14 +350,6 @@ if(DisableIndex!=-1){
|
||||
EnableJoyRun=false
|
||||
}
|
||||
|
||||
//E卡查询
|
||||
let EnableCheckEcard=true;
|
||||
DisableIndex=strDisableList.findIndex((item) => item === "E卡查询");
|
||||
if(DisableIndex!=-1){
|
||||
console.log("检测到设定关闭E卡查询");
|
||||
EnableCheckEcard=false
|
||||
}
|
||||
|
||||
//京豆收益查询
|
||||
let EnableCheckBean=true;
|
||||
DisableIndex=strDisableList.findIndex((item) => item === "京豆收益");
|
||||
@@ -349,7 +400,8 @@ if(DisableIndex!=-1){
|
||||
$.jxFactoryInfo = '';
|
||||
$.jxFactoryReceive = '';
|
||||
$.jdCash = 0;
|
||||
$.isPlusVip = 0;
|
||||
$.isPlusVip = false;
|
||||
$.isRealNameAuth = false;
|
||||
$.JingXiang = "";
|
||||
$.allincomeBean = 0; //月收入
|
||||
$.allexpenseBean = 0; //月支出
|
||||
@@ -370,14 +422,29 @@ if(DisableIndex!=-1){
|
||||
$.JoyRunningAmount = "";
|
||||
$.ECardinfo = "";
|
||||
$.PlustotalScore=0;
|
||||
$.CheckTime="";
|
||||
$.beanCache=0;
|
||||
|
||||
TempBaipiao = "";
|
||||
strGuoqi="";
|
||||
console.log(`******开始查询【京东账号${$.index}】${$.nickName || $.UserName}*********`);
|
||||
|
||||
await Promise.all([
|
||||
TotalBean(),
|
||||
TotalBean2()])
|
||||
|
||||
await TotalBean();
|
||||
//await TotalBean2();
|
||||
if ($.beanCount == 0) {
|
||||
console.log("数据获取失败,等待30秒后重试....")
|
||||
await $.wait(30*1000);
|
||||
await TotalBean();
|
||||
}
|
||||
if ($.beanCount == 0) {
|
||||
console.log("疑似获取失败,等待10秒后用第二个接口试试....")
|
||||
await $.wait(10*1000);
|
||||
var userdata = await getuserinfo();
|
||||
if (userdata.code == 1) {
|
||||
$.beanCount = userdata.content.jdBean;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!$.isLogin) {
|
||||
await isLoginByX1a0He();
|
||||
}
|
||||
@@ -392,24 +459,69 @@ if(DisableIndex!=-1){
|
||||
continue
|
||||
}
|
||||
|
||||
await Promise.all([
|
||||
getJoyBaseInfo(), //汪汪乐园
|
||||
getJdZZ(), //京东赚赚
|
||||
getMs(), //京东秒杀
|
||||
getjdfruitinfo(), //东东农场
|
||||
cash(), //极速金币
|
||||
jdJxMCinfo(), //京喜牧场
|
||||
bean(), //京豆查询
|
||||
getJxFactory(), //京喜工厂
|
||||
getDdFactoryInfo(), // 京东工厂
|
||||
jdCash(), //领现金
|
||||
GetJxBeaninfo(), //喜豆查询
|
||||
GetPigPetInfo(), //金融养猪
|
||||
GetJoyRuninginfo(), //汪汪赛跑
|
||||
CheckEcard(), //E卡查询
|
||||
queryScores()
|
||||
])
|
||||
if (TempBeanCache) {
|
||||
for (let j = 0; j < TempBeanCache.length; j++) {
|
||||
if (TempBeanCache[j].pt_pin == $.UserName) {
|
||||
$.CheckTime = TempBeanCache[j].CheckTime;
|
||||
$.beanCache = TempBeanCache[j].BeanNum;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var llfound = false;
|
||||
var timeString = "";
|
||||
var nowHour = new Date().getHours();
|
||||
var nowMinute = new Date().getMinutes();
|
||||
if (nowHour < 10)
|
||||
timeString += "0" + nowHour + ":";
|
||||
else
|
||||
timeString += nowHour + ":";
|
||||
|
||||
if (nowMinute < 10)
|
||||
timeString += "0" + nowMinute;
|
||||
else
|
||||
timeString += nowMinute;
|
||||
|
||||
if (TodayCache) {
|
||||
for (let j = 0; j < TodayCache.length; j++) {
|
||||
if (TodayCache[j].pt_pin == $.UserName) {
|
||||
TodayCache[j].CheckTime = timeString;
|
||||
TodayCache[j].BeanNum = $.beanCount;
|
||||
llfound = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!llfound) {
|
||||
|
||||
var tempAddCache = {
|
||||
"pt_pin": $.UserName,
|
||||
"CheckTime": timeString,
|
||||
"BeanNum": $.beanCount
|
||||
};
|
||||
TodayCache.push(tempAddCache);
|
||||
}
|
||||
|
||||
await getjdfruitinfo(); //东东农场
|
||||
await $.wait(1000);
|
||||
|
||||
await Promise.all([
|
||||
getJoyBaseInfo(), //汪汪乐园
|
||||
getJdZZ(), //京东赚赚
|
||||
getMs(), //京东秒杀
|
||||
cash(), //极速金币
|
||||
jdJxMCinfo(), //京喜牧场
|
||||
bean(), //京豆查询
|
||||
getJxFactory(), //京喜工厂
|
||||
getDdFactoryInfo(), // 京东工厂
|
||||
jdCash(), //领现金
|
||||
GetJxBeaninfo(), //喜豆查询
|
||||
GetPigPetInfo(), //金融养猪
|
||||
GetJoyRuninginfo(), //汪汪赛跑
|
||||
queryScores()
|
||||
])
|
||||
|
||||
await showMsg();
|
||||
if (intPerSent > 0) {
|
||||
if ((i + 1) % intPerSent == 0) {
|
||||
@@ -435,6 +547,17 @@ if(DisableIndex!=-1){
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var str = JSON.stringify(TodayCache, null, 2);
|
||||
fs.writeFile(strNewBeanCache, str, function (err) {
|
||||
if (err) {
|
||||
console.log(err);
|
||||
console.log("添加缓存" + TodayDate + ".json失败!");
|
||||
} else {
|
||||
console.log("添加缓存" + TodayDate + ".json成功!");
|
||||
}
|
||||
})
|
||||
|
||||
//组1通知
|
||||
if (ReceiveMessageGp4) {
|
||||
allMessage2Gp4 = `【⏰商品白嫖活动领取提醒⏰】\n` + ReceiveMessageGp4;
|
||||
@@ -618,58 +741,38 @@ async function showMsg() {
|
||||
|
||||
if (userIndex2 != -1) {
|
||||
IndexGp2 += 1;
|
||||
ReturnMessageTitle = `【账号${IndexGp2}🆔】${$.nickName || $.UserName}\n`;
|
||||
ReturnMessageTitle = `【账号${IndexGp2}🆔】${$.nickName || $.UserName}`;
|
||||
}
|
||||
if (userIndex3 != -1) {
|
||||
IndexGp3 += 1;
|
||||
ReturnMessageTitle = `【账号${IndexGp3}🆔】${$.nickName || $.UserName}\n`;
|
||||
ReturnMessageTitle = `【账号${IndexGp3}🆔】${$.nickName || $.UserName}`;
|
||||
}
|
||||
if (userIndex4 != -1) {
|
||||
IndexGp4 += 1;
|
||||
ReturnMessageTitle = `【账号${IndexGp4}🆔】${$.nickName || $.UserName}\n`;
|
||||
ReturnMessageTitle = `【账号${IndexGp4}🆔】${$.nickName || $.UserName}`;
|
||||
}
|
||||
if (userIndex2 == -1 && userIndex3 == -1 && userIndex4 == -1) {
|
||||
IndexAll += 1;
|
||||
ReturnMessageTitle = `【账号${IndexAll}🆔】${$.nickName || $.UserName}\n`;
|
||||
ReturnMessageTitle = `【账号${IndexAll}🆔】${$.nickName || $.UserName}`;
|
||||
}
|
||||
|
||||
if ($.levelName || $.JingXiang){
|
||||
ReturnMessage += `【账号信息】`;
|
||||
if ($.levelName) {
|
||||
if ($.levelName.length > 2)
|
||||
$.levelName = $.levelName.substring(0, 2);
|
||||
|
||||
if ($.levelName == "注册")
|
||||
$.levelName = `😊普通`;
|
||||
|
||||
if ($.levelName == "钻石")
|
||||
$.levelName = `💎钻石`;
|
||||
|
||||
if ($.levelName == "金牌")
|
||||
$.levelName = `🥇金牌`;
|
||||
|
||||
if ($.levelName == "银牌")
|
||||
$.levelName = `🥈银牌`;
|
||||
|
||||
if ($.levelName == "铜牌")
|
||||
$.levelName = `🥉铜牌`;
|
||||
|
||||
if ($.isPlusVip == 1){
|
||||
ReturnMessage += `${$.levelName}Plus`;
|
||||
if($.PlustotalScore)
|
||||
ReturnMessage+=`(${$.PlustotalScore}分)`
|
||||
}
|
||||
else
|
||||
ReturnMessage += `${$.levelName}会员`;
|
||||
}
|
||||
|
||||
if ($.JingXiang){
|
||||
if ($.levelName) {
|
||||
ReturnMessage +=",";
|
||||
}
|
||||
ReturnMessage += `${$.JingXiang}`;
|
||||
}
|
||||
ReturnMessage +=`\n`;
|
||||
|
||||
|
||||
if ($.JingXiang) {
|
||||
if ($.isRealNameAuth)
|
||||
ReturnMessageTitle += `(已实名)\n`;
|
||||
else
|
||||
ReturnMessageTitle += `(未实名)\n`;
|
||||
ReturnMessage += `【账号信息】`;
|
||||
if ($.isPlusVip) {
|
||||
ReturnMessage += `Plus会员`;
|
||||
if ($.PlustotalScore)
|
||||
ReturnMessage += `(${$.PlustotalScore}分)`
|
||||
} else {
|
||||
ReturnMessage += `普通会员`;
|
||||
}
|
||||
ReturnMessage += `,京享值${$.JingXiang}\n`;
|
||||
}else{
|
||||
ReturnMessageTitle+= `\n`;
|
||||
}
|
||||
if (llShowMonth) {
|
||||
ReturnMessageMonth = ReturnMessage;
|
||||
@@ -696,20 +799,35 @@ async function showMsg() {
|
||||
|
||||
}
|
||||
if (EnableCheckBean) {
|
||||
ReturnMessage += `【今日京豆】收${$.todayIncomeBean}豆`;
|
||||
strsummary += `【今日京豆】收${$.todayIncomeBean}豆`;
|
||||
if ($.todayOutcomeBean != 0) {
|
||||
ReturnMessage += `,支${$.todayOutcomeBean}豆`;
|
||||
strsummary += `,支${$.todayOutcomeBean}豆`;
|
||||
}
|
||||
ReturnMessage += `\n`;
|
||||
strsummary += `\n`;
|
||||
ReturnMessage += `【昨日京豆】收${$.incomeBean}豆`;
|
||||
if (checkbeanDetailMode == 0) {
|
||||
ReturnMessage += `【今日京豆】收${$.todayIncomeBean}豆`;
|
||||
strsummary += `【今日京豆】收${$.todayIncomeBean}豆`;
|
||||
if ($.todayOutcomeBean != 0) {
|
||||
ReturnMessage += `,支${$.todayOutcomeBean}豆`;
|
||||
strsummary += `,支${$.todayOutcomeBean}豆`;
|
||||
}
|
||||
ReturnMessage += `\n`;
|
||||
strsummary += `\n`;
|
||||
ReturnMessage += `【昨日京豆】收${$.incomeBean}豆`;
|
||||
|
||||
if ($.expenseBean != 0) {
|
||||
ReturnMessage += `,支${$.expenseBean}豆`;
|
||||
}
|
||||
ReturnMessage += `\n`;
|
||||
if ($.expenseBean != 0) {
|
||||
ReturnMessage += `,支${$.expenseBean}豆`;
|
||||
}
|
||||
ReturnMessage += `\n`;
|
||||
} else {
|
||||
if (TempBeanCache){
|
||||
ReturnMessage += `【京豆变动】${$.beanCount-$.beanCache}豆(与${matchtitle}${$.CheckTime}比较)`;
|
||||
strsummary += `【京豆变动】${$.beanCount-$.beanCache}豆(与${matchtitle}${$.CheckTime}比较)`;
|
||||
ReturnMessage += `\n`;
|
||||
strsummary += `\n`;
|
||||
}
|
||||
else{
|
||||
ReturnMessage += `【京豆变动】未找到缓存,下次出结果统计`;
|
||||
strsummary += `【京豆变动】未找到缓存,下次出结果统计`;
|
||||
ReturnMessage += `\n`;
|
||||
strsummary += `\n`;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1013,8 +1131,14 @@ async function showMsg() {
|
||||
|
||||
if ($.isNode() && WP_APP_TOKEN_ONE) {
|
||||
var strTitle="京东资产变动";
|
||||
ReturnMessage=`【账号名称】${$.nickName || $.UserName}\n`+ReturnMessage;
|
||||
|
||||
if($.JingXiang){
|
||||
if ($.isRealNameAuth)
|
||||
ReturnMessage=`【账号名称】${$.nickName || $.UserName}(已实名)\n`+ReturnMessage;
|
||||
else
|
||||
ReturnMessage=`【账号名称】${$.nickName || $.UserName}(未实名)\n`+ReturnMessage;
|
||||
}else{
|
||||
ReturnMessage=`【账号名称】${$.nickName || $.UserName}\n`+ReturnMessage;
|
||||
}
|
||||
if (TempBaipiao) {
|
||||
strsummary=strSubNotify+TempBaipiao +strsummary;
|
||||
TempBaipiao = `【⏰商品白嫖活动提醒⏰】\n` + TempBaipiao;
|
||||
@@ -1034,7 +1158,9 @@ async function showMsg() {
|
||||
//$.msg($.name, '', ReturnMessage , {"open-url": "https://bean.m.jd.com/beanDetail/index.action?resourceValue=bean"});
|
||||
}
|
||||
async function bean() {
|
||||
if (EnableCheckBean) {
|
||||
|
||||
if (EnableCheckBean && checkbeanDetailMode==0) {
|
||||
|
||||
// console.log(`北京时间零点时间戳:${parseInt((Date.now() + 28800000) / 86400000) * 86400000 - 28800000}`);
|
||||
// console.log(`北京时间2020-10-28 06:16:05::${new Date("2020/10/28 06:16:05+08:00").getTime()}`)
|
||||
// 不管哪个时区。得到都是当前时刻北京时间的时间戳 new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000
|
||||
@@ -1053,7 +1179,7 @@ async function bean() {
|
||||
// console.log(`第${page}页: ${JSON.stringify(response)}`);
|
||||
if (response && response.code === "0") {
|
||||
page++;
|
||||
let detailList = response.detailList;
|
||||
let detailList = response.jingDetailList;
|
||||
if (detailList && detailList.length > 0) {
|
||||
for (let item of detailList) {
|
||||
const date = item.date.replace(/-/g, '/') + "+08:00";
|
||||
@@ -1097,18 +1223,17 @@ async function bean() {
|
||||
}
|
||||
}
|
||||
$.todayOutcomeBean = -$.todayOutcomeBean;
|
||||
$.expenseBean = -$.expenseBean;
|
||||
|
||||
decExBean = 0;
|
||||
if (EnableOverBean) {
|
||||
await queryexpirejingdou(); //过期京豆
|
||||
if (decExBean && doExJxBeans == "true") {
|
||||
var jxbeans = await exchangejxbeans(decExBean);
|
||||
if (jxbeans) {
|
||||
$.beanChangeXi = decExBean;
|
||||
console.log(`已为您将` + decExBean + `临期京豆转换成喜豆!`);
|
||||
strGuoqi += `已为您将` + decExBean + `临期京豆转换成喜豆!\n`;
|
||||
}
|
||||
$.expenseBean = -$.expenseBean;
|
||||
}
|
||||
decExBean = 0;
|
||||
if (EnableOverBean) {
|
||||
await queryexpirejingdou(); //过期京豆
|
||||
if (decExBean && doExJxBeans == "true") {
|
||||
var jxbeans = await exchangejxbeans(decExBean);
|
||||
if (jxbeans) {
|
||||
$.beanChangeXi = decExBean;
|
||||
console.log(`已为您将` + decExBean + `临期京豆转换成喜豆!`);
|
||||
strGuoqi += `已为您将` + decExBean + `临期京豆转换成喜豆!\n`;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1149,7 +1274,7 @@ async function Monthbean() {
|
||||
// console.log(`第${allpage}页: ${JSON.stringify(response)}`);
|
||||
if (response && response.code === "0") {
|
||||
allpage++;
|
||||
let detailList = response.detailList;
|
||||
let detailList = response.jingDetailList;
|
||||
if (detailList && detailList.length > 0) {
|
||||
for (let item of detailList) {
|
||||
const date = item.date.replace(/-/g, '/') + "+08:00";
|
||||
@@ -1205,29 +1330,6 @@ async function jdCash() {
|
||||
if (!EnableCash)
|
||||
return;
|
||||
let functionId = "cash_homePage";
|
||||
/* let body = {};
|
||||
console.log(`正在获取领现金任务签名...`);
|
||||
isSignError = false;
|
||||
let sign = await getSign(functionId, body);
|
||||
if (isSignError) {
|
||||
console.log(`领现金任务签名获取失败,等待2秒后再次尝试...`)
|
||||
await $.wait(2 * 1000);
|
||||
isSignError = false;
|
||||
sign =await getSign(functionId, body);
|
||||
}
|
||||
if (isSignError) {
|
||||
console.log(`领现金任务签名获取失败,等待2秒后再次尝试...`)
|
||||
await $.wait(2 * 1000);
|
||||
isSignError = false;
|
||||
sign = await getSign(functionId, body);
|
||||
}
|
||||
if (!isSignError) {
|
||||
console.log(`领现金任务签名获取成功...`)
|
||||
} else {
|
||||
console.log(`领现金任务签名获取失败...`)
|
||||
$.jdCash = 0;
|
||||
return
|
||||
} */
|
||||
let sign = `body=%7B%7D&build=167968&client=apple&clientVersion=10.4.0&d_brand=apple&d_model=iPhone13%2C3&ef=1&eid=eidI25488122a6s9Uqq6qodtQx6rgQhFlHkaE1KqvCRbzRnPZgP/93P%2BzfeY8nyrCw1FMzlQ1pE4X9JdmFEYKWdd1VxutadX0iJ6xedL%2BVBrSHCeDGV1&ep=%7B%22ciphertype%22%3A5%2C%22cipher%22%3A%7B%22screen%22%3A%22CJO3CMeyDJCy%22%2C%22osVersion%22%3A%22CJUkDK%3D%3D%22%2C%22openudid%22%3A%22CJSmCWU0DNYnYtS0DtGmCJY0YJcmDwCmYJC0DNHwZNc5ZQU2DJc3Zq%3D%3D%22%2C%22area%22%3A%22CJZpCJCmC180ENcnCv80ENc1EK%3D%3D%22%2C%22uuid%22%3A%22aQf1ZRdxb2r4ovZ1EJZhcxYlVNZSZz09%22%7D%2C%22ts%22%3A1648428189%2C%22hdid%22%3A%22JM9F1ywUPwflvMIpYPok0tt5k9kW4ArJEU3lfLhxBqw%3D%22%2C%22version%22%3A%221.0.3%22%2C%22appname%22%3A%22com.360buy.jdmobile%22%2C%22ridx%22%3A-1%7D&ext=%7B%22prstate%22%3A%220%22%2C%22pvcStu%22%3A%221%22%7D&isBackground=N&joycious=104&lang=zh_CN&networkType=3g&networklibtype=JDNetworkBaseAF&partner=apple&rfs=0000&scope=11&sign=98c0ea91318ef1313786d86d832f1d4d&st=1648428208392&sv=101&uemps=0-0&uts=0f31TVRjBSv7E8yLFU2g86XnPdLdKKyuazYDek9RnAdkKCbH50GbhlCSab3I2jwM04d75h5qDPiLMTl0I3dvlb3OFGnqX9NrfHUwDOpTEaxACTwWl6n//EOFSpqtKDhg%2BvlR1wAh0RSZ3J87iAf36Ce6nonmQvQAva7GoJM9Nbtdah0dgzXboUL2m5YqrJ1hWoxhCecLcrUWWbHTyAY3Rw%3D%3D`
|
||||
return new Promise((resolve) => {
|
||||
$.post(apptaskUrl(functionId, sign), async (err, resp, data) => {
|
||||
@@ -1254,57 +1356,6 @@ async function jdCash() {
|
||||
})
|
||||
}
|
||||
|
||||
async function CheckEcard() {
|
||||
if (!EnableCheckEcard)
|
||||
return;
|
||||
var balEcard = 0;
|
||||
var body = "pageNo=1&queryType=1&cardType=-1&pageSize=20";
|
||||
var stroption = {
|
||||
url: 'https://mygiftcard.jd.com/giftcard/queryGiftCardItem/app?source=JDAP',
|
||||
body,
|
||||
headers: {
|
||||
"accept": "application/json, text/plain, */*",
|
||||
"accept-encoding": "gzip, deflate, br",
|
||||
"accept-language": "zh-CN,zh-Hans;q=0.9",
|
||||
"content-length": "44",
|
||||
"content-type": "application/x-www-form-urlencoded",
|
||||
"cookie": cookie,
|
||||
"origin": "https://mygiftcard.jd.com",
|
||||
"referer": "https://mygiftcard.jd.com/giftcardForM.html?source=JDAP&sid=9f55a224c8286baa2fe3a7545bbd411w&un_area=16_1303_48712_48758",
|
||||
"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"
|
||||
},
|
||||
timeout: 10000
|
||||
}
|
||||
return new Promise((resolve) => {
|
||||
$.post(stroption, async(err, resp, data) => {
|
||||
try {
|
||||
if (err) {
|
||||
console.log(`${JSON.stringify(err)}`)
|
||||
console.log(`jdCash API请求失败,请检查网路重试`)
|
||||
} else {
|
||||
//console.log(data);
|
||||
data = JSON.parse(data);
|
||||
let useable = data.couponVOList;
|
||||
if (useable) {
|
||||
for (let k = 0; k < useable.length; k++) {
|
||||
if(useable[k].balance>0)
|
||||
balEcard += useable[k].balance;
|
||||
}
|
||||
if(balEcard)
|
||||
$.ECardinfo = '共' + useable.length + '张E卡,合计' + parseFloat(balEcard).toFixed(2) + '元';
|
||||
}
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
$.logErr(e, resp)
|
||||
}
|
||||
finally {
|
||||
resolve(data);
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function apptaskUrl(functionId = "", body = "") {
|
||||
return {
|
||||
url: `${JD_API_HOST}?functionId=${functionId}`,
|
||||
@@ -1357,7 +1408,7 @@ function getSign(functionId, body) {
|
||||
})
|
||||
})
|
||||
}
|
||||
function TotalBean() {
|
||||
/* function TotalBean() {
|
||||
return new Promise(async resolve => {
|
||||
const options = {
|
||||
url: "https://me-api.jd.com/user_new/info/GetJDUserInfoUnion",
|
||||
@@ -1372,9 +1423,9 @@ function TotalBean() {
|
||||
if (err) {
|
||||
$.logErr(err)
|
||||
} else {
|
||||
console.log(data);
|
||||
if (data) {
|
||||
data = JSON.parse(data);
|
||||
|
||||
if (data['retcode'] === "1001") {
|
||||
$.isLogin = false; //cookie过期
|
||||
return;
|
||||
@@ -1403,7 +1454,60 @@ function TotalBean() {
|
||||
}
|
||||
})
|
||||
})
|
||||
} */
|
||||
|
||||
function TotalBean() {
|
||||
return new Promise(async resolve => {
|
||||
const options = {
|
||||
"url": `https://wq.jd.com/user/info/QueryJDUserInfo?sceneval=2`,
|
||||
"headers": {
|
||||
"Accept": "application/json,text/plain, */*",
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
"Accept-Encoding": "gzip, deflate, br",
|
||||
"Accept-Language": "zh-cn",
|
||||
"Connection": "keep-alive",
|
||||
"Cookie": cookie,
|
||||
"Referer": "https://wqs.jd.com/my/jingdou/my.shtml?sceneval=2",
|
||||
"User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.4.4;14.3;network/4g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1")
|
||||
}
|
||||
}
|
||||
$.post(options, (err, resp, data) => {
|
||||
try {
|
||||
if (err) {
|
||||
console.log(`${JSON.stringify(err)}`)
|
||||
console.log(`${$.name} API请求失败,请检查网路重试`)
|
||||
} else {
|
||||
if (data) {
|
||||
data = JSON.parse(data);
|
||||
if (data['retcode'] === 13) {
|
||||
$.isLogin = false; //cookie过期
|
||||
return
|
||||
}
|
||||
if (data['retcode'] === 0) {
|
||||
$.nickName = (data['base'] && data['base'].nickname) || $.UserName;
|
||||
$.isPlusVip=data['isPlusVip'];
|
||||
$.isRealNameAuth=data['isRealNameAuth'];
|
||||
$.beanCount=(data['base'] && data['base'].jdNum) || 0 ;
|
||||
$.JingXiang = (data['base'] && data['base'].jvalue) || 0 ;
|
||||
} else {
|
||||
$.nickName = $.UserName
|
||||
}
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
console.log(`京东服务器返回空数据`)
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
$.logErr(e, resp)
|
||||
} finally {
|
||||
resolve();
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function TotalBean2() {
|
||||
return new Promise(async(resolve) => {
|
||||
const options = {
|
||||
@@ -1423,9 +1527,10 @@ function TotalBean2() {
|
||||
try {
|
||||
if (err) {
|
||||
$.logErr(err);
|
||||
} else {
|
||||
if (data) {
|
||||
data = JSON.parse(data);
|
||||
} else {
|
||||
if (data) {
|
||||
data = JSON.parse(data);
|
||||
|
||||
if (!data.user) {
|
||||
return;
|
||||
}
|
||||
@@ -1488,39 +1593,38 @@ function isLoginByX1a0He() {
|
||||
}
|
||||
|
||||
function getJingBeanBalanceDetail(page) {
|
||||
return new Promise(async resolve => {
|
||||
const options = {
|
||||
"url": `https://api.m.jd.com/client.action?functionId=getJingBeanBalanceDetail`,
|
||||
"body": `body=${escape(JSON.stringify({"pageSize": "20", "page": page.toString()}))}&appid=ld`,
|
||||
"headers": {
|
||||
'User-Agent': $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.4.4;14.3;network/4g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1"),
|
||||
'Host': 'api.m.jd.com',
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'Cookie': cookie,
|
||||
}
|
||||
}
|
||||
$.post(options, (err, resp, data) => {
|
||||
try {
|
||||
if (err) {
|
||||
console.log(`${JSON.stringify(err)}`)
|
||||
console.log(`getJingBeanBalanceDetail API请求失败,请检查网路重试`)
|
||||
} else {
|
||||
if (data) {
|
||||
data = JSON.parse(data);
|
||||
// console.log(data)
|
||||
} else {
|
||||
console.log(`京东服务器返回空数据`)
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
$.logErr(e, resp)
|
||||
}
|
||||
finally {
|
||||
resolve(data);
|
||||
}
|
||||
})
|
||||
})
|
||||
return new Promise(async resolve => {
|
||||
const options = {
|
||||
"url": `https://bean.m.jd.com/beanDetail/detail.json?page=${page}`,
|
||||
"body": `body=${escape(JSON.stringify({"pageSize": "20", "page": page.toString()}))}&appid=ld`,
|
||||
"headers": {
|
||||
'User-Agent': "Mozilla/5.0 (Linux; Android 12; SM-G9880) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Mobile Safari/537.36 EdgA/106.0.1370.47",
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'Cookie': cookie,
|
||||
}
|
||||
}
|
||||
$.post(options, (err, resp, data) => {
|
||||
try {
|
||||
if (err) {
|
||||
// console.log(`${JSON.stringify(err)}`)
|
||||
// console.log(`${$.name} API请求失败,请检查网路重试`)
|
||||
} else {
|
||||
if (data) {
|
||||
data = JSON.parse(data);
|
||||
// console.log(data)
|
||||
} else {
|
||||
// console.log(`京东服务器返回空数据`)
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
// $.logErr(e, resp)
|
||||
} finally {
|
||||
resolve(data);
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function queryexpirejingdou() {
|
||||
return new Promise(async resolve => {
|
||||
const options = {
|
||||
@@ -1611,6 +1715,7 @@ function getUUID(x = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", t = 0) {
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
function redPacket() {
|
||||
return new Promise(async resolve => {
|
||||
const options = {
|
||||
@@ -1638,41 +1743,60 @@ function redPacket() {
|
||||
$.jsRed = 0,
|
||||
$.jdRed = 0,
|
||||
$.jdhRed = 0,
|
||||
$.jdwxRed = 0,
|
||||
$.jdGeneralRed = 0,
|
||||
$.jxRedExpire = 0,
|
||||
$.jsRedExpire = 0,
|
||||
$.jdRedExpire = 0,
|
||||
$.jdhRedExpire = 0;
|
||||
$.jdwxRedExpire = 0,
|
||||
$.jdGeneralRedExpire = 0
|
||||
|
||||
let t = new Date();
|
||||
t.setDate(t.getDate() + 1);
|
||||
t.setHours(0, 0, 0, 0);
|
||||
t = parseInt((t - 1) / 1000);
|
||||
//console.log(JSON.stringify(data.useRedInfo.redList))
|
||||
for (let vo of data.useRedInfo.redList || []) {
|
||||
if (vo.orgLimitStr && vo.orgLimitStr.includes("京喜")) {
|
||||
if (vo.limitStr && vo.limitStr.includes("京喜")) {
|
||||
$.jxRed += parseFloat(vo.balance)
|
||||
if (vo['endTime'] === t) {
|
||||
$.jxRedExpire += parseFloat(vo.balance)
|
||||
}
|
||||
} else if (vo.activityName.includes("极速版") || vo.activityName.includes("京东特价")) {
|
||||
} else if (vo.limitStr.includes("购物小程序")) {
|
||||
$.jdwxRed += parseFloat(vo.balance)
|
||||
if (vo['endTime'] === t) {
|
||||
$.jdwxRedExpire += parseFloat(vo.balance)
|
||||
}
|
||||
} else if (vo.limitStr.includes("京东商城")) {
|
||||
$.jdRed += parseFloat(vo.balance)
|
||||
if (vo['endTime'] === t) {
|
||||
$.jdRedExpire += parseFloat(vo.balance)
|
||||
}
|
||||
} else if (vo.limitStr.includes("极速版") || vo.limitStr.includes("京东特价")) {
|
||||
$.jsRed += parseFloat(vo.balance)
|
||||
if (vo['endTime'] === t) {
|
||||
$.jsRedExpire += parseFloat(vo.balance)
|
||||
}
|
||||
} else if (vo.orgLimitStr && vo.orgLimitStr.includes("京东健康")) {
|
||||
} else if (vo.limitStr && vo.limitStr.includes("京东健康")) {
|
||||
$.jdhRed += parseFloat(vo.balance)
|
||||
if (vo['endTime'] === t) {
|
||||
$.jdhRedExpire += parseFloat(vo.balance)
|
||||
}
|
||||
} else {
|
||||
$.jdRed += parseFloat(vo.balance)
|
||||
$.jdGeneralRed += parseFloat(vo.balance)
|
||||
if (vo['endTime'] === t) {
|
||||
$.jdRedExpire += parseFloat(vo.balance)
|
||||
$.jdGeneralRedExpire += parseFloat(vo.balance)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$.jxRed = $.jxRed.toFixed(2);
|
||||
$.jsRed = $.jsRed.toFixed(2);
|
||||
$.jdRed = $.jdRed.toFixed(2);
|
||||
$.jdRed = $.jdRed.toFixed(2);
|
||||
$.jdhRed = $.jdhRed.toFixed(2);
|
||||
$.jdwxRed = $.jdwxRed.toFixed(2);
|
||||
$.jdGeneralRed = $.jdGeneralRed.toFixed(2);
|
||||
$.balance = data.balance;
|
||||
$.expiredBalance = ($.jxRedExpire + $.jsRedExpire + $.jdRedExpire).toFixed(2);
|
||||
$.message += `【红包总额】${$.balance}(总过期${$.expiredBalance})元 \n`;
|
||||
@@ -1684,6 +1808,10 @@ function redPacket() {
|
||||
$.message += `【京东红包】${$.jdRed}(将过期${$.jdRedExpire.toFixed(2)})元 \n`;
|
||||
if ($.jdhRed > 0)
|
||||
$.message += `【健康红包】${$.jdhRed}(将过期${$.jdhRedExpire.toFixed(2)})元 \n`;
|
||||
if ($.jdwxRed > 0)
|
||||
$.message += `【微信小程序】${$.jdwxRed}(将过期${$.jdwxRedExpire.toFixed(2)})元 \n`;
|
||||
if ($.jdGeneralRed > 0)
|
||||
$.message += `【全平台通用】${$.jdGeneralRed}(将过期${$.jdGeneralRedExpire.toFixed(2)})元 \n`;
|
||||
} else {
|
||||
console.log(`京东服务器返回空数据`)
|
||||
}
|
||||
@@ -1726,7 +1854,7 @@ function getCoupon() {
|
||||
//console.log(useable[i]);
|
||||
if (useable[i].limitStr.indexOf('全品类') > -1) {
|
||||
$.beginTime = useable[i].beginTime;
|
||||
if ($.beginTime < new Date().getTime() && useable[i].quota < 20 && useable[i].coupontype === 1) {
|
||||
if ($.beginTime < new Date().getTime() && useable[i].quota <= 100 && useable[i].coupontype === 1) {
|
||||
//$.couponEndTime = new Date(parseInt(useable[i].endTime)).Format('yyyy-MM-dd');
|
||||
$.couponName = useable[i].limitStr;
|
||||
if (useable[i].platFormInfo)
|
||||
@@ -1769,7 +1897,7 @@ function getCoupon() {
|
||||
}
|
||||
|
||||
}
|
||||
if (useable[i].couponTitle.indexOf('极速版APP活动') > -1 && useable[i].limitStr=='仅可购买活动商品') {
|
||||
if (useable[i].couponTitle.indexOf('特价版APP活动') > -1 && useable[i].limitStr=='仅可购买活动商品') {
|
||||
$.beginTime = useable[i].beginTime;
|
||||
if ($.beginTime < new Date().getTime() && useable[i].coupontype === 1) {
|
||||
if (useable[i].platFormInfo)
|
||||
@@ -1777,7 +1905,7 @@ function getCoupon() {
|
||||
var decquota=parseFloat(useable[i].quota).toFixed(2);
|
||||
var decdisc= parseFloat(useable[i].discount).toFixed(2);
|
||||
|
||||
$.message += `【极速版券】满${decquota}减${decdisc}元`;
|
||||
$.message += `【特价版券】满${decquota}减${decdisc}元`;
|
||||
|
||||
if (useable[i].endTime < $.todayEndTime) {
|
||||
$.message += `(今日过期,${$.platFormInfo})\n`;
|
||||
@@ -1931,9 +2059,14 @@ function jdfruitRequest(function_id, body = {}, timeout = 1000) {
|
||||
console.log(`function_id:${function_id}`)
|
||||
$.logErr(err);
|
||||
} else {
|
||||
if (safeGet(data)) {
|
||||
if (safeGet(data)) {
|
||||
data = JSON.parse(data);
|
||||
$.JDwaterEveryDayT = data.totalWaterTaskInit.totalWaterTaskTimes;
|
||||
if (data.code=="400"){
|
||||
console.log('东东农场: '+data.message);
|
||||
llgeterror = true;
|
||||
}
|
||||
else
|
||||
$.JDwaterEveryDayT = data.totalWaterTaskInit.totalWaterTaskTimes;
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
@@ -1956,7 +2089,10 @@ async function getjdfruitinfo() {
|
||||
"channel": 1,
|
||||
"babelChannel": "120"
|
||||
});
|
||||
|
||||
|
||||
if (llgeterror)
|
||||
return
|
||||
|
||||
await getjdfruit();
|
||||
if (llgeterror) {
|
||||
console.log(`东东农场API查询失败,等待10秒后再次尝试...`)
|
||||
@@ -2928,7 +3064,7 @@ function GetDateTime(date) {
|
||||
}
|
||||
|
||||
async function queryScores() {
|
||||
if ($.isPlusVip != 1)
|
||||
if (!$.isPlusVip)
|
||||
return
|
||||
let res = ''
|
||||
let url = {
|
||||
@@ -2953,6 +3089,110 @@ async function queryScores() {
|
||||
|
||||
}
|
||||
|
||||
async function getuserinfo() {
|
||||
var body=[{"pin": "$cooMrdGatewayUid$"}];
|
||||
var ua = `jdapp;iPhone;${random(["11.1.0", "10.5.0", "10.3.6"])};${random(["13.5", "14.0", "15.0"])};${uuidRandom()};network/wifi;supportApplePay/0;hasUPPay/0;hasOCPay/0;model/iPhone11,6;addressid/7565095847;supportBestPay/0;appBuild/167541;jdSupportDarkMode/0;Mozilla/5.0 (iPhone; CPU iPhone OS 13_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1`;
|
||||
|
||||
let config = {
|
||||
url: 'https://lop-proxy.jd.com/JingIntegralApi/userAccount',
|
||||
body: JSON.stringify(body),
|
||||
headers: {
|
||||
"host": "lop-proxy.jd.com",
|
||||
"jexpress-report-time": Date.now().toString(),
|
||||
"access": "H5",
|
||||
"source-client": "2",
|
||||
"accept": "application/json, text/plain, */*",
|
||||
"d_model": "iPhone11,6",
|
||||
"accept-encoding": "gzip",
|
||||
"lop-dn": "jingcai.jd.com",
|
||||
"user-agent": ua,
|
||||
"partner": "",
|
||||
"screen": "375*812",
|
||||
"cookie": cookie,
|
||||
"x-requested-with": "XMLHttpRequest",
|
||||
"version": "1.0.0",
|
||||
"uuid": randomNumber(10),
|
||||
"clientinfo": "{\"appName\":\"jingcai\",\"client\":\"m\"}",
|
||||
"d_brand": "iPhone",
|
||||
"appparams": "{\"appid\":158,\"ticket_type\":\"m\"}",
|
||||
"sdkversion": "1.0.7",
|
||||
"area": area(),
|
||||
"client": "iOS",
|
||||
"referer": "https://jingcai-h5.jd.com/",
|
||||
"eid": "",
|
||||
"osversion": random(["13.5", "14.0", "15.0"]),
|
||||
"networktype": "wifi",
|
||||
"jexpress-trace-id": uuid(),
|
||||
"origin": "https://jingcai-h5.jd.com",
|
||||
"app-key": "jexpress",
|
||||
"event-id": uuid(),
|
||||
"clientversion": random(["11.1.0", "10.5.0", "10.3.6"]),
|
||||
"content-type": "application/json;charset=utf-8",
|
||||
"build": "167541",
|
||||
"biz-type": "service-monitor",
|
||||
"forcebot": "0"
|
||||
}
|
||||
}
|
||||
return new Promise(resolve => {
|
||||
$.post(config, async(err, resp, data) => {
|
||||
try {
|
||||
//console.log(data)
|
||||
if (err) {
|
||||
console.log(err)
|
||||
} else {
|
||||
data = JSON.parse(data);
|
||||
}
|
||||
} catch (e) {
|
||||
$.logErr(e, resp)
|
||||
}
|
||||
finally {
|
||||
resolve(data || '');
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
function area() {
|
||||
let i = getRand(1, 30)
|
||||
let o = getRand(70, 3000)
|
||||
let x = getRand(900, 60000)
|
||||
let g = getRand(600, 30000)
|
||||
let a = i + '_' + o + '_' + x + '_' + g;
|
||||
return a
|
||||
};
|
||||
function getRand(min, max) {
|
||||
return parseInt(Math.random() * (max - min)) + min;
|
||||
};
|
||||
function uuid() {
|
||||
var s = [];
|
||||
var hexDigits = "0123456789abcdef";
|
||||
for (var i = 0; i < 36; i++) {
|
||||
s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
|
||||
}
|
||||
s[14] = "4";
|
||||
s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1);
|
||||
s[8] = s[13] = s[18] = s[23] = "-";
|
||||
var uuid = s.join("");
|
||||
return uuid;
|
||||
};
|
||||
function uuidRandom() {
|
||||
return Math.random().toString(16).slice(2, 10) +
|
||||
Math.random().toString(16).slice(2, 10) +
|
||||
Math.random().toString(16).slice(2, 10) +
|
||||
Math.random().toString(16).slice(2, 10) +
|
||||
Math.random().toString(16).slice(2, 10);
|
||||
}
|
||||
function random(arr) {
|
||||
return arr[Math.floor(Math.random() * arr.length)];
|
||||
}
|
||||
function randomNumber(len) {
|
||||
let chars = '0123456789';
|
||||
let maxPos = chars.length;
|
||||
let str = '';
|
||||
for (let i = 0; i < len; i++) {
|
||||
str += chars.charAt(Math.floor(Math.random() * maxPos));
|
||||
}
|
||||
return Date.now() + str;
|
||||
}
|
||||
// prettier-ignore
|
||||
function Env(t, e) {
|
||||
"undefined" != typeof process && JSON.stringify(process.env).indexOf("GITHUB") > -1 && process.exit(0);
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
/*
|
||||
京豆详情统计
|
||||
依次推送 + 全部统计
|
||||
7 7 7 7 7 jd_bean_info.js
|
||||
*/
|
||||
const $ = new Env('京豆详情统计');
|
||||
const notify = $.isNode() ? require('./sendNotify') : '';
|
||||
//Node.js用户请在jdCookie.js处填写京东ck;
|
||||
@@ -47,10 +52,12 @@ if ($.isNode()) {
|
||||
}
|
||||
await bean();
|
||||
await showMsg();
|
||||
|
||||
}
|
||||
console.log(allMessage)
|
||||
await notify.sendNotify(`${$.name}`, `${allMessage}`, { url: `https://bean.m.jd.com/beanDetail/index.action?resourceValue=bean` })
|
||||
allMessage = ''
|
||||
}
|
||||
allMessage += `\n今日全部账号收入:${allBean}个京豆 🐶\n`
|
||||
allMessage += `今日全部账号收入:${allBean}个京豆 🐶\n`
|
||||
if ($.isNode() && allMessage) {
|
||||
await notify.sendNotify(`${$.name}`, `${allMessage}`, { url: `https://bean.m.jd.com/beanDetail/index.action?resourceValue=bean` })
|
||||
}
|
||||
@@ -90,9 +97,9 @@ async function bean() {
|
||||
// console.log(`第${page}页: ${JSON.stringify(response)}`);
|
||||
if (response && response.code === "0") {
|
||||
page++;
|
||||
let detailList = response.detailList;
|
||||
if (detailList && detailList.length > 0) {
|
||||
for (let item of detailList) {
|
||||
let jingDetailList = response.jingDetailList;
|
||||
if (jingDetailList && jingDetailList.length > 0) {
|
||||
for (let item of jingDetailList) {
|
||||
const date = item.date.replace(/-/g, '/') + "+08:00";
|
||||
if (new Date(date).getTime() >= tm1 && (!item['eventMassage'].includes("退还") && !item['eventMassage'].includes('扣赠'))) {
|
||||
todayArr.push(item);
|
||||
@@ -190,11 +197,10 @@ function TotalBean() {
|
||||
function getJingBeanBalanceDetail(page) {
|
||||
return new Promise(async resolve => {
|
||||
const options = {
|
||||
"url": `https://api.m.jd.com/client.action?functionId=getJingBeanBalanceDetail`,
|
||||
"url": `https://bean.m.jd.com/beanDetail/detail.json?page=${page}`,
|
||||
"body": `body=${escape(JSON.stringify({"pageSize": "20", "page": page.toString()}))}&appid=ld`,
|
||||
"headers": {
|
||||
'User-Agent': $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.4.4;14.3;network/4g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1"),
|
||||
'Host': 'api.m.jd.com',
|
||||
'User-Agent': "Mozilla/5.0 (Linux; Android 12; SM-G9880) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Mobile Safari/537.36 EdgA/106.0.1370.47",
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'Cookie': cookie,
|
||||
}
|
||||
@@ -220,53 +226,6 @@ function getJingBeanBalanceDetail(page) {
|
||||
})
|
||||
})
|
||||
}
|
||||
function queryexpirejingdou() {
|
||||
return new Promise(async resolve => {
|
||||
const options = {
|
||||
"url": `https://wq.jd.com/activep3/singjd/queryexpirejingdou?_=${Date.now()}&g_login_type=1&sceneval=2`,
|
||||
"headers": {
|
||||
"Accept": "*/*",
|
||||
"Accept-Encoding": "gzip, deflate, br",
|
||||
"Accept-Language": "zh-cn",
|
||||
"Connection": "keep-alive",
|
||||
"Cookie": cookie,
|
||||
"Host": "wq.jd.com",
|
||||
"Referer": "https://wqs.jd.com/promote/201801/bean/mybean.html",
|
||||
"User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.1 Mobile/15E148 Safari/604.1"
|
||||
}
|
||||
}
|
||||
$.expirejingdou = 0;
|
||||
$.get(options, (err, resp, data) => {
|
||||
try {
|
||||
if (err) {
|
||||
// console.log(`${JSON.stringify(err)}`)
|
||||
// console.log(`${$.name} API请求失败,请检查网路重试`)
|
||||
} else {
|
||||
if (data) {
|
||||
// console.log(data)
|
||||
data = JSON.parse(data.slice(23, -13));
|
||||
// console.log(data)
|
||||
if (data.ret === 0) {
|
||||
data['expirejingdou'].map(item => {
|
||||
// console.log(`${timeFormat(item['time'] * 1000)}日过期京豆:${item['expireamount']}\n`);
|
||||
$.expirejingdou += item['expireamount'];
|
||||
})
|
||||
// if ($.expirejingdou > 0) {
|
||||
// $.message += `\n今日将过期:${$.expirejingdou}京豆 🐶`;
|
||||
// }
|
||||
}
|
||||
} else {
|
||||
// console.log(`京东服务器返回空数据`)
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
// $.logErr(e, resp)
|
||||
} finally {
|
||||
resolve();
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
function jsonParse(str) {
|
||||
if (typeof str == "string") {
|
||||
try {
|
||||
|
||||
431
jd_captian.js
Executable file
431
jd_captian.js
Executable file
File diff suppressed because one or more lines are too long
32
jd_comment.js
Normal file
32
jd_comment.js
Normal file
File diff suppressed because one or more lines are too long
30
jd_comment_wzb.js
Normal file
30
jd_comment_wzb.js
Normal file
File diff suppressed because one or more lines are too long
381
jd_dpqd.js
381
jd_dpqd.js
File diff suppressed because one or more lines are too long
11
jd_dpqd_dsb.js
Normal file
11
jd_dpqd_dsb.js
Normal file
File diff suppressed because one or more lines are too long
408
jd_fcwb.py
408
jd_fcwb.py
@@ -1,408 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
'''
|
||||
cron: 1 1 1 1 *
|
||||
new Env('发财挖宝');
|
||||
活动入口: 京东极速版 > 我的 > 发财挖宝
|
||||
最高可得总和为10元的微信零钱和红包
|
||||
脚本功能为: 挖宝,提现,没有助力功能,当血量剩余 1 时停止挖宝,领取奖励并提现
|
||||
|
||||
目前需要完成逛一逛任务并且下单任务才能通关,不做的话大概可得1.5~2块的微信零钱
|
||||
'''
|
||||
import os,json,random,time,re,string,functools,asyncio
|
||||
import sys
|
||||
sys.path.append('../../tmp')
|
||||
print('\n运行本脚本之前请手动进入游戏点击一个方块\n')
|
||||
print('\n挖的如果都是0.01红包就是黑了,别挣扎了!\n')
|
||||
print('\n默认自动领取奖励,关闭请在代码383行加上#号注释即可\n')
|
||||
try:
|
||||
import requests
|
||||
except Exception as e:
|
||||
print(str(e) + "\n缺少requests模块, 请执行命令:pip3 install requests\n")
|
||||
requests.packages.urllib3.disable_warnings()
|
||||
|
||||
|
||||
linkId="pTTvJeSTrpthgk9ASBVGsw"
|
||||
|
||||
|
||||
# 获取pin
|
||||
cookie_findall=re.compile(r'pt_pin=(.+?);')
|
||||
def get_pin(cookie):
|
||||
try:
|
||||
return cookie_findall.findall(cookie)[0]
|
||||
except:
|
||||
print('ck格式不正确,请检查')
|
||||
|
||||
# 读取环境变量
|
||||
def get_env(env):
|
||||
try:
|
||||
if env in os.environ:
|
||||
a=os.environ[env]
|
||||
elif '/ql' in os.path.abspath(os.path.dirname(__file__)):
|
||||
try:
|
||||
a=v4_env(env,'/ql/config/config.sh')
|
||||
except:
|
||||
a=eval(env)
|
||||
elif '/jd' in os.path.abspath(os.path.dirname(__file__)):
|
||||
try:
|
||||
a=v4_env(env,'/jd/config/config.sh')
|
||||
except:
|
||||
a=eval(env)
|
||||
else:
|
||||
a=eval(env)
|
||||
except:
|
||||
a=''
|
||||
return a
|
||||
|
||||
# v4
|
||||
def v4_env(env,paths):
|
||||
b=re.compile(r'(?:export )?'+env+r' ?= ?[\"\'](.*?)[\"\']', re.I)
|
||||
with open(paths, 'r') as f:
|
||||
for line in f.readlines():
|
||||
try:
|
||||
c=b.match(line).group(1)
|
||||
break
|
||||
except:
|
||||
pass
|
||||
return c
|
||||
|
||||
|
||||
# 随机ua
|
||||
def ua():
|
||||
sys.path.append(os.path.abspath('.'))
|
||||
try:
|
||||
from jdEnv import USER_AGENTS as a
|
||||
except:
|
||||
a='jdpingou;android;5.5.0;11;network/wifi;model/M2102K1C;appBuild/18299;partner/lcjx11;session/110;pap/JA2019_3111789;brand/Xiaomi;Mozilla/5.0 (Linux; Android 11; M2102K1C Build/RKQ1.201112.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/92.0.4515.159 Mobile Safari/537.36'
|
||||
return a
|
||||
|
||||
# 13位时间戳
|
||||
def gettimestamp():
|
||||
return str(int(time.time() * 1000))
|
||||
|
||||
## 获取cooie
|
||||
class Judge_env(object):
|
||||
def main_run(self):
|
||||
if '/jd' in os.path.abspath(os.path.dirname(__file__)):
|
||||
cookie_list=self.v4_cookie()
|
||||
else:
|
||||
cookie_list=os.environ["JD_COOKIE"].split('&') # 获取cookie_list的合集
|
||||
if len(cookie_list)<1:
|
||||
print('请填写环境变量JD_COOKIE\n')
|
||||
return cookie_list
|
||||
|
||||
def v4_cookie(self):
|
||||
a=[]
|
||||
b=re.compile(r'Cookie'+'.*?=\"(.*?)\"', re.I)
|
||||
with open('/jd/config/config.sh', 'r') as f:
|
||||
for line in f.readlines():
|
||||
try:
|
||||
regular=b.match(line).group(1)
|
||||
a.append(regular)
|
||||
except:
|
||||
pass
|
||||
return a
|
||||
cookie_list=Judge_env().main_run()
|
||||
|
||||
|
||||
def taskGetUrl(functionId, body, cookie):
|
||||
url=f'https://api.m.jd.com/?functionId={functionId}&body={json.dumps(body)}&t={gettimestamp()}&appid=activities_platform&client=H5&clientVersion=1.0.0'
|
||||
headers={
|
||||
'Cookie': cookie,
|
||||
'Host': 'api.m.jd.com',
|
||||
'Connection': 'keep-alive',
|
||||
'origin': 'https://bnzf.jd.com',
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'accept': 'application/json, text/plain, */*',
|
||||
"User-Agent": ua(),
|
||||
'Accept-Language': 'zh-cn',
|
||||
'Accept-Encoding': 'gzip, deflate, br',
|
||||
}
|
||||
for n in range(3):
|
||||
try:
|
||||
res=requests.get(url,headers=headers, timeout=10).json()
|
||||
return res
|
||||
except:
|
||||
if n==2:
|
||||
print('API请求失败,请检查网路重试❗\n')
|
||||
|
||||
|
||||
# 剩余血量
|
||||
def xueliang(cookie):
|
||||
body={"linkId":linkId,"round":1}
|
||||
res=taskGetUrl("happyDigHome", body, cookie)
|
||||
if not res:
|
||||
return
|
||||
if res['code']==0:
|
||||
if res['success']:
|
||||
curRound=res['data']['curRound'] # 未知
|
||||
blood=res['data']['blood'] # 剩余血量
|
||||
return blood
|
||||
|
||||
def jinge(cookie,i):
|
||||
body={"linkId":linkId}
|
||||
res=taskGetUrl("happyDigHome", body, cookie)
|
||||
if not res:
|
||||
return
|
||||
if res['code']==0:
|
||||
if res['success']:
|
||||
curRound=res['data']['curRound'] # 未知
|
||||
blood=res['data']['blood'] # 剩余血量
|
||||
roundList=res['data']['roundList'] # 3个总池子
|
||||
roundList_n=roundList[0]
|
||||
redAmount=roundList_n['redAmount'] # 当前池已得京东红包
|
||||
cashAmount=roundList_n['cashAmount'] # 当前池已得微信红包
|
||||
|
||||
return [blood,redAmount,cashAmount]
|
||||
|
||||
# 页面数据
|
||||
def happyDigHome(cookie):
|
||||
body={"linkId":linkId,"round":1}
|
||||
res=taskGetUrl("happyDigHome", body, cookie)
|
||||
exit_flag = "false"
|
||||
if not res:
|
||||
return
|
||||
if res['code']==0:
|
||||
if res['success']:
|
||||
curRound=res['data']['curRound'] # 未知
|
||||
incep_blood=res['data']['blood'] # 剩余血量
|
||||
roundList=res['data']['roundList'] # 3个总池子
|
||||
for e,roundList_n in enumerate(roundList): # 迭代每个池子
|
||||
roundid=roundList_n['round'] # 池序号
|
||||
state=roundList_n['state']
|
||||
rows=roundList_n['rows'] # 池规模,rows*rows
|
||||
redAmount=roundList_n['redAmount'] # 当前池已得京东红包
|
||||
cashAmount=roundList_n['cashAmount'] # 当前池已得微信红包
|
||||
leftAmount=roundList_n['leftAmount'] # 剩余红包?
|
||||
chunks=roundList_n['chunks'] # 当前池详情list
|
||||
|
||||
a=jinge(cookie,roundid)
|
||||
if roundid==1:
|
||||
print(f'\n开始 "入门" 难度关卡({rows}*{rows})')
|
||||
elif roundid==2:
|
||||
print(f'\n开始 "挑战" 难度关卡({rows}*{rows})')
|
||||
elif roundid==3:
|
||||
print(f'\n开始 "终极" 难度关卡({rows}*{rows})')
|
||||
print(f'当前剩余血量 {a[0]}🩸')
|
||||
## print(f'当前池已得京东红包 {a[2]}\n当前池已得微信红包 {a[1]}\n')
|
||||
_blood=xueliang(cookie)
|
||||
if _blood>1 or incep_blood>=21:
|
||||
happyDigDo(cookie,roundid,0,0)
|
||||
if e==0 or e==1:
|
||||
roundid_n=4
|
||||
else:
|
||||
roundid_n=5
|
||||
for n in range(roundid_n):
|
||||
for i in range(roundid_n):
|
||||
_blood=xueliang(cookie)
|
||||
if _blood>1 or incep_blood>=21:
|
||||
## print(f'当前血量为 {_blood}')
|
||||
a=n+1
|
||||
b=i+1
|
||||
print(f'挖取坐标({a},{b})')
|
||||
happyDigDo(cookie,roundid,n,i)
|
||||
else:
|
||||
a=jinge(cookie,roundid)
|
||||
print(f'没血了,不挖了')
|
||||
exit_flag = "true"
|
||||
## print(f'当前池已得京东红包 {a[2]}\n当前池已得微信红包 {a[1]}\n')
|
||||
break
|
||||
|
||||
if exit_flag == "true":
|
||||
break
|
||||
if exit_flag == "true":
|
||||
break
|
||||
else:
|
||||
print(f'获取数据失败\n{res}\n')
|
||||
else:
|
||||
print(f'获取数据失败\n{res}\n')
|
||||
|
||||
|
||||
# 玩一玩
|
||||
def apDoTask(cookie):
|
||||
print('开始做玩一玩任务')
|
||||
body={"linkId":linkId,"taskType":"BROWSE_CHANNEL","taskId":454,"channel":4,"itemId":"https%3A%2F%2Fsignfree.jd.com%2F%3FactivityId%3DPiuLvM8vamONsWzC0wqBGQ","checkVersion":False}
|
||||
res=taskGetUrl('apDoTask', body, cookie)
|
||||
if not res:
|
||||
return
|
||||
try:
|
||||
if res['success']:
|
||||
print('玩好了')
|
||||
else:
|
||||
print(f"{res['errMsg']}")
|
||||
except:
|
||||
print(f"错误\n{res}")
|
||||
|
||||
|
||||
# 挖宝
|
||||
def happyDigDo(cookie,roundid,rowIdx,colIdx):
|
||||
body={"round":roundid,"rowIdx":rowIdx,"colIdx":colIdx,"linkId":linkId}
|
||||
res=taskGetUrl("happyDigDo", body, cookie)
|
||||
if not res:
|
||||
return
|
||||
if res['code']==0:
|
||||
if res['success']:
|
||||
typeid=res['data']['chunk']['type']
|
||||
if typeid==2:
|
||||
print(f"获得极速版红包 {res['data']['chunk']['value']} 🧧\n")
|
||||
elif typeid==3:
|
||||
print(f"🎉 获得微信零钱 {res['data']['chunk']['value']} 💰\n")
|
||||
elif typeid==4:
|
||||
print(f"💥Boom💥 挖到了炸弹 💣\n")
|
||||
elif typeid==1:
|
||||
print(f"获得优惠券 🎟️\n")
|
||||
else:
|
||||
print(f'不知道挖到了什么 🎁\n')
|
||||
else:
|
||||
print(f'{res}\n挖宝失败\n')
|
||||
else:
|
||||
print(f'{res}\n挖宝失败\n')
|
||||
|
||||
# # 助力码
|
||||
# def inviteCode(cookie):
|
||||
# global inviteCode_1_list,inviteCode_2_list
|
||||
# body={"linkId":linkId}
|
||||
# res=taskGetUrl("happyDigHome", body, cookie)
|
||||
# if not res:
|
||||
# return
|
||||
# try:
|
||||
# if res['success']:
|
||||
# print(f"账号{get_pin(cookie)}助力码为{res['data']['inviteCode']}")
|
||||
# inviteCode_1_list.append(res['data']['inviteCode'])
|
||||
# print(f"账号{get_pin(cookie)}助力码为{res['data']['markedPin']}")
|
||||
# inviteCode_2_list.append(res['data']['markedPin'])
|
||||
# else:
|
||||
# print('快去买买买吧')
|
||||
# except:
|
||||
# print(f"错误\n{res}\n")
|
||||
|
||||
# # 助力
|
||||
# def happyDigHelp(cookie,fcwbinviter,fcwbinviteCode):
|
||||
# print(f"账号 {get_pin(cookie)} 去助力{fcwbinviteCode}")
|
||||
# xueliang(cookie)
|
||||
# body={"linkId":linkId,"inviter":fcwbinviter,"inviteCode":fcwbinviteCode}
|
||||
# res=taskGetUrl("happyDigHelp", body, cookie)
|
||||
# if res['success']:
|
||||
# print('助力成功')
|
||||
# else:
|
||||
# print(res['errMsg'])
|
||||
|
||||
# 领取奖励
|
||||
def happyDigExchange(cookie):
|
||||
for n in range(1,4):
|
||||
xueliang(cookie)
|
||||
print(f"\n开始领取第{n}场的奖励")
|
||||
body={"round":n,"linkId":linkId}
|
||||
res=taskGetUrl("happyDigExchange", body, cookie)
|
||||
if not res:
|
||||
return
|
||||
if res['code']==0:
|
||||
if res['success']:
|
||||
try:
|
||||
print(f"已领取极速版红包 {res['data']['redValue']} 🧧")
|
||||
except:
|
||||
print('')
|
||||
if res['data']['wxValue'] != "0":
|
||||
try:
|
||||
print(f"可提现微信零钱 {res['data']['wxValue']} 💰")
|
||||
except:
|
||||
pass
|
||||
else:
|
||||
print(res['errMsg'])
|
||||
else:
|
||||
print(res['errMsg'])
|
||||
|
||||
|
||||
|
||||
# 微信现金id
|
||||
def spring_reward_list(cookie):
|
||||
happyDigExchange(cookie)
|
||||
xueliang(cookie)
|
||||
|
||||
body={"linkId":linkId,"pageNum":1,"pageSize":6}
|
||||
res=taskGetUrl("spring_reward_list", body, cookie)
|
||||
|
||||
if res['code']==0:
|
||||
if res['success']:
|
||||
items=res['data']['items']
|
||||
for _items in items:
|
||||
amount=_items['amount'] # 金额
|
||||
prizeDesc=_items['prizeDesc'] # 金额备注
|
||||
amountid=_items['id'] # 金额id
|
||||
poolBaseId=_items['poolBaseId']
|
||||
prizeGroupId=_items['prizeGroupId']
|
||||
prizeBaseId=_items['prizeBaseId']
|
||||
if '红包' in f"{prizeDesc}":
|
||||
continue
|
||||
if '券' in f"{prizeDesc}":
|
||||
continue
|
||||
else:
|
||||
print('\n去提现微信零钱 💰')
|
||||
time.sleep(3.2)
|
||||
wecat(cookie,amountid,poolBaseId,prizeGroupId,prizeBaseId)
|
||||
else:
|
||||
print(f'获取数据失败\n{res}\n')
|
||||
else:
|
||||
print(f'获取数据失败\n{res}\n')
|
||||
|
||||
# 微信提现
|
||||
def wecat(cookie,amountid,poolBaseId,prizeGroupId,prizeBaseId):
|
||||
xueliang(cookie)
|
||||
|
||||
url='https://api.m.jd.com'
|
||||
headers={
|
||||
'Cookie': cookie,
|
||||
'Host': 'api.m.jd.com',
|
||||
'Connection': 'keep-alive',
|
||||
'origin': 'https://bnzf.jd.com',
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
"User-Agent": ua(),
|
||||
'Accept-Language': 'zh-cn',
|
||||
'Accept-Encoding': 'gzip, deflate, br',
|
||||
}
|
||||
body={"businessSource":"happyDiggerH5Cash","base":{"id":amountid,"business":"happyDigger","poolBaseId":poolBaseId,"prizeGroupId":prizeGroupId,"prizeBaseId":prizeBaseId,"prizeType":4},"linkId":linkId}
|
||||
data=f"functionId=apCashWithDraw&body={json.dumps(body)}&t=1635596380119&appid=activities_platform&client=H5&clientVersion=1.0.0"
|
||||
for n in range(3):
|
||||
try:
|
||||
res=requests.post(url,headers=headers,data=data,timeout=10).json()
|
||||
break
|
||||
except:
|
||||
if n==2:
|
||||
print('API请求失败,请检查网路重试❗\n')
|
||||
try:
|
||||
if res['code']==0:
|
||||
if res['success']:
|
||||
print(res['data']['message']+'\n')
|
||||
except:
|
||||
print(res)
|
||||
print('')
|
||||
|
||||
|
||||
def main():
|
||||
print('🔔发财挖宝,开始!\n')
|
||||
|
||||
# print('获取助力码\n')
|
||||
# global inviteCode_1_list,inviteCode_2_list
|
||||
# inviteCode_1_list=list()
|
||||
# inviteCode_2_list=list()
|
||||
# for cookie in cookie_list:
|
||||
# inviteCode(cookie)
|
||||
|
||||
# print('互助\n')
|
||||
# inviteCode_2_list=inviteCode_2_list[:2]
|
||||
# for e,fcwbinviter in enumerate(inviteCode_2_list):
|
||||
# fcwbinviteCode=inviteCode_1_list[e]
|
||||
# for cookie in cookie_list:
|
||||
# happyDigHelp(cookie,fcwbinviter,fcwbinviteCode)
|
||||
|
||||
print(f'====================共{len(cookie_list)}京东个账号Cookie=========\n')
|
||||
|
||||
for e,cookie in enumerate(cookie_list,start=1):
|
||||
print(f'******开始【账号 {e}】 {get_pin(cookie)} *********\n')
|
||||
apDoTask(cookie)
|
||||
happyDigHome(cookie)
|
||||
spring_reward_list(cookie)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
1605
jd_fruit_old.js
1605
jd_fruit_old.js
File diff suppressed because one or more lines are too long
11
jd_harmony_auto.js
Normal file
11
jd_harmony_auto.js
Normal file
File diff suppressed because one or more lines are too long
7
jd_lzdz1.js
Normal file
7
jd_lzdz1.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
File diff suppressed because one or more lines are too long
31
jd_lzdz1_joinCommon_jm.js
Normal file
31
jd_lzdz1_joinCommon_jm.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
473
jd_lzdz_bd.js
473
jd_lzdz_bd.js
File diff suppressed because one or more lines are too long
205
jd_makemoneyshop_award.js
Normal file
205
jd_makemoneyshop_award.js
Normal file
File diff suppressed because one or more lines are too long
282
jd_makemoneyshop_reward.js
Normal file
282
jd_makemoneyshop_reward.js
Normal file
File diff suppressed because one or more lines are too long
353
jd_marketmh.js
Normal file
353
jd_marketmh.js
Normal file
File diff suppressed because one or more lines are too long
340
jd_mncryyj.js
340
jd_mncryyj.js
File diff suppressed because one or more lines are too long
134
jd_mofang.ts
134
jd_mofang.ts
@@ -1,134 +0,0 @@
|
||||
/**
|
||||
* 京东-新品-魔方
|
||||
* rabbit log
|
||||
* cron: 10 9,12,15 * * *
|
||||
*/
|
||||
|
||||
import {requireConfig, wait, post, get} from './TS_USER_AGENTS'
|
||||
import {existsSync} from "fs";
|
||||
import * as dotenv from 'dotenv'
|
||||
|
||||
let cookie: string = '', res: any = '', UserName: string, index: number, log: string = ''
|
||||
let rabbitToken: string = process.env.RABBIT_TOKEN || '', tg_id: string = process.env.TG_ID || '', mf_logs: any
|
||||
|
||||
!(async () => {
|
||||
dotenv.config()
|
||||
if (existsSync('./test/mf_log.ts')) {
|
||||
mf_logs = require('./test/mf_log').mf_logs
|
||||
} else {
|
||||
console.log('./test/mf_log not found')
|
||||
}
|
||||
let cookiesArr: any = await requireConfig()
|
||||
for (let i = 0; i < cookiesArr.length; i++) {
|
||||
cookie = cookiesArr[i]
|
||||
UserName = decodeURIComponent(cookie.match(/pt_pin=([^;]*)/)![1])
|
||||
index = i + 1
|
||||
console.log(`\n开始【京东账号${index}】${UserName}\n`)
|
||||
|
||||
res = await api("functionId=getInteractionHomeInfo&body=%7B%22sign%22%3A%22u6vtLQ7ztxgykLEr%22%7D&appid=content_ecology&client=wh5&clientVersion=1.0.0")
|
||||
let sign: string = res.result.taskConfig.projectId
|
||||
|
||||
res = await api(`functionId=queryInteractiveInfo&body=%7B%22encryptProjectId%22%3A%22${sign}%22%2C%22sourceCode%22%3A%22acexinpin0823%22%2C%22ext%22%3A%7B%7D%7D&client=wh5&clientVersion=1.0.0&appid=content_ecology`)
|
||||
for (let t of res.assignmentList) {
|
||||
if (t.completionCnt < t.assignmentTimesLimit) {
|
||||
if (t.ext) {
|
||||
if (t.assignmentName === '每日签到') {
|
||||
if (t.ext.sign1.status === 1) {
|
||||
let signDay: number = t.ext.sign1.signList?.length || 0,
|
||||
type: number = t.rewards[signDay].rewardType
|
||||
console.log(signDay, type)
|
||||
log = await getLog()
|
||||
res = await api(`functionId=doInteractiveAssignment&body=${JSON.stringify({
|
||||
"encryptProjectId": sign, "encryptAssignmentId": t.encryptAssignmentId, "sourceCode": "acexinpin0823", "itemId": "1", "actionType": "", "completionFlag": "", "ext": {}, "extParam": {"businessData": {"random": log.match(/"random":"(\d+)"/)[1]}, "signStr": log.match(/"log":"(.*)"/)[1], "sceneid": "XMFhPageh5"}
|
||||
})}&client=wh5&clientVersion=1.0.0&appid=content_ecology`)
|
||||
console.log('签到成功')
|
||||
} else {
|
||||
console.log('已签到')
|
||||
}
|
||||
}
|
||||
|
||||
for (let proInfo of t.ext.productsInfo ?? []) {
|
||||
if (proInfo.status === 1) {
|
||||
console.log(t.assignmentName)
|
||||
log = await getLog()
|
||||
res = await api(`functionId=doInteractiveAssignment&body=${encodeURIComponent(JSON.stringify({"encryptProjectId": sign, "encryptAssignmentId": t.encryptAssignmentId, "sourceCode": "acexinpin0823", "itemId": proInfo.itemId, "actionType": 0, "completionFlag": "", "ext": {}, "extParam": {"businessData": {"random": log.match(/"random":"(\d+)"/)[1]}, "signStr": log.match(/"log":"(.*)"/)[1], "sceneid": "XMFhPageh5"}}))}&client=wh5&clientVersion=1.0.0&appid=content_ecology`)
|
||||
console.log(res.msg)
|
||||
if (res.msg === '任务已完成') {
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (let proInfo of t.ext.shoppingActivity ?? []) {
|
||||
if (proInfo.status === 1) {
|
||||
console.log(t.assignmentName)
|
||||
log = await getLog()
|
||||
res = await api(`functionId=doInteractiveAssignment&body=${encodeURIComponent(JSON.stringify({"encryptProjectId": sign, "encryptAssignmentId": t.encryptAssignmentId, "sourceCode": "acexinpin0823", "itemId": proInfo.itemId, "actionType": 1, "completionFlag": "", "ext": {}, "extParam": {"businessData": {"random": log.match(/"random":"(\d+)"/)[1]}, "signStr": log.match(/"log":"(.*)"/)[1], "sceneid": "XMFhPageh5"}}))}&client=wh5&clientVersion=1.0.0&appid=content_ecology`)
|
||||
console.log(res.msg)
|
||||
await wait(t.ext.waitDuration * 1000)
|
||||
log = await getLog()
|
||||
res = await api(`functionId=doInteractiveAssignment&body=${encodeURIComponent(JSON.stringify({"encryptProjectId": sign, "encryptAssignmentId": t.encryptAssignmentId, "sourceCode": "acexinpin0823", "itemId": proInfo.itemId, "actionType": 0, "completionFlag": "", "ext": {}, "extParam": {"businessData": {"random": log.match(/"random":"(\d+)"/)[1]}, "signStr": log.match(/"log":"(.*)"/)[1], "sceneid": "XMFhPageh5"}}))}&client=wh5&clientVersion=1.0.0&appid=content_ecology`)
|
||||
console.log(res.msg)
|
||||
}
|
||||
}
|
||||
|
||||
for (let proInfo of t.ext.browseShop ?? []) {
|
||||
if (proInfo.status === 1) {
|
||||
console.log(t.assignmentName)
|
||||
log = await getLog()
|
||||
res = await api(`functionId=doInteractiveAssignment&body=${JSON.stringify({
|
||||
"encryptProjectId": sign, "encryptAssignmentId": t.encryptAssignmentId, "sourceCode": "acexinpin0823", "itemId": proInfo.itemId, "actionType": 1, "completionFlag": "", "ext": {}, "extParam": {"businessData": {"random": log.match(/"random":"(\d+)"/)[1]}, "signStr": log.match(/"log":"(.*)"/)[1], "sceneid": "XMFhPageh5"}
|
||||
})}&client=wh5&clientVersion=1.0.0&appid=content_ecology`)
|
||||
console.log(res.msg)
|
||||
await wait(t.ext.waitDuration * 1000)
|
||||
log = await getLog()
|
||||
res = await api(`functionId=doInteractiveAssignment&body=${JSON.stringify({
|
||||
"encryptProjectId": sign, "encryptAssignmentId": t.encryptAssignmentId, "sourceCode": "acexinpin0823", "itemId": proInfo.itemId, "actionType": 0, "completionFlag": "", "ext": {}, "extParam": {"businessData": {"random": log.match(/"random":"(\d+)"/)[1]}, "signStr": log.match(/"log":"(.*)"/)[1], "sceneid": "XMFhPageh5"}
|
||||
})}&client=wh5&clientVersion=1.0.0&appid=content_ecology`)
|
||||
console.log(res.msg)
|
||||
}
|
||||
}
|
||||
|
||||
for (let proInfo of t.ext.addCart ?? []) {
|
||||
if (proInfo.status === 1) {
|
||||
console.log(t.assignmentName)
|
||||
log = await getLog()
|
||||
res = await api(`functionId=doInteractiveAssignment&body=${encodeURIComponent(JSON.stringify({"encryptProjectId": sign, "encryptAssignmentId": t.encryptAssignmentId, "sourceCode": "acexinpin0823", "itemId": proInfo.itemId, "actionType": "0", "completionFlag": "", "ext": {}, "extParam": {"businessData": {"random": log.match(/"random":"(\d+)"/)[1]}, "signStr": log.match(/"log":"(.*)"/)[1], "sceneid": "XMFJGh5"}}))}&client=wh5&clientVersion=1.0.0&appid=content_ecology`)
|
||||
console.log(res.msg)
|
||||
if (res.msg === '任务已完成') {
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (t.assignmentName === '去新品频道逛逛') {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})()
|
||||
|
||||
async function api(params: string) {
|
||||
await wait(1000)
|
||||
return await post("https://api.m.jd.com/client.action", params, {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
"User-Agent": "Mozilla/5.0 (Linux; U; Android 8.0.0; zh-cn; Mi Note 2 Build/OPR1.170623.032) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/61.0.3163.128 Mobile Safari/537.36 XiaoMi/MiuiBrowser/10.1.1",
|
||||
'Referer': 'https://h5.m.jd.com/babelDiy/Zeus/2bf3XEEyWG11pQzPGkKpKX2GxJz2/index.html',
|
||||
'Origin': 'https://h5.m.jd.com',
|
||||
'Host': 'api.m.jd.com',
|
||||
'Cookie': cookie
|
||||
})
|
||||
}
|
||||
|
||||
async function getLog() {
|
||||
if (rabbitToken && tg_id) {
|
||||
console.log('rabbit log api')
|
||||
let {data} = await get(`http://www.madrabbit.cf:8080/license/log?tg_id=${tg_id}&token=${rabbitToken}`)
|
||||
return `'"random":"${data.random}","log":"${data.log}"'`
|
||||
} else if (mf_logs) {
|
||||
return mf_logs[Math.floor(Math.random() * mf_logs.length)]
|
||||
} else {
|
||||
console.log('No log')
|
||||
process.exit(0)
|
||||
}
|
||||
}
|
||||
885
jd_moneyTree.js
885
jd_moneyTree.js
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,64 +0,0 @@
|
||||
//40 5,12,21 * * * m_jd_pet_automation.js
|
||||
//问题反馈:https://t.me/Wall_E_Channel
|
||||
const {Env} = require('./magic');
|
||||
const $ = new Env('M萌宠自动化');
|
||||
let commodityName = process.env.M_JD_PET_COMMODITY
|
||||
? process.env.M_JD_PET_COMMODITY
|
||||
: ''
|
||||
$.log('默认4级商品,生产指定商品请自行配置 M_JD_PET_COMMODITY')
|
||||
$.logic = async function () {
|
||||
let info = await api('initPetTown', {"version": 1});
|
||||
$.log(JSON.stringify(info));
|
||||
debugger
|
||||
if (info?.result?.petStatus < 5) {
|
||||
return
|
||||
}
|
||||
if (info?.result?.petStatus === 5) {
|
||||
$.log(info?.result?.goodsInfo);
|
||||
let activityId = info?.result?.goodsInfo.activityId;
|
||||
let activityIds = info?.result?.goodsInfo.activityIds;
|
||||
let data = await api('redPacketExchange',
|
||||
{"activityId": activityId, "activityIds": activityIds});
|
||||
$.putMsg(`${info?.result?.goodsInfo.exchangeMedalNum === 4 ? '12'
|
||||
: '25'}红包,${$.formatDate(
|
||||
$.timestamp() + data.result.pastDays * 24 * 60 * 60 * 1000)}过期`)
|
||||
info = await api('initPetTown', {"version": 1});
|
||||
}
|
||||
if (info?.result?.petStatus === 6) {
|
||||
info = await api('goodsInfoList', {"type": 2})
|
||||
let goods = commodityName ? info.result.goodsList.filter(
|
||||
o => o.goodsName.includes(commodityName))[0]
|
||||
: info.result.goodsList.filter(o => o.exchangeMedalNum === 4)[0];
|
||||
if (!goods) {
|
||||
$.putMsg(`没找到你要生产的 ${commodityName}`)
|
||||
return
|
||||
}
|
||||
info = await api('goodsInfoUpdate', {"goodsId": goods.goodsId})
|
||||
$.putMsg(`生产【${info.result.goodsInfo.goodsName}】成功`)
|
||||
}
|
||||
};
|
||||
|
||||
$.run({
|
||||
wait: [2000, 3000], whitelist: ['1-15']
|
||||
}).catch(
|
||||
reason => $.log(reason));
|
||||
|
||||
// noinspection DuplicatedCode
|
||||
async function api(fn, body) {
|
||||
let url = `https://api.m.jd.com/client.action?functionId=${fn}&body=${JSON.stringify(
|
||||
body)}&client=apple&clientVersion=10.0.4&osVersion=13.7&appid=wh5&loginType=2&loginWQBiz=pet-town`
|
||||
//↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓请求头↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
|
||||
let headers = {
|
||||
"Cookie": $.cookie,
|
||||
"Connection": "keep-alive",
|
||||
"Accept": "*/*",
|
||||
"Host": "api.m.jd.com",
|
||||
'User-Agent': `Mozilla/5.0 (iPhone; CPU iPhone OS 14_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.4(0x1800042c) NetType/4G Language/zh_CN miniProgram`,
|
||||
"Accept-Encoding": "gzip, deflate, br",
|
||||
"Accept-Language": "zh-cn"
|
||||
}
|
||||
let {data} = await $.request(url, headers)
|
||||
await $.wait(1000, 3000)
|
||||
return data;
|
||||
}
|
||||
|
||||
33
jd_prodev.js
Normal file
33
jd_prodev.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
@@ -101,7 +101,7 @@ $.flag = false
|
||||
async function main(_0x14f2ac){
|
||||
let _0xc6f9d4=decodeURIComponent(_0x14f2ac.match(/pt_pin=(.+?);/)&&_0x14f2ac.match(/pt_pin=(.+?);/)[1]);
|
||||
let _0x43a9de=await takeRequest(_0x14f2ac,'showSecondFloorCardInfo','{"source":"card"}');
|
||||
if(JSON.stringify(_0x43a9de)==='{}'||!_0x43a9de||!_0x43a9de.result||!_0x43a9de.result.activityBaseInfo){
|
||||
if(_0x43a9de.bizCode == 'MP001'){
|
||||
console.log('本期活动结束,等待下期。。。');
|
||||
$.flag = true
|
||||
return;
|
||||
|
||||
233
jd_superBrandSign.js
Normal file
233
jd_superBrandSign.js
Normal file
File diff suppressed because one or more lines are too long
7
jd_twCard.js
Normal file
7
jd_twCard.js
Normal file
File diff suppressed because one or more lines are too long
10
jd_tyt.js
10
jd_tyt.js
@@ -96,7 +96,7 @@ function info() {
|
||||
|
||||
const nm = {
|
||||
url: `${JD_API_HOST}`,
|
||||
body: `functionId=initiateCoinDozer&body={"actId":"e6ad1ef1a55c440e9054e663be14e1d6","channel":"coin_dozer","antiToken":"","referer":"-1","frontendInitStatus":"s"}&appid=megatron&client=ios&clientVersion=14.3&t=1636014459632&networkType=4g&eid=&fp=-1&frontendInitStatus=s&uuid=8888&osVersion=14.3&d_brand=&d_model=&agent=-1&pageClickKey=-1&screen=400*700&platform=3&lang=zh_CN`,
|
||||
body: `functionId=initiateCoinDozer&body={"actId":"ccd0447255384f06ae26690993be27f1","channel":"coin_dozer","antiToken":"","referer":"-1","frontendInitStatus":"s"}&appid=megatron&client=ios&clientVersion=14.3&t=1636014459632&networkType=4g&eid=&fp=-1&frontendInitStatus=s&uuid=8888&osVersion=14.3&d_brand=&d_model=&agent=-1&pageClickKey=-1&screen=400*700&platform=3&lang=zh_CN`,
|
||||
headers: {
|
||||
"Cookie": cookie,
|
||||
"Origin": "https://pushgold.jd.com",
|
||||
@@ -139,7 +139,7 @@ function coinDozerBackFlow() {
|
||||
|
||||
const nm = {
|
||||
url: `${JD_API_HOST}`,
|
||||
body: `functionId=coinDozerBackFlow&body={"actId":"e6ad1ef1a55c440e9054e663be14e1d6","channel":"coin_dozer","antiToken":"","referer":"-1","frontendInitStatus":"s"}&appid=megatron&client=ios&clientVersion=14.3&t=1636015617899&networkType=4g&eid=&fp=-1&frontendInitStatus=s&uuid=8888&osVersion=14.3&d_brand=&d_model=&agent=-1&pageClickKey=-1&screen=400*700&platform=3&lang=zh_CN`,
|
||||
body: `functionId=coinDozerBackFlow&body={"actId":"ccd0447255384f06ae26690993be27f1","channel":"coin_dozer","antiToken":"","referer":"-1","frontendInitStatus":"s"}&appid=megatron&client=ios&clientVersion=14.3&t=1636015617899&networkType=4g&eid=&fp=-1&frontendInitStatus=s&uuid=8888&osVersion=14.3&d_brand=&d_model=&agent=-1&pageClickKey=-1&screen=400*700&platform=3&lang=zh_CN`,
|
||||
headers: {
|
||||
|
||||
"Cookie": cookie,
|
||||
@@ -180,7 +180,7 @@ function helpCoinDozer(packetId) {
|
||||
return new Promise((resolve) => {
|
||||
const nm = {
|
||||
url: `${JD_API_HOST}`,
|
||||
body: `functionId=helpCoinDozer&appid=station-soa-h5&client=H5&clientVersion=1.0.0&t=1636015855103&body={"actId":"e6ad1ef1a55c440e9054e663be14e1d6","channel":"coin_dozer","antiToken":"","referer":"-1","frontendInitStatus":"s","packetId":"${packetId}"}&_ste=1&_stk=appid,body,client,clientVersion,functionId,t&h5st=20211104165055104;9806356985655163;10005;tk01wd1ed1d5f30nBDriGzaeVZZ9vuiX+cBzRLExSEzpfTriRD0nxU6BbRIOcSQvnfh74uInjSeb6i+VHpnHrBJdVwzs;017f330f7a84896d31a8d6017a1504dc16be8001273aaea9a04a8d04aad033d9`,
|
||||
body: `functionId=helpCoinDozer&appid=station-soa-h5&client=H5&clientVersion=1.0.0&t=1636015855103&body={"actId":"ccd0447255384f06ae26690993be27f1","channel":"coin_dozer","antiToken":"","referer":"-1","frontendInitStatus":"s","packetId":"${packetId}"}&_ste=1&_stk=appid,body,client,clientVersion,functionId,t&h5st=20211104165055104;9806356985655163;10005;tk01wd1ed1d5f30nBDriGzaeVZZ9vuiX+cBzRLExSEzpfTriRD0nxU6BbRIOcSQvnfh74uInjSeb6i+VHpnHrBJdVwzs;017f330f7a84896d31a8d6017a1504dc16be8001273aaea9a04a8d04aad033d9`,
|
||||
headers: {
|
||||
|
||||
"Cookie": cookie,
|
||||
@@ -220,7 +220,7 @@ function help(packetId) {
|
||||
return new Promise((resolve) => {
|
||||
const nm = {
|
||||
url: `${JD_API_HOST}`,
|
||||
body: `functionId=helpCoinDozer&appid=station-soa-h5&client=H5&clientVersion=1.0.0&t=1623120183787&body={"actId":"e6ad1ef1a55c440e9054e663be14e1d6","channel":"coin_dozer","antiToken":"","referer":"-1","frontendInitStatus":"s","packetId":"${packetId}","helperStatus":"0"}&_ste=1&_stk=appid,body,client,clientVersion,functionId,t&h5st=20210608104303790;8489907903583162;10005;tk01w89681aa9a8nZDdIanIyWnVuWFLK4gnqY+05WKcPY3NWU2dcfa73B7PBM7ufJEN0U+4MyHW5N2mT/RNMq72ycJxH;7e6b956f1a8a71b269a0038bbb4abd24bcfb834a88910818cf1bdfc55b7b96e5`,
|
||||
body: `functionId=helpCoinDozer&appid=station-soa-h5&client=H5&clientVersion=1.0.0&t=1623120183787&body={"actId":"ccd0447255384f06ae26690993be27f1","channel":"coin_dozer","antiToken":"","referer":"-1","frontendInitStatus":"s","packetId":"${packetId}","helperStatus":"0"}&_ste=1&_stk=appid,body,client,clientVersion,functionId,t&h5st=20210608104303790;8489907903583162;10005;tk01w89681aa9a8nZDdIanIyWnVuWFLK4gnqY+05WKcPY3NWU2dcfa73B7PBM7ufJEN0U+4MyHW5N2mT/RNMq72ycJxH;7e6b956f1a8a71b269a0038bbb4abd24bcfb834a88910818cf1bdfc55b7b96e5`,
|
||||
headers: {
|
||||
|
||||
"Cookie": cookie,
|
||||
@@ -268,7 +268,7 @@ function getCoinDozerInfo() {
|
||||
|
||||
const nm = {
|
||||
url: `${JD_API_HOST}`,
|
||||
body: `functionId=getCoinDozerInfo&body={"actId":"e6ad1ef1a55c440e9054e663be14e1d6","channel":"coin_dozer","antiToken":"","referer":"-1","frontendInitStatus":"s"}&appid=megatron&client=ios&clientVersion=14.3&t=1636015858295&networkType=4g&eid=&fp=-1&frontendInitStatus=s&uuid=8888&osVersion=14.3&d_brand=&d_model=&agent=-1&pageClickKey=-1&screen=400*700&platform=3&lang=zh_CN`,
|
||||
body: `functionId=getCoinDozerInfo&body={"actId":"ccd0447255384f06ae26690993be27f1","channel":"coin_dozer","antiToken":"","referer":"-1","frontendInitStatus":"s"}&appid=megatron&client=ios&clientVersion=14.3&t=1636015858295&networkType=4g&eid=&fp=-1&frontendInitStatus=s&uuid=8888&osVersion=14.3&d_brand=&d_model=&agent=-1&pageClickKey=-1&screen=400*700&platform=3&lang=zh_CN`,
|
||||
headers: {
|
||||
"Cookie": cookie,
|
||||
"Origin": "https://pushgold.jd.com",
|
||||
|
||||
556
jd_tyt_ks.js
556
jd_tyt_ks.js
@@ -1,556 +0,0 @@
|
||||
/*
|
||||
分享到QQ查看邀请码 packetId就是
|
||||
#自定义变量
|
||||
export tytpacketId=""
|
||||
[task_local]
|
||||
#推一推助力码
|
||||
0 0 * * * jd_tyt.js, tag=推一推, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/jd.png, enabled=true
|
||||
注意:助力码每天会变,旧的不可用。
|
||||
助力逻辑:优先助力互助码变量
|
||||
入口-极速版-推推赚大钱 5元无门槛卷 大概需要50人助力
|
||||
*/
|
||||
const $ = new Env('推推赚大钱-快速');
|
||||
const notify = $.isNode() ? require('./sendNotify') : '';
|
||||
//Node.js用户请在jdCookie.js处填写京东ck;
|
||||
const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
|
||||
const ua = `jdltapp;iPhone;3.1.0;${Math.ceil(Math.random()*4+10)}.${Math.ceil(Math.random()*4)};${randomString(40)}`
|
||||
var status = 0
|
||||
|
||||
//IOS等用户直接用NobyDa的jd cookie
|
||||
let cookiesArr = [],
|
||||
cookie = '',
|
||||
message;
|
||||
let tytpacketId = '';
|
||||
if (process.env.tytpacketId) {
|
||||
tytpacketId = process.env.tytpacketId;
|
||||
}
|
||||
if ($.isNode()) {
|
||||
Object.keys(jdCookieNode).forEach((item) => {
|
||||
cookiesArr.push(jdCookieNode[item])
|
||||
})
|
||||
// if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {};
|
||||
} else {
|
||||
cookiesArr = [$.getdata('CookieJD'), $.getdata('CookieJD2'), ...jsonParse($.getdata('CookiesJD') || "[]").map(item => item.cookie)].filter(item => !!item);
|
||||
}
|
||||
const JD_API_HOST = 'https://api.m.jd.com/client.action';
|
||||
|
||||
!(async() => {
|
||||
if (!cookiesArr[0]) {
|
||||
$.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', {
|
||||
"open-url": "https://bean.m.jd.com/bean/signIndex.action"
|
||||
});
|
||||
return;
|
||||
}
|
||||
console.log("推一推开始")
|
||||
for (let i = cookiesArr.length - 1; i > 0; i--) {
|
||||
if (cookiesArr[i]) {
|
||||
cookie = cookiesArr[i];
|
||||
$.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1])
|
||||
$.index = i + 1;
|
||||
$.isLogin = true;
|
||||
$.nickName = '';
|
||||
message = '';
|
||||
await TotalBean();
|
||||
console.log(`\n******开始【京东账号${$.index}】${$.nickName || $.UserName}*********\n`);
|
||||
if (!$.isLogin) {
|
||||
$.msg($.name, `【提示】cookie已失效`, `京东账号${$.index} ${$.nickName || $.UserName}\n请重新登录获取\nhttps://bean.m.jd.com/bean/signIndex.action`, {
|
||||
"open-url": "https://bean.m.jd.com/bean/signIndex.action"
|
||||
});
|
||||
|
||||
if ($.isNode()) {
|
||||
await notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`);
|
||||
}
|
||||
continue
|
||||
}
|
||||
if (status == 1) {
|
||||
break
|
||||
}
|
||||
await tythelp()
|
||||
await $.wait(15000)
|
||||
}
|
||||
}
|
||||
console.log("推一推结束")
|
||||
})()
|
||||
.catch((e) => {
|
||||
$.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '')
|
||||
})
|
||||
.finally(() => {
|
||||
$.done();
|
||||
})
|
||||
|
||||
function tythelp() {
|
||||
return new Promise(async(resolve) => {
|
||||
let options = {
|
||||
url: `https://api.m.jd.com/?t=1623066557140`,
|
||||
|
||||
body: `functionId=helpCoinDozer&appid=station-soa-h5&client=H5&clientVersion=1.0.0&t=1623120183787&body={"actId":"3075b6eab065464dad1c4042d345ac97","channel":"coin_dozer","antiToken":"","referer":"-1","frontendInitStatus":"s","packetId":"${tytpacketId}","helperStatus":"0"}&_ste=1&_stk=appid,body,client,clientVersion,functionId,t&h5st=20210608104303790;8489907903583162;10005;tk01w89681aa9a8nZDdIanIyWnVuWFLK4gnqY+05WKcPY3NWU2dcfa73B7PBM7ufJEN0U+4MyHW5N2mT/RNMq72ycJxH;7e6b956f1a8a71b269a0038bbb4abd24bcfb834a88910818cf1bdfc55b7b96e5`,
|
||||
headers: {
|
||||
"Origin": "https://pushgold.jd.com",
|
||||
"Host": "api.m.jd.com",
|
||||
"Accept": "application/json, text/plain, */*",
|
||||
"User-Agent": ua,
|
||||
"Cookie": cookie,
|
||||
}
|
||||
}
|
||||
|
||||
$.post(options, async(err, resp, data) => {
|
||||
try {
|
||||
data = JSON.parse(data);
|
||||
|
||||
if (data.code == 0) {
|
||||
console.log("帮砍:" + data.data.amount)
|
||||
|
||||
} else if (data.msg.indexOf("完成") != -1) {
|
||||
console.log("已完成砍价")
|
||||
status = 1
|
||||
} else {
|
||||
if (data.msg !== "need verify"){
|
||||
console.log(data.msg)
|
||||
}
|
||||
console.log(data.msg)
|
||||
}
|
||||
} catch (e) {
|
||||
$.logErr(e, resp);
|
||||
} finally {
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function randomString(e) {
|
||||
e = e || 32;
|
||||
let t = "abcdefhijkmnprstwxyz2345678",
|
||||
a = t.length,
|
||||
n = "";
|
||||
for (i = 0; i < e; i++)
|
||||
n += t.charAt(Math.floor(Math.random() * a));
|
||||
return n
|
||||
}
|
||||
async function taskPostUrl(functionId, body) {
|
||||
return {
|
||||
url: `${JD_API_HOST}`,
|
||||
body: `functionId=${functionId}&body=${escape(JSON.stringify(body))}&client=wh5&clientVersion=1.0.0&appid=content_ecology&uuid=6898c30638c55142969304c8e2167997fa59eb54&t=1622588448365`,
|
||||
headers: {
|
||||
'Cookie': cookie,
|
||||
'Host': 'api.m.jd.com',
|
||||
'Connection': 'keep-alive',
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
"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',
|
||||
'Accept-Encoding': 'gzip, deflate, br',
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
async function TotalBean() {
|
||||
return new Promise(async resolve => {
|
||||
const options = {
|
||||
"url": `https://wq.jd.com/user/info/QueryJDUserInfo?sceneval=2`,
|
||||
"headers": {
|
||||
"Accept": "application/json,text/plain, */*",
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
"Accept-Encoding": "gzip, deflate, br",
|
||||
"Accept-Language": "zh-cn",
|
||||
"Connection": "keep-alive",
|
||||
"Cookie": cookie,
|
||||
"Referer": "https://wqs.jd.com/my/jingdou/my.shtml?sceneval=2",
|
||||
"User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.4.4;14.3;network/4g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1")
|
||||
}
|
||||
}
|
||||
$.post(options, (err, resp, data) => {
|
||||
try {
|
||||
if (err) {
|
||||
console.log(`${JSON.stringify(err)}`)
|
||||
console.log(`${$.name} API请求失败,请检查网路重试`)
|
||||
} else {
|
||||
if (data) {
|
||||
data = JSON.parse(data);
|
||||
if (data["retcode"] === 13) {
|
||||
$.isLogin = false; //cookie过期
|
||||
return;
|
||||
}
|
||||
if (data["retcode"] === 0) {
|
||||
$.nickName = (data["base"] && data["base"].nickname) || $.UserName;
|
||||
} else {
|
||||
$.nickName = $.UserName;
|
||||
}
|
||||
} else {
|
||||
console.log(`京东服务器返回空数据`)
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
$.logErr(e, resp)
|
||||
} finally {
|
||||
resolve();
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
async function safeGet(data) {
|
||||
try {
|
||||
if (typeof JSON.parse(data) == "object") {
|
||||
return true;
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
console.log(`京东服务器访问数据为空,请检查自身设备网络情况`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
42
jd_wish.js
42
jd_wish.js
@@ -1,8 +1,22 @@
|
||||
/*
|
||||
众筹许愿池
|
||||
活动入口:京东-京东众筹-众筹许愿池
|
||||
40 0,2 * * * jd_wish.js
|
||||
*/
|
||||
脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js
|
||||
===============Quantumultx===============
|
||||
[task_local]
|
||||
#众筹许愿池
|
||||
40 0,2 * * * https://raw.githubusercontent.com/KingRan/JDJB/main/jd_wish.js, tag=众筹许愿池, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/jd.png, enabled=true
|
||||
|
||||
================Loon==============
|
||||
[Script]
|
||||
cron "40 0,2 * * *" script-path=https://raw.githubusercontent.com/KingRan/JDJB/main/jd_wish.js,tag=众筹许愿池
|
||||
|
||||
===============Surge=================
|
||||
众筹许愿池 = type=cron,cronexp="40 0,2 * * *",wake-system=1,timeout=3600,script-path=https://raw.githubusercontent.com/KingRan/JDJB/main/jd_wish.js
|
||||
|
||||
============小火箭=========
|
||||
众筹许愿池 = type=cron,script-path=https://raw.githubusercontent.com/KingRan/JDJB/main/jd_wish.js, cronexpr="40 0,2 * * *", timeout=3600, enable=true
|
||||
*/
|
||||
const $ = new Env('众筹许愿池');
|
||||
const notify = $.isNode() ? require('./sendNotify') : '';
|
||||
//Node.js用户请在jdCookie.js处填写京东ck;
|
||||
@@ -11,8 +25,8 @@ let message = '', allMessage = '';
|
||||
//IOS等用户直接用NobyDa的jd cookie
|
||||
let cookiesArr = [], cookie = '';
|
||||
const JD_API_HOST = 'https://api.m.jd.com/client.action';
|
||||
let appIdArr = ['1FFVQyqw','1EFRWxKuG', '1E1xZy6s'];
|
||||
let appNameArr = ['1111点心动','许愿抽好礼', 'PLUS生活特权'];
|
||||
let appIdArr = ["1FVRZxKiD"];
|
||||
let appNameArr = ["超级大转盘"];
|
||||
let appId, appName;
|
||||
$.shareCode = [];
|
||||
if ($.isNode()) {
|
||||
@@ -28,6 +42,10 @@ if ($.isNode()) {
|
||||
$.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', {"open-url": "https://bean.m.jd.com/bean/signIndex.action"});
|
||||
return;
|
||||
}
|
||||
if(appIdArr.length <= 0) {
|
||||
console.log(`\n暂无活动~\n`);
|
||||
return;
|
||||
}
|
||||
for (let i = 0; i < cookiesArr.length; i++) {
|
||||
if (cookiesArr[i]) {
|
||||
cookie = cookiesArr[i];
|
||||
@@ -36,7 +54,7 @@ if ($.isNode()) {
|
||||
$.isLogin = true;
|
||||
$.nickName = '';
|
||||
message = '';
|
||||
await TotalBean();
|
||||
//await TotalBean();
|
||||
console.log(`\n*******开始【京东账号${$.index}】${$.nickName || $.UserName}*********\n`);
|
||||
if (!$.isLogin) {
|
||||
$.msg($.name, `【提示】cookie已失效`, `京东账号${$.index} ${$.nickName || $.UserName}\n请重新登录获取\nhttps://bean.m.jd.com/bean/signIndex.action`, {"open-url": "https://bean.m.jd.com/bean/signIndex.action"});
|
||||
@@ -46,6 +64,7 @@ if ($.isNode()) {
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
for (let j = 0; j < appIdArr.length; j++) {
|
||||
appId = appIdArr[j]
|
||||
appName = appNameArr[j]
|
||||
@@ -99,7 +118,9 @@ if ($.isNode()) {
|
||||
})
|
||||
async function jd_wish() {
|
||||
try {
|
||||
$.hasEnd = false;
|
||||
await healthyDay_getHomeData();
|
||||
if($.hasEnd) return;
|
||||
await $.wait(2000)
|
||||
|
||||
let getHomeDataRes = (await healthyDay_getHomeData(false)).data.result.userInfo
|
||||
@@ -135,6 +156,7 @@ async function healthyDay_getHomeData(type = true) {
|
||||
if (safeGet(data)) {
|
||||
data = JSON.parse(data);
|
||||
// console.log(data);
|
||||
if(data.data.bizCode === 0) {
|
||||
if (type) {
|
||||
for (let key of Object.keys(data.data.result.hotTaskVos).reverse()) {
|
||||
let vo = data.data.result.hotTaskVos[key]
|
||||
@@ -145,8 +167,8 @@ async function healthyDay_getHomeData(type = true) {
|
||||
} else {
|
||||
console.log(`【${vo.taskName}】已完成\n`)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (let key of Object.keys(data.data.result.taskVos).reverse()) {
|
||||
let vo = data.data.result.taskVos[key]
|
||||
if (vo.status !== 2) {
|
||||
@@ -178,7 +200,7 @@ async function healthyDay_getHomeData(type = true) {
|
||||
}
|
||||
}
|
||||
} else if (vo.taskType === 3) {
|
||||
for (let key of Object.keys(vo.shoppingActivityVos)) {
|
||||
for (let key of Object.keys(vo.shoppingActivityVos)) {
|
||||
let shoppingActivityVos = vo.shoppingActivityVos[key]
|
||||
if (shoppingActivityVos.status !== 2) {
|
||||
console.log(`【${vo.subTitleName}】`)
|
||||
@@ -225,6 +247,10 @@ async function healthyDay_getHomeData(type = true) {
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log(`黑号,火爆了\n`)
|
||||
$.hasEnd = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
let common = require("./function/common");
|
||||
let $ = new common.env('京喜购物返红包助力');
|
||||
let min = 5,
|
||||
help = $.config[$.filename(__filename)] || Math.min(min, $.config.JdMain) || min;
|
||||
$.setOptions({
|
||||
headers: {
|
||||
'content-type': 'application/json',
|
||||
'user-agent': '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',
|
||||
'referer': 'https://happy.m.jd.com/babelDiy/Zeus/3ugedFa7yA6NhxLN5gw2L3PF9sQC/index.html?asid=287215626&un_area=12_904_905_57901&lng=117.612969135975&lat=23.94014745198865',
|
||||
}
|
||||
});
|
||||
$.readme = `
|
||||
在京喜下单,如订单有购物返现,脚本会自动查询返现groupid并予以助力,目前每个账号每天能助力3次
|
||||
44 */6 * * * task ${$.runfile}
|
||||
export ${$.runfile}=2 #如需增加被助力账号,在这边修改人数
|
||||
`
|
||||
eval(common.eval.mainEval($));
|
||||
async function prepare() {
|
||||
let url = `https://wq.jd.com/bases/orderlist/list?order_type=3&start_page=1&last_page=0&page_size=10&callersource=newbiz&t=${$.timestamp}&traceid=&g_ty=ls&g_tk=606717070`
|
||||
for (let j of cookies['help']) {
|
||||
$.setCookie(j);
|
||||
await $.curl(url)
|
||||
try {
|
||||
for (let k of $.source.orderList) {
|
||||
try {
|
||||
let orderid = k.parentId != '0' ? k.parentId : k.orderId
|
||||
let url = `https://wq.jd.com/fanxianzl/zhuli/QueryGroupDetail?isquerydraw=1&orderid=${orderid}&groupid=&sceneval=2&g_login_type=1&g_ty=ls`
|
||||
let dec = await jxAlgo.dec(url)
|
||||
await $.curl(dec.url)
|
||||
let now = parseInt(new Date() / 1000)
|
||||
let end = $.source.data.groupinfo.end_time
|
||||
if (end > now && $.source.data.groupinfo.openhongbaosum != $.source.data.groupinfo.totalhongbaosum) {
|
||||
let groupid = $.source.data.groupinfo.groupid;
|
||||
$.sharecode.push({
|
||||
'groupid': groupid
|
||||
})
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
}
|
||||
async function main(id) {
|
||||
common.assert(id.groupid, '没有可助力ID')
|
||||
let url = `http://wq.jd.com/fanxianzl/zhuli/Help?groupid=${id.groupid}&_stk=groupid&_ste=2&g_ty=ls&g_tk=1710198667&sceneval=2&g_login_type=1`
|
||||
let dec = await jxAlgo.dec(url)
|
||||
await $.curl(dec.url)
|
||||
console.log($.source.data.prize.discount)
|
||||
}
|
||||
@@ -21,7 +21,7 @@ const querystring = require('querystring');
|
||||
const exec = require('child_process').exec;
|
||||
const $ = new Env();
|
||||
const timeout = 15000; //超时时间(单位毫秒)
|
||||
console.log("加载sendNotify,当前版本: 20220723");
|
||||
console.log("加载sendNotify,当前版本: 20221118");
|
||||
// =======================================go-cqhttp通知设置区域===========================================
|
||||
//gobot_url 填写请求地址http://127.0.0.1/send_private_msg
|
||||
//gobot_token 填写在go-cqhttp文件设置的访问密钥
|
||||
@@ -1968,7 +1968,7 @@ function GetnickName() {
|
||||
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"),
|
||||
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36 Edg/106.0.1370.42",
|
||||
"Accept-Language": "zh-cn",
|
||||
"Referer": "https://home.m.jd.com/myJd/newhome.action?sceneval=2&ufc=&",
|
||||
"Accept-Encoding": "gzip, deflate, br"
|
||||
@@ -2005,16 +2005,17 @@ function GetnickName() {
|
||||
function GetnickName2() {
|
||||
return new Promise(async(resolve) => {
|
||||
const options = {
|
||||
url: `https://wxapp.m.jd.com/kwxhome/myJd/home.json?&useGuideModule=0&bizId=&brandId=&fromType=wxapp×tamp=${Date.now()}`,
|
||||
headers: {
|
||||
Cookie: cookie,
|
||||
'content-type': `application/x-www-form-urlencoded`,
|
||||
Connection: `keep-alive`,
|
||||
'Accept-Encoding': `gzip,compress,br,deflate`,
|
||||
Referer: `https://servicewechat.com/wxa5bf5ee667d91626/161/page-frame.html`,
|
||||
Host: `wxapp.m.jd.com`,
|
||||
'User-Agent': `Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.10(0x18000a2a) NetType/WIFI Language/zh_CN`,
|
||||
},
|
||||
"url": `https://wq.jd.com/user/info/QueryJDUserInfo?sceneval=2`,
|
||||
"headers": {
|
||||
"Accept": "application/json,text/plain, */*",
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
"Accept-Encoding": "gzip, deflate, br",
|
||||
"Accept-Language": "zh-cn",
|
||||
"Connection": "keep-alive",
|
||||
"Cookie": cookie,
|
||||
"Referer": "https://wqs.jd.com/my/jingdou/my.shtml?sceneval=2",
|
||||
"User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.4.4;14.3;network/4g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1")
|
||||
}
|
||||
};
|
||||
$.post(options, (err, resp, data) => {
|
||||
try {
|
||||
@@ -2023,13 +2024,12 @@ function GetnickName2() {
|
||||
} else {
|
||||
if (data) {
|
||||
data = JSON.parse(data);
|
||||
if (!data.user) {
|
||||
if (data['retcode'] === 13) {
|
||||
$.isLogin = false; //cookie过期
|
||||
return;
|
||||
}
|
||||
const userInfo = data.user;
|
||||
if (userInfo) {
|
||||
$.nickName = userInfo.petName;
|
||||
return
|
||||
}
|
||||
if (data['retcode'] === 0) {
|
||||
$.nickName = (data['base'] && data['base'].nickname) || "";
|
||||
}
|
||||
} else {
|
||||
$.log('京东服务器返回空数据');
|
||||
|
||||
Reference in New Issue
Block a user