diff --git a/.github/workflows/deploy_tencent_scf.yml b/.github/workflows/deploy_tencent_scf.yml index 191b3869..b41fa481 100644 --- a/.github/workflows/deploy_tencent_scf.yml +++ b/.github/workflows/deploy_tencent_scf.yml @@ -52,6 +52,7 @@ jobs: 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 [ $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 [ $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; @@ -110,6 +111,7 @@ jobs: JDZZ_SHARECODES: ${{ secrets.JDZZ_SHARECODES}} JDJOY_SHARECODES: ${{ secrets.JDJOY_SHARECODES}} BOOKSHOP_SHARECODES: ${{ secrets.BOOKSHOP_SHARECODES}} + JD_CASH_SHARECODES: ${{ secrets.JD_CASH_SHARECODES}} JXNC_SHARECODES: ${{ secrets.JXNC_SHARECODES}} JD_BEAN_STOP: ${{ secrets.JD_BEAN_STOP}} JD_BEAN_SIGN_STOP_NOTIFY: ${{ secrets.JD_BEAN_SIGN_STOP_NOTIFY}} diff --git a/QuantumultX/lxk0301_gallery.json b/QuantumultX/lxk0301_gallery.json index 5007c2d3..2dab7cc8 100644 --- a/QuantumultX/lxk0301_gallery.json +++ b/QuantumultX/lxk0301_gallery.json @@ -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", "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", - "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" ] } diff --git a/jd_jxnc.js b/jd_jxnc.js index 743a7fdf..9df094fa 100644 --- a/jd_jxnc.js +++ b/jd_jxnc.js @@ -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 京喜农场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 +特别说明: +脚本运行必须填写种子token,iOS用户使用代理可以直接获取;Android用户需要抓包获取种子token,手动做京喜农场任意任务即可获取种子token,推荐使用elecV2P(使用设置类似iOS用户的代理软件)或者HttpCanary,搜索关键字"farm_jstoken",token按照{"farm_jstoken":"xxx","timestamp":"xxx","phoneid":"xxx-xxx"}格式填写即可 + */ const $ = new Env('京喜农场'); @@ -377,7 +380,7 @@ function getMessage(endInfo, startInfo) { } message += `【水滴】本次获得${get} 离线获得${leaveGet} 今日获得${dayGet} 还需水滴${need}\n`; 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`; } if (get > 0 || leaveGet > 0) { // 本次 或 离线 有水滴 @@ -394,44 +397,54 @@ function submitInviteId(userName) { resolve(); return; } - $.post( - { - url: `https://api.ninesix.cc/api/jx-nc/${$.info.smp}/${encodeURIComponent(userName)}?active=${$.info.active}`, - }, - (err, resp, _data) => { - try { - const {code, data = {}} = JSON.parse(_data); - $.log(`邀请码提交:${code}`); - if (data.value) { - message += '【邀请码】提交成功!\n'; + try { + $.post( + { + url: `https://api.ninesix.cc/api/jx-nc/${$.info.smp}/${encodeURIComponent(userName)}?active=${$.info.active}`, + }, + (err, resp, _data) => { + try { + const {code, data = {}} = JSON.parse(_data); + $.log(`邀请码提交:${code}`); + if (data.value) { + message += '【邀请码】提交成功!\n'; + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); } - } catch (e) { - $.logErr(e, resp); - } finally { - resolve(); - } - }, - ); + }, + ); + } catch (e) { + $.logErr(e, resp); + resolve(); + } }); } 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); - if (data.value) { - $.log(`获取随机助力码成功 ${code} ${data.value}`); - resolve(data.value); - } else { - $.log(`获取随机助力码失败 ${code}`); + try { + $.get({url: `https://api.ninesix.cc/api/jx-nc?active=${$.info.active}`}, async (err, resp, _data) => { + try { + const {code, data = {}} = JSON.parse(_data); + if (data.value) { + $.log(`获取随机助力码成功 ${code} ${data.value}`); + resolve(data.value); + } else { + $.log(`获取随机助力码失败 ${code}`); + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(false); } - } catch (e) { - $.logErr(e, resp); - } finally { - resolve(false); - } - }); + }); + } catch (e) { + $.logErr(e, resp); + resolve(false); + } }); } diff --git a/jd_nh.js b/jd_nh.js index ae65cffe..a02dda68 100644 --- a/jd_nh.js +++ b/jd_nh.js @@ -113,7 +113,7 @@ function getIsvToken() { $.post(config,async (err, resp, data) => { try { if (err) { - console.log(`${err},${jsonParse(resp.body)['message']}`) + console.log(`${err}`) console.log(`${$.name} API请求失败,请检查网路重试`) } else { if (safeGet(data)) { @@ -146,7 +146,7 @@ function getIsvToken2() { $.post(config,async (err, resp, data) => { try { if (err) { - console.log(`${err},${jsonParse(resp.body)['message']}`) + console.log(`${err}`) console.log(`${$.name} API请求失败,请检查网路重试`) } else { if (safeGet(data)) { @@ -169,7 +169,7 @@ function getActCk() { $.get(taskUrl("dingzhi/vm/template/activity/940531", `activityId=${ACT_ID}`), (err, resp, data) => { try { if (err) { - console.log(`${err},${jsonParse(resp.body)['message']}`) + console.log(`${err}`) console.log(`${$.name} API请求失败,请检查网路重试`) } else { cookie = `${cookie};` @@ -198,7 +198,7 @@ function getActInfo() { $.post(taskPostUrl('dz/common/getSimpleActInfoVo', `activityId=${ACT_ID}`), async (err, resp, data) => { try { if (err) { - console.log(`${err},${jsonParse(resp.body)['message']}`) + console.log(`${err}`) console.log(`${$.name} API请求失败,请检查网路重试`) } else { if (safeGet(data)) { @@ -221,7 +221,7 @@ function getMyPing() { $.post(taskPostUrl('customer/getMyPing', `userId=${$.shopId}&token=${$.token2}&fromType=APP`), async (err, resp, data) => { try { if (err) { - console.log(`${err},${jsonParse(resp.body)['message']}`) + console.log(`${err}`) console.log(`${$.name} API请求失败,请检查网路重试`) } else { if (safeGet(data)) { @@ -247,7 +247,7 @@ function getUserInfo() { $.post(taskPostUrl('wxActionCommon/getUserInfo', body), async (err, resp, data) => { try { if (err) { - console.log(`${err},${jsonParse(resp.body)['message']}`) + console.log(`${err}`) console.log(`${$.name} API请求失败,请检查网路重试`) } else { 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) => { try { if (err) { - console.log(`${err},${jsonParse(resp.body)['message']}`) + console.log(`${err}`) console.log(`${$.name} API请求失败,请检查网路重试`) } else { if (safeGet(data)) { @@ -304,6 +304,7 @@ function getActContent(info=false, shareUuid = '') { let res = await getTaskInfo(task.taskType) let vo = res[0] 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) => { try { if (err) { - console.log(`${err},${jsonParse(resp.body)['message']}`) + console.log(`${err}`) console.log(`${$.name} API请求失败,请检查网路重试`) } else { if (safeGet(data)) { @@ -354,7 +355,7 @@ function doTask(taskType, value) { $.post(taskPostUrl('dingzhi/vm/template/saveTask', body), async (err, resp, data) => { try { if (err) { - console.log(`${err},${jsonParse(resp.body)['message']}`) + console.log(`${err}`) console.log(`${$.name} API请求失败,请检查网路重试`) } else { if (safeGet(data)) {