Merge remote-tracking branch 'origin/master'

This commit is contained in:
lxk0301
2021-01-13 09:32:15 +08:00
4 changed files with 63 additions and 42 deletions

View File

@@ -52,6 +52,7 @@ jobs:
if [ $JDZZ_SHARECODES ]; then sed -i "/variables/a\ JDZZ_SHARECODES: $JDZZ_SHARECODES" 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 [ $JDJOY_SHARECODES ]; then sed -i "/variables/a\ JDJOY_SHARECODES: $JDJOY_SHARECODES" serverless.yml; fi;
if [ $BOOKSHOP_SHARECODES ]; then sed -i "/variables/a\ BOOKSHOP_SHARECODES: $BOOKSHOP_SHARECODES" serverless.yml; fi; if [ $BOOKSHOP_SHARECODES ]; then sed -i "/variables/a\ BOOKSHOP_SHARECODES: $BOOKSHOP_SHARECODES" serverless.yml; fi;
if [ $JD_CASH_SHARECODES ]; then sed -i "/variables/a\ JD_CASH_SHARECODES: $JD_CASH_SHARECODES" serverless.yml; fi;
if [ $JXNC_SHARECODES ]; then sed -i "/variables/a\ JXNC_SHARECODES: $JXNC_SHARECODES" serverless.yml; fi; if [ $JXNC_SHARECODES ]; then sed -i "/variables/a\ JXNC_SHARECODES: $JXNC_SHARECODES" serverless.yml; fi;
if [ $JD_BEAN_STOP ]; then sed -i "/variables/a\ JD_BEAN_STOP: $JD_BEAN_STOP" serverless.yml; fi; if [ $JD_BEAN_STOP ]; then sed -i "/variables/a\ JD_BEAN_STOP: $JD_BEAN_STOP" serverless.yml; fi;
if [ $JD_BEAN_SIGN_STOP_NOTIFY ]; then sed -i "/variables/a\ JD_BEAN_SIGN_STOP_NOTIFY: $JD_BEAN_SIGN_STOP_NOTIFY" serverless.yml; fi; if [ $JD_BEAN_SIGN_STOP_NOTIFY ]; then sed -i "/variables/a\ JD_BEAN_SIGN_STOP_NOTIFY: $JD_BEAN_SIGN_STOP_NOTIFY" serverless.yml; fi;
@@ -110,6 +111,7 @@ jobs:
JDZZ_SHARECODES: ${{ secrets.JDZZ_SHARECODES}} JDZZ_SHARECODES: ${{ secrets.JDZZ_SHARECODES}}
JDJOY_SHARECODES: ${{ secrets.JDJOY_SHARECODES}} JDJOY_SHARECODES: ${{ secrets.JDJOY_SHARECODES}}
BOOKSHOP_SHARECODES: ${{ secrets.BOOKSHOP_SHARECODES}} BOOKSHOP_SHARECODES: ${{ secrets.BOOKSHOP_SHARECODES}}
JD_CASH_SHARECODES: ${{ secrets.JD_CASH_SHARECODES}}
JXNC_SHARECODES: ${{ secrets.JXNC_SHARECODES}} JXNC_SHARECODES: ${{ secrets.JXNC_SHARECODES}}
JD_BEAN_STOP: ${{ secrets.JD_BEAN_STOP}} JD_BEAN_STOP: ${{ secrets.JD_BEAN_STOP}}
JD_BEAN_SIGN_STOP_NOTIFY: ${{ secrets.JD_BEAN_SIGN_STOP_NOTIFY}} JD_BEAN_SIGN_STOP_NOTIFY: ${{ secrets.JD_BEAN_SIGN_STOP_NOTIFY}}

View File

