This commit is contained in:
Faker 2022-08-01 11:18:41 +08:00
parent 91ceb2f82d
commit 979ad18e2b
29 changed files with 2652 additions and 2858 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@ -2,7 +2,7 @@
入口首页下拉
特务集勋章
不开卡但尝试领取开卡任务奖励集齐勋章晚上8点后瓜分需要开卡才能集齐
3 10,17,20 * * * jd_SuperBrandJXZ.js
8 10,18,20 * * * jd_superBrandJXZ.js
*/
const $ = new Env('特务集勋章');
const notify = $.isNode() ? require('./sendNotify') : '';
@ -32,7 +32,7 @@ if ($.isNode()) {
$.isLogin = true;
$.nickName = '';
$.UserName = decodeURIComponent($.cookie.match(/pt_pin=([^; ]+)(?=;?)/) && $.cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1]);
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" });
@ -42,9 +42,13 @@ if ($.isNode()) {
}
continue
}
try {
await main();
}catch (e) {
console.log(`好像账号黑号~~~`);
}
await $.wait(2000);
if (i == 0 && $.flag) return;
if ($.flag) return;
}
})().catch((e) => { $.log('', `${$.name}, 失败! 原因: ${e}!`, '') }).finally(() => { $.done(); })
@ -68,6 +72,20 @@ async function main() {
await takeRequest('superBrandTaskList', { "source": "badge", "activityId": $.activityId });
await $.wait(1000);
await doTask();
if (new Date().getHours() >= 20) {
console.log(`去瓜分`);
if ($.activityInfo.activityBadgeInfo.allTaskStatus === 1) {
if ($.activityInfo.activityBadgeInfo.divideStatus === 0) {
await takeRequest('superBrandTaskLottery', { "source": "badge", "activityId": $.activityId, "encryptProjectId": $.encryptProjectId, "tag": "divide" });
} else {
$.log('已瓜分过啦!')
}
} else {
$.log('未获得瓜分资格');
}
} else {
console.log('未到瓜分时间!')
}
}
@ -160,7 +178,7 @@ function dealReturn(type, data) {
switch (type) {
case 'showBadgeInfo':
$.bizCode = data.data.bizCode;
if (data.code === '0' && data.data && data.data.result) {
if (data.code === '0' && data.data?.result) {
$.activityInfo = data.data.result;
}
break;
@ -171,13 +189,22 @@ function dealReturn(type, data) {
break;
case 'superBrandDoTask':
if (data.code === '0') {
console.log(JSON.stringify(data.data.bizMsg));
console.log(data.data.bizMsg);
} else {
console.log(JSON.stringify(data));
console.log(data);
}
break;
case 'superBrandTaskLottery':
if (data.data.success) {
if (data.data?.result?.rewardComponent?.successRewards) {
console.log(`获得豆子:${data.data.result.rewardComponent.beanList[0].quantity}`)
}
} else {
console.log(data.bizMsg);
}
break;
default:
console.log(JSON.stringify(data));
console.log(data);
}
}

View File

@ -1,25 +1,22 @@
/*
Last Modified time: 2021-5-11 09:27:09
活动入口京东APP首页-领京豆-摇京豆/京东APP首页-我的-京东会员-摇京豆
增加京东APP首页超级摇一摇(不定时有活动)
增加超级品牌日做任务及抽奖
增加 京东小魔方 抽奖
Modified from https://github.com/Zero-S1/JD_tools/blob/master/JD_vvipclub.py
已支持IOS双京东账号,Node.js支持N个京东账号
脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js
============QuantumultX==============
[task_local]
#摇京豆
5 0,23 * * * jd_club_lottery.js, tag=摇京豆, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jdyjd.png, enabled=true
11 0,18 * * * jd_club_lottery.js, tag=摇京豆, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jdyjd.png, enabled=true
=================Loon===============
[Script]
cron "5 0,23 * * *" script-path=jd_club_lottery.js,tag=摇京豆
cron "11 0,18 * * *" script-path=jd_club_lottery.js,tag=摇京豆
=================Surge==============
[Script]
摇京豆 = type=cron,cronexp="5 0,23 * * *",wake-system=1,timeout=3600,script-path=jd_club_lottery.js
摇京豆 = type=cron,cronexp="11 0,18 * * *",wake-system=1,timeout=3600,script-path=jd_club_lottery.js
============小火箭=========
摇京豆 = type=cron,script-path=jd_club_lottery.js, cronexpr="5 0,23 * * *", timeout=3600, enable=true
摇京豆 = type=cron,script-path=jd_club_lottery.js, cronexpr="11 0,18 * * *", timeout=3600, enable=true
*/
const $ = new Env('摇京豆');
@ -52,10 +49,10 @@ const JD_API_HOST = 'https://api.m.jd.com/client.action';
$.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', {"open-url": "https://bean.m.jd.com/bean/signIndex.action"});
return;
}
await welcomeHome()
if ($.superShakeUrl) {
await getActInfo($.superShakeUrl);
}
// await welcomeHome()
// if ($.superShakeUrl) {
// await getActInfo($.superShakeUrl);
// }
for (let i = 0; i < cookiesArr.length; i++) {
if (cookiesArr[i]) {
cookie = cookiesArr[i];
@ -69,7 +66,7 @@ const JD_API_HOST = 'https://api.m.jd.com/client.action';
$.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"});
@ -106,6 +103,7 @@ const JD_API_HOST = 'https://api.m.jd.com/client.action';
"actionType": 0,
"source": "main"
});
await $.wait(1000);
if (!$.canHelp) {
console.log(`次数已用完,跳出助力`)
break
@ -139,13 +137,13 @@ const JD_API_HOST = 'https://api.m.jd.com/client.action';
async function clubLottery() {
try {
await doTasks();//做任务
await getFreeTimes();//获取摇奖次数
//await getFreeTimes();//获取摇奖次数
await vvipclub_receive_lottery_times();//京东会员:领取一次免费的机会
await vvipclub_shaking_info();//京东会员:查询多少次摇奖次数
await shaking();//开始摇奖
await shakeSign();//京东会员签到
await superShakeBean();//京东APP首页超级摇一摇
await superbrandShakeBean();//京东APP首页超级品牌日
//await superbrandShakeBean();//京东APP首页超级品牌日
} catch (e) {
$.logErr(e)
}
@ -191,38 +189,38 @@ async function doTasks() {
}
}
async function shaking() {
console.log(`开始摇盒子`)
for (let i = 0; i < new Array($.leftShakingTimes).fill('').length; i++) {
console.log(`开始 【京东会员】 摇奖`)
await $.wait(1000);
const newShakeBeanRes = await vvipclub_shaking_lottery();
if (newShakeBeanRes.success) {
console.log(`京东会员-剩余摇奖次数:${newShakeBeanRes.data.remainLotteryTimes}`)
console.log(`摇盒子剩余次数:${newShakeBeanRes.data.remainLotteryTimes}`)
if (newShakeBeanRes.data && newShakeBeanRes.data.rewardBeanAmount) {
$.prizeBeanCount += newShakeBeanRes.data.rewardBeanAmount;
console.log(`恭喜你,京东会员中奖了,获得${newShakeBeanRes.data.rewardBeanAmount}京豆\n`)
console.log(`恭喜你,中奖了,获得${newShakeBeanRes.data.rewardBeanAmount}京豆\n`)
} else {
console.log(`未中奖\n`)
}
}
}
for (let i = 0; i < new Array($.freeTimes).fill('').length; i++) {
console.log(`开始 【摇京豆】 摇奖`)
await $.wait(1000);
const shakeBeanRes = await shakeBean();
if (shakeBeanRes.success) {
console.log(`剩余摇奖次数:${shakeBeanRes.data.luckyBox.freeTimes}`)
if (shakeBeanRes.data && shakeBeanRes.data.prizeBean) {
console.log(`恭喜你,中奖了,获得${shakeBeanRes.data.prizeBean.count}京豆\n`)
$.prizeBeanCount += shakeBeanRes.data.prizeBean.count;
$.totalBeanCount = shakeBeanRes.data.luckyBox.totalBeanCount;
} else if (shakeBeanRes.data && shakeBeanRes.data.prizeCoupon) {
console.log(`获得优惠券:${shakeBeanRes.data.prizeCoupon['limitStr']}\n`)
} else {
console.log(`摇奖其他未知结果:${JSON.stringify(shakeBeanRes)}\n`)
}
}
}
if ($.prizeBeanCount > 0) message += `摇京豆:获得${$.prizeBeanCount}京豆`;
// for (let i = 0; i < new Array($.freeTimes).fill('').length; i++) {
// console.log(`开始 【摇京豆】 摇奖`)
// await $.wait(1000);
// const shakeBeanRes = await shakeBean();
// if (shakeBeanRes.success) {
// console.log(`剩余摇奖次数:${shakeBeanRes.data.luckyBox.freeTimes}`)
// if (shakeBeanRes.data && shakeBeanRes.data.prizeBean) {
// console.log(`恭喜你,中奖了,获得${shakeBeanRes.data.prizeBean.count}京豆\n`)
// $.prizeBeanCount += shakeBeanRes.data.prizeBean.count;
// $.totalBeanCount = shakeBeanRes.data.luckyBox.totalBeanCount;
// } else if (shakeBeanRes.data && shakeBeanRes.data.prizeCoupon) {
// console.log(`获得优惠券:${shakeBeanRes.data.prizeCoupon['limitStr']}\n`)
// } else {
// console.log(`摇奖其他未知结果:${JSON.stringify(shakeBeanRes)}\n`)
// }
// }
// }
//if ($.prizeBeanCount > 0) message += `摇京豆:获得${$.prizeBeanCount}京豆`;
}
function showMsg() {
return new Promise(resolve => {
@ -271,20 +269,21 @@ function vvipclub_shaking_info() {
}
//京东会员摇奖API
function vvipclub_shaking_lottery() {
let h5st = 'h5st=20220731095220008;9428754190460302;ae692;tk02wae471be618nu2AtLaVUAqz83VXz7Mwfw9BdcpqRvC/hLcdG0HsqaoLPQFmOM2+6vPCnb6TIqmQnb86/Lro5R+ee;c075187ab379fa154d5ed726fa6c91463518fa7932f6bbd4781ef36609885093;3.0;1659232340008';
return new Promise(resolve => {
const options = {
url: `https://api.m.jd.com/?t=${Date.now()}&appid=sharkBean&functionId=vvipclub_shaking_lottery&body=%7B%7D`,
url: `https://api.m.jd.com/?t=${Date.now()}&appid=sharkBean&functionId=vvipclub_shaking_lottery&h5st=${encodeURIComponent(h5st)}body=%7B%7D`,
headers: {
"accept": "application/json",
"accept-encoding": "gzip, deflate, br",
"accept-language": "zh-CN,zh;q=0.9",
"cookie": cookie,
"origin": "https://skuivip.jd.com",
"referer": "https://skuivip.jd.com/",
"origin": "https://spa.jd.com",
"referer": "https://spa.jd.com/",
"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")
}
}
$.get(options, (err, resp, data) => {
$.post(options, (err, resp, data) => {
try {
if (err) {
console.log(`\n${$.name}: API查询请求失败 ‼️‼️`)
@ -417,10 +416,14 @@ function shakeBean() {
//新版超级本摇一摇
async function superShakeBean() {
await superBrandMainPage();
await $.wait(1000);
if ($.activityId && $.encryptProjectId) {
await superBrandTaskList();
await $.wait(1000);
await superBrandDoTaskFun();
await $.wait(1000);
await superBrandMainPage();
await $.wait(1000);
await lo();
}
if ($.ActInfo) {
@ -429,7 +432,7 @@ async function superShakeBean() {
await fc_getHomeData($.ActInfo, true);//做完任务后查询多少次摇奖次数
await superShakeLottery($.ActInfo);//开始摇奖
} else {
console.log(`\n\n京东APP首页超级摇一摇目前暂无活动\n\n`)
console.log(`\n京东APP首页超级摇一摇目前暂无活动\n`)
}
}
function welcomeHome() {
@ -814,7 +817,7 @@ async function superBrandDoTaskFun() {
if (item['assignmentType'] === 2) {
const { ext } = item;
const assistTaskDetail = ext['assistTaskDetail'];
console.log(`${item['assignmentName']}好友邀请码: ${assistTaskDetail['itemId']}`)
console.log(`${item['assignmentName']}好友邀请码: ${assistTaskDetail['itemId']}\n`)
if (assistTaskDetail['itemId']) $.assigFirends.push({
itemId: assistTaskDetail['itemId'],
encryptAssignmentId: item['encryptAssignmentId'],
@ -833,12 +836,12 @@ function superBrandDoTask(body) {
console.log(`${$.name} superBrandTaskList API请求失败请检查网路重试`)
} else {
if (data) {
if (body['assignmentType'] === 2) {
console.log(`助力好友 ${body['itemId']}结果 ${data}`);
} else {
console.log('做任务结果', data);
}
data = JSON.parse(data);
if (body['assignmentType'] === 2) {
console.log(`助力结果: ${data.data.bizMsg}\n`);
} else {
console.log(`做任务结果:${data.data.bizMsg}\n`);
}
if (data && data['code'] === '0' && data['data']['bizCode'] === '108') {
$.canHelp = false;
}
@ -881,19 +884,19 @@ function superBrandTaskLottery() {
if (data['data']['bizCode'] === "TK000") {
$.rewardComponent = data['data']['result']['rewardComponent'];
if ($.rewardComponent) {
console.log(`超级摇一摇 抽奖结果:${JSON.stringify($.rewardComponent)}`)
//console.log(`超级摇一摇 抽奖结果:${JSON.stringify($.rewardComponent)}`)
if ($.rewardComponent.beanList && $.rewardComponent.beanList.length) {
console.log(`获得${$.rewardComponent.beanList[0]['quantity']}京豆`)
console.log(`超级摇一摇 抽奖获得${$.rewardComponent.beanList[0]['quantity']}京豆\n`)
$.superShakeBeanNum += parseInt($.rewardComponent.beanList[0]['quantity']);
}
}
} else if (data['data']['bizCode'] === "TK1703") {
console.log(`超级摇一摇 抽奖失败:${data['data']['bizMsg']}`);
console.log(`超级摇一摇 抽奖失败:${data['data']['bizMsg']}\n`);
} else {
console.log(`超级摇一摇 抽奖失败:${data['data']['bizMsg']}`);
console.log(`超级摇一摇 抽奖失败:${data['data']['bizMsg']}\n`);
}
} else {
console.log(`超级摇一摇 抽奖异常: ${JSON.stringify(data)}`)
console.log(`超级摇一摇 抽奖异常: ${JSON.stringify(data)}\n`)
}
}
}
@ -1129,7 +1132,7 @@ async function shakeSign() {
message += `\n京东会员签到:获得${beanNum}京豆\n`;
}
} else {
console.log(`京东会员第${$.currSignCursor}天已签到`)
console.log(`京东会员第${$.currSignCursor}天已签到\n`)
}
}
function pg_channel_page_data() {

View File

@ -26,27 +26,24 @@ let num=0
let shopname=''
const token = [
"7B5E686A0CAF1C144620A3FFE04AFF1E",
"2C6ED83F0F2FF8F456624EF6D72D5597",
"3949F55A02AA8A345409AFD9821C861F",
"F0A7971BFC6A5C12B06A45080B6C04CF",
"BF79A51EB3D3812701DBDC9ED066AE02",
"A92269DC92DDD73CC5EB38B3BACF51E3",
"52B71EA2E4961677AF31D4D2085974EB",
"1DD46671387EAC6FDC14B753E01D5E30",
"0A073A68225B4429CA7AC1322BA3981A",
"E0087463F85940305DCA705308208EBB",
"773D63918C47D32F33DDB2FB78C5820A",
"0D42F0A3359FBC13F816F22201F91EE6",
"FCE9F2E4FB075C3A2CBDF6C27F972B03",
"B60ECB73A9E19C9DC9097EC589C731A0",
"F573A078062F9F18BFCC39080864D7F5",
"ED26E464FC19DF617081F86F860AFA31",
"2E0617200F04BF484B2945B7D855345D",
"C1B3B8D4BBE96E6A3EF0C12F27F868D3",
"04CC7B1B2CBB41F9B38D0E2EAF5A9FA6",
"CC8AB17E5EDC1E6791D64AB83567525A",
"A6D7A29DB6C46B7D3F7CD6EC3AE110C6",
"67D2D5824D043A5C2EA9C53B900B932C",
"E5DA4749F7A04D36FBC4AFCC2D26DD7E",
"30D17316E31067004ED239DE9F121B0D",
"AC959DB80E29F4F7CA1EA409C165793B",
"37D0FAA99892A9E613A1B46E5A55973B",
"D35923E942C11178C38BD29E783695B8",
"9958AB926F4070AF8E14B236DD3CB2C0",
"DB872465EDEB653BB501819F9B9DD326",
"AB549463C778127E4A3EA0F9AE447F43",
"8DB49116004EED1D0D944A55F7F33003",
"BF2568B0566EAA51ADAA0B503EE797D1",
"C84F63CEFA39F70F461F7F4FAF3DD08A"
]

View File

@ -54,7 +54,7 @@ const JD_API_HOST = 'https://api.m.jd.com/client.action';
$.beans = 0
$.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/`, {"open-url": "https://bean.m.jd.com/"});
@ -100,7 +100,7 @@ async function getDetail() {
for (let item of $.subTitleInfos) {
console.log(`\n开始给【${item['longTitle']}】主题下的商品进行投票`);
await goldCreatorDetail(item['matGrpId'], item['subTitleId'], item['taskId'], item['batchId']);
await $.wait(2000);
await $.wait(4000);
}
}
function goldCreatorTab() {
@ -211,7 +211,7 @@ async function doTask2(batchId) {
body['type'] = 2;
}
await goldCreatorDoTask(body);
await $.wait(2000);
await $.wait(4000);
}
}
if ($.signTask['taskStatus'] === 1) {

541
jd_insight.js Normal file
View File

@ -0,0 +1,541 @@
/*
cron "35 11 * * *" jd_insight.js, tag:京洞察问卷通知
by ccwav
*/
const $ = new Env('京洞察问卷通知');
const notify = $.isNode() ? require('./sendNotify') : '';
//Node.js用户请在jdCookie.js处填写京东ck;
const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
//IOS等用户直接用NobyDa的jd cookie
let cookiesArr = [],
cookie = '';
let allnotify="";
let WP_APP_TOKEN_ONE = "";
if ($.isNode()) {
if (process.env.WP_APP_TOKEN_ONE) {
WP_APP_TOKEN_ONE = process.env.WP_APP_TOKEN_ONE;
}
Object.keys(jdCookieNode)
.forEach((item) => {
cookiesArr.push(jdCookieNode[item])
})
if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {};
} else {
cookiesArr = [$.getdata('CookieJD'), $.getdata('CookieJD2'), ...jsonParse($.getdata('CookiesJD') || "[]")
.map(item => item.cookie)
].filter(item => !!item);
}
!(async () => {
if (!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;
}
UUID = getUUID('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
for (let i = 0; i < cookiesArr.length; i++) {
UA = `jdapp;iPhone;10.0.8;14.6;${UUID};network/wifi;JDEbook/openapp.jdreader;model/iPhone9,2;addressid/2214222493;appBuild/168841;jdSupportDarkMode/0;Mozilla/5.0 (iPhone; CPU iPhone OS 14_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/16E158;supportJDSHWK/1`;
if (cookiesArr[i]) {
cookie = cookiesArr[i];
$.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1]);
$.index = i + 1;
$.isLogin = true;
$.nickName = '';
$.maxPage = '1';
message = '';
//await TotalBean();
console.log(`******开始查询【京东账号${$.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
}
await main()
}
}
if ($.isNode() && allnotify) {
await notify.sendNotify(`${$.name}`, allnotify);
}
})()
.catch((e) => {
$.log('', `${$.name}, 失败! 原因: ${e}!`, '')
})
.finally(() => {
$.done();
})
async function main() {
console.log(`开始获取京洞察调研列表...\n`)
let data= await GetSurveyList();
if(data.result){
let list=data.messages.list
if(list.length>0){
let AccTitle=`账号${$.index} ${$.nickName || $.UserName} `;
let msg = AccTitle+`${list.length}个类型调查问卷\n`;
for (let index = 0; index < list.length; index++) {
const item = list[index].surveyList;
//msg += `类型:${list[index].type}\n`;
for (let index = 0; index < item.length; index++) {
let surveyItem = item[index];
let title = surveyItem.title
let subTitle = surveyItem.subTitle
let answerUrl = surveyItem.answerUrl
msg += `${index+1}.【${title}${subTitle}\n<a href="${answerUrl}">点击这里开启问卷</a>\n`
}
}
if ($.isNode() && WP_APP_TOKEN_ONE) {
await notify.sendNotifybyWxPucher("京洞察问卷通知", msg, `${$.UserName}`);
}
allnotify+=msg
}
}else{
$.log('当前账户没有京调研问卷')
}
}
function random(min, max) {
return parseInt((max - min) * Math.random());
}
// prettier-ignore
function getUUID(x = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", t = 0) {
return x.replace(/[xy]/g, function(x) {
var r = 16 * Math.random() | 0,
n = "x" == x ? r : 3 & r | 8;
return uuid = t ? n.toString(36)
.toUpperCase() : n.toString(36), uuid
})
}
function GetSurveyList() {
const options = {
"url": 'https://answer.jd.com/community/survey/list',
"headers": {
"Cookie": cookie,
"User-Agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 14_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Mobile/15E148 Safari/604.1"
}
};
return new Promise(resolve => {
$.get(options, async (err, resp, data) => {
try {
if (err) {
console.log(err);
console.log(`${$.name} API请求失败请检查网路重试`)
} else {
//console.log(data);
if (data) {
data = JSON.parse(data);
} else {
console.log("没有返回数据")
}
}
} catch (e) {
$.logErr(e, resp)
} finally {
resolve(data);
}
})
})
}
function TotalBean() {
return new Promise(async e => {
const n = {
url: "https://wq.jd.com/user_new/info/GetJDUserInfoUnion?sceneval=2",
headers: {
Host: "wq.jd.com",
Accept: "*/*",
Connection: "keep-alive",
Cookie: cookie,
"User-Agent": UA,
"Accept-Language": "zh-cn",
Referer: "https://home.m.jd.com/myJd/newhome.action?sceneval=2&ufc=&",
"Accept-Encoding": "gzip, deflate, br"
}
};
$.get(n, (n, o, a) => {
try {
if (n) $.logErr(n);
else if (a) {
if (1001 === (a = JSON.parse(a))["retcode"]) return void($.isLogin = !1);
0 === a["retcode"] && a.data && a.data.hasOwnProperty("userInfo") && ($.nickName = a.data.userInfo.baseInfo.nickname), 0 === a["retcode"] && a.data && a.data["assetInfo"] && ($.beanCount = a.data && a.data["assetInfo"]["beanNum"])
} else console.log("京东服务器返回空数据")
} catch (e) {
$.logErr(e)
} finally {
e()
}
})
})
}
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)
}

137
jd_jdfactory.js Executable file → Normal file
View File

@ -1,9 +1,3 @@
/*
* @Author: LXK9301 https://github.com/LXK9301
* @Date: 2021-8-20
* @Last Modified by: LXK9301
* @Last Modified time: 2020-12-26 22:58:02
*/
/*
东东工厂不是京喜工厂
活动入口京东APP首页-数码电器-东东工厂
@ -13,24 +7,22 @@
不会每次运行脚本都投入电力
只有当心仪的商品存在并且收集起来的电量满足当前商品所需电力才投入
// zero205已添加自己账号内部互助有剩余助力次数再帮我助力
已支持IOS双京东账号,Node.js支持N个京东账号
脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js
============Quantumultx===============
[task_local]
#东东工厂
10 0,6-23 * * * https://gitee.com/lxk0301/jd_scripts/raw/master/jd_jdfactory.js, tag=东东工厂, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_factory.png, enabled=true
10 0,6-23 * * * https://raw.githubusercontent.com/shufflewzc/faker2/main/jd_jdfactory.js, tag=东东工厂, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_factory.png, enabled=true
================Loon==============
[Script]
cron "10 0,6-23 * * *" script-path=https://gitee.com/lxk0301/jd_scripts/raw/master/jd_jdfactory.js,tag=东东工厂
cron "10 0,6-23 * * *" script-path=https://raw.githubusercontent.com/shufflewzc/faker2/main/jd_jdfactory.js,tag=东东工厂
===============Surge=================
东东工厂 = type=cron,cronexp="10 0,6-23 * * *",wake-system=1,timeout=3600,script-path=https://gitee.com/lxk0301/jd_scripts/raw/master/jd_jdfactory.js
东东工厂 = type=cron,cronexp="10 0,6-23 * * *",wake-system=1,timeout=3600,script-path=https://raw.githubusercontent.com/shufflewzc/faker2/main/jd_jdfactory.js
============小火箭=========
东东工厂 = type=cron,script-path=https://gitee.com/lxk0301/jd_scripts/raw/master/jd_jdfactory.js, cronexpr="10 0,6-23 * * *", timeout=3600, enable=true
东东工厂 = type=cron,script-path=https://raw.githubusercontent.com/shufflewzc/faker2/main/jd_jdfactory.js, cronexpr="10 0,6-23 * * *", timeout=3600, enable=true
*/
const $ = new Env('东东工厂');
@ -52,16 +44,10 @@ if ($.isNode()) {
}
let wantProduct = ``;//心仪商品名称
const JD_API_HOST = 'https://api.m.jd.com/client.action';
const inviteCodes = ['T0225KkcRUxL9FKDJh7ylvMLcACjVWnYaS5kRrbA@T0225KkcRx0Q_AaCdRr1xf8DIQCjVWnYaS5kRrbA@T0225KkcRksZpgDSIBj3xvADdQCjVWnYaS5kRrbA@T018v_52Qxge81HeJB2b1ACjVWnYaS5kRrbA@T0205KkcPFd_vD2uSkCi3YhXCjVWnYaS5kRrbA@T018v_hzQhwZ8FbUIRib1ACjVWnYaS5kRrbA'];
const inviteCodes = [];
let myInviteCode;
$.newShareCode = [];
const ZLC = !(process.env.JD_JOIN_ZLC && process.env.JD_JOIN_ZLC === 'false')
const JD_ZLC_URL=process.env.JD_ZLC_URL?process.env.JD_ZLC_URL:"http://zlc1.chaoyi996.com:8880";
!(async () => {
if (!process.env.JD_JOIN_ZLC) {
console.log(`【注意】本脚本默认会给助力池进行助力!\n如需加入助力池请添加TG群https://t.me/jd_zero_205\n如不加入助力池互助可添加变量名称JD_JOIN_ZLC变量值false\n`)
}
await requireConfig();
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;
@ -73,9 +59,9 @@ const JD_ZLC_URL=process.env.JD_ZLC_URL?process.env.JD_ZLC_URL:"http://zlc1.chao
$.index = i + 1;
$.isLogin = true;
$.nickName = '';
$.stop = false;
$.stop = true;
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" });
@ -88,15 +74,6 @@ const JD_ZLC_URL=process.env.JD_ZLC_URL?process.env.JD_ZLC_URL:"http://zlc1.chao
await jdFactory()
}
}
for (let j = 0; j < cookiesArr.length; j++) {
if (cookiesArr[j]) {
cookie = cookiesArr[j];
$.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1])
$.index = j + 1;
await shareCodesFormat();
await helpFriends();
}
}
})()
.catch((e) => {
$.log('', `${$.name}, 失败! 原因: ${e}!`, '')
@ -263,12 +240,7 @@ async function algorithm() {
})
}
async function helpFriends() {
if ($.isNode() && !process.env.DDFACTORY_SHARECODES) {
console.log(`您未填写助力码变量开始账号内互助再帮【zero205】助力`);
$.newShareCode = [...(jdFactoryShareArr || []), ...(newShareCodes || [])]
} else {
$.newShareCode = newShareCodes
}
$.newShareCode = [...(jdFactoryShareArr || [])]
for (let code of $.newShareCode) {
if (!code) continue
const helpRes = await jdfactory_collectScore(code);
@ -670,99 +642,6 @@ function jdfactory_getHomeData() {
})
})
}
function readShareCode() {
console.log(`当前使用助力池${JD_ZLC_URL}`);
return new Promise(async resolve => {
$.get({url: `${JD_ZLC_URL}/ddfactory`, timeout: 10000}, (err, resp, data) => {
try {
if (err) {
console.log(`${JSON.stringify(err)}`)
console.log(`${$.name} API请求失败请检查网路重试`)
} else {
if (data) {
console.log(`随机取${randomCount}个码放到您固定的互助码后面(不影响已有固定互助)`)
data = JSON.parse(data);
}
}
} catch (e) {
$.logErr(e, resp)
} finally {
resolve(data);
}
})
await $.wait(10000);
resolve()
})
}
//提交互助码
// function submitCode() {
// return new Promise(async resolve => {
// $.get({ url: `http://www.helpu.cf/jdcodes/submit.php?code=${myInviteCode}&type=ddfactory`, timeout: 10000 }, (err, resp, data) => {
// try {
// if (err) {
// console.log(`${JSON.stringify(err)}`)
// console.log(`${$.name} API请求失败请检查网路重试`)
// } else {
// if (data) {
// //console.log(`随机取个${randomCount}码放到您固定的互助码后面(不影响已有固定互助)`)
// data = JSON.parse(data);
// }
// }
// } catch (e) {
// $.logErr(e, resp)
// } finally {
// resolve(data);
// }
// })
// await $.wait(15000);
// resolve()
// })
// }
//格式化助力码
function shareCodesFormat() {
return new Promise(async resolve => {
console.log(`${$.index}个京东账号的助力码:::${$.shareCodesArr[$.index - 1]}`)
newShareCodes = [];
if ($.shareCodesArr[$.index - 1]) {
newShareCodes = $.shareCodesArr[$.index - 1].split('@');
} else {
// console.log(`由于您第${$.index}个京东账号未提供shareCode,将采纳本脚本自带的助力码\n`)
const tempIndex = $.index > inviteCodes.length ? (inviteCodes.length - 1) : ($.index - 1);
newShareCodes = inviteCodes[tempIndex].split('@');
}
if (!ZLC) {
console.log(`您设置了不加入助力池,跳过\n`)
} else {
const readShareCodeRes = await readShareCode();
if (readShareCodeRes && readShareCodeRes.code === 200) {
newShareCodes = [...new Set([...newShareCodes, ...(readShareCodeRes.data || [])])];
}
}
console.log(`${$.index}个京东账号将要助力的好友${JSON.stringify(newShareCodes)}`)
resolve();
})
}
function requireConfig() {
return new Promise(resolve => {
console.log(`开始获取${$.name}配置文件\n`);
//Node.js用户请在jdCookie.js处填写京东ck;
const shareCodes = $.isNode() ? require('./jdFactoryShareCodes.js') : '';
console.log(`${cookiesArr.length}个京东账号\n`);
$.shareCodesArr = [];
if ($.isNode()) {
Object.keys(shareCodes).forEach((item) => {
if (shareCodes[item]) {
$.shareCodesArr.push(shareCodes[item])
}
})
} else {
if ($.getdata('DDFACTORY_SHARECODES')) $.shareCodesArr = $.getdata('DDFACTORY_SHARECODES').split('\n').filter(item => !!item);
console.log(`\nBoxJs设置的东东工厂邀请码:${$.getdata('DDFACTORY_SHARECODES')}\n`);
}
console.log(`您提供了${$.shareCodesArr.length}个账号的${$.name}助力码\n`);
resolve()
})
}
function taskPostUrl(function_id, body = {}, function_id2) {
let url = `${JD_API_HOST}`;
if (function_id2) {

294
jd_jdfactory_help.js Normal file

File diff suppressed because one or more lines are too long

View File

@ -1,16 +1,29 @@
if (!["card","car"].includes(process.env.FS_LEVEL)) {
console.log("请设置通用加购/开卡环境变量FS_LEVEL为\"car\"(或\"card\"开卡+加购)来运行加购脚本")
return
}
/*
#jd_joyjd_open通用ID任务多个活动用@连接任务连接https://jdjoy.jd.com/module/task/v2/doTask
JoyJd任务脚本
已支持IOS双京东账号,Node.js支持N个京东账号
脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js
jd_joyjd_open通用ID任务多个活动用@连接任务连接https://jdjoy.jd.com/module/task/v2/doTask
export comm_activityIDList="af2b3d56e22d43afa0c50622c45ca2a3"
export comm_endTimeList="1639756800000"
export comm_tasknameList="京东工业品抽奖"
即时任务无需cron,短期或者长期请参考活动规则设置cron
============Quantumultx===============
[task_local]
#JoyJd任务脚本
5 2,18 * * * https://raw.githubusercontent.com/KingRan/JDJB/main/jd_joyjd_open.js, tag=JoyJd任务脚本, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/jd.png, enabled=true
================Loon==============
[Script]
cron "5 2,18 * * *" script-path=https://raw.githubusercontent.com/KingRan/JDJB/main/jd_joyjd_open.js,tag=JoyJd任务脚本
===============Surge=================
JoyJd任务脚本 = type=cron,cronexp="5 2,18 * * *",wake-system=1,timeout=3600,script-path=https://raw.githubusercontent.com/KingRan/JDJB/main/jd_joyjd_open.js
============小火箭=========
JoyJd任务脚本 = type=cron,script-path=https://raw.githubusercontent.com/KingRan/JDJB/main/jd_joyjd_open.js, cronexpr="5 2,18 * * *", timeout=3600, enable=true
*/
const $ = new Env('jd_joyjd_open通用ID任务');
const $ = new Env('JoyJd任务脚本');
const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
const notify = $.isNode() ? require('./sendNotify') : '';
let cookiesArr = [];
@ -43,10 +56,7 @@ if ($.isNode()) {
}
if (!activityIDList) {
$.log(`没有通用ID任务尝试获取远程`);
let data = await getData("https://raw.githubusercontent.com/Ca11back/scf-experiment/master/json/joyjd_open.json")
if (!data) {
data = await getData("https://raw.fastgit.org/Ca11back/scf-experiment/master/json/joyjd_open.json")
}
let data = await getData("https://cdn.jsdelivr.net/gh/KingRan/shareCodes@master/joyjd_open.json")
if (data.activityIDList && data.activityIDList.length) {
$.log(`获取到远程且有数据`);
activityIDList = data.activityIDList.join('@')
@ -66,7 +76,7 @@ if ($.isNode()) {
$.oldcookie = cookiesArr[i];
$.isLogin = true;
$.nickName = '';
await TotalBean();
//await TotalBean();
$.UserName = decodeURIComponent($.cookie.match(/pt_pin=([^; ]+)(?=;?)/) && $.cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1]);
console.log(`\n*****开始【京东账号${$.index}${$.nickName || $.UserName}*****\n`);
if (!$.isLogin) {

308
jd_kanjia.js Normal file

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
/*
待已久望你来
浪漫七夕 放肆约惠
*/
const $ = new Env("“七”待已久,“夕”望你来");
const $ = new Env("浪漫七夕 放肆约惠");
const jdCookieNode = $.isNode() ? require("./jdCookie.js") : "";
const notify = $.isNode() ? require("./sendNotify") : "";
let cookiesArr = [], cookie = "", message = "";
@ -55,19 +55,19 @@ if ($.isNode()) {
$.ADID = getUUID("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", 1);
$.UUID = getUUID("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
authorCodeList = [
'a944fc3b436741718bda3115f7a81e7f',
// '60ec3454bd4e44c6b39431f602161729',
'6b8106de4c77406d8fc0691f7363f8bd',
// 'ee1cffb7a3c04c25afbcbe4ff8a3adc1',
// '99a10aa547ae425f8245479a3f6cc680',
];
// $.authorCode = authorCodeList[random(0, authorCodeList.length)];
$.authorCode = ownCode ? ownCode : authorCodeList[random(0, authorCodeList.length)]
$.authorNum = `${random(1000000, 9999999)}`;
$.randomCode = random(1000000, 9999999);
$.activityId = "e6fc50c7dcc34c99bf5cca76c8c6468e";
$.activityShopId = "1000164941";
$.activityId = "fbfd6f75f0f845418801dfc46e15d7a5";
$.activityShopId = "1000000904";
$.activityUrl = `https://lzdz1-isv.isvjcloud.com/dingzhi/joinCommon/activity/${$.authorNum}?activityId=${$.activityId}&shareUuid=${encodeURIComponent($.authorCode)}&adsource=&shareuserid4minipg=${encodeURIComponent($.secretPin)}&shopid=1000004065&lng=00.000000&lat=00.000000&sid=&un_area=`;
await member();
// await $.wait(1000);
await $.wait(3000);
if ($.bean > 0) {
message += `\n【京东账号${$.index}${$.nickName || $.UserName} \n └ 获得 ${$.bean} 京豆。`;
}
@ -174,7 +174,7 @@ function task(function_id, body, isCommon = 0, own = 0) {
$.jdActivityId = data.data.jdActivityId;
$.venderId = data.data.venderId;
$.activityType = data.data.activityType;
// console.log($.venderId)
console.log($.venderId)
break;
case "wxActionCommon/getUserInfo":
break;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,9 +1,9 @@
/**
京东粉丝联盟福利社
京东超店会员福利社
**/
const $ = new Env("京东粉丝联盟福利社");
const $ = new Env("京东超店会员福利社");
const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
const notify = $.isNode() ? require('./sendNotify') : '';
let cookiesArr = [], cookie = '', message = '';
@ -54,30 +54,30 @@ if ($.isNode()) {
$.ADID = getUUID('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', 1);
$.UUID = getUUID('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
authorCodeList = [
'72c063179e01411fa87e404c9ab6bcb2',
// '18a76a8d1b7644568c1a357b240b3444',
'8e07c72a5686489e8fb2785d3abdcf70',
'bc8c2618444f4b64baee1497a8418870',
// '12958ed848ea42c9a0d9d8df6e9199ad',
]
// $.authorCode = authorCodeList[random(0, authorCodeList.length)]
$.authorCode = ownCode ? ownCode : authorCodeList[random(0, authorCodeList.length)]
$.authorNum = `${random(1000000, 9999999)}`
$.activityId = 'dza044fb424c3fa1bd9e4415e0shop'
$.activityShopId = '1000083681'
$.activityUrl = `https://lzdz1-isv.isvjcloud.com/dingzhi/shop/league/activity?activityId=${$.activityId}&shareUuid=${encodeURIComponent($.authorCode)}&adsource=null&shareuserid4minipg=null&shopid=${$.activityShopId}&lng=00.000000&lat=00.000000&sid=&un_area=`
$.activityId = '4a4b4c2e46dd80c1d89bd445shop'
$.activityShopId = '1000077045'
$.activityUrl = `https://lzdz1-isv.isvjcloud.com/dingzhi/shop/league/activity/${$.authorNum}?activityId=${$.activityId}&shareUuid=${encodeURIComponent($.authorCode)}&adsource=null&shareuserid4minipg=${encodeURIComponent($.secretPin)}&shopid=${$.activityShopId}&lng=00.000000&lat=00.000000&sid=&un_area=`
await superFans();
await $.wait(3000);
// if ($.bean > 0) {
// message += `\n【京东账号${$.index}】${$.nickName || $.UserName} \n └ 获得 ${$.bean} 京豆。`
// }
await $.wait(2000);
if ($.bean > 0) {
message += `\n【京东账号${$.index}${$.nickName || $.UserName} \n └ 获得 ${$.bean} 京豆。`
}
}
}
if (message !== '') {
if ($.isNode()) {
await notify.sendNotify($.name, message, '', `\n`);
} else {
$.msg($.name, '有点儿收获', message);
}
}
// if (message !== '') {
// if ($.isNode()) {
// await notify.sendNotify($.name, message, '', `\n`);
// } else {
// $.msg($.name, '有点儿收获', message);
// }
// }
})()
.catch((e) => {
$.log('', `${$.name}, 失败! 原因: ${e}!`, '')
@ -146,7 +146,7 @@ async function superFans() {
vo.value
);
}
await $.wait(1000);
await $.wait(2000);
// await $.wait(1000);
}
// await getFirstLZCK()

View File

@ -10,7 +10,7 @@ const notify = $.isNode() ? require('./sendNotify') : '';
const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
//Node.js用户请在jdCookie.js处填写京东ck;
//IOS等用户直接用NobyDa的jd cookie
let cookiesArr = [], cookie = '', message;
let cookiesArr = [], cookie = '', message = '', allMessage = '';
let jd_mhurlList = '';
let jd_mhurlArr = [];
let jd_mhurl = '';
@ -41,7 +41,7 @@ if ($.isNode()) {
$.nickName = '';
$.beans = 0
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/`, {"open-url": "https://bean.m.jd.com/"});
@ -159,11 +159,15 @@ function doTask(taskId) {
console.log(`${$.name} API请求失败请检查网路重试`)
} else {
data = JSON.parse(data.match(/query\((.*)\n/)[1])
if (data.errcode === 8004) {
console.log(`任务完成失败无效任务ID`)
} else {
if (data.data.complete_task_list.includes(taskId)) {
console.log(`任务完成成功,当前幸运值${data.data.curbless}`)
$.userInfo.bless = data.data.curbless
}
}
}
} catch (e) {
$.logErr(e, resp)
} finally {

File diff suppressed because one or more lines are too long

View File

@ -30,7 +30,7 @@ let errorNum = 0
let JD_API_HOST = 'https://sendbeans.jd.com'
const turnTableId = [
{ "name": "翻牌", "id": 1082, "shopid": 1000004123, "url": "https://sendbeans.jd.com/jump/index/" },
{ "name": "翻牌", "id": 1440, "shopid": 1000005670, "url": "https://sendbeans.jd.com/jump/index/" },
{ "name": "翻牌", "id": 815, "shopid": 887726, "url": "https://sendbeans.jd.com/jump/index/" },
//{ "name": "翻牌", "id": 1419, "shopid": 1000007205, "url": "https://sendbeans.jd.com/jump/index/" },
]

View File

@ -1,9 +1,11 @@
/**
特务Z默认选择左边战队
/*
特务集卡
脚本没有自动开卡会尝试领取开卡奖励
5 10,18,20 * * * https://raw.githubusercontent.com/star261/jd/main/scripts/jd_superBrand.js
*/
const $ = new Env('特务Z');
cron:35 10,18,20 * * *
35 10,18,20 * * * jd_superBrand.js
* */
const $ = new Env('特务Z-II');
const notify = $.isNode() ? require('./sendNotify') : '';
const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
let cookiesArr = [];
@ -11,6 +13,7 @@ let UA = ``;
$.allInvite = [];
let useInfo = {};
$.helpEncryptAssignmentId = '';
$.flag = false
if ($.isNode()) {
Object.keys(jdCookieNode).forEach((item) => {
cookiesArr.push(jdCookieNode[item])
@ -27,7 +30,6 @@ 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;
}
$.teamName = "left"
for (let i = 0; i < cookiesArr.length; i++) {
UA = `jdapp;iPhone;10.0.8;14.6;${randomWord(false,40,40)};network/wifi;JDEbook/openapp.jdreader;model/iPhone9,2;addressid/2214222493;appBuild/168841;jdSupportDarkMode/0;Mozilla/5.0 (iPhone; CPU iPhone OS 14_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/16E158;supportJDSHWK/1`;
$.index = i + 1;
@ -35,7 +37,7 @@ if ($.isNode()) {
$.isLogin = true;
$.nickName = '';
$.UserName = decodeURIComponent($.cookie.match(/pt_pin=([^; ]+)(?=;?)/) && $.cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1]);
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"});
@ -50,9 +52,9 @@ if ($.isNode()) {
}catch (e) {
console.log(JSON.stringify(e));
}
if ($.flag) return;
await $.wait(1000);
}
//return ;
if($.allInvite.length > 0 ){
console.log(`\n开始脚本内互助\n`);
}
@ -68,7 +70,7 @@ if ($.isNode()) {
for (let j = 0; j < $.allInvite.length && $.canHelp; j++) {
$.codeInfo = $.allInvite[j];
$.code = $.codeInfo.code;
if($.UserName === $.codeInfo.userName || $.codeInfo.time === 999){
if($.UserName === $.codeInfo.userName || $.codeInfo.time === 3){
continue;
}
$.encryptAssignmentId = $.codeInfo.encryptAssignmentId;
@ -82,44 +84,34 @@ if ($.isNode()) {
async function main() {
$.runFlag = false;
$.activityInfo = {};
await takeRequest('showSecondFloorPkInfo');
if(JSON.stringify($.activityInfo) === '{}'){
console.log(`获取活动详情失败`);
await takeRequest('superBrandSecondFloorMainPage');
if($.bizCode == 'MP001'){
console.log(`本期活动结束,期待下期。。。`);
$.flag = true
return ;
}
console.log(`获取活动详情成功`);
$.activityId = $.activityInfo.activityBaseInfo.activityId;
$.activityName = $.activityInfo.activityBaseInfo.activityName;
console.log(`当前活动:${$.activityName},ID${$.activityId}`);
$.callNumber = $.activityInfo.activityUserInfo.userStarNum;
console.log(`当前活动:${$.activityName},ID${$.activityId},可抽奖次数:${$.callNumber}`);
$.encryptProjectId = $.activityInfo.activityBaseInfo.encryptProjectId;
useInfo[$.UserName] = $.encryptProjectId;
await $.wait(1000);
$.taskList = [];
await takeRequest('superBrandTaskList',{"source":"pk","activityId":$.activityId,"assistInfoFlag":1});
if($.activityInfo.activityPkInfo.userTeamStatus === 0){
console.log(`去加入战队,选择:${$.teamName}`);
await takeRequest('superBrandPkJoinTeam',{"source":"pk","activityId":$.activityId,"pre":"pre","teamName":$.teamName.toString()});
}else{
console.log(`已加入战队`);
}
if (new Date().getHours() >= 20){
if($.activityInfo.activityPkInfo.userTeamName === $.activityInfo.activityPkInfo.winTeamName && $.activityInfo.activityPkInfo.divideStatus === 0){
console.log(`去瓜分`);
await takeRequest('superBrandTaskLottery',{"source":"pk","activityId":$.activityId,"encryptProjectId":$.encryptProjectId,"encryptAssignmentId":"2v8f6JzBBTjrvzwZbYztuV9MVWv7","tag":"divide"});
return ;
}
} else {
console.log('晚上8点后瓜分')
}
if($.activityInfo.activityPkInfo.divideStatus === 1){
console.log(`已瓜分`);
return ;
}
if($.activityInfo.activityPkInfo.userTeamStatus !== 0 && $.activityInfo.activityPkInfo.userTeamStatus !== 1){
return ;
}
await $.wait(3000);
await takeRequest('superBrandTaskList');
await $.wait(1000);
await doTask();
if($.runFlag){
await takeRequest('superBrandSecondFloorMainPage');
$.callNumber = $.activityInfo.activityUserInfo.userStarNum;
console.log(`可抽奖次数:${$.callNumber}`);
}
for (let i = 0; i < $.callNumber; i++) {
console.log(`进行抽奖`);
await takeRequest('superBrandTaskLottery');//抽奖
await $.wait(1000);
}
}
async function doTask(){
for (let i = 0; i < $.taskList.length; i++) {
@ -128,27 +120,19 @@ async function doTask(){
console.log(`任务:${$.oneTask.assignmentName},已完成`);
continue;
}
if($.oneTask.assignmentType === 1 || $.oneTask.assignmentType === 3 || $.oneTask.assignmentType === 0 || $.oneTask.assignmentType === 7){
if($.oneTask.assignmentType === 3 || $.oneTask.assignmentType === 7 || $.oneTask.assignmentType === 1){ //7是开卡 3是关注店铺 1是浏览会场
if($.oneTask.assignmentType === 7){
console.log(`任务:${$.oneTask.assignmentName},尝试领取开卡奖励;(不会自动开卡,如果你已经是会员,则会领取成功)`);
}else{
console.log(`任务:${$.oneTask.assignmentName},去执行`);
}
let subInfo = $.oneTask.ext.followShop || $.oneTask.ext.brandMemberList || $.oneTask.ext.productsInfo || $.oneTask.ext.shoppingActivity ||'';
let subInfo = $.oneTask.ext.followShop || $.oneTask.ext.brandMemberList || $.oneTask.ext.shoppingActivity;
if(subInfo && subInfo[0]){
for (let j = 0; j < subInfo.length; j++) {
$.runInfo = subInfo[j];
if($.runInfo.status !== 1){
continue;
}
console.log(`任务:${$.runInfo.title || $.runInfo.shopName || $.runInfo.itemId},去执行`);
await takeRequest('superBrandDoTask');
await $.wait(1000);
}
$.runInfo = subInfo[0];
}else{
$.runInfo = {'itemId':null};
await takeRequest('superBrandDoTask');
}
await takeRequest('superBrandDoTask');
await $.wait(1000);
$.runFlag = true;
}else if($.oneTask.assignmentType === 2){
@ -175,44 +159,40 @@ async function doTask(){
await $.wait(3000);
}
}
$.runFlag = true;
//}
}
}
}
async function takeRequest(type,bodyInfo = '') {
async function takeRequest(type) {
let url = ``;
let myRequest = ``;
if(bodyInfo){
url = `https://api.m.jd.com/?uuid=&client=wh5&area=&appid=ProductZ4Brand&functionId=${type}&t=${Date.now()}&body=${encodeURIComponent(JSON.stringify(bodyInfo))}`;
}else{
switch (type) {
case 'showSecondFloorPkInfo':
url = `https://api.m.jd.com/?uuid=&client=wh5&area=&appid=ProductZ4Brand&functionId=showSecondFloorPkInfo&t=${Date.now()}&body=%7B%22source%22:%22pk%22%7D`;
case 'superBrandSecondFloorMainPage':
url = `https://api.m.jd.com/api?functionId=superBrandSecondFloorMainPage&appid=ProductZ4Brand&client=wh5&t=${Date.now()}&body=%7B%22source%22:%22secondfloor%22%7D`;
break;
case 'superBrandTaskList':
url = `https://api.m.jd.com/api?functionId=superBrandTaskList&appid=ProductZ4Brand&client=wh5&t=${Date.now()}&body=%7B%22source%22:%22pk%22,%22activityId%22:${$.activityId},%22assistInfoFlag%22:1%7D`;
url = `https://api.m.jd.com/api?functionId=superBrandTaskList&appid=ProductZ4Brand&client=wh5&t=${Date.now()}&body=%7B%22source%22:%22secondfloor%22,%22activityId%22:${$.activityId},%22assistInfoFlag%22:1%7D`;
break;
case 'superBrandDoTask':
if($.runInfo.itemId === null){
url = `https://api.m.jd.com/api?functionId=superBrandDoTask&appid=ProductZ4Brand&client=wh5&t=${Date.now()}&body=%7B%22source%22:%22pk%22,%22activityId%22:${$.activityId},%22encryptProjectId%22:%22${$.encryptProjectId}%22,%22encryptAssignmentId%22:%22${$.oneTask.encryptAssignmentId}%22,%22assignmentType%22:${$.oneTask.assignmentType},%22completionFlag%22:1,%22itemId%22:%22${$.runInfo.itemId}%22,%22actionType%22:0%7D`;
url = `https://api.m.jd.com/api?functionId=superBrandDoTask&appid=ProductZ4Brand&client=wh5&t=${Date.now()}&body=%7B%22source%22:%22secondfloor%22,%22activityId%22:${$.activityId},%22encryptProjectId%22:%22${$.encryptProjectId}%22,%22encryptAssignmentId%22:%22${$.oneTask.encryptAssignmentId}%22,%22assignmentType%22:${$.oneTask.assignmentType},%22completionFlag%22:1,%22itemId%22:%22${$.runInfo.itemId}%22,%22actionType%22:0%7D`;
}else{
url = `https://api.m.jd.com/api?functionId=superBrandDoTask&appid=ProductZ4Brand&client=wh5&t=${Date.now()}&body=%7B%22source%22:%22pk%22,%22activityId%22:${$.activityId},%22encryptProjectId%22:%22${$.encryptProjectId}%22,%22encryptAssignmentId%22:%22${$.oneTask.encryptAssignmentId}%22,%22assignmentType%22:${$.oneTask.assignmentType},%22itemId%22:%22${$.runInfo.itemId}%22,%22actionType%22:0%7D`;
url = `https://api.m.jd.com/api?functionId=superBrandDoTask&appid=ProductZ4Brand&client=wh5&t=${Date.now()}&body=%7B%22source%22:%22secondfloor%22,%22activityId%22:${$.activityId},%22encryptProjectId%22:%22${$.encryptProjectId}%22,%22encryptAssignmentId%22:%22${$.oneTask.encryptAssignmentId}%22,%22assignmentType%22:${$.oneTask.assignmentType},%22itemId%22:%22${$.runInfo.itemId}%22,%22actionType%22:0%7D`;
}
if($.oneTask.assignmentType === 5){
url = `https://api.m.jd.com/api?functionId=superBrandDoTask&appid=ProductZ4Brand&client=wh5&t=${Date.now()}&body=%7B%22source%22:%22pk%22,%22activityId%22:${$.activityId},%22encryptProjectId%22:%22${$.encryptProjectId}%22,%22encryptAssignmentId%22:%22${$.oneTask.encryptAssignmentId}%22,%22assignmentType%22:${$.oneTask.assignmentType},%22itemId%22:%22${$.runInfo.itemId}%22,%22actionType%22:0,%22dropDownChannel%22:1%7D`;
url = `https://api.m.jd.com/api?functionId=superBrandDoTask&appid=ProductZ4Brand&client=wh5&t=${Date.now()}&body=%7B%22source%22:%22secondfloor%22,%22activityId%22:${$.activityId},%22encryptProjectId%22:%22${$.encryptProjectId}%22,%22encryptAssignmentId%22:%22${$.oneTask.encryptAssignmentId}%22,%22assignmentType%22:${$.oneTask.assignmentType},%22itemId%22:%22${$.runInfo.itemId}%22,%22actionType%22:0,%22dropDownChannel%22:1%7D`;
}
break;
case 'superBrandTaskLottery':
url = `https://api.m.jd.com/api?functionId=superBrandTaskLottery&appid=ProductZ4Brand&client=wh5&t=${Date.now()}&body=%7B%22source%22:%22pk%22,%22activityId%22:${$.activityId}%7D`;
url = `https://api.m.jd.com/api?functionId=superBrandTaskLottery&appid=ProductZ4Brand&client=wh5&t=${Date.now()}&body=%7B%22source%22:%22secondfloor%22,%22activityId%22:${$.activityId}%7D`;
break;
case 'help':
url = `https://api.m.jd.com/api?functionId=superBrandDoTask&appid=ProductZ4Brand&client=wh5&t=${Date.now()}&body=%7B%22source%22:%22pk%22,%22activityId%22:${$.activityId},%22encryptProjectId%22:%22${$.encryptProjectId}%22,%22encryptAssignmentId%22:%22${$.encryptAssignmentId}%22,%22assignmentType%22:2,%22itemId%22:%22${$.code}%22,%22actionType%22:0%7D`;
url = `https://api.m.jd.com/api?functionId=superBrandDoTask&appid=ProductZ4Brand&client=wh5&t=${Date.now()}&body=%7B%22source%22:%22secondfloor%22,%22activityId%22:${$.activityId},%22encryptProjectId%22:%22${$.encryptProjectId}%22,%22encryptAssignmentId%22:%22${$.encryptAssignmentId}%22,%22assignmentType%22:2,%22itemId%22:%22${$.code}%22,%22actionType%22:0%7D`;
break;
default:
console.log(`错误${type}`);
}
}
myRequest = getRequest(url);
return new Promise(async resolve => {
$.post(myRequest, (err, resp, data) => {
@ -236,16 +216,12 @@ function dealReturn(type, data) {
return;
}
switch (type) {
case 'showSecondFloorPkInfo':
case 'superBrandSecondFloorMainPage':
$.bizCode = data.data.bizCode;
if(data.code === '0' && data.data && data.data.result){
$.activityInfo = data.data.result;
}
break;
case 'superBrandPkJoinTeam':
if(data.code === '0' && data.data && data.data.success){
console.log(`加入成功`);
}
break;
case 'superBrandTaskList':
if(data.code === '0'){
$.taskList = data.data.result.taskList;
@ -272,7 +248,7 @@ function dealReturn(type, data) {
$.runFlag = false;
console.log(`抽奖失败`);
}
console.log(JSON.stringify(data));
//console.log(JSON.stringify(data));
break;
case 'help':
@ -287,7 +263,7 @@ function dealReturn(type, data) {
console.log(`助力次数已用完`);
}else if (data.code === '0' && data.data.bizCode === '103'){
console.log(`助力已满`);
$.codeInfo.time = 999;
$.codeInfo.time = 3;
}else if (data.code === '0' && data.data.bizCode === '2001'){
$.canHelp = false;
console.log(`黑号`);
@ -302,11 +278,11 @@ function dealReturn(type, data) {
function getRequest(url) {
const headers = {
'Origin' : `https://prodev.m.jd.com`,
'Origin' : `https://pro.m.jd.com`,
'Cookie' : $.cookie ,
'Connection' : `keep-alive`,
'Accept' : `application/json, text/plain, */*`,
'Referer' : `https://prodev.m.jd.com/mall/active/3XbzM8XrNaiKRVuD9jHZhj9vYG8d/index.html`,
'Referer' : `https://pro.m.jd.com/mall/active/4UgUvnFebXGw6CbzvN6cadmfczuP/index.html`,
'Host' : `api.m.jd.com`,
'User-Agent' : UA,
'Accept-Language' : `zh-cn`,

View File

@ -1,7 +1,7 @@
/**
特务之明星送好礼
第一个CK黑号自动退出
15 5,21 * * * jd_superBrandStar.js
一次性脚本请禁用
cron 36 2,19 * * * jd_superBrandStar.js
*/
const $ = new Env('特务之明星送好礼');
const notify = $.isNode() ? require('./sendNotify') : '';
@ -30,7 +30,7 @@ if ($.isNode()) {
$.isLogin = true;
$.nickName = '';
$.UserName = decodeURIComponent($.cookie.match(/pt_pin=([^; ]+)(?=;?)/) && $.cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1]);
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" });
@ -40,8 +40,12 @@ if ($.isNode()) {
}
continue
}
try {
await main();
if (i == 0 && $.flag) return;
}catch (e) {
console.log(`好像账号黑号~~~`);
}
if ($.flag) return;
}
})().catch((e) => { $.log('', `${$.name}, 失败! 原因: ${e}!`, '') }).finally(() => { $.done(); })

View File

@ -48,7 +48,7 @@ if ($.isNode()) {
$.isLogin = true;
$.nickName = '';
$.canRun = true;
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" });

View File

@ -38,7 +38,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" });

View File

@ -50,7 +50,7 @@ const JD_API_HOST = 'https://api.m.jd.com/client.action';
$.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`, {

View File

@ -43,7 +43,7 @@ if ($.isNode()) {
$.index = i + 1;
$.isLogin = true;
$.nickName = '';
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" });

View File

@ -88,7 +88,7 @@ let args_xh = {
$.index = i + 1;
$.isLogin = true;
$.nickName = '';
await TotalBean();
//await TotalBean();
console.log(`\n****开始【京东账号${$.index}${$.nickName || $.UserName}*****\n`);
if(args_xh.except.includes($.UserName)){
console.log(`跳过账号:${$.nickName || $.UserName}`)

480
jd_wsdlb.js Normal file

File diff suppressed because one or more lines are too long

View File

@ -38,7 +38,7 @@ let allMessage = '';
$.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" });

View File

@ -65,7 +65,7 @@ if ($.isNode()) {
} else {
if (!isLoginInfo[$.UserName]) {
await TotalBean();
//await TotalBean();
isLoginInfo[$.UserName] = $.isLogin
}
}
@ -92,7 +92,7 @@ if ($.isNode()) {
} else {
if (!isLoginInfo[$.UserName]) {
await TotalBean();
//await TotalBean();
isLoginInfo[$.UserName] = $.isLogin
}
}
@ -472,7 +472,7 @@ function taskUrl(functionId, body = '') {
"User-Agent": UA,
"Accept-Language": "zh-CN,zh-Hans;q=0.9",
"Referer": "https://st.jingxi.com/",
"Cookie": cookie
"Cookie": `cid=4;${cookie}`
}
}
}
@ -488,7 +488,7 @@ function JDtaskUrl(functionId, body = '') {
"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,zh-Hans;q=0.9",
"Referer": "https://wqs.jd.com/",
"Cookie": cookie
"Cookie": `cid=4;${cookie}`
}
}
}