4
.github/workflows/deploy_tencent_scf.yml
vendored
4
.github/workflows/deploy_tencent_scf.yml
vendored
@@ -71,8 +71,8 @@ jobs:
|
||||
if [ $DREAM_FACTORY_SHARE_CODES ]; then sed -i "/variables/a\ DREAM_FACTORY_SHARE_CODES: $DREAM_FACTORY_SHARE_CODES" serverless.yml; fi;
|
||||
if [ $JDZZ_SHARECODES ]; then sed -i "/variables/a\ JDZZ_SHARECODES: $JDZZ_SHARECODES" serverless.yml; fi;
|
||||
if [ $JDJOY_SHARECODES ]; then sed -i "/variables/a\ JDJOY_SHARECODES: $JDJOY_SHARECODES" serverless.yml; fi;
|
||||
if [ $JXNC_SHARECODES ]; then sed -i "/variables/a\ JXNC_SHARECODES: $JXNC_SHARECODES" serverless.yml; fi;
|
||||
if [ $BOOKSHOP_SHARECODES ]; then sed -i "/variables/a\ BOOKSHOP_SHARECODES: $BOOKSHOP_SHARECODES" serverless.yml; fi;
|
||||
if [ $JXNC_SHARECODES ]; then sed -i "/variables/a\ JXNC_SHARECODES: $JXNC_SHARECODES" serverless.yml; fi;
|
||||
if [ $TG_PROXY_HOST ]; then sed -i "/variables/a\ TG_PROXY_HOST: $TG_PROXY_HOST" serverless.yml; fi;
|
||||
if [ $TG_PROXY_PORT ]; then sed -i "/variables/a\ TG_PROXY_PORT: $TG_PROXY_PORT" serverless.yml; fi;
|
||||
if [ $MONEY_TREE_SELL_FRUIT ]; then sed -i "/variables/a\ MONEY_TREE_SELL_FRUIT: $MONEY_TREE_SELL_FRUIT" serverless.yml; fi;
|
||||
@@ -129,8 +129,8 @@ jobs:
|
||||
DREAM_FACTORY_SHARE_CODES: ${{ secrets.DREAM_FACTORY_SHARE_CODES}}
|
||||
JDZZ_SHARECODES: ${{ secrets.JDZZ_SHARECODES}}
|
||||
JDJOY_SHARECODES: ${{ secrets.JDJOY_SHARECODES}}
|
||||
JXNC_SHARECODES: ${{ secrets.JXNC_SHARECODES}}
|
||||
BOOKSHOP_SHARECODES: ${{ secrets.BOOKSHOP_SHARECODES}}
|
||||
JXNC_SHARECODES: ${{ secrets.JXNC_SHARECODES}}
|
||||
TG_PROXY_HOST: ${{ secrets.TG_PROXY_HOST}}
|
||||
TG_PROXY_PORT: ${{ secrets.TG_PROXY_PORT}}
|
||||
MONEY_TREE_SELL_FRUIT: ${{ secrets.MONEY_TREE_SELL_FRUIT}}
|
||||
|
@@ -69,7 +69,7 @@ cron "20 11 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scri
|
||||
cron "20 12 * * 6" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_unbind.js, timeout=750, wake-system=1, tag=注销京东店铺会员卡
|
||||
#疯狂的joy日常任务
|
||||
cron "30 8 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_crazy_joy.js, timeout=1750, wake-system=1, tag=疯狂的joy日常任务
|
||||
#以下为短期活动
|
||||
#健康抽奖机
|
||||
cron "30 2 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_health.js, timeout=750, wake-system=1, tag=健康抽奖机
|
||||
#签到领现金
|
||||
签到领现金 = type=cron,cronexp="0 0 * * *",wake-system=1,timeout=2220,script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_cash.js
|
||||
|
||||
|
||||
|
@@ -27,7 +27,7 @@ let cookiesArr = [], cookie = '', message;
|
||||
const ACT_ID = 'dz2010100034444201', shareUuid = '28a699ac78d74aa3b31f7103597f8927'
|
||||
|
||||
let inviteCodes = [
|
||||
'28a699ac78d74aa3b31f7103597f8927@2f14ee9c92954cf79829320dd482bf49@fdf827db272543d88dbb51a505c2e869',
|
||||
'28a699ac78d74aa3b31f7103597f8927@2f14ee9c92954cf79829320dd482bf49@fdf827db272543d88dbb51a505c2e869@ce2536153a8742fb9e8754a9a7d361da@38ba4e7ba8074b78851e928af2b4f6b2',
|
||||
'28a699ac78d74aa3b31f7103597f8927@2f14ee9c92954cf79829320dd482bf49@fdf827db272543d88dbb51a505c2e869'
|
||||
]
|
||||
|
||||
|
156
jd_jxnc.js
156
jd_jxnc.js
@@ -10,6 +10,8 @@
|
||||
理论上脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js
|
||||
助力码shareCode请先手动运行脚本查看打印可看到
|
||||
|
||||
hostname = wq.jd.com
|
||||
|
||||
==========================Quantumultx=========================
|
||||
[task_local]
|
||||
0 9,12,18 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_jxnc.js, tag=京喜农场, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jxnc.png, enabled=true
|
||||
@@ -32,6 +34,8 @@ cron "0 9,12,18 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_
|
||||
|
||||
const $ = new Env('京喜农场');
|
||||
let notify = ''; // nodejs 发送通知脚本
|
||||
let notifyLevel = $.isNode() ? process.env.JXNC_NOTIFY_LEVEL || 3 : 3; // 通知级别 0=不通知;1=本次获得水滴>0;2=任务执行;3=任务执行+未种植种子;
|
||||
let notifyBool = true; // 代码内部使用,控制是否通知
|
||||
let cookieArr = []; // 用户 cookie 数组
|
||||
let currentCookie = ''; // 当前用户 cookie
|
||||
let tokenNull = {'farm_jstoken': '', 'phoneid': '', 'timestamp': ''}; // 内置一份空的 token
|
||||
@@ -44,18 +48,22 @@ const openUrl = `openjd://virtual?params=${encodeURIComponent('{ "category": "ju
|
||||
let subTitle = '', message = '', option = {'open-url': openUrl}; // 消息副标题,消息正文,消息扩展参数
|
||||
const JXNC_API_HOST = 'https://wq.jd.com/';
|
||||
|
||||
$.detail = []; // 今日明细列表
|
||||
$.helpTask = null;
|
||||
$.allTask = []; // 任务列表
|
||||
$.info = {}; // 用户信息
|
||||
$.answer = 0;
|
||||
$.drip = 0;
|
||||
$.maxHelpNum = shareCode.split('@').length; // 助力 ret 1011 错误最大计数
|
||||
$.maxHelpNum = $.isNode() ? 8 : 3; // 助力 ret 1011 错误最大计数
|
||||
$.helpNum = 0; // 当前账号 助力 ret 1011 次数
|
||||
$.maxHelpSelfNum = 3; // 助力 自身 ret 1021 cannot help self 最大次数限制(防止随机API不停返回自身 code 导致死循环)
|
||||
$.helpSelfNum = 0; // 当前账号 助力 ret 1021 cannot help self 次数
|
||||
let assistUserShareCode = 0; // 随机助力用户 share code
|
||||
|
||||
!(async () => {
|
||||
await requireConfig();
|
||||
if (!cookieArr[0]) {
|
||||
$.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"});
|
||||
$.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', {"open-url": "https://bean.m.jd.com/bean/signIndex.action"});
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -80,6 +88,7 @@ $.helpNum = 0; // 当前账号 助力 ret 1011 次数
|
||||
message = '';
|
||||
option = {};
|
||||
$.helpNum = 0;
|
||||
$.helpSelfNum = 0;
|
||||
await tokenFormat(); // 处理当前账号 token
|
||||
await shareCodesFormat(); // 处理当前账号 助力码
|
||||
await jdJXNC(); // 执行当前账号 主代码流程
|
||||
@@ -99,6 +108,7 @@ function requireConfig() {
|
||||
return new Promise(resolve => {
|
||||
$.log('开始获取配置文件\n')
|
||||
notify = $.isNode() ? require('./sendNotify') : '';
|
||||
notifyBool = notifyLevel > 0; // 初始化是否推送
|
||||
//Node.js用户请在jdCookie.js处填写京东ck;
|
||||
const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
|
||||
const jdTokenNode = $.isNode() ? require('./jdJxncTokens.js') : '';
|
||||
@@ -120,7 +130,7 @@ function requireConfig() {
|
||||
|
||||
if ($.isNode()) {
|
||||
Object.keys(jdTokenNode).forEach((item) => {
|
||||
tokenArr.push(tokenArr[item] ? JSON.parse(jxncShareCodeArr[item]) : tokenNull)
|
||||
tokenArr.push(jdTokenNode[item] ? JSON.parse(jdTokenNode[item]) : tokenNull)
|
||||
})
|
||||
} else {
|
||||
tokenArr.push(...[$.getdata('jxnc_token1') || tokenNull, $.getdata('jxnc_token2') || tokenNull]);
|
||||
@@ -201,10 +211,7 @@ function shareCodesFormat() {
|
||||
// console.log(`第${$.index}个京东账号的助力码:::${jdFruitShareArr[$.index - 1]}`)
|
||||
if (jxncShareCodeArr[$.index - 1]) {
|
||||
currentShareCode = jxncShareCodeArr[$.index - 1].split('@');
|
||||
let length = currentShareCode.length;
|
||||
if (length < 3) {
|
||||
currentShareCode.push(...(shareCode.split('@').splice(0, 3 - length)));
|
||||
}
|
||||
currentShareCode.push(...(shareCode.split('@')));
|
||||
} else {
|
||||
$.log(`由于您第${$.index}个京东账号未提供shareCode,将采纳本脚本自带的助力码`)
|
||||
currentShareCode = shareCode.split('@');
|
||||
@@ -218,27 +225,38 @@ async function jdJXNC() {
|
||||
subTitle = `【京东账号${$.index}】${$.nickName}`;
|
||||
$.log(`获取用户信息 & 任务列表`);
|
||||
const startInfo = await getTaskList();
|
||||
if (!startInfo) { // 未选择种子时,当前账号流程结束
|
||||
return false;
|
||||
if (startInfo.prizename) {
|
||||
message += `【水果名称】${startInfo.prizename}\n`;
|
||||
}
|
||||
message += `【水果名称】${startInfo.prizename}\n`;
|
||||
$.log(`【京东账号${$.index}(${$.nickName || $.UserName})的${$.name}好友互助码】 ${$.info.smp}`);
|
||||
$.log(`【京东账号${$.index}(${$.nickName || $.UserName})的${$.name}种子active】 ${$.info.active}`);
|
||||
await $.wait(500);
|
||||
const isOk = await browserTask();
|
||||
if (!isOk) {
|
||||
return false;
|
||||
}
|
||||
await $.wait(500);
|
||||
await answerTask();
|
||||
await $.wait(500);
|
||||
const endInfo = await getTaskList();
|
||||
getMessage(endInfo, startInfo);
|
||||
const next = await helpFriends();
|
||||
if (next) {
|
||||
await submitInviteId($.UserName);
|
||||
if (startInfo) {
|
||||
$.log(`【京东账号${$.index}(${$.nickName || $.UserName})的${$.name}好友互助码】 ${$.info.smp}`);
|
||||
$.log(`【京东账号${$.index}(${$.nickName || $.UserName})的${$.name}种子active】 ${$.info.active}`);
|
||||
await $.wait(500);
|
||||
await createAssistUser();
|
||||
const isOk = await browserTask();
|
||||
if (isOk) {
|
||||
await $.wait(500);
|
||||
await answerTask();
|
||||
await $.wait(500);
|
||||
const endInfo = await getTaskList();
|
||||
getMessage(endInfo, startInfo);
|
||||
await submitInviteId($.UserName);
|
||||
await $.wait(500);
|
||||
let next = await helpFriends();
|
||||
if (next) {
|
||||
while (true) {
|
||||
assistUserShareCode = await getAssistUser();
|
||||
if (assistUserShareCode) {
|
||||
await $.wait(300);
|
||||
next = await helpShareCode(assistUserShareCode);
|
||||
if (next) {
|
||||
await $.wait(200);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
await showMsg()
|
||||
}
|
||||
@@ -250,16 +268,15 @@ function getTaskList() {
|
||||
try {
|
||||
const res = data.match(/try\{whyour\(([\s\S]*)\)\;\}catch\(e\)\{\}/)[1];
|
||||
const {detail, msg, task = [], retmsg, ...other} = JSON.parse(res);
|
||||
$.helpTask = task.filter(x => x.tasktype === 2)[0] || { eachtimeget: 0, limit: 0 };
|
||||
$.detail = detail;
|
||||
$.helpTask = task.filter(x => x.tasktype === 2)[0] || {eachtimeget: 0, limit: 0};
|
||||
$.allTask = task.filter(x => x.tasktype !== 3 && x.tasktype !== 2 && parseInt(x.left) > 0);
|
||||
$.info = other;
|
||||
$.log(`获取任务列表 ${retmsg} 总共${$.allTask.length}个任务!`);
|
||||
if (!$.info.active) {
|
||||
$.log('账号未选择种子,请先去京喜农场选择种子,选择 APP 专属种子时,必须提供 token');
|
||||
$.msg($.name, subTitle, '请先去京喜农场选择种子!\n选择app专属种子时,请参考脚本头部说明获取token,点击通知跳转', option);
|
||||
if ($.isNode()) {
|
||||
await notify.sendNotify(`${$.name}`, `京东账号${$.index}[${$.nickName || $.UserName}]请先去京喜农场选择种子!\n选择app专属种子时,请参考脚本头部说明获取token`);
|
||||
}
|
||||
$.log('账号未选择种子,请先去京喜农场选择种子。\n如果选择 APP 专属种子,必须提供 token。');
|
||||
message += '账号未选择种子,请先去京喜农场选择种子。\n如果选择 APP 专属种子,必须提供 token。\n';
|
||||
notifyBool = notifyBool && notifyLevel >= 3;
|
||||
resolve(false);
|
||||
}
|
||||
resolve(other);
|
||||
@@ -292,10 +309,7 @@ function browserTask() {
|
||||
}
|
||||
if (status[0] === 1032) {
|
||||
$.log('任务执行失败,种植的 APP 专属种子,请提供 token 或种植非 APP 种子');
|
||||
$.msg($.name, '请参考脚本头部说明获取token', '或者改中非app专属种子,点击通知跳转', option);
|
||||
if ($.isNode()) {
|
||||
await notify.sendNotify(`${$.name}`, `京东账号${$.index}[${$.nickName || $.UserName}]请参考脚本头部说明获取token\n或者改中非app专属种子`);
|
||||
}
|
||||
message += '任务执行失败,种植的 APP 专属种子,请提供 token 或种植非 APP 种子\n';
|
||||
resolve(false);
|
||||
return;
|
||||
}
|
||||
@@ -348,14 +362,28 @@ function answerTask() {
|
||||
});
|
||||
}
|
||||
|
||||
function getMessage(endInfo) {
|
||||
function getMessage(endInfo, startInfo) {
|
||||
const need = endInfo.target - endInfo.score;
|
||||
const get = $.drip;
|
||||
message += `【水滴】获得水滴${get} 还需水滴${need}\n`;
|
||||
if (get > 0) {
|
||||
const max = parseInt(need / get);
|
||||
const min = parseInt(need / (get + $.helpTask.limit * $.helpTask.eachtimeget));
|
||||
message += `【预测】还需 ${min} ~ ${max} 天\n`;
|
||||
const get = endInfo.modifyscore; // 本地变更获得水滴
|
||||
const leaveGet = startInfo.modifyscore; // 离开时获得水滴
|
||||
let dayGet = 0; // 今日共获取水滴数
|
||||
if ($.detail) {
|
||||
let dayTime = new Date(new Date().toLocaleDateString()).getTime() / 1000; // 今日 0 点时间戳(10位数)
|
||||
$.detail.forEach(function (item, index) {
|
||||
if (item.time >= dayTime && item.score) {
|
||||
dayGet += item.score;
|
||||
}
|
||||
});
|
||||
}
|
||||
message += `【水滴】本次获得${get} 离线获得${leaveGet} 今日获得${dayGet} 还需水滴${need}\n`;
|
||||
if (get > 0 || leaveGet > 0 || dayGet > 0) {
|
||||
const day = parseInt(need / (dayGet > 0 ? dayGet : (get + leaveGet)));
|
||||
message += `【预测】还需 ${day} 天\n`;
|
||||
}
|
||||
if (get > 0 || leaveGet > 0) { // 本次 或 离线 有水滴
|
||||
notifyBool = notifyBool && notifyLevel >= 1;
|
||||
} else {
|
||||
notifyBool = notifyBool && notifyLevel >= 2;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -387,26 +415,21 @@ function submitInviteId(userName) {
|
||||
});
|
||||
}
|
||||
|
||||
// 获取随机助力码并助力
|
||||
function createAssistUser() {
|
||||
function getAssistUser() {
|
||||
return new Promise(resolve => {
|
||||
$.get({url: `https://api.ninesix.cc/api/jx-nc?active=${$.info.active}`}, async (err, resp, _data) => {
|
||||
try {
|
||||
const {code, data = {}} = JSON.parse(_data);
|
||||
$.log(`获取随机助力码 ${code}`);
|
||||
if (!data.value) {
|
||||
$.log('随机助力码不存在,跳过助力');
|
||||
resolve();
|
||||
return;
|
||||
}
|
||||
const next = await helpShareCode(data.value);
|
||||
if (next) {
|
||||
await createAssistUser();
|
||||
if (data.value) {
|
||||
$.log(`获取随机助力码成功 ${code} ${data.value}`);
|
||||
resolve(data.value);
|
||||
} else {
|
||||
resolve();
|
||||
$.log(`获取随机助力码失败 ${code}`);
|
||||
}
|
||||
} catch (e) {
|
||||
$.logErr(e, resp);
|
||||
} finally {
|
||||
resolve(false);
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -429,16 +452,27 @@ async function helpFriends() {
|
||||
// 执行助力 return true 继续助力 false 助力结束
|
||||
function helpShareCode(code) {
|
||||
return new Promise(async resolve => {
|
||||
if (code === $.info.smp) { // 自己的助力码,跳过,继续执行
|
||||
$.log('助力码与当前账号相同,跳过助力。准备进行下一个助力');
|
||||
resolve(true);
|
||||
}
|
||||
$.log(`即将助力 share code:${code}`);
|
||||
$.get(
|
||||
taskUrl('help', `active=${$.info.active}&joinnum=${$.info.joinnum}&smp=${code}`),
|
||||
async (err, resp, data) => {
|
||||
try {
|
||||
const res = data.match(/try\{whyour\(([\s\S]*)\)\;\}catch\(e\)\{\}/)[1];
|
||||
const {ret, retmsg = ''} = JSON.parse(res);
|
||||
$.log(`助力结果:ret=${ret} retmsg="${retmsg ? retmsg : '助力成功'}"`);
|
||||
if (ret === 0 || ret === 1021) { // 0 助力成功 1021 不能助力自己
|
||||
$.log(`助力结果:ret=${ret} retmsg="${retmsg ? retmsg : 'OK'}"`);
|
||||
if (ret === 0) { // 0 助力成功
|
||||
resolve(true);
|
||||
}
|
||||
if (ret === 1021) { // 1021 cannot help self 不能助力自己
|
||||
$.helpSelfNum++;
|
||||
if ($.helpSelfNum <= $.maxHelpSelfNum) {
|
||||
resolve(true);
|
||||
}
|
||||
}
|
||||
if (ret === 1011) { // 1011 active 不同
|
||||
$.helpNum++;
|
||||
if ($.helpNum <= $.maxHelpNum) {
|
||||
@@ -504,9 +538,11 @@ function taskUrl(function_path, body) {
|
||||
}
|
||||
|
||||
async function showMsg() {
|
||||
$.msg($.name, subTitle, message, option);
|
||||
if ($.isNode()) {
|
||||
await notify.sendNotify(`${$.name} - 账号${$.index} - ${$.nickName}`, `${subTitle}\n${message}`);
|
||||
if (notifyBool) {
|
||||
$.msg($.name, subTitle, message, option);
|
||||
if ($.isNode()) {
|
||||
await notify.sendNotify(`${$.name} - 账号${$.index} - ${$.nickName}`, `${subTitle}\n${message}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -28,12 +28,12 @@ inputs:
|
||||
cronExpression: "0 0 0 * * * *"
|
||||
enable: true
|
||||
argument: jd_blueCoin&jd_club_lottery&jd_car&jd_car_exchange
|
||||
- timer: #东东农场 #东东萌宠 #口袋书店
|
||||
- timer: #东东农场 #东东萌宠 #口袋书店 #京喜农场
|
||||
parameters:
|
||||
name: jd_fruit_jd_pet_bookshop
|
||||
name: jd_fruit_jd_pet_bookshop_jxnc
|
||||
cronExpression: "0 5 6-18/6,8 * * * *"
|
||||
enable: true
|
||||
argument: jd_fruit&jd_pet&jd_bookshop
|
||||
argument: jd_fruit&jd_pet&jd_bookshop&jd_jxnc
|
||||
- timer: # 宠汪汪喂食# 宠汪汪# 摇钱树# 京东种豆得豆# 京喜工厂 #东东工厂
|
||||
parameters:
|
||||
name: joy_feedPets_joy_moneyTree_plantBean_dreamFactory_jdfactory
|
||||
|
Reference in New Issue
Block a user