@@ -31,6 +31,11 @@
"14 11 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_jdzz.js, tag=京东赚赚, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jdzz.png", "14 11 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_jdzz.js, tag=京东赚赚, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jdzz.png",
"44 12 * * 6 https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_unbind.js, tag=注销京东店铺会员卡, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_unbind.png", "44 12 * * 6 https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_unbind.js, tag=注销京东店铺会员卡, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_unbind.png",
"30 8 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_crazy_joy.js, tag=crazyJoy任务, img-url=https://raw.githubusercontent.com/Orz-3/task/master/jd.png", "30 8 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_crazy_joy.js, tag=crazyJoy任务, img-url=https://raw.githubusercontent.com/Orz-3/task/master/jd.png",
"15 17 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/backUp/xmSports.js, tag=小米运动, img-url=https://raw.githubusercontent.com/58xinian/icon/master/xmyd.png" "15 17 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/backUp/xmSports.js, tag=小米运动, img-url=https://raw.githubusercontent.com/58xinian/icon/master/xmyd.png",
"0 0 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_car_exchange.js, tag=京东汽车兑换, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_redPacket.png",
"0 0 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_bookshop.js, tag=口袋书店, img-url=https://raw.githubusercontent.com/Orz-3/task/master/jd.png",
"5 0 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jx_sign.js, tag=京喜签到, img-url=https://raw.githubusercontent.com/Orz-3/task/master/jd.png",
"2 0 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_cash.js, tag=签到领现金, img-url=https://raw.githubusercontent.com/Orz-3/task/master/jd.png",
"1 7 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_nh.js, tag=京东年货节, img-url=https://raw.githubusercontent.com/Orz-3/task/master/jd.png"
] ]
} }

View File

@@ -30,6 +30,9 @@ cron "0 9,12,18 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_
京喜农场 = type=cron,script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_jxnc.js, cronexpr="0 9,12,18 * * *", timeout=200, enable=true 京喜农场 = type=cron,script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_jxnc.js, cronexpr="0 9,12,18 * * *", timeout=200, enable=true
京喜农场APP种子cookie = type=http-request,script-path=https://raw.githubusercontent.com/whyour/hundun/master/quanx/jx_nc.cookie.js,pattern=^https\:\/\/wq\.jd\.com\/cubeactive\/farm\/dotask,max-size=131072,timeout=110,enable=true 京喜农场APP种子cookie = type=http-request,script-path=https://raw.githubusercontent.com/whyour/hundun/master/quanx/jx_nc.cookie.js,pattern=^https\:\/\/wq\.jd\.com\/cubeactive\/farm\/dotask,max-size=131072,timeout=110,enable=true
特别说明:
脚本运行必须填写种子tokeniOS用户使用代理可以直接获取Android用户需要抓包获取种子token手动做京喜农场任意任务即可获取种子token推荐使用elecV2P使用设置类似iOS用户的代理软件或者HttpCanary搜索关键字"farm_jstoken"token按照{"farm_jstoken":"xxx","timestamp":"xxx","phoneid":"xxx-xxx"}格式填写即可
*/ */
const $ = new Env('京喜农场'); const $ = new Env('京喜农场');
@@ -377,7 +380,7 @@ function getMessage(endInfo, startInfo) {
} }
message += `【水滴】本次获得${get} 离线获得${leaveGet} 今日获得${dayGet} 还需水滴${need}\n`; message += `【水滴】本次获得${get} 离线获得${leaveGet} 今日获得${dayGet} 还需水滴${need}\n`;
if (get > 0 || leaveGet > 0 || dayGet > 0) { if (get > 0 || leaveGet > 0 || dayGet > 0) {
const day = parseInt(need / (dayGet > 0 ? dayGet : (get + leaveGet))); const day = Math.ceil(need / (dayGet > 0 ? dayGet : (get + leaveGet)));
message += `【预测】还需 ${day}\n`; message += `【预测】还需 ${day}\n`;
} }
if (get > 0 || leaveGet > 0) { // 本次 或 离线 有水滴 if (get > 0 || leaveGet > 0) { // 本次 或 离线 有水滴
@@ -394,44 +397,54 @@ function submitInviteId(userName) {
resolve(); resolve();
return; return;
} }
$.post( try {
{ $.post(
url: `https://api.ninesix.cc/api/jx-nc/${$.info.smp}/${encodeURIComponent(userName)}?active=${$.info.active}`, {
}, url: `https://api.ninesix.cc/api/jx-nc/${$.info.smp}/${encodeURIComponent(userName)}?active=${$.info.active}`,
(err, resp, _data) => { },
try { (err, resp, _data) => {
const {code, data = {}} = JSON.parse(_data); try {
$.log(`邀请码提交:${code}`); const {code, data = {}} = JSON.parse(_data);
if (data.value) { $.log(`邀请码提交:${code}`);
message += '【邀请码】提交成功!\n'; if (data.value) {
message += '【邀请码】提交成功!\n';
}
} catch (e) {
$.logErr(e, resp);
} finally {
resolve();
} }
} catch (e) { },
$.logErr(e, resp); );
} finally { } catch (e) {
resolve(); $.logErr(e, resp);
} resolve();
}, }
);
}); });
} }
function getAssistUser() { function getAssistUser() {
return new Promise(resolve => { return new Promise(resolve => {
$.get({url: `https://api.ninesix.cc/api/jx-nc?active=${$.info.active}`}, async (err, resp, _data) => { try {
try { $.get({url: `https://api.ninesix.cc/api/jx-nc?active=${$.info.active}`}, async (err, resp, _data) => {
const {code, data = {}} = JSON.parse(_data); try {
if (data.value) { const {code, data = {}} = JSON.parse(_data);
$.log(`获取随机助力码成功 ${code} ${data.value}`); if (data.value) {
resolve(data.value); $.log(`获取随机助力码成功 ${code} ${data.value}`);
} else { resolve(data.value);
$.log(`获取随机助力码失败 ${code}`); } else {
$.log(`获取随机助力码失败 ${code}`);
}
} catch (e) {
$.logErr(e, resp);
} finally {
resolve(false);
} }
} catch (e) { });
$.logErr(e, resp); } catch (e) {
} finally { $.logErr(e, resp);
resolve(false); resolve(false);
} }
});
}); });
} }

