From d607c357e5ebfec9e055d608b6fa71b2adf9b6a1 Mon Sep 17 00:00:00 2001 From: Faker Date: Fri, 10 Jun 2022 15:22:05 +0800 Subject: [PATCH] update --- jd_bean_home.js | 137 +++++++++++++++++++++++++----------------------- jd_dpqd.js | 8 +-- 2 files changed, 75 insertions(+), 70 deletions(-) diff --git a/jd_bean_home.js b/jd_bean_home.js index febd0b9..6f2c44d 100644 --- a/jd_bean_home.js +++ b/jd_bean_home.js @@ -2,23 +2,23 @@ 领京豆额外奖励&抢京豆 脚本自带助力码,介意者可将 29行 helpAuthor 变量设置为 false 活动入口:京东APP首页-领京豆 -更新地址:https://raw.githubusercontent.com/Aaron-lv/sync/jd_scripts/jd_bean_home.js +更新地址:https://raw.githubusercontent.com/shufflewzc/faker2/main/jd_bean_home.js 已支持IOS双京东账号, Node.js支持N个京东账号 脚本兼容: QuantumultX, Surge, Loon, 小火箭,JSBox, Node.js ============Quantumultx=============== [task_local] #领京豆额外奖励 -23 1,12,22 * * * https://raw.githubusercontent.com/Aaron-lv/sync/jd_scripts/jd_bean_home.js, tag=领京豆额外奖励, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_bean_home.png, enabled=true +23 1,18 * * * https://raw.githubusercontent.com/shufflewzc/faker2/main/jd_bean_home.js, tag=领京豆额外奖励, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_bean_home.png, enabled=true ================Loon============== [Script] -cron "23 1,12,22 * * *" script-path=https://raw.githubusercontent.com/Aaron-lv/sync/jd_scripts/jd_bean_home.js, tag=领京豆额外奖励 +cron "23 1,18 * * *" script-path=https://raw.githubusercontent.com/shufflewzc/faker2/main/jd_bean_home.js, tag=领京豆额外奖励 ===============Surge================= -领京豆额外奖励 = type=cron,cronexp="23 1,12,22 * * *",wake-system=1,timeout=3600,script-path=https://raw.githubusercontent.com/Aaron-lv/sync/jd_scripts/jd_bean_home.js +领京豆额外奖励 = type=cron,cronexp="23 1,18 * * *",wake-system=1,timeout=3600,script-path=https://raw.githubusercontent.com/shufflewzc/faker2/main/jd_bean_home.js ============小火箭========= -领京豆额外奖励 = type=cron,script-path=https://raw.githubusercontent.com/Aaron-lv/sync/jd_scripts/jd_bean_home.js, cronexpr="23 1,12,22 * * *", timeout=3600, enable=true +领京豆额外奖励 = type=cron,script-path=https://raw.githubusercontent.com/shufflewzc/faker2/main/jd_bean_home.js, cronexpr="23 1,18 * * *", timeout=3600, enable=true */ const $ = new Env('领京豆额外奖励'); @@ -26,9 +26,10 @@ const notify = $.isNode() ? require('./sendNotify') : ''; //Node.js用户请在jdCookie.js处填写京东ck; const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; let jdNotify = true;//是否关闭通知,false打开通知推送,true关闭通知推送 -const helpAuthor = true; // 是否帮助作者助力,false打开通知推送,true关闭通知推送 +const helpAuthor = false; // 是否帮助作者助力,false打开通知推送,true关闭通知推送 //IOS等用户直接用NobyDa的jd cookie let cookiesArr = [], cookie = '', uuid = '', message; +$.outFlag = false if ($.isNode()) { Object.keys(jdCookieNode).forEach((item) => { cookiesArr.push(jdCookieNode[item]) @@ -41,12 +42,6 @@ if ($.isNode()) { const JD_API_HOST = 'https://api.m.jd.com/'; !(async () => { $.newShareCodes = [] - $.authorCode = await getAuthorShareCode('https://raw.githubusercontent.com/Aaron-lv/updateTeam/master/shareCodes/jd_updateBeanHome.json') - if (!$.authorCode) { - $.http.get({url: 'https://purge.jsdelivr.net/gh/Aaron-lv/updateTeam@master/shareCodes/jd_updateBeanHome.json'}).then((resp) => {}).catch((e) => $.log('刷新CDN异常', e)); - await $.wait(1000) - $.authorCode = await getAuthorShareCode('https://cdn.jsdelivr.net/gh/Aaron-lv/updateTeam@master/shareCodes/jd_updateBeanHome.json') || [] - } 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,48 +68,53 @@ const JD_API_HOST = 'https://api.m.jd.com/'; await jdBeanHome(); } } - for (let i = 0; i < cookiesArr.length; i++) { - $.index = i + 1; - if (cookiesArr[i]) { - cookie = cookiesArr[i]; - $.canHelp = true; - $.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1]) - if ($.newShareCodes.length > 1) { - console.log(`\n【抢京豆】 ${$.UserName} 去助力排名第一的cookie`); - // let code = $.newShareCodes[(i + 1) % $.newShareCodes.length] - // await help(code[0], code[1]) - let code = $.newShareCodes[0]; - if(code[2] && code[2] === $.UserName){ - //不助力自己 - } else { - await help(code[0], code[1]); - } - } - if (helpAuthor && $.authorCode && $.canHelp) { - console.log(`\n【抢京豆】${$.UserName} 去帮助作者`) - for (let code of $.authorCode) { - const helpRes = await help(code.shareCode, code.groupCode); - if (helpRes && helpRes['code'] === '0') { - if (helpRes && helpRes.data && helpRes.data.respCode === 'SG209') { - console.log(`${helpRes.data.helpToast}\n`); - break; - } - } else { - console.log(`助力异常:${JSON.stringify(helpRes)}\n`); - } - } - } - for (let j = 1; j < $.newShareCodes.length && $.canHelp; j++) { - let code = $.newShareCodes[j]; - if(code[2] && code[2] === $.UserName){ - //不助力自己 - } else { - console.log(`【抢京豆】${$.UserName} 去助力账号 ${j + 1}`); - await help(code[0], code[1]); - await $.wait(2000); - } - } - } + // for (let i = 0; i < cookiesArr.length; i++) { + // $.index = i + 1; + // if (cookiesArr[i]) { + // cookie = cookiesArr[i]; + // $.canHelp = true; + // $.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1]) + // if ($.newShareCodes.length > 1) { + // console.log(`\n【抢京豆】 ${$.UserName} 去助力排名第一的cookie`); + // // let code = $.newShareCodes[(i + 1) % $.newShareCodes.length] + // // await help(code[0], code[1]) + // let code = $.newShareCodes[0]; + // if(code[2] && code[2] === $.UserName){ + // //不助力自己 + // } else { + // await help(code[0], code[1]); + // } + // } + // if (helpAuthor && $.authorCode && $.canHelp) { + // console.log(`\n【抢京豆】${$.UserName} 去帮助作者`) + // for (let code of $.authorCode) { + // const helpRes = await help(code.shareCode, code.groupCode); + // if (helpRes && helpRes['code'] === '0') { + // if (helpRes && helpRes.data && helpRes.data.respCode === 'SG209') { + // console.log(`${helpRes.data.helpToast}\n`); + // break; + // } + // } else { + // console.log(`助力异常:${JSON.stringify(helpRes)}\n`); + // } + // } + // } + // for (let j = 1; j < $.newShareCodes.length && $.canHelp; j++) { + // let code = $.newShareCodes[j]; + // if(code[2] && code[2] === $.UserName){ + // //不助力自己 + // } else { + // console.log(`【抢京豆】${$.UserName} 去助力账号 ${j + 1}`); + // await help(code[0], code[1]); + // await $.wait(2000); + // } + // } + // } + // } + if($.outFlag) { + let msg = '好像IP黑了,换个IP试试吧' + $.msg($.name, ``, `${msg}`); + if ($.isNode()) await notify.sendNotify(`${$.name}`, `${msg}`); } })() .catch((e) => { @@ -132,8 +132,10 @@ async function jdBeanHome() { // await $.wait(1000) // if ($.doneState) break // } - do { + do { + $.outFlag = false await doTask2() + if ($.outFlag) return await $.wait(3000) } while (!$.doneState) await $.wait(1000) @@ -144,8 +146,8 @@ async function jdBeanHome() { await getTaskList(); await receiveJd2(); - await morningGetBean() - await $.wait(1000) + //await morningGetBean() + //await $.wait(1000) await beanTaskList(1) await $.wait(1000) @@ -398,8 +400,9 @@ function doTask2() { $.post(taskUrl('beanHomeTask', body), (err, resp, data) => { try { if (err) { - console.log(`${JSON.stringify(err)}`) - console.log(`${$.name} API请求失败,请检查网路重试`) + $.outFlag = true + console.log(`${JSON.stringify(err)}`) + console.log(`doTask2 API请求失败,请检查网路重试`) } else { if (safeGet(data)) { data = JSON.parse(data); @@ -464,7 +467,7 @@ function getUserInfo() { try { if (err) { console.log(`${JSON.stringify(err)}`) - console.log(`${$.name} API请求失败,请检查网路重试`) + console.log(`getUserInfo API请求失败,请检查网路重试`) } else { if (safeGet(data)) { data = JSON.parse(data); @@ -502,7 +505,7 @@ function hitGroup() { try { if (err) { console.log(`${JSON.stringify(err)}`) - console.log(`${$.name} API请求失败,请检查网路重试`) + console.log(`hitGroup API请求失败,请检查网路重试`) } else { if (safeGet(data)) { data = JSON.parse(data); @@ -584,7 +587,7 @@ function getTaskList() { try { if (err) { console.log(`${JSON.stringify(err)}`) - console.log(`${$.name} API请求失败,请检查网路重试`) + console.log(`getTaskList API请求失败,请检查网路重试`) } else { if (safeGet(data)) { data = JSON.parse(data); @@ -620,7 +623,7 @@ function receiveTask(itemId = "zddd", type = "3") { try { if (err) { console.log(`${JSON.stringify(err)}`) - console.log(`${$.name} API请求失败,请检查网路重试`) + console.log(`receiveTask API请求失败,请检查网路重试`) } else { if (safeGet(data)) { data = JSON.parse(data); @@ -648,7 +651,8 @@ function award(source="home") { try { if (err) { console.log(`${JSON.stringify(err)}`) - console.log(`${$.name} API请求失败,请检查网路重试`) + console.log(`award API请求失败,请检查网路重试`) + $.outFlag = true } else { if (safeGet(data)) { data = JSON.parse(data); @@ -689,7 +693,8 @@ function receiveJd2() { try { if (err) { console.log(`${JSON.stringify(err)}`) - console.log(`${$.name} API请求失败,请检查网路重试`) + console.log(`receiveJd2 API请求失败,请检查网路重试`) + $.outFlag = true } else { if (safeGet(data)) { data = JSON.parse(data); @@ -780,7 +785,7 @@ function TotalBean() { try { if (err) { console.log(`${JSON.stringify(err)}`) - console.log(`${$.name} API请求失败,请检查网路重试`) + console.log(`TotalBean API请求失败,请检查网路重试`) } else { if (data) { data = JSON.parse(data); diff --git a/jd_dpqd.js b/jd_dpqd.js index ccbf306..1d71ab1 100644 --- a/jd_dpqd.js +++ b/jd_dpqd.js @@ -27,12 +27,11 @@ let shopname='' const token = [ "FD7F0E88F2555A9A7254AA00D6DDA1F6", "4BE1B58FE1360409A5967CAD1127B5A8", - "60454759577C6664C8AAAFEEBE25B7A1", + "E9885E4C06000433BBB4221A04D44C36", "3B27B2B9E70249C339D66F27B7E133F0", - "C031053EDBD2C047C072C53F80D82577", + "70E81DD8CF06D043FE1FD2DB60B59987", "572B5331C2303ABFF034700EDDFE2B41", "979F3F329012E8BE0D64DA1B7D6F024B", - "3B864BF96848A44E170A26D2791E0AE3", "1C963AA3BBBD0396784BD0CA527BCDF8", "C5FD1482A207F2CC65570F8FBC492C9A", "5CF1A3455369BDB3D1153D9FC974CAFA", @@ -42,9 +41,10 @@ const token = [ "EBC1F95B42459D9F27E2025E11E1F7C6", "05FE7C8117A8CF6FA8BAD56C6E776CD7", "7C54AE28BAEDCBB8C927768AE71CA0EF", - "3B864BF96848A44E170A26D2791E0AE3", "809569E3816B2C76210BFF8DB3F2766E", "3B864BF96848A44E170A26D2791E0AE3", + "0CB602BF5179A3A4670621F3F83C494E", + "174F67A03DD7EF31096C0F35EFF45702", "85B78F013645D1EC53D5F3974528654A" ]