View File

@@ -113,7 +113,7 @@ function getIsvToken() {
$.post(config,async (err, resp, data) => { $.post(config,async (err, resp, data) => {
try { try {
if (err) { if (err) {
console.log(`${err},${jsonParse(resp.body)['message']}`) console.log(`${err}`)
console.log(`${$.name} API请求失败请检查网路重试`) console.log(`${$.name} API请求失败请检查网路重试`)
} else { } else {
if (safeGet(data)) { if (safeGet(data)) {
@@ -146,7 +146,7 @@ function getIsvToken2() {
$.post(config,async (err, resp, data) => { $.post(config,async (err, resp, data) => {
try { try {
if (err) { if (err) {
console.log(`${err},${jsonParse(resp.body)['message']}`) console.log(`${err}`)
console.log(`${$.name} API请求失败请检查网路重试`) console.log(`${$.name} API请求失败请检查网路重试`)
} else { } else {
if (safeGet(data)) { if (safeGet(data)) {
@@ -169,7 +169,7 @@ function getActCk() {
$.get(taskUrl("dingzhi/vm/template/activity/940531", `activityId=${ACT_ID}`), (err, resp, data) => { $.get(taskUrl("dingzhi/vm/template/activity/940531", `activityId=${ACT_ID}`), (err, resp, data) => {
try { try {
if (err) { if (err) {
console.log(`${err},${jsonParse(resp.body)['message']}`) console.log(`${err}`)
console.log(`${$.name} API请求失败请检查网路重试`) console.log(`${$.name} API请求失败请检查网路重试`)
} else { } else {
cookie = `${cookie};` cookie = `${cookie};`
@@ -198,7 +198,7 @@ function getActInfo() {
$.post(taskPostUrl('dz/common/getSimpleActInfoVo', `activityId=${ACT_ID}`), async (err, resp, data) => { $.post(taskPostUrl('dz/common/getSimpleActInfoVo', `activityId=${ACT_ID}`), async (err, resp, data) => {
try { try {
if (err) { if (err) {
console.log(`${err},${jsonParse(resp.body)['message']}`) console.log(`${err}`)
console.log(`${$.name} API请求失败请检查网路重试`) console.log(`${$.name} API请求失败请检查网路重试`)
} else { } else {
if (safeGet(data)) { if (safeGet(data)) {
@@ -221,7 +221,7 @@ function getMyPing() {
$.post(taskPostUrl('customer/getMyPing', `userId=${$.shopId}&token=${$.token2}&fromType=APP`), async (err, resp, data) => { $.post(taskPostUrl('customer/getMyPing', `userId=${$.shopId}&token=${$.token2}&fromType=APP`), async (err, resp, data) => {
try { try {
if (err) { if (err) {
console.log(`${err},${jsonParse(resp.body)['message']}`) console.log(`${err}`)
console.log(`${$.name} API请求失败请检查网路重试`) console.log(`${$.name} API请求失败请检查网路重试`)
} else { } else {
if (safeGet(data)) { if (safeGet(data)) {
@@ -247,7 +247,7 @@ function getUserInfo() {
$.post(taskPostUrl('wxActionCommon/getUserInfo', body), async (err, resp, data) => { $.post(taskPostUrl('wxActionCommon/getUserInfo', body), async (err, resp, data) => {
try { try {
if (err) { if (err) {
console.log(`${err},${jsonParse(resp.body)['message']}`) console.log(`${err}`)
console.log(`${$.name} API请求失败请检查网路重试`) console.log(`${$.name} API请求失败请检查网路重试`)
} else { } else {
if (safeGet(data)) { if (safeGet(data)) {
@@ -276,7 +276,7 @@ function getActContent(info=false, shareUuid = '') {
`activityId=${ACT_ID}&pin=${encodeURIComponent($.pin)}&pinImg=${$.pinImg}&nick=${$.nick}&cjyxPin=&cjhyPin=&shareUuid=${shareUuid}`), async (err, resp, data) => { `activityId=${ACT_ID}&pin=${encodeURIComponent($.pin)}&pinImg=${$.pinImg}&nick=${$.nick}&cjyxPin=&cjhyPin=&shareUuid=${shareUuid}`), async (err, resp, data) => {
try { try {
if (err) { if (err) {
console.log(`${err},${jsonParse(resp.body)['message']}`) console.log(`${err}`)
console.log(`${$.name} API请求失败请检查网路重试`) console.log(`${$.name} API请求失败请检查网路重试`)
} else { } else {
if (safeGet(data)) { if (safeGet(data)) {
@@ -304,6 +304,7 @@ function getActContent(info=false, shareUuid = '') {
let res = await getTaskInfo(task.taskType) let res = await getTaskInfo(task.taskType)
let vo = res[0] let vo = res[0]
await doTask(vo.type, vo.value) await doTask(vo.type, vo.value)
await $.wait(500)
} }
} }
} }
@@ -326,7 +327,7 @@ function getTaskInfo(taskType, value) {
$.post(taskPostUrl('dingzhi/vm/template/taskInfo', body), async (err, resp, data) => { $.post(taskPostUrl('dingzhi/vm/template/taskInfo', body), async (err, resp, data) => {
try { try {
if (err) { if (err) {
console.log(`${err},${jsonParse(resp.body)['message']}`) console.log(`${err}`)
console.log(`${$.name} API请求失败请检查网路重试`) console.log(`${$.name} API请求失败请检查网路重试`)
} else { } else {
if (safeGet(data)) { if (safeGet(data)) {
@@ -354,7 +355,7 @@ function doTask(taskType, value) {
$.post(taskPostUrl('dingzhi/vm/template/saveTask', body), async (err, resp, data) => { $.post(taskPostUrl('dingzhi/vm/template/saveTask', body), async (err, resp, data) => {
try { try {
if (err) { if (err) {
console.log(`${err},${jsonParse(resp.body)['message']}`) console.log(`${err}`)
console.log(`${$.name} API请求失败请检查网路重试`) console.log(`${$.name} API请求失败请检查网路重试`)
} else { } else {
if (safeGet(data)) { if (safeGet(data)) {