From 79aacbba363c0f7af35a117ff4abb52f5cefa6c7 Mon Sep 17 00:00:00 2001 From: DoveBoy <393366046@qq.com> Date: Fri, 1 Jan 2021 17:20:43 +0800 Subject: [PATCH 01/30] =?UTF-8?q?=E8=BF=81=E7=A7=BB=E8=BF=87=E6=9C=9F?= =?UTF-8?q?=E7=9A=84=E6=B4=BB=E5=8A=A8=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 迁移过期的活动脚本 --- jd_jdh.js => activity/jd_jdh.js | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename jd_jdh.js => activity/jd_jdh.js (100%) diff --git a/jd_jdh.js b/activity/jd_jdh.js similarity index 100% rename from jd_jdh.js rename to activity/jd_jdh.js From f93cef05aafa06f0bf27e5d77a9ccfeeae4bf9f4 Mon Sep 17 00:00:00 2001 From: DoveBoy <393366046@qq.com> Date: Fri, 1 Jan 2021 17:21:33 +0800 Subject: [PATCH 02/30] =?UTF-8?q?=E8=BF=81=E7=A7=BB=E8=BF=87=E6=9C=9F?= =?UTF-8?q?=E7=9A=84=E6=B4=BB=E5=8A=A8=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 迁移过期的活动脚本 --- jd_live_redrain.js => activity/jd_live_redrain.js | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename jd_live_redrain.js => activity/jd_live_redrain.js (100%) diff --git a/jd_live_redrain.js b/activity/jd_live_redrain.js similarity index 100% rename from jd_live_redrain.js rename to activity/jd_live_redrain.js From 63fd6a8547226e848098c417e7cffe49849398dd Mon Sep 17 00:00:00 2001 From: DoveBoy <393366046@qq.com> Date: Fri, 1 Jan 2021 17:21:58 +0800 Subject: [PATCH 03/30] =?UTF-8?q?=E8=BF=81=E7=A7=BB=E8=BF=87=E6=9C=9F?= =?UTF-8?q?=E7=9A=84=E6=B4=BB=E5=8A=A8=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 迁移过期的活动脚本 --- jd_ms_redrain.js => activity/jd_ms_redrain.js | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename jd_ms_redrain.js => activity/jd_ms_redrain.js (100%) diff --git a/jd_ms_redrain.js b/activity/jd_ms_redrain.js similarity index 100% rename from jd_ms_redrain.js rename to activity/jd_ms_redrain.js From c92b67c00cb0b526a377439bb86b0ca4aa0a326e Mon Sep 17 00:00:00 2001 From: DoveBoy <393366046@qq.com> Date: Fri, 1 Jan 2021 17:22:22 +0800 Subject: [PATCH 04/30] =?UTF-8?q?=E8=BF=81=E7=A7=BB=E8=BF=87=E6=9C=9F?= =?UTF-8?q?=E7=9A=84=E6=B4=BB=E5=8A=A8=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 迁移过期的活动脚本 --- jd_watch.js => activity/jd_watch.js | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename jd_watch.js => activity/jd_watch.js (100%) diff --git a/jd_watch.js b/activity/jd_watch.js similarity index 100% rename from jd_watch.js rename to activity/jd_watch.js From bb81326d3e1cdfa810251e9eafa14fdad31477e2 Mon Sep 17 00:00:00 2001 From: DoveBoy <393366046@qq.com> Date: Fri, 1 Jan 2021 17:22:45 +0800 Subject: [PATCH 05/30] =?UTF-8?q?=E8=BF=81=E7=A7=BB=E8=BF=87=E6=9C=9F?= =?UTF-8?q?=E7=9A=84=E6=B4=BB=E5=8A=A8=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 迁移过期的活动脚本 --- jr_sign.js => activity/jr_sign.js | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename jr_sign.js => activity/jr_sign.js (100%) diff --git a/jr_sign.js b/activity/jr_sign.js similarity index 100% rename from jr_sign.js rename to activity/jr_sign.js From 4329038d0f38b15599ebc4aa2f7cf7dc18e6070a Mon Sep 17 00:00:00 2001 From: sxx1314 <8444252+sxx1314@users.noreply.github.com> Date: Tue, 5 Jan 2021 00:53:50 +0800 Subject: [PATCH 06/30] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BC=81=E4=B8=9A?= =?UTF-8?q?=E5=BE=AE=E4=BF=A1=20=E5=BA=94=E7=94=A8=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E6=96=87=E7=AB=A0=E4=B8=AD=E7=9A=84=E6=8D=A2=E8=A1=8C=E7=BC=BA?= =?UTF-8?q?=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修复企业微信 应用消息图文消息推送中换行缺失的问题 - 简单的替换了换行符,以后可以按照需求增加css等样式。 - 更换了图片id的issues说明链接 --- sendNotify.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sendNotify.js b/sendNotify.js index 262e5e97..e32a197b 100644 --- a/sendNotify.js +++ b/sendNotify.js @@ -49,7 +49,7 @@ let DD_BOT_SECRET = ''; let QYWX_KEY = ''; // =======================================企业微信应用消息通知设置区域=========================================== -//此处填你企业微信应用消息的 值(详见文档 https://work.weixin.qq.com/api/doc/90000/90135/90236),依次填上corpid的值,corpsecret的值,touser的值,agentid的值,素材库图片id(见https://work.weixin.qq.com/api/doc/90000/90135/90253) 注意用,号隔开,例如:wwcff56746d9adwers,B-791548lnzXBE6_BWfxdf3kSTMJr9vFEPKAbh6WERQ,mingcheng,1000001,2COXgjH2UIfERF2zxrtUOKgQ9XklUqMdGSWLBoW_lSDAdafat +//此处填你企业微信应用消息的 值(详见文档 https://work.weixin.qq.com/api/doc/90000/90135/90236),依次填上corpid的值,corpsecret的值,touser的值,agentid的值,素材库图片id(见https://github.com/lxk0301/jd_scripts/issues/519) 注意用,号隔开,例如:wwcff56746d9adwers,B-791548lnzXBE6_BWfxdf3kSTMJr9vFEPKAbh6WERQ,mingcheng,1000001,2COXgjH2UIfERF2zxrtUOKgQ9XklUqMdGSWLBoW_lSDAdafat //注:此处设置github action用户填写到Settings-Secrets里面(Name输入QYWX_AM) let QYWX_AM = ''; @@ -430,7 +430,8 @@ function qywxamNotify(text, desp) { 'Content-Type': 'application/json', }, }; - $.post(options_accesstoken, (err, resp, data) => { + $.post(options_accesstoken, (err, resp, data) => { + html=desp.replace(/\n/g,"
") var json = JSON.parse(data); accesstoken = json.access_token; const options = { @@ -446,7 +447,7 @@ function qywxamNotify(text, desp) { thumb_media_id: `${QYWX_AM_AY[4]}`, author : `智能助手` , content_source_url: ``, - content : `${desp}`, //暂时直接设置成了desp + content : `${html}`, digest: `${desp}` } ] From 809552726d5c639591c24517f601f1ac47e507c7 Mon Sep 17 00:00:00 2001 From: lxk0301 <778732665@qq.com> Date: Tue, 5 Jan 2021 09:20:26 +0800 Subject: [PATCH 07/30] update jdCookie.js --- jdCookie.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jdCookie.js b/jdCookie.js index f24b3983..0dcadb23 100644 --- a/jdCookie.js +++ b/jdCookie.js @@ -24,5 +24,5 @@ console.log(`\n====================共有${CookieJDs.length}个京东账号Cooki console.log(`==================脚本执行- 北京时间(UTC+8):${new Date(new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000).toLocaleString()}=====================\n`) for (let i = 0; i < CookieJDs.length; i++) { const index = (i + 1 === 1) ? '' : (i + 1); - exports['CookieJD' + index] = CookieJDs[i]; + exports['CookieJD' + index] = CookieJDs[i].trim(); } From ded398be6aee3456d2b327a8aa42b56e5ed011b4 Mon Sep 17 00:00:00 2001 From: lxk0301 <778732665@qq.com> Date: Tue, 5 Jan 2021 09:39:24 +0800 Subject: [PATCH 08/30] =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E8=BF=87=E6=9C=9F?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=EF=BC=8C=E8=BF=81=E7=A7=BBtencentscf.md?= =?UTF-8?q?=E5=88=B0=E5=88=AB=E7=9A=84=E6=96=87=E4=BB=B6=E5=A4=B9=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 +- jd_ds.js => activity/jd_ds.js | 0 backUp/tencentscf.md | 128 ++++++++++++++++++++++++++++++++++ jd_fruit.js | 40 ++++++----- 4 files changed, 152 insertions(+), 20 deletions(-) rename jd_ds.js => activity/jd_ds.js (100%) create mode 100644 backUp/tencentscf.md diff --git a/README.md b/README.md index 8783d737..005764d5 100644 --- a/README.md +++ b/README.md @@ -85,9 +85,9 @@ ### 方法二:云服务器、腾讯云函数等等 - 需自行有云服务器,云函数等 - - 腾讯云云函数 [快速部署教程](tencentscf.md)(免费) + - 腾讯云云函数 [快速部署教程](../tencentscf.md)(免费) - 腾讯云云函数控制台使用 [教程说明](iCloud.md) - - 腾讯云云函数 [GitHub Action部署教程](tencentscf.md#github-action-部署) + - 腾讯云云函数 [GitHub Action部署教程](../tencentscf.md#github-action-部署) ### 方法三:Docker(NAS或VPS用户) diff --git a/jd_ds.js b/activity/jd_ds.js similarity index 100% rename from jd_ds.js rename to activity/jd_ds.js diff --git a/backUp/tencentscf.md b/backUp/tencentscf.md new file mode 100644 index 00000000..30c04ca2 --- /dev/null +++ b/backUp/tencentscf.md @@ -0,0 +1,128 @@ + +# 云函数快速部署京东脚本 +> +> - 本地安装依赖使用serverless部署,[点这里](tencentscf.md#1-安装-nodejs-环境) +> - Github Action 部署[点这里](tencentscf.md#github-action-部署) + +## 1. 安装 Node.js 环境 + +Node.js 环境 [下载地址](https://nodejs.org/zh-tw/download/) ,根据自己的操作系统下载和安装。 + +## 2. 下载代码 + +点击红框处下载压缩包 +![下载代码](https://imgbed-bucket-1251971143.cos.ap-guangzhou.myqcloud.com/1605497672397-zip.png) + +## 3. 安装依赖,配置 cookie + +### 3.1 安装依赖 + +压缩包解压后进入项目文件夹 + +- Windows 用户按住 **shift** 点击右键,点击 **在此处打开命令窗口** +- Mac 用户通过终端,自行进入该文件夹 + +在命令行内输入 `npm i `,等待运行完成。 + +此时,项目文件夹内会多出一个 `node_modules`文件夹 + +### 3.2 配置 cookie + +打开项目文件内的 `jdCookie.js` + +在最上面的 `CookieJDs`里写入 cookie ,多个账号以逗号分隔 + +例如 + +```javascript +let CookieJDs = [ + 'pt_key=xxx;pt_pin=xxx;', + 'pt_key=zzz;pt_pin=zzz;', + 'pt_key=aaa;pt_pin=xxxaaa' +] +``` + +> 注:获取京东 cookie 教程参考 [浏览器获取京东cookie教程](https://github.com/lxk0301/jd_scripts/blob/master/backUp/GetJdCookie.md) , [插件获取京东cookie教程](https://github.com/lxk0301/jd_scripts/blob/master/backUp/GetJdCookie2.md) + + +## 4. 部署到云函数 + +### 4.1 开通服务 + +依次登录 [SCF 云函数控制台](https://console.cloud.tencent.com/scf) 和 [SLS 控制台](https://console.cloud.tencent.com/sls) 开通相关服务,确保账户下已开通服务并创建相应[服务角色](https://console.cloud.tencent.com/cam/role) **SCF_QcsRole、SLS_QcsRole** + +> 注意!为了确保权限足够,获取这两个参数时不要使用子账户!此外,腾讯云账户需要[实名认证](https://console.cloud.tencent.com/developer/auth)。 + +### 4.2 工具部署 + +下载 Serverless 工具,快速部署函数 +``` +npm install -g serverless +``` + +执行部署命令 +``` +serverless deploy +``` + +如果已经配置了永久秘钥,则可以直接部署,如果没有,可以直接**微信扫码**登录腾讯云,并且授权部署。 + +过几秒后,查看输出,可以看到函数和定时触发器都已经配置完成。 +``` +serverless ⚡framework +Action: "deploy" - Stage: "dev" - App: "jdscript" - Instance: "jdscript" + +functionName: scf-jdscript +description: This is a function in jdscript application. +namespace: default +runtime: Nodejs12.16 +handler: index.main_handler +memorySize: 64 +lastVersion: $LATEST +traffic: 1 +triggers: + timer: + - timer-jdscript-dev + +36s › jdscript › Success +``` + +## 5. 查看和测试 + +登录后,在 [腾讯云函数地址](https://console.cloud.tencent.com/scf/index) 点击管理控制台,查看最新部署的函数。 + +在左侧栏的日志查询中,可以查看到触发的日志,包括是否打卡成功等。 + +![测试函数](https://user-images.githubusercontent.com/6993269/99628053-5a9eea80-2a70-11eb-906f-f1d5ea2bfa3a.png) + +> 如果需要配置永久秘钥,则可以在[访问秘钥页面](https://console.cloud.tencent.com/cam/capi)获取账号的 TENCENT_SECRET_ID,TENCENT_SECRET_KEY,并配置在代码根目录 .env 文件中。 + + +# Github Action 部署 +## 1. 开通服务 + +依次登录 [SCF 云函数控制台](https://console.cloud.tencent.com/scf) 和 [SLS 控制台](https://console.cloud.tencent.com/sls) 开通相关服务,确保账户下已开通服务并创建相应[服务角色](https://console.cloud.tencent.com/cam/role) **SCF_QcsRole、SLS_QcsRole** + +> 注意!为了确保权限足够,获取这两个参数时不要使用子账户!此外,腾讯云账户需要[实名认证](https://console.cloud.tencent.com/developer/auth)。 + +## 2. 在这里新建一个访问密钥[新建密钥](https://console.cloud.tencent.com/cam/capi) +> 将SecretId和SecretKey分别配置在仓库的secrets变量里面, TENCENT_SECRET_ID对应你的SecretId的值,TENCENT_SECRET_KEY对应你的SecretKey的值 + +## 3. 配置自己需要secrets变量[参考这里](githubAction.md#下方提供使用到的-secrets全集合) +### __重要的说三遍__ +### 如果涉及一个变量配置多个值,如多个cookie,多个取消订阅关键字,去掉里面的 *__[空格]()__* 和 __*[换行]()*__ 使用 `&` 连接 +### 如果涉及一个变量配置多个值,如多个cookie,多个取消订阅关键字,去掉里面的 *__[空格]()__* 和 __*[换行]()*__ 使用 `&` 连接 +### 如果涉及一个变量配置多个值,如多个cookie,多个取消订阅关键字,去掉里面的 *__[空格]()__* 和 __*[换行]()*__ 使用 `&` 连接 +> 排查问题第一步先看自己[腾讯云函数](https://console.cloud.tencent.com/scf/list-detail?rid=5&ns=default&id=scf-jdscript)那边的环境变量跟自己在仓库配置的 `secrets` 是否一致 +![image](https://user-images.githubusercontent.com/6993269/99937191-06617680-2da0-11eb-99ea-033f2c655683.png) + + +## 4.执行action workflow进行部署,workflow未报错即部署成功 +![image](https://user-images.githubusercontent.com/6993269/99513289-6a152980-29c5-11eb-9266-3f56ba13d3b2.png) +## 5. 查看和测试 +登录后,在 [腾讯云函数地址](https://console.cloud.tencent.com/scf/index) 点击管理控制台,查看最新部署的函数。 + +在左侧栏的日志查询中,可以查看到触发的日志,包括是否打卡成功等。 + +![测试函数](https://user-images.githubusercontent.com/6993269/99628053-5a9eea80-2a70-11eb-906f-f1d5ea2bfa3a.png) +## 6. 设置触发器[看这里](iCloud.md#5设置触发器) 或者看这里的[注释说明](https://github.com/iouAkira/jd_scripts/blob/patch-1/index.js#L4) diff --git a/jd_fruit.js b/jd_fruit.js index 2cb8ec94..327e97f3 100644 --- a/jd_fruit.js +++ b/jd_fruit.js @@ -1,6 +1,6 @@ /* 东东水果:脚本更新地址 https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_fruit.js -更新时间:2020-12-25 +更新时间:2021-1-5 东东农场活动链接:https://h5.m.jd.com/babelDiy/Zeus/3KSjXqQabiTuD1cJ28QskrpWoBKT/index.html 已支持IOS双京东账号,Node.js支持N个京东账号 脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js @@ -29,9 +29,9 @@ let cookiesArr = [], cookie = '', jdFruitShareArr = [], isBox = false, notify, n //下面给出两个账号的填写示例(iOS只支持2个京东账号) let shareCodes = [ // 这个列表填入你要助力的好友的shareCode //账号一的好友shareCode,不同好友的shareCode中间用@符号隔开 - '0a74407df5df4fa99672a037eec61f7e@dbb21614667246fabcfd9685b6f448f3@6fbd26cc27ac44d6a7fed34092453f77@61ff5c624949454aa88561f2cd721bf6@56db8e7bc5874668ba7d5195230d067a', + '0a74407df5df4fa99672a037eec61f7e@dbb21614667246fabcfd9685b6f448f3@6fbd26cc27ac44d6a7fed34092453f77@61ff5c624949454aa88561f2cd721bf6@56db8e7bc5874668ba7d5195230d067a@', //账号二的好友shareCode,不同好友的shareCode中间用@符号隔开 - 'b1638a774d054a05a30a17d3b4d364b8@f92cb56c6a1349f5a35f0372aa041ea0@9c52670d52ad4e1a812f894563c746ea@8175509d82504e96828afc8b1bbb9cb3', + 'b1638a774d054a05a30a17d3b4d364b8@f92cb56c6a1349f5a35f0372aa041ea0@9c52670d52ad4e1a812f894563c746ea@8175509d82504e96828afc8b1bbb9cb3@2673c3777d4443829b2a635059953a28', ] let message = '', subTitle = '', option = {}, isFruitFinished = false; const retainWater = 100;//保留水滴大于多少g,默认100g; @@ -771,24 +771,28 @@ async function clockInIn() { // async function getAwardInviteFriend() { await friendListInitForFarm();//查询好友列表 - console.log(`\n今日已邀请好友${$.friendList.inviteFriendCount}个 / 每日邀请上限${$.friendList.inviteFriendMax}个`); - console.log(`开始删除${$.friendList.friends.length}个好友,可拿每天的邀请奖励`); - for (let friend of $.friendList.friends) { - console.log(`\n开始删除好友 [${friend.shareCode}]`); - const deleteFriendForFarm = await request('deleteFriendForFarm', { "shareCode": `${friend.shareCode}`,"version":8,"channel":1 }); - if (deleteFriendForFarm && deleteFriendForFarm.code === '0') { - console.log(`删除好友 [${friend.shareCode}] 成功\n`); + if ($.friendList) { + console.log(`\n今日已邀请好友${$.friendList.inviteFriendCount}个 / 每日邀请上限${$.friendList.inviteFriendMax}个`); + console.log(`开始删除${$.friendList.friends.length}个好友,可拿每天的邀请奖励`); + for (let friend of $.friendList.friends) { + console.log(`\n开始删除好友 [${friend.shareCode}]`); + const deleteFriendForFarm = await request('deleteFriendForFarm', { "shareCode": `${friend.shareCode}`,"version":8,"channel":1 }); + if (deleteFriendForFarm && deleteFriendForFarm.code === '0') { + console.log(`删除好友 [${friend.shareCode}] 成功\n`); + } } - } - await receiveFriendInvite();//为他人助力,接受邀请成为别人的好友 - if ($.friendList.inviteFriendCount > 0) { - if ($.friendList.inviteFriendCount > $.friendList.inviteFriendGotAwardCount) { - console.log('开始领取邀请好友的奖励'); - await awardInviteFriendForFarm(); - console.log(`领取邀请好友的奖励结果::${JSON.stringify($.awardInviteFriendRes)}`); + await receiveFriendInvite();//为他人助力,接受邀请成为别人的好友 + if ($.friendList.inviteFriendCount > 0) { + if ($.friendList.inviteFriendCount > $.friendList.inviteFriendGotAwardCount) { + console.log('开始领取邀请好友的奖励'); + await awardInviteFriendForFarm(); + console.log(`领取邀请好友的奖励结果::${JSON.stringify($.awardInviteFriendRes)}`); + } + } else { + console.log('今日未邀请过好友') } } else { - console.log('今日未邀请过好友') + console.log(`查询好友列表失败\n`); } } //给好友浇水 From 15aa04ba57a2f3774b32713aef0640ec7587c22a Mon Sep 17 00:00:00 2001 From: lxk0301 <778732665@qq.com> Date: Tue, 5 Jan 2021 09:41:24 +0800 Subject: [PATCH 09/30] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 005764d5..4290e747 100644 --- a/README.md +++ b/README.md @@ -85,9 +85,9 @@ ### 方法二:云服务器、腾讯云函数等等 - 需自行有云服务器,云函数等 - - 腾讯云云函数 [快速部署教程](../tencentscf.md)(免费) + - 腾讯云云函数 [快速部署教程](./backUp/tencentscf.md)(免费) - 腾讯云云函数控制台使用 [教程说明](iCloud.md) - - 腾讯云云函数 [GitHub Action部署教程](../tencentscf.md#github-action-部署) + - 腾讯云云函数 [GitHub Action部署教程](./backUp/tencentscf.md#github-action-部署) ### 方法三:Docker(NAS或VPS用户) From d5250cca9ccad67bdbbc0fa636684eaa355e39b6 Mon Sep 17 00:00:00 2001 From: lxk0301 <778732665@qq.com> Date: Tue, 5 Jan 2021 10:00:14 +0800 Subject: [PATCH 10/30] update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4290e747..5c424359 100644 --- a/README.md +++ b/README.md @@ -107,7 +107,7 @@ ### 方法四:iOS系统的代理软件(QuantumultX, Surge, Loon, 小火箭) -#### [京东cookie获取脚本](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/JD_extra_cookie.js) + - [京东cookie获取脚本 JD_extra_cookie.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/JD_extra_cookie.js) ### 赞赏码(开发维护不易,请赏杯茶水费)
From 178a74eb33bfd92566bc55313e6eeedc8542cf2f Mon Sep 17 00:00:00 2001 From: lxk0301 <778732665@qq.com> Date: Tue, 5 Jan 2021 10:05:56 +0800 Subject: [PATCH 11/30] =?UTF-8?q?=E8=BF=81=E7=A7=BB=20iCloud.md=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- iCloud.md => backUp/iCloud.md | 10 +++++----- backUp/tencentscf.md | 2 +- tencentscf.md | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) rename iCloud.md => backUp/iCloud.md (98%) diff --git a/README.md b/README.md index 5c424359..682c55cb 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,7 @@ - 需自行有云服务器,云函数等 - 腾讯云云函数 [快速部署教程](./backUp/tencentscf.md)(免费) - - 腾讯云云函数控制台使用 [教程说明](iCloud.md) + - 腾讯云云函数控制台使用 [教程说明](./backUp/iCloud.md) - 腾讯云云函数 [GitHub Action部署教程](./backUp/tencentscf.md#github-action-部署) diff --git a/iCloud.md b/backUp/iCloud.md similarity index 98% rename from iCloud.md rename to backUp/iCloud.md index 9eb86134..22696205 100644 --- a/iCloud.md +++ b/backUp/iCloud.md @@ -108,21 +108,21 @@ let CookieJDs = [ 单击左侧导航栏**函数服务**,进入“函数服务”页面。 在页面上方选择一个地域,最好选择离你常用地区近点的,不至于导致账号异常。单击**新建**。如下图所示: -![iCloud1](./icon/iCloud1.png) +![iCloud1](../icon/iCloud1.png) 在“新建函数”页面填写函数基础信息,单击**下一步**。如下图所示: -![iCloud2](./icon/iCloud2.png) +![iCloud2](../icon/iCloud2.png) **函数名称**:可以自定义,比如为jd。
**运行环境**:选择 “Nodejs 12.16”。
**创建方式**:选择 “空白函数”。 确保环境为Nodejs 12.16,执行方法改为:index.main_handler,提交方式建议选本地文件夹,然后从GitHub项目克隆Zip压缩包,解压成文件夹,然后点击这个上传把文件夹上传进来(记得node_modules文件夹一并上传或者将node_modules文件夹上传到“层”,之后选择“函数管理”-“层管理”绑定上传好的层),完了后点击下面的高级设置。 -![iCloud3](./icon/iCloud3.png) +![iCloud3](../icon/iCloud3.png) 内存用不了太大,64MB就够了(64M内存,免费时长6,400,000秒,内存与免费时长大致关系可以参看云函数官方说明),超时时间改为最大的900秒,然后点击最下面的完成。 -![iCloud4](./icon/iCloud4.png) +![iCloud4](../icon/iCloud4.png) ## 5.设置触发器 @@ -136,7 +136,7 @@ let CookieJDs = [ 创建触发器 -![iCloud6](./icon/iCloud6.png) +![iCloud6](../icon/iCloud6.png) 触发方式默认“**定时触发**”,定时任务名称随便起个名字,触发周期根据自己需要自行设置。 diff --git a/backUp/tencentscf.md b/backUp/tencentscf.md index 30c04ca2..eb31e499 100644 --- a/backUp/tencentscf.md +++ b/backUp/tencentscf.md @@ -125,4 +125,4 @@ triggers: 在左侧栏的日志查询中,可以查看到触发的日志,包括是否打卡成功等。 ![测试函数](https://user-images.githubusercontent.com/6993269/99628053-5a9eea80-2a70-11eb-906f-f1d5ea2bfa3a.png) -## 6. 设置触发器[看这里](iCloud.md#5设置触发器) 或者看这里的[注释说明](https://github.com/iouAkira/jd_scripts/blob/patch-1/index.js#L4) +## 6. 设置触发器[看这里](./backUp/iCloud.md#5设置触发器) 或者看这里的[注释说明](https://github.com/iouAkira/jd_scripts/blob/patch-1/index.js#L4) diff --git a/tencentscf.md b/tencentscf.md index 30c04ca2..eb31e499 100644 --- a/tencentscf.md +++ b/tencentscf.md @@ -125,4 +125,4 @@ triggers: 在左侧栏的日志查询中,可以查看到触发的日志,包括是否打卡成功等。 ![测试函数](https://user-images.githubusercontent.com/6993269/99628053-5a9eea80-2a70-11eb-906f-f1d5ea2bfa3a.png) -## 6. 设置触发器[看这里](iCloud.md#5设置触发器) 或者看这里的[注释说明](https://github.com/iouAkira/jd_scripts/blob/patch-1/index.js#L4) +## 6. 设置触发器[看这里](./backUp/iCloud.md#5设置触发器) 或者看这里的[注释说明](https://github.com/iouAkira/jd_scripts/blob/patch-1/index.js#L4) From bfbb04a7ab24346b1ad4cf25e55c044fb1417945 Mon Sep 17 00:00:00 2001 From: lxk0301 <778732665@qq.com> Date: Tue, 5 Jan 2021 10:08:18 +0800 Subject: [PATCH 12/30] fix --- backUp/tencentscf.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backUp/tencentscf.md b/backUp/tencentscf.md index eb31e499..30c04ca2 100644 --- a/backUp/tencentscf.md +++ b/backUp/tencentscf.md @@ -125,4 +125,4 @@ triggers: 在左侧栏的日志查询中,可以查看到触发的日志,包括是否打卡成功等。 ![测试函数](https://user-images.githubusercontent.com/6993269/99628053-5a9eea80-2a70-11eb-906f-f1d5ea2bfa3a.png) -## 6. 设置触发器[看这里](./backUp/iCloud.md#5设置触发器) 或者看这里的[注释说明](https://github.com/iouAkira/jd_scripts/blob/patch-1/index.js#L4) +## 6. 设置触发器[看这里](iCloud.md#5设置触发器) 或者看这里的[注释说明](https://github.com/iouAkira/jd_scripts/blob/patch-1/index.js#L4) From 91a5e94d36150b38ded23a359949e6a3d7fdea30 Mon Sep 17 00:00:00 2001 From: lxk0301 <778732665@qq.com> Date: Tue, 5 Jan 2021 10:27:22 +0800 Subject: [PATCH 13/30] delete --- tencentscf.md | 128 -------------------------------------------------- 1 file changed, 128 deletions(-) delete mode 100644 tencentscf.md diff --git a/tencentscf.md b/tencentscf.md deleted file mode 100644 index eb31e499..00000000 --- a/tencentscf.md +++ /dev/null @@ -1,128 +0,0 @@ - -# 云函数快速部署京东脚本 -> -> - 本地安装依赖使用serverless部署,[点这里](tencentscf.md#1-安装-nodejs-环境) -> - Github Action 部署[点这里](tencentscf.md#github-action-部署) - -## 1. 安装 Node.js 环境 - -Node.js 环境 [下载地址](https://nodejs.org/zh-tw/download/) ,根据自己的操作系统下载和安装。 - -## 2. 下载代码 - -点击红框处下载压缩包 -![下载代码](https://imgbed-bucket-1251971143.cos.ap-guangzhou.myqcloud.com/1605497672397-zip.png) - -## 3. 安装依赖,配置 cookie - -### 3.1 安装依赖 - -压缩包解压后进入项目文件夹 - -- Windows 用户按住 **shift** 点击右键,点击 **在此处打开命令窗口** -- Mac 用户通过终端,自行进入该文件夹 - -在命令行内输入 `npm i `,等待运行完成。 - -此时,项目文件夹内会多出一个 `node_modules`文件夹 - -### 3.2 配置 cookie - -打开项目文件内的 `jdCookie.js` - -在最上面的 `CookieJDs`里写入 cookie ,多个账号以逗号分隔 - -例如 - -```javascript -let CookieJDs = [ - 'pt_key=xxx;pt_pin=xxx;', - 'pt_key=zzz;pt_pin=zzz;', - 'pt_key=aaa;pt_pin=xxxaaa' -] -``` - -> 注:获取京东 cookie 教程参考 [浏览器获取京东cookie教程](https://github.com/lxk0301/jd_scripts/blob/master/backUp/GetJdCookie.md) , [插件获取京东cookie教程](https://github.com/lxk0301/jd_scripts/blob/master/backUp/GetJdCookie2.md) - - -## 4. 部署到云函数 - -### 4.1 开通服务 - -依次登录 [SCF 云函数控制台](https://console.cloud.tencent.com/scf) 和 [SLS 控制台](https://console.cloud.tencent.com/sls) 开通相关服务,确保账户下已开通服务并创建相应[服务角色](https://console.cloud.tencent.com/cam/role) **SCF_QcsRole、SLS_QcsRole** - -> 注意!为了确保权限足够,获取这两个参数时不要使用子账户!此外,腾讯云账户需要[实名认证](https://console.cloud.tencent.com/developer/auth)。 - -### 4.2 工具部署 - -下载 Serverless 工具,快速部署函数 -``` -npm install -g serverless -``` - -执行部署命令 -``` -serverless deploy -``` - -如果已经配置了永久秘钥,则可以直接部署,如果没有,可以直接**微信扫码**登录腾讯云,并且授权部署。 - -过几秒后,查看输出,可以看到函数和定时触发器都已经配置完成。 -``` -serverless ⚡framework -Action: "deploy" - Stage: "dev" - App: "jdscript" - Instance: "jdscript" - -functionName: scf-jdscript -description: This is a function in jdscript application. -namespace: default -runtime: Nodejs12.16 -handler: index.main_handler -memorySize: 64 -lastVersion: $LATEST -traffic: 1 -triggers: - timer: - - timer-jdscript-dev - -36s › jdscript › Success -``` - -## 5. 查看和测试 - -登录后,在 [腾讯云函数地址](https://console.cloud.tencent.com/scf/index) 点击管理控制台,查看最新部署的函数。 - -在左侧栏的日志查询中,可以查看到触发的日志,包括是否打卡成功等。 - -![测试函数](https://user-images.githubusercontent.com/6993269/99628053-5a9eea80-2a70-11eb-906f-f1d5ea2bfa3a.png) - -> 如果需要配置永久秘钥,则可以在[访问秘钥页面](https://console.cloud.tencent.com/cam/capi)获取账号的 TENCENT_SECRET_ID,TENCENT_SECRET_KEY,并配置在代码根目录 .env 文件中。 - - -# Github Action 部署 -## 1. 开通服务 - -依次登录 [SCF 云函数控制台](https://console.cloud.tencent.com/scf) 和 [SLS 控制台](https://console.cloud.tencent.com/sls) 开通相关服务,确保账户下已开通服务并创建相应[服务角色](https://console.cloud.tencent.com/cam/role) **SCF_QcsRole、SLS_QcsRole** - -> 注意!为了确保权限足够,获取这两个参数时不要使用子账户!此外,腾讯云账户需要[实名认证](https://console.cloud.tencent.com/developer/auth)。 - -## 2. 在这里新建一个访问密钥[新建密钥](https://console.cloud.tencent.com/cam/capi) -> 将SecretId和SecretKey分别配置在仓库的secrets变量里面, TENCENT_SECRET_ID对应你的SecretId的值,TENCENT_SECRET_KEY对应你的SecretKey的值 - -## 3. 配置自己需要secrets变量[参考这里](githubAction.md#下方提供使用到的-secrets全集合) -### __重要的说三遍__ -### 如果涉及一个变量配置多个值,如多个cookie,多个取消订阅关键字,去掉里面的 *__[空格]()__* 和 __*[换行]()*__ 使用 `&` 连接 -### 如果涉及一个变量配置多个值,如多个cookie,多个取消订阅关键字,去掉里面的 *__[空格]()__* 和 __*[换行]()*__ 使用 `&` 连接 -### 如果涉及一个变量配置多个值,如多个cookie,多个取消订阅关键字,去掉里面的 *__[空格]()__* 和 __*[换行]()*__ 使用 `&` 连接 -> 排查问题第一步先看自己[腾讯云函数](https://console.cloud.tencent.com/scf/list-detail?rid=5&ns=default&id=scf-jdscript)那边的环境变量跟自己在仓库配置的 `secrets` 是否一致 -![image](https://user-images.githubusercontent.com/6993269/99937191-06617680-2da0-11eb-99ea-033f2c655683.png) - - -## 4.执行action workflow进行部署,workflow未报错即部署成功 -![image](https://user-images.githubusercontent.com/6993269/99513289-6a152980-29c5-11eb-9266-3f56ba13d3b2.png) -## 5. 查看和测试 -登录后,在 [腾讯云函数地址](https://console.cloud.tencent.com/scf/index) 点击管理控制台,查看最新部署的函数。 - -在左侧栏的日志查询中,可以查看到触发的日志,包括是否打卡成功等。 - -![测试函数](https://user-images.githubusercontent.com/6993269/99628053-5a9eea80-2a70-11eb-906f-f1d5ea2bfa3a.png) -## 6. 设置触发器[看这里](./backUp/iCloud.md#5设置触发器) 或者看这里的[注释说明](https://github.com/iouAkira/jd_scripts/blob/patch-1/index.js#L4) From bb1b30aaf9196214d89279631d631b94120700e5 Mon Sep 17 00:00:00 2001 From: lxk0301 <778732665@qq.com> Date: Tue, 5 Jan 2021 12:44:30 +0800 Subject: [PATCH 14/30] =?UTF-8?q?=E4=B8=9C=E4=B8=9C=E5=86=9C=E5=9C=BA?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0log=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jd_fruit.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/jd_fruit.js b/jd_fruit.js index 327e97f3..0b4b3ba2 100644 --- a/jd_fruit.js +++ b/jd_fruit.js @@ -771,14 +771,17 @@ async function clockInIn() { // async function getAwardInviteFriend() { await friendListInitForFarm();//查询好友列表 + console.log(`查询好友列表数据:${JSON.stringify($.friendList)}\n`) if ($.friendList) { console.log(`\n今日已邀请好友${$.friendList.inviteFriendCount}个 / 每日邀请上限${$.friendList.inviteFriendMax}个`); - console.log(`开始删除${$.friendList.friends.length}个好友,可拿每天的邀请奖励`); - for (let friend of $.friendList.friends) { - console.log(`\n开始删除好友 [${friend.shareCode}]`); - const deleteFriendForFarm = await request('deleteFriendForFarm', { "shareCode": `${friend.shareCode}`,"version":8,"channel":1 }); - if (deleteFriendForFarm && deleteFriendForFarm.code === '0') { - console.log(`删除好友 [${friend.shareCode}] 成功\n`); + console.log(`开始删除${$.friendList.friends && $.friendList.friends.length}个好友,可拿每天的邀请奖励`); + if ($.friendList.friends && $.friendList.friends.length > 0) { + for (let friend of $.friendList.friends) { + console.log(`\n开始删除好友 [${friend.shareCode}]`); + const deleteFriendForFarm = await request('deleteFriendForFarm', { "shareCode": `${friend.shareCode}`,"version":8,"channel":1 }); + if (deleteFriendForFarm && deleteFriendForFarm.code === '0') { + console.log(`删除好友 [${friend.shareCode}] 成功\n`); + } } } await receiveFriendInvite();//为他人助力,接受邀请成为别人的好友 From 4516f0a4fd615caa611acf463822636c8cccb895 Mon Sep 17 00:00:00 2001 From: lxk0301 <778732665@qq.com> Date: Tue, 5 Jan 2021 15:19:15 +0800 Subject: [PATCH 15/30] debug --- jd_bean_sign.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jd_bean_sign.js b/jd_bean_sign.js index fb3fee0e..5ab774c7 100644 --- a/jd_bean_sign.js +++ b/jd_bean_sign.js @@ -131,7 +131,7 @@ async function downFile () { async function changeFile (content) { console.log(`开始替换变量`) let newContent = content.replace(/var Key = ''/, `var Key = '${cookie}'`); - newContent = newContent.replace(/const NodeSet = 'CookieSet.json'/, `const NodeSet = '${NodeSet}'`) + // newContent = newContent.replace(/const NodeSet = 'CookieSet.json'/, `const NodeSet = '${NodeSet}'`) if (process.env.JD_BEAN_STOP && process.env.JD_BEAN_STOP !== '0') { newContent = newContent.replace(/var stop = 0/, `var stop = ${process.env.JD_BEAN_STOP * 1}`); } From 7f10a966c5b2cea381c662e2e8a8ac44da7696cc Mon Sep 17 00:00:00 2001 From: lxk0301 <778732665@qq.com> Date: Tue, 5 Jan 2021 17:39:33 +0800 Subject: [PATCH 16/30] =?UTF-8?q?=E6=94=B9=E4=B8=BAPromise.all?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jd_bean_sign.js | 2 +- sendNotify.js | 24 ++++++++++++++---------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/jd_bean_sign.js b/jd_bean_sign.js index 5ab774c7..fb3fee0e 100644 --- a/jd_bean_sign.js +++ b/jd_bean_sign.js @@ -131,7 +131,7 @@ async function downFile () { async function changeFile (content) { console.log(`开始替换变量`) let newContent = content.replace(/var Key = ''/, `var Key = '${cookie}'`); - // newContent = newContent.replace(/const NodeSet = 'CookieSet.json'/, `const NodeSet = '${NodeSet}'`) + newContent = newContent.replace(/const NodeSet = 'CookieSet.json'/, `const NodeSet = '${NodeSet}'`) if (process.env.JD_BEAN_STOP && process.env.JD_BEAN_STOP !== '0') { newContent = newContent.replace(/var stop = 0/, `var stop = ${process.env.JD_BEAN_STOP * 1}`); } diff --git a/sendNotify.js b/sendNotify.js index e32a197b..b23e2e12 100644 --- a/sendNotify.js +++ b/sendNotify.js @@ -2,7 +2,7 @@ * @Author: lxk0301 https://github.com/lxk0301 * @Date: 2020-08-19 16:12:40 * @Last Modified by: lxk0301 - * @Last Modified time: 2020-12-21 13:52:54 + * @Last Modified time: 2021-1-5 17:52:54 */ const querystring = require("querystring"); const $ = new Env(); @@ -132,17 +132,21 @@ if (process.env.PUSH_PLUS_USER) { async function sendNotify(text, desp, params = {}) { //提供7种通知 - await serverNotify(text, desp);//微信server酱 - await pushPlusNotify(text, desp);//pushplus(推送加) + await Promise.all([ + serverNotify(text, desp),//微信server酱 + pushPlusNotify(text, desp)//pushplus(推送加) + ]) //由于上述两种微信通知需点击进去才能查看到详情,故text(标题内容)携带了账号序号以及昵称信息,方便不点击也可知道是哪个京东哪个活动 text = text.match(/.*?(?=\s?-)/g) ? text.match(/.*?(?=\s?-)/g)[0] : text; - await BarkNotify(text, desp, params);//iOS Bark APP - await tgBotNotify(text, desp);//telegram 机器人 - await ddBotNotify(text, desp);//钉钉机器人 - await qywxBotNotify(text, desp); //企业微信机器人 - await qywxamNotify(text, desp); //企业微信应用消息推送 - await iGotNotify(text, desp, params);//iGot - await CoolPush(text, desp);//QQ酷推 + await Promise.all([ + BarkNotify(text, desp, params),//iOS Bark APP + tgBotNotify(text, desp),//telegram 机器人 + ddBotNotify(text, desp),//钉钉机器人 + qywxBotNotify(text, desp), //企业微信机器人 + qywxamNotify(text, desp), //企业微信应用消息推送 + iGotNotify(text, desp, params),//iGot + CoolPush(text, desp)//QQ酷推 + ]) } function serverNotify(text, desp, timeout = 2100) { From 5c2384e204f6149d4038393eb2e662e1bccddcf2 Mon Sep 17 00:00:00 2001 From: lxk0301 <778732665@qq.com> Date: Tue, 5 Jan 2021 18:02:44 +0800 Subject: [PATCH 17/30] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=90=84=E7=B1=BB?= =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E9=82=80=E8=AF=B7=E7=A0=81=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0cookie=E8=BF=87=E6=9C=9F=E5=88=A4=E6=96=AD?= =?UTF-8?q?=EF=BC=8C=E5=90=A6=E5=88=99=E8=84=9A=E6=9C=AC=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E4=BC=9A=E6=89=A7=E8=A1=8C=E5=87=BA=E9=94=99=E4=B8=AD=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 6 ++-- jd_get_share_code.js | 65 +++++++++++++++++++++++++++++++++++--------- 2 files changed, 56 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 682c55cb..f7497952 100644 --- a/README.md +++ b/README.md @@ -68,8 +68,10 @@ **TODO** - [ ] 所有活动互助码在一个脚本打印 -## [邀请码互助入口](https://github.com/lxk0301/jd_scripts/discussions) - +## 邀请码互助 + - [邀请码互助入口](https://github.com/lxk0301/jd_scripts/discussions) + - [获取各类活动互助码脚本](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_jdfactory.js) + - [邀请码使用规范](githubAction.md#互助码类环境变量)(仅限云端) ## 食用方法 ### 方法一:本地安装Node.js,下载本库脚本 diff --git a/jd_get_share_code.js b/jd_get_share_code.js index 46357d5b..5b44c5cb 100644 --- a/jd_get_share_code.js +++ b/jd_get_share_code.js @@ -144,11 +144,14 @@ if ($.isNode()) { $.isLogin = true; $.nickName = ''; message = ''; + await TotalBean(); + if (!$.isLogin) { + continue + } console.log(`======账号${$.index}开始======`) await getShareCode() - console.log(`======账号${$.index}结束======`) + console.log(`======账号${$.index}结束======\n`) } - } })() .catch((e) => { @@ -174,7 +177,7 @@ function getJdFactory() { $.taskVos.map((item) => { if (item.taskType === 14) { console.log( - `【东东工厂】${item.assistTaskDetailVo.taskToken}` + `【账号${$.index}(${$.nickName || $.UserName})东东工厂】${item.assistTaskDetailVo.taskToken}` ); } }); @@ -238,7 +241,7 @@ function getJxFactory(){ $.commodityDimId = production.commodityDimId; $.encryptPin = data.user.encryptPin; // subTitle = data.user.pin; - console.log(`【惊喜工厂】${data.user.encryptPin}`); + console.log(`【账号${$.index}(${$.nickName || $.UserName})惊喜工厂】${data.user.encryptPin}`); } } else { $.unActive = false; //标记是否开启了京喜活动或者选购了商品进行生产 @@ -317,7 +320,7 @@ function getJdPet(){ } console.log( - `【京东萌宠】${$.petInfo.shareCode}` + `【账号${$.index}(${$.nickName || $.UserName})京东萌宠】${$.petInfo.shareCode}` ); } else if (initPetTownRes.code === "0") { @@ -348,7 +351,7 @@ async function getJdZZ() { if (safeGet(data)) { data = JSON.parse(data); if (data.data.shareTaskRes) { - console.log(`【京东赚赚】${data.data.shareTaskRes.itemId}`); + console.log(`【账号${$.index}(${$.nickName || $.UserName})京东赚赚】${data.data.shareTaskRes.itemId}`); } else { //console.log(`已满5人助力,暂时看不到您的京东赚赚好友助力码`) } @@ -449,7 +452,7 @@ async function getPlantBean() { if ($.plantBeanIndexResult.code === "0") { const shareUrl = $.plantBeanIndexResult.data.jwordShareInfo.shareUrl; $.myPlantUuid = getParam(shareUrl, "plantUuid"); - console.log(`【种豆得豆】${$.myPlantUuid}`); + console.log(`【账号${$.index}(${$.nickName || $.UserName})种豆得豆】${$.myPlantUuid}`); } else { console.log( @@ -513,11 +516,8 @@ async function getJDFruit() { async function jdFruit() { await initForFarm(); if ($.farmInfo.farmUserPro) { - // option['media-url'] = $.farmInfo.farmUserPro.goodsImage; - subTitle = `【京东账号${$.index}】${$.nickName}`; - message = `【水果名称】${$.farmInfo.farmUserPro.name}`; console.log( - `【京东农场】${$.farmInfo.farmUserPro.shareCode}` + `【账号${$.index}(${$.nickName || $.UserName})京东农场】${$.farmInfo.farmUserPro.shareCode}` ); } else { @@ -563,7 +563,7 @@ async function getJoy(){ if (safeGet(data)) { data = JSON.parse(data); if (data.success && data.data && data.data.userInviteCode) { - console.log(`【crazyJoy】${data.data.userInviteCode}`) + console.log(`【账号${$.index}(${$.nickName || $.UserName})crazyJoy】${data.data.userInviteCode}`) } } } @@ -596,7 +596,46 @@ function safeGet(data) { return false; } } - +function TotalBean() { + return new Promise(async resolve => { + const options = { + "url": `https://wq.jd.com/user/info/QueryJDUserInfo?sceneval=2`, + "headers": { + "Accept": "application/json,text/plain, */*", + "Content-Type": "application/x-www-form-urlencoded", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-cn", + "Connection": "keep-alive", + "Cookie": cookie, + "Referer": "https://wqs.jd.com/my/jingdou/my.shtml?sceneval=2", + "User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0") : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0") + } + } + $.post(options, (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (data) { + data = JSON.parse(data); + if (data['retcode'] === 13) { + $.isLogin = false; //cookie过期 + return + } + $.nickName = data['base'].nickname; + } else { + console.log(`京东服务器返回空数据`) + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} function taskPostUrl(function_id, body = {}, function_id2) { let url = `${JD_API_HOST}`; if (function_id2) { From fe715e87ea80ef5db8a243718626d965513a82ab Mon Sep 17 00:00:00 2001 From: lxk0301 <778732665@qq.com> Date: Tue, 5 Jan 2021 18:04:26 +0800 Subject: [PATCH 18/30] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=90=84=E7=B1=BB?= =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E9=82=80=E8=AF=B7=E7=A0=81=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0cookie=E8=BF=87=E6=9C=9F=E5=88=A4=E6=96=AD?= =?UTF-8?q?=EF=BC=8C=E5=90=A6=E5=88=99=E8=84=9A=E6=9C=AC=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E4=BC=9A=E6=89=A7=E8=A1=8C=E5=87=BA=E9=94=99=E4=B8=AD=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f7497952..245ab57f 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ ## 邀请码互助 - [邀请码互助入口](https://github.com/lxk0301/jd_scripts/discussions) - - [获取各类活动互助码脚本](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_jdfactory.js) + - [获取各类活动互助码脚本 jd_get_share_code.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_get_share_code.js) - [邀请码使用规范](githubAction.md#互助码类环境变量)(仅限云端) ## 食用方法 From 59e0522f77ac689bda499408649a099ecc8130ab Mon Sep 17 00:00:00 2001 From: lxk0301 <778732665@qq.com> Date: Tue, 5 Jan 2021 18:53:22 +0800 Subject: [PATCH 19/30] Update jd_crazy_joy_coin.js --- jd_crazy_joy_coin.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jd_crazy_joy_coin.js b/jd_crazy_joy_coin.js index 669bf766..8824b85a 100644 --- a/jd_crazy_joy_coin.js +++ b/jd_crazy_joy_coin.js @@ -287,9 +287,9 @@ function getJoyShop() { if (data.success && data.data && data.data.shop) { const shop = data.data.shop.filter(vo => vo.status === 1) || [] $.buyJoyLevel = shop.length ? shop[shop.length - 1]['joyId'] : 1;//可购买的最大等级 - if ($.isNode() && process.env.BUY_JPY_LEVEL) { + if ($.isNode() && process.env.BUY_JOY_LEVEL) { $.log(`当前可购买的最高JOY等级为${$.buyJoyLevel}级\n`) - $.buyJoyLevel = (process.env.BUY_JPY_LEVEL * 1) > $.buyJoyLevel ? $.buyJoyLevel : process.env.BUY_JPY_LEVEL * 1; + $.buyJoyLevel = (process.env.BUY_JOY_LEVEL * 1) > $.buyJoyLevel ? $.buyJoyLevel : process.env.BUY_JOY_LEVEL * 1; $.cost = shop[$.buyJoyLevel - 1]['coins'] } else { $.cost = shop.length ? shop[shop.length - 1]['coins'] : Infinity From 19262bba61dba72dc6de4690d3edcdff629010f5 Mon Sep 17 00:00:00 2001 From: huang28 <52352624+Huang28@users.noreply.github.com> Date: Tue, 5 Jan 2021 20:37:47 +0800 Subject: [PATCH 20/30] 1 --- Loon/lxk0301_LoonTask.conf | 14 +- QuantumultX/lxk0301_gallery.json | 2 +- README.md | 14 +- Surge/lxk0301_Task.sgmodule.sgmodule | 14 +- activity/jd_apple_live.js | 2 +- activity/jd_ds.js | 220 +++++++++ activity/jd_jdh.js | 435 ++++++++++++++++++ activity/jd_jxstory.js | 2 +- activity/jd_live_redrain.js | 282 ++++++++++++ activity/jd_ms_redrain.js | 208 +++++++++ activity/jd_pubg.js | 2 +- activity/jd_watch.js | 418 +++++++++++++++++ activity/jr_sign.js | 199 ++++++++ backUp/iCloud.md | 208 +++++++++ backUp/iOS_Weather_AQI_Standard.js | 138 ++++++ backUp/tencentscf.md | 128 ++++++ docker/Readme.md | 26 +- docker/crontab_list.sh | 21 +- docker/default_task.sh | 23 +- jdCookie.js | 13 +- jd_bean_home.js | 22 +- jd_bean_sign.js | 5 +- jd_crazy_joy.js | 2 +- jd_crazy_joy_coin.js | 16 +- jd_dreamFactory.js | 4 +- jd_fruit.js | 45 +- jd_get_share_code.js | 665 +++++++++++++++++++++++++++ jd_health.js | 2 +- jd_jdfactory.js | 43 +- jd_jdzz.js | 2 +- jd_joy_reward.js | 30 ++ jd_pet.js | 2 +- jd_plantBean.js | 31 +- jd_small_home.js | 40 +- jd_syj.js | 8 +- sendNotify.js | 45 +- serverless.yml | 18 +- 37 files changed, 3179 insertions(+), 170 deletions(-) create mode 100644 activity/jd_ds.js create mode 100644 activity/jd_jdh.js create mode 100644 activity/jd_live_redrain.js create mode 100644 activity/jd_ms_redrain.js create mode 100644 activity/jd_watch.js create mode 100644 activity/jr_sign.js create mode 100644 backUp/iCloud.md create mode 100644 backUp/iOS_Weather_AQI_Standard.js create mode 100644 backUp/tencentscf.md create mode 100644 jd_get_share_code.js diff --git a/Loon/lxk0301_LoonTask.conf b/Loon/lxk0301_LoonTask.conf index 8f236711..13ff0c41 100644 --- a/Loon/lxk0301_LoonTask.conf +++ b/Loon/lxk0301_LoonTask.conf @@ -91,13 +91,13 @@ http-response ^https:\/\/jdjoy\.jd\.com\/pet\/getPetTreasureBox|^https:\/\/draw\ http-response ^https:\/\/account\.huami\.com\/v2\/client\/login script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/backUp/xmSports.js, requires-body=true, timeout=10, tag=小米运动获取Token # 京东代属 -cron "10 7 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_ds.js, tag=京东代属 +# cron "10 7 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_ds.js, tag=京东代属 # 京东快递 cron "10 0 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_kd.js, tag=京东快递签到 # 京东汽车 -cron "10 7 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_car.js, tag=京东汽车 +cron "0 0 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_car.js, tag=京东汽车 # 领京豆额外奖励 cron "10 7 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_bean_home.js, tag=领京豆额外奖励 @@ -107,19 +107,19 @@ cron "3 8 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_script # 京东赚赚 cron "10 11 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_jdzz.js, tag=京东赚赚 # 京东秒杀红包雨 -cron "10 7 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_ms_redrain.js, tag=秒杀红包雨 +# cron "10 7 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_ms_redrain.js, tag=秒杀红包雨 #注销京东店铺会员卡 cron "23 12 * * 6" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_unbind.js, tag=注销京东店铺会员卡 # 京东直播 cron "10-20/5 12 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live.js, tag=京东直播 # 京东看一看 -cron "40 9,10 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_watch.js, tag=京东看一看 +# cron "40 9,10 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_watch.js, tag=京东看一看 #直播红包雨 -cron "1 0,20,9-23/2 15-31 12 *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live_redrain.js, tag=直播红包雨 +# cron "1 0,20,9-23/2 15-31 12 *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live_redrain.js, tag=直播红包雨 # 金融打卡领年终奖 -cron "10 6 1-31 12 *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jr_sign.js, tag=金融打卡领年终奖 +# cron "10 6 1-31 12 *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jr_sign.js, tag=金融打卡领年终奖 # 健康抽奖机 -cron "10 0 1-31 12 *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_health.js,tag=健康抽奖机 +cron "10 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_health.js,tag=健康抽奖机 # 疯狂的joy日常任务 cron "30 8 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_crazy_joy.js,tag=疯狂的joy日常任务 diff --git a/QuantumultX/lxk0301_gallery.json b/QuantumultX/lxk0301_gallery.json index 162513d2..a3709536 100644 --- a/QuantumultX/lxk0301_gallery.json +++ b/QuantumultX/lxk0301_gallery.json @@ -26,7 +26,7 @@ "0 7 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_syj.js, tag=十元街, img-url=https://github.com/58xinian/icon/raw/master/jd_syj.png", "15 7 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_ms_redrain.js, tag=秒杀红包雨, img-url=https://raw.githubusercontent.com/Orz-3/task/master/jd.png", "10 6 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_bean_home.js, tag=领京豆额外奖励, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_bean_home.png", - "20 7 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_car.js, tag=京东汽车, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_car.png", + "0 0 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_car.js, tag=京东汽车, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_car.png", "10 0 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_kd.js, tag=京东快递签到, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_kd.png", "30 7 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_ds.js, tag=京东代属, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_ds.png", "30 0 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_health.js, tag=健康抽奖机, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_redPacket.png", diff --git a/README.md b/README.md index 8783d737..245ab57f 100644 --- a/README.md +++ b/README.md @@ -68,8 +68,10 @@ **TODO** - [ ] 所有活动互助码在一个脚本打印 -## [邀请码互助入口](https://github.com/lxk0301/jd_scripts/discussions) - +## 邀请码互助 + - [邀请码互助入口](https://github.com/lxk0301/jd_scripts/discussions) + - [获取各类活动互助码脚本 jd_get_share_code.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_get_share_code.js) + - [邀请码使用规范](githubAction.md#互助码类环境变量)(仅限云端) ## 食用方法 ### 方法一:本地安装Node.js,下载本库脚本 @@ -85,9 +87,9 @@ ### 方法二:云服务器、腾讯云函数等等 - 需自行有云服务器,云函数等 - - 腾讯云云函数 [快速部署教程](tencentscf.md)(免费) - - 腾讯云云函数控制台使用 [教程说明](iCloud.md) - - 腾讯云云函数 [GitHub Action部署教程](tencentscf.md#github-action-部署) + - 腾讯云云函数 [快速部署教程](./backUp/tencentscf.md)(免费) + - 腾讯云云函数控制台使用 [教程说明](./backUp/iCloud.md) + - 腾讯云云函数 [GitHub Action部署教程](./backUp/tencentscf.md#github-action-部署) ### 方法三:Docker(NAS或VPS用户) @@ -107,7 +109,7 @@ ### 方法四:iOS系统的代理软件(QuantumultX, Surge, Loon, 小火箭) -#### [京东cookie获取脚本](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/JD_extra_cookie.js) + - [京东cookie获取脚本 JD_extra_cookie.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/JD_extra_cookie.js) ### 赞赏码(开发维护不易,请赏杯茶水费)
diff --git a/Surge/lxk0301_Task.sgmodule.sgmodule b/Surge/lxk0301_Task.sgmodule.sgmodule index 08b3479b..f359b012 100644 --- a/Surge/lxk0301_Task.sgmodule.sgmodule +++ b/Surge/lxk0301_Task.sgmodule.sgmodule @@ -53,18 +53,14 @@ cron "40 * * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scrip cron "10 7 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_small_home.js, timeout=650, wake-system=1, tag=东东小窝 #十元街 cron "40 8 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_syj.js, timeout=650, wake-system=1, tag=十元街 -#京东代属(仅京东学生认证用户可用) -cron "30 8 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_ds.js, timeout=650, wake-system=1, tag=京东代属 #领京豆额外奖励 cron "30 10 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_bean_home.js, timeout=750, wake-system=1, tag=领京豆额外奖励 #京东汽车 -cron "30 11 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_car.js, timeout=750, wake-system=1, tag=京东汽车 +cron "0 0 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_car.js, timeout=750, wake-system=1, tag=京东汽车 #京东快递签到 cron "20 11 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_kd.js, timeout=750, wake-system=1, tag=京东快递签到 #京东直播(活动结束时间未知) cron "20 12 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live.js, timeout=750, wake-system=1, tag=京东直播 -#京东看一看 -cron "40 9,10 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_watch.js, timeout=7750, wake-system=1, tag=京东看一看 #京东健康 cron "20 23 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_jdh.js, timeout=750, wake-system=1, tag=京东健康 #京东赚赚 @@ -74,12 +70,6 @@ cron "20 12 * * 6" script-path=https://raw.githubusercontent.com/lxk0301/jd_scri #疯狂的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 7 1-31 12 *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jr_sign.js, timeout=750, wake-system=1, tag=金融打卡领年终奖 #健康抽奖机 -cron "30 2 1-31 12 *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_health.js, timeout=750, wake-system=1, tag=健康抽奖机 -#直播红包雨(2020-12-31活动结束) -cron "1 0,20,9-23/2 15-31 12 *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live_redrain.js, timeout=750, wake-system=1, tag=直播红包雨 -#秒杀红包雨(2020-12-31活动结束) -cron "20 9 1-31 12 *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_ms_redrain.js, timeout=750, wake-system=1, tag=秒杀红包雨 +cron "30 2 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_health.js, timeout=750, wake-system=1, tag=健康抽奖机 diff --git a/activity/jd_apple_live.js b/activity/jd_apple_live.js index 26022817..e2d04104 100644 --- a/activity/jd_apple_live.js +++ b/activity/jd_apple_live.js @@ -283,7 +283,7 @@ function readShareCode() { console.log(`${$.name} API请求失败,请检查网路重试`) } else { if (data) { - console.log(`随机取${randomCount}个码放到您固定的互助码后面`) + console.log(`随机取${randomCount}个码放到您固定的互助码后面(不影响已有固定互助)`) data = JSON.parse(data); } } diff --git a/activity/jd_ds.js b/activity/jd_ds.js new file mode 100644 index 00000000..46381bf9 --- /dev/null +++ b/activity/jd_ds.js @@ -0,0 +1,220 @@ +/* + * @Author: lxk0301 https://github.com/lxk0301 + * @Date: 2020-11-27 09:19:21 + * @Last Modified by: shylocks https://github.com/shylocks + * @Last Modified time: 2020-12-7 17:39:02 + */ +/* +京东代属脚本,类似十元街,⚠️⚠️⚠️⚠️限校园用户可使用,其他用户签到失败无京豆 +一周签到下来可获得30京豆,一天任意时刻运行一次即可 + +更新地址:https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_ds.js +参考github@jidesheng6修改而来 +已支持IOS双京东账号, Node.js支持N个京东账号 +脚本兼容: QuantumultX, Surge, Loon, 小火箭,JSBox, Node.js +============Quantumultx=============== +[task_local] +#京东代属 +10 7 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_ds.js, tag=京东代属, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_ds.png, enabled=true + +================Loon============== +[Script] +cron "10 7 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_ds.js, tag=京东代属 + +===============Surge================= +京东代属 = type=cron,cronexp="10 7 * * *",wake-system=1,timeout=20,script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_ds.js + +============小火箭========= +京东代属 = type=cron,script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_ds.js, cronexpr="10 7 * * *", timeout=200, enable=true + */ +const $ = new Env('京东代属'); + +const notify = $.isNode() ? require('./sendNotify') : ''; +//Node.js用户请在jdCookie.js处填写京东ck; +const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; +let jdNotify = true;//是否关闭通知,false打开通知推送,true关闭通知推送 +const randomCount = $.isNode() ? 20 : 5; +//IOS等用户直接用NobyDa的jd cookie +let cookiesArr = [], cookie = '', message; +if ($.isNode()) { + Object.keys(jdCookieNode).forEach((item) => { + cookiesArr.push(jdCookieNode[item]) + }) + if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {}; +} else { + let cookiesData = $.getdata('CookiesJD') || "[]"; + cookiesData = jsonParse(cookiesData); + cookiesArr = cookiesData.map(item => item.cookie); + cookiesArr.reverse(); + cookiesArr.push(...[$.getdata('CookieJD2'), $.getdata('CookieJD')]); + cookiesArr.reverse(); + cookiesArr = cookiesArr.filter(item => item !== "" && item !== null && item !== undefined); +} +const JD_API_HOST = 'https://api.m.jd.com/'; +!(async () => { + if (!cookiesArr[0]) { + $.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"}); + return; + } + for (let i = 0; i < cookiesArr.length; i++) { + if (cookiesArr[i]) { + cookie = cookiesArr[i]; + $.UserName = decodeURIComponent(cookie.match(/pt_pin=(.+?);/) && cookie.match(/pt_pin=(.+?);/)[1]) + $.index = i + 1; + $.isLogin = true; + $.nickName = ''; + message = ''; + 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/"}); + + if ($.isNode()) { + await notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`); + } + continue + } + await userSignIn(); + await showMsg(); + } + } +})() + .catch((e) => { + $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '') + }) + .finally(() => { + $.done(); + }) + +function showMsg() { + return new Promise(async resolve => { + // $.msg($.name, '', `【京东账号${$.index}】${$.nickName}\n${message}`); + let nowTime = new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000; + if (nowTime > new Date('2020/12/31 23:59:59+08:00').getTime()) { + $.msg($.name, '活动已结束', `咱江湖再见\nhttps://github.com/lxk0301/jd_scripts`, {"open-url": "https://github.com/lxk0301/jd_scripts"}); + if ($.isNode()) await notify.sendNotify($.name + '活动已结束', `咱江湖再见\n https://github.com/lxk0301/jd_scripts`) + } else { + $.msg($.name, '', `京东账号${$.index} ${$.nickName}\n${message}`); + } + resolve() + }) +} +function userSignIn() { + return new Promise(resolve => { + const body = {"activityId":"28acd0b5255d4aed866c60508ebf10f8","inviterId":"gCBrvPfINCZc+dotfvHPlA==","channel":"MiniProgram"}; + $.get(taskUrl('userSignIn', body), (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data.code === 0) { + console.log(`今日签到成功`) + if (data.data) { + let { alreadySignDays, beanTotalNum, todayPrize, eachDayPrize } = data.data; + message += `【第${alreadySignDays}日签到】成功,获得${todayPrize.beanAmount}京豆 🐶\n`; + if (alreadySignDays === 7) alreadySignDays = 0; + message += `【明日签到】可获得${eachDayPrize[alreadySignDays].beanAmount}京豆 🐶\n`; + message += `【累计获得】${beanTotalNum}京豆 🐶\n`; + } + } else if (data.code === 81) { + console.log(`今日已签到`) + message += `【签到】失败,今日已签到`; + } else if (data.code === 82) { + console.log(`非校园用户无法签到`) + message += `【签到】失败,非校园用户无法签到`; + } else { + console.log(`异常:${JSON.stringify(data)}`) + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} +function taskUrl(function_id, body = {}) { + return { + url: `${JD_API_HOST}?functionId=${function_id}&body=${escape(JSON.stringify(body))}&appid=campus-mall&client=ds_m&fromType=wxapp×tamp=${new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000}`, + headers: { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-cn", + "Connection": "keep-alive", + "Content-Type": "application/x-www-form-urlencoded", + "Host": "api.m.jd.com", + "Referer": "https://servicewechat.com/wxcb6c7f7be08467e3/104/page-frame.html", + "Cookie": cookie, + "User-Agent": 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/7.0.18(0x17001231) NetType/WIFI Language/zh_CN'//$.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0") : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0"), + } + } +} +function TotalBean() { + return new Promise(async resolve => { + const options = { + "url": `https://wq.jd.com/user/info/QueryJDUserInfo?sceneval=2`, + "headers": { + "Accept": "application/json,text/plain, */*", + "Content-Type": "application/x-www-form-urlencoded", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-cn", + "Connection": "keep-alive", + "Cookie": cookie, + "Referer": "https://wqs.jd.com/my/jingdou/my.shtml?sceneval=2", + "User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0") : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0") + } + } + $.post(options, (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (data) { + data = JSON.parse(data); + if (data['retcode'] === 13) { + $.isLogin = false; //cookie过期 + return + } + $.nickName = data['base'].nickname; + } else { + console.log(`京东服务器返回空数据`) + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} +function safeGet(data) { + try { + if (typeof JSON.parse(data) == "object") { + return true; + } + } catch (e) { + console.log(e); + console.log(`京东服务器访问数据为空,请检查自身设备网络情况`); + return false; + } +} +function jsonParse(str) { + if (typeof str == "string") { + try { + return JSON.parse(str); + } catch (e) { + console.log(e); + $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') + return []; + } + } +} +// prettier-ignore +function Env(t,e){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("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}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("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(a,(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();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){let e={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).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}}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r)));let h=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];h.push(e),s&&h.push(s),i&&h.push(i),console.log(h.join("\n")),this.logs=this.logs.concat(h)}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("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)} diff --git a/activity/jd_jdh.js b/activity/jd_jdh.js new file mode 100644 index 00000000..9ff14775 --- /dev/null +++ b/activity/jd_jdh.js @@ -0,0 +1,435 @@ +/* +京东健康 +京东健康APP集汪汪卡瓜分百万红包 +已支持IOS双京东账号,Node.js支持N个京东账号 +脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js +============Quantumultx=============== +[task_local] +#京东健康 +10 8 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_jdh.js, tag=京东健康, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_jdh.png, enabled=true + +================Loon============== +[Script] +cron "10 8 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_jdh.js,tag=京东健康 + +===============Surge================= +京东健康 = type=cron,cronexp="10 8 * * *",wake-system=1,timeout=20,script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_jdh.js + +============小火箭========= +京东健康 = type=cron,script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_jdh.js, cronexpr="10 8 * * *", timeout=200, enable=true + */ +const $ = new Env('京东健康'); +const notify = $.isNode() ? require('./sendNotify') : ''; +//Node.js用户请在jdCookie.js处填写京东ck; +const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; +let jdNotify = true;//是否关闭通知,false打开通知推送,true关闭通知推送 +//IOS等用户直接用NobyDa的jd cookie +let cookiesArr = [], cookie = '', message; +if ($.isNode()) { + Object.keys(jdCookieNode).forEach((item) => { + cookiesArr.push(jdCookieNode[item]) + }) + if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {}; +} else { + let cookiesData = $.getdata('CookiesJD') || "[]"; + cookiesData = jsonParse(cookiesData); + cookiesArr = cookiesData.map(item => item.cookie); + cookiesArr.reverse(); + cookiesArr.push(...[$.getdata('CookieJD2'), $.getdata('CookieJD')]); + cookiesArr.reverse(); + cookiesArr = cookiesArr.filter(item => item !== "" && item !== null && item !== undefined); +} +const JD_API_HOST = 'https://api.m.jd.com/api'; +$.newShareCodes = ['21d9b4b51a69839577027beb0aad5105', '8edbdfa148e78f028496cff17e7df35b']; +!(async () => { + if (!cookiesArr[0]) { + $.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"}); + return; + } + for (let i = 0; i < cookiesArr.length; i++) { + if (cookiesArr[i]) { + cookie = cookiesArr[i]; + $.UserName = decodeURIComponent(cookie.match(/pt_pin=(.+?);/) && cookie.match(/pt_pin=(.+?);/)[1]) + $.index = i + 1; + $.isLogin = true; + $.nickName = ''; + message = ''; + 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/"}); + + if ($.isNode()) { + await notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`); + } + continue + } + await jdJdh() + } + } + // 帮助作者,把作者助力码放到用户助力码之后 + await getAuthorShareCode('https://gitee.com/shylocks/updateTeam/raw/main/jd_jdh.json'); + for (let i = 0; i < cookiesArr.length; i++) { + if (cookiesArr[i]) { + cookie = cookiesArr[i]; + await helpFriends() + } + } +})() + .catch((e) => { + $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '') + }) + .finally(() => { + $.done(); + }) +async function helpFriends(){ + for(let i = 0; i < $.newShareCodes.length; ++i){ + const res = await helpFriend($.newShareCodes[i]) + if (res['data'] && res['data']['inviteCode'] === 8){ + // 助力次数已满,跳出 + break + } + } +} +function rand(min, max) { + min = Math.ceil(min); + max = Math.floor(max); + return Math.floor(Math.random() * (max - min + 1)) + min; +} +async function jdJdh() { + await queryShareInfo() + await queryInviteHome() + $.nowCount = $.count + let t = `${new Date().getUTCFullYear()}${new Date().getUTCMonth()+1}${new Date().getUTCDate()}` + await queryTask(15,"meetingplace") // 逛义诊会场 + await queryTask(18,"2951198") // 看名医直播 + await queryTask(17,"246147") // + await queryTask(24, t) // 辟谣 + await doTask(22,42,`${new Date().getUTCFullYear()}-${new Date().getUTCMonth()+1}-${new Date().getUTCDate()}`) // 去打卡 + await queryTask(20,"362451650500001") // 测一测 + await doTask(23,40,`${rand(10000, 20000)}`) // 走路,这个可以直接提示领奖结果 + // 以下两个需要开启家庭医生才能完成 + await doTask(null,50,`${rand(10000, 20000)}`) // 家庭医生走路 + await queryTask(17,"235741") // 家庭医生资讯,这个可以不用开启直接完成 + await queryInviteHome() + await showMsg() +} +function getAuthorShareCode(url) { + return new Promise(resolve => { + $.get({url: `${url}?${new Date()}`, + headers:{ + "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1 Edg/87.0.4280.88" + }}, async (err, resp, data) => { + try { + if (err) { + } else { + $.newShareCodes = $.newShareCodes.concat(JSON.parse(data)) + console.log($.newShareCodes) + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} +function queryShareInfo() { + return new Promise(resolve => { + $.get(taskUrl("jdh_invite_startInvite", {"channel":"jdhapp","m_patch_appid":"jdh"}), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(resp) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + console.log(`您的分享助力码为:${data.data.shareParam}`) + $.newShareCodes.push(data.data.shareParam) + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(data); + } + }) + }) +} +function queryInviteHome() { + // 首次点击30张汪汪卡 + return new Promise(resolve => { + $.get(taskUrl("jdh_invite_queryInviteHome", {"channel":"jdhapp","m_patch_appid":"jdh"}), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + $.count = data.data.ownerInfo.activityChanceCount + if(data.data.ownerInfo.firstVisitChance){ + console.log(`首次访问成功,获得 ${data.data.ownerInfo.firstVisitChance}张汪汪卡`) + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(data); + } + }) + }) +} +function helpFriend(code) { + let body = {"channel":"jdhapp","m_patch_appid":"jdh","shareParam":code} + return new Promise(resolve => { + $.get(taskUrl("jdh_invite_inviteFriends", body), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if(data.code === 0){ + console.log(`助力好友 ${code} 结果:${data.data.inviteDesc}`) + } + else console.log(`助力好友 ${code} 失败,错误信息:${data.message}`) + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(data); + } + }) + }) +} +function getTaskList() { + let body = {"pageSize":15,"startFloor":1,"pageId":"c7c1fa16b8a94fbb97f6ec220488d01b"} + return new Promise(resolve => { + $.get(taskUrl("jdh_queryFloor", body), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(resp) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + // console.log(data) + $.inviteInfo = data.data.floorDataList.filter(vo=>vo.name==="HD_Floor_Health_Month_CollectCard")[0] + console.log($.inviteInfo) + console.log(`当前助力进度:${$.inviteInfo.items[0].completeNum}/${$.inviteInfo.items[0].limitNum}`) + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(data); + } + }) + }) +} +function queryTask(taskType,infoId) { + let body = {"channel":"jdhapp","m_patch_appid":"jdh","taskType":taskType,"infoId":infoId} + return new Promise(resolve => { + $.get(taskUrl("jdh_task_queryTask", body), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if(data.data&&data.data.length>0) + await doTask(taskType,data.data[0].id,infoId) + else + console.log(`任务已做过`) + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(data); + } + }) + }) +} +function doTask(taskType,taskId,infoId) { + let body = {"channel":"jdhapp","m_patch_appid":"jdh","taskId":taskId, "infoId":infoId} + return new Promise(resolve => { + $.get(taskUrl("jdh_task_doTask", body), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + console.log(data.message) + // await rewardTask(taskType,taskId,infoId) + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(data); + } + }) + }) +} +function doTask2(taskType,taskId,infoId) { + let body = {"channel":"jdhapp","m_patch_appid":"jdh","taskId":taskId, "infoId":infoId} + return new Promise(resolve => { + $.get(taskUrl("jdh_task_doTask", body), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + console.log(data.message) + // await rewardTask(taskType,taskId,infoId) + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(data); + } + }) + }) +} +function rewardTask(taskType,taskId,infoId) { + // 会报 no access 无解 + let body = {"channel":"jdhapp","m_patch_appid":"jdh", + "taskId":taskId,"taskType":taskType,"infoId":infoId} + return new Promise(resolve => { + $.get(taskUrl("jdh_task_getReward", body), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + console.log(data) + if (data.code ===0) { + console.log(data.data.extResult.mainTitle) + }else{ + console.log(data.data.msg) + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(data); + } + }) + }) +} +async function showMsg() { + message = `获得${$.count - $.nowCount}张汪汪卡,共${$.count}张汪汪卡\n任务已做完,请手动领取奖励` + if ($.isNode() && !jdNotify) { + await notify.sendNotify(`【京东账号${$.index}】${$.nickName} `, `【${$.name}】${message}`); + } else { + $.log(`京东账号${$.index}${$.nickName}\n${message}`); + } +} + +function taskPostUrl(function_id, body = {}) { + return { + url: `${JD_API_HOST}?functionId=${function_id}`, + body: body, + headers: { + "Cookie": cookie, + 'Content-Type': 'application/x-www-form-urlencoded', + 'accept': 'application/json, text/plain, */*', + 'origin': 'https://hlc.m.jd.com', + 'referer': 'https://hlc.m.jd.com/Question_Answer_Rumour/answerComplete', + "User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : "jdhapp;iPhone;9.2.7;14.2;network/wifi;lang/zh_CN;model/iPhone10,2;appBuild/1206;pv/2.1;apprpd/;usc/;jdv/0|;umd/;psq/4;ucp/;app_device/IOS;utr/;ref/;adk/;ads/;Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1") : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdhapp;iPhone;9.2.7;14.2;network/wifi;lang/zh_CN;model/iPhone10,2;appBuild/1206;pv/2.1;apprpd/;usc/;jdv/0|;umd/;psq/4;ucp/;app_device/IOS;utr/;ref/;adk/;ads/;Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1"), + } + } +} +function taskUrl(function_id, body = {}) { + return { + url: `${JD_API_HOST}?functionId=${function_id}&appid=JDHAPP&clientVersion=2.1.7&body=${escape(JSON.stringify(body))}`, + headers: { + "Cookie": cookie, + 'Content-Type': 'application/x-www-form-urlencoded', + 'accept': 'application/json, text/plain, */*', + 'origin': 'https://hlc.m.jd.com', + 'referer': 'https://hlc.m.jd.com/Question_Answer_Rumour/answerComplete', + "User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : "jdhapp;iPhone;9.2.7;14.2;network/wifi;lang/zh_CN;model/iPhone10,2;appBuild/1206;pv/2.1;apprpd/;usc/;jdv/0|;umd/;psq/4;ucp/;app_device/IOS;utr/;ref/;adk/;ads/;Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1") : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdhapp;iPhone;9.2.7;14.2;network/wifi;lang/zh_CN;model/iPhone10,2;appBuild/1206;pv/2.1;apprpd/;usc/;jdv/0|;umd/;psq/4;ucp/;app_device/IOS;utr/;ref/;adk/;ads/;Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1"), + } + } +} +function TotalBean() { + return new Promise(async resolve => { + const options = { + "url": `https://wq.jd.com/user/info/QueryJDUserInfo?sceneval=2`, + "headers": { + "Accept": "application/json,text/plain, */*", + "Content-Type": "application/x-www-form-urlencoded", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-cn", + "Connection": "keep-alive", + "Cookie": cookie, + "Referer": "https://wqs.jd.com/my/jingdou/my.shtml?sceneval=2", + "User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0") : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0") + } + } + $.post(options, (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (data) { + data = JSON.parse(data); + if (data['retcode'] === 13) { + $.isLogin = false; //cookie过期 + return + } + $.nickName = data['base'].nickname; + } else { + console.log(`京东服务器返回空数据`) + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} +function safeGet(data) { + try { + if (typeof JSON.parse(data) == "object") { + return true; + } + } catch (e) { + console.log(e); + console.log(`京东服务器访问数据为空,请检查自身设备网络情况`); + return false; + } +} +function jsonParse(str) { + if (typeof str == "string") { + try { + return JSON.parse(str); + } catch (e) { + console.log(e); + $.msg($.name, '', '不要在BoxJS手动复制粘贴修改cookie') + return []; + } + } +} +// prettier-ignore +function Env(t,e){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("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}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("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(a,(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();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){let e={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).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}}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r)));let h=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];h.push(e),s&&h.push(s),i&&h.push(i),console.log(h.join("\n")),this.logs=this.logs.concat(h)}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("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)} diff --git a/activity/jd_jxstory.js b/activity/jd_jxstory.js index cd46e3ed..45c79941 100644 --- a/activity/jd_jxstory.js +++ b/activity/jd_jxstory.js @@ -498,7 +498,7 @@ function readShareCode() { console.log(`${$.name} API请求失败,请检查网路重试`) } else { if (data) { - console.log(`随机取${randomCount}个码放到您固定的互助码后面`) + console.log(`随机取${randomCount}个码放到您固定的互助码后面(不影响已有固定互助)`) data = JSON.parse(data); } } diff --git a/activity/jd_live_redrain.js b/activity/jd_live_redrain.js new file mode 100644 index 00000000..4de7cad5 --- /dev/null +++ b/activity/jd_live_redrain.js @@ -0,0 +1,282 @@ +/* +直播红包雨 +每天0,9,11,13,15,17,19,20,21,23可领,每日上限未知 +活动时间:2020-12-14 到 2020-12-31 +更新地址:https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live_redrain.js +已支持IOS双京东账号, Node.js支持N个京东账号 +脚本兼容: QuantumultX, Surge, Loon, 小火箭,JSBox, Node.js +============Quantumultx=============== +[task_local] +#直播红包雨 +0 0,9,11,13,15,17,19,20,21,23 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live_redrain.js, tag=直播红包雨, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_redPacket.png, enabled=true + +================Loon============== +[Script] +cron "0 0,9,11,13,15,17,19,20,21,23 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live_redrain.js, tag=直播红包雨 + +===============Surge================= +直播红包雨 = type=cron,cronexp="0 0,9,11,13,15,17,19,20,21,23 * * *",wake-system=1,timeout=20,script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live_redrain.js + +============小火箭========= +直播红包雨 = type=cron,script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live_redrain.js, cronexpr="0 0,9,11,13,15,17,19,20,21,23 * * *", timeout=200, enable=true + */ +const $ = new Env('直播红包雨'); +let ids = { + '0': 'RRA3S6TRRbnNNuGN43oHMA5okbcXmRY', + '9': 'RRA3vyGH4MRwCJELDwV7p24mNAByiSk', + '11': 'RRAnabmRSnpzSSZicXUhSFGBvFXs5c', + '13': 'RRA4RhWMc159kA62qLbaEa88evE7owb', + '15': 'RRA2CnovS9KVTTwBD9NV7o4kc3P8PTN', + '17': 'RRA2nFXT2oSQM3KaYX9uhBC1hBijDey', + '19': 'RRA3SQpuSAAJq1ckoPr4TXaxwbLG73k', + '20': 'RRA2cHV3KXqvHAZGboTTryr8JMYZd5j', + '21': 'RRA3SPs4XrDEXXwQjEFGrBLtMpjtkMV', + '23': 'RRA3dFHoZXGThSnctvtAf69dmVyEDfm', +} +const notify = $.isNode() ? require('./sendNotify') : ''; +//Node.js用户请在jdCookie.js处填写京东ck; +const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; +let jdNotify = true;//是否关闭通知,false打开通知推送,true关闭通知推送 +//IOS等用户直接用NobyDa的jd cookie +let cookiesArr = [], cookie = '', message; +if ($.isNode()) { + Object.keys(jdCookieNode).forEach((item) => { + cookiesArr.push(jdCookieNode[item]) + }) + if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => { + }; + process.env.TZ = "Asia/Shanghai"; + Date.prototype.TimeZone = new Map([ + ['Asia/Shanghai',+8], + ]) + Date.prototype.zoneDate = function(){ + if(process.env.TZ === undefined){ + return new Date(); + }else{ + for (let item of this.TimeZone.entries()) { + if(item[0] === process.env.TZ){ + let d = new Date(); + d.setHours(d.getHours()+item[1]); + return d; + } + } + return new Date(); + } + } +} else { + let cookiesData = $.getdata('CookiesJD') || "[]"; + cookiesData = jsonParse(cookiesData); + cookiesArr = cookiesData.map(item => item.cookie); + cookiesArr.reverse(); + cookiesArr.push(...[$.getdata('CookieJD2'), $.getdata('CookieJD')]); + cookiesArr.reverse(); + cookiesArr = cookiesArr.filter(item => item !== "" && item !== null && item !== undefined); +} +const JD_API_HOST = 'https://api.m.jd.com/api'; +!(async () => { + if (!cookiesArr[0]) { + $.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"}); + return; + } + $.log(`=====远程红包雨信息=====`) + await getRedRain(); + if(!$.activityId) return + let nowTs = new Date().getTime() + if (!($.st <= nowTs && nowTs < $.ed)) { + $.log(`远程红包雨配置获取错误,从本地读取配置`) + $.log(`\n`) + let hour = (new Date().getUTCHours() + 8) %24 + if (ids[hour]){ + $.activityId = ids[hour] + $.log(`本地红包雨配置获取成功`) + } else{ + $.log(`无法从本地读取配置,请检查运行时间`) + return + } + } else{ + $.log(`远程红包雨配置获取成功`) + } + for (let i = 0; i < cookiesArr.length; i++) { + if (cookiesArr[i]) { + cookie = cookiesArr[i]; + $.UserName = decodeURIComponent(cookie.match(/pt_pin=(.+?);/) && cookie.match(/pt_pin=(.+?);/)[1]) + $.index = i + 1; + $.isLogin = true; + $.nickName = ''; + message = `【${new Date().getUTCHours()+8}点${$.name}】` + 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/"}); + + if ($.isNode()) { + await notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`); + } + continue + } + await receiveRedRain(); + await showMsg(); + } + } +})() + .catch((e) => { + $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '') + }) + .finally(() => { + $.done(); + }) + +async function showMsg() { + if ($.isNode() && !jdNotify) { + await notify.sendNotify(`【京东账号${$.index}】${$.nickName}`, message) + } + return new Promise(resolve => { + $.msg($.name, '', `【京东账号${$.index}】${$.nickName}\n${message}`); + resolve() + }) +} + +function getRedRain() { + return new Promise(resolve => { + $.get({ + url: "http://ql4kk90rw.hb-bkt.clouddn.com/jd_live_redRain.json?" + Date.now(), + }, (err, resp, data) => { + try { + if (err) { + console.log(`1111${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + $.activityId = data.activityId + $.st = data.startTime + $.ed = data.endTime + console.log(`下一场红包雨开始时间:${new Date(data.startTime)}`) + console.log(`下一场红包雨结束时间:${new Date(data.endTime)}`) + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} + +function receiveRedRain() { + return new Promise(resolve => { + const body = {"actId": $.activityId}; + $.get(taskUrl('noahRedRainLottery', body), (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data.subCode === '0') { + console.log(`领取成功,获得${JSON.stringify(data.lotteryResult)}`) + // message+= `领取成功,获得${JSON.stringify(data.lotteryResult)}\n` + message += `领取成功,获得 ${(data.lotteryResult.jPeasList[0].quantity)} 京豆\n` + + } else if (data.subCode === '8') { + console.log(`领取失败,已领过`) + message += `领取失败,已领过\n`; + } else { + console.log(`异常:${JSON.stringify(data)}`) + message += `暂无红包雨\n`; + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} + +function taskUrl(function_id, body = {}) { + return { + url: `${JD_API_HOST}?functionId=${function_id}&body=${escape(JSON.stringify(body))}&client=wh5&clientVersion=1.0.0&_=${new Date().getTime()}`, + headers: { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-cn", + "Connection": "keep-alive", + "Content-Type": "application/x-www-form-urlencoded", + "Host": "api.m.jd.com", + "Referer": "https://h5.m.jd.com/active/redrain/index.html", + "Cookie": cookie, + "User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0") : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0"), + } + } +} + +function TotalBean() { + return new Promise(async resolve => { + const options = { + "url": `https://wq.jd.com/user/info/QueryJDUserInfo?sceneval=2`, + "headers": { + "Accept": "application/json,text/plain, */*", + "Content-Type": "application/x-www-form-urlencoded", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-cn", + "Connection": "keep-alive", + "Cookie": cookie, + "Referer": "https://wqs.jd.com/my/jingdou/my.shtml?sceneval=2", + "User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0") : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0") + } + } + $.post(options, (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (data) { + data = JSON.parse(data); + if (data['retcode'] === 13) { + $.isLogin = false; //cookie过期 + return + } + $.nickName = data['base'].nickname; + } else { + console.log(`京东服务器返回空数据`) + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} + +function safeGet(data) { + try { + if (typeof JSON.parse(data) == "object") { + return true; + } + } catch (e) { + console.log(e); + console.log(`京东服务器访问数据为空,请检查自身设备网络情况`); + return false; + } +} +function jsonParse(str) { + if (typeof str == "string") { + try { + return JSON.parse(str); + } catch (e) { + console.log(e); + $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') + return []; + } + } +} +// prettier-ignore +function Env(t,e){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("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}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("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(a,(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();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){let e={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).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}}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r)));let h=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];h.push(e),s&&h.push(s),i&&h.push(i),console.log(h.join("\n")),this.logs=this.logs.concat(h)}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("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)} diff --git a/activity/jd_ms_redrain.js b/activity/jd_ms_redrain.js new file mode 100644 index 00000000..c2ea858e --- /dev/null +++ b/activity/jd_ms_redrain.js @@ -0,0 +1,208 @@ +/* +秒杀红包雨,可以获取3次,一天运行一次即可 +活动时间:2020-12-1 到 2020-12-31 +活动入口:首页👉秒杀👉往下拉(手指向上滑动)👉可以看到狂撒2亿京东 +更新地址:https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_ms_redrain.js +已支持IOS双京东账号, Node.js支持N个京东账号 +脚本兼容: QuantumultX, Surge, Loon, 小火箭,JSBox, Node.js +============Quantumultx=============== +[task_local] +#秒杀红包雨 +10 7 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_ms_redrain.js, tag=秒杀红包雨, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_redPacket.png, enabled=true + +================Loon============== +[Script] +cron "10 7 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_ms_redrain.js, tag=秒杀红包雨 + +===============Surge================= +秒杀红包雨 = type=cron,cronexp="10 7 * * *",wake-system=1,timeout=20,script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_ms_redrain.js + +============小火箭========= +秒杀红包雨 = type=cron,script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_ms_redrain.js, cronexpr="10 7 * * *", timeout=200, enable=true + */ +const $ = new Env('秒杀红包雨'); + +const notify = $.isNode() ? require('./sendNotify') : ''; +//Node.js用户请在jdCookie.js处填写京东ck; +const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; +let jdNotify = true;//是否关闭通知,false打开通知推送,true关闭通知推送 +const randomCount = $.isNode() ? 20 : 5; +//IOS等用户直接用NobyDa的jd cookie +let cookiesArr = [], cookie = '', message; +if ($.isNode()) { + Object.keys(jdCookieNode).forEach((item) => { + cookiesArr.push(jdCookieNode[item]) + }) + if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {}; +} else { + let cookiesData = $.getdata('CookiesJD') || "[]"; + cookiesData = jsonParse(cookiesData); + cookiesArr = cookiesData.map(item => item.cookie); + cookiesArr.reverse(); + cookiesArr.push(...[$.getdata('CookieJD2'), $.getdata('CookieJD')]); + cookiesArr.reverse(); + cookiesArr = cookiesArr.filter(item => item !== "" && item !== null && item !== undefined); +} +const JD_API_HOST = 'https://api.m.jd.com/api'; +!(async () => { + if (!cookiesArr[0]) { + $.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"}); + return; + } + for (let i = 0; i < cookiesArr.length; i++) { + if (cookiesArr[i]) { + cookie = cookiesArr[i]; + $.UserName = decodeURIComponent(cookie.match(/pt_pin=(.+?);/) && cookie.match(/pt_pin=(.+?);/)[1]) + $.index = i + 1; + $.isLogin = true; + $.nickName = ''; + message = ''; + 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/"}); + + if ($.isNode()) { + await notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`); + } + continue + } + for(let i=0;i<3;++i){ + await getRedRain(); + await $.wait(5000); //防止黑号 + } + await showMsg(); + } + } +})() + .catch((e) => { + $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '') + }) + .finally(() => { + $.done(); + }) + +function showMsg() { + return new Promise(async resolve => { + let nowTime = new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000; + if (nowTime > new Date('2020/12/31 23:59:59+08:00').getTime()) { + $.msg($.name, '活动已结束', `咱江湖再见\nhttps://github.com/lxk0301/jd_scripts`, {"open-url": "https://github.com/lxk0301/jd_scripts"}); + if ($.isNode()) await notify.sendNotify($.name + '活动已结束', `咱江湖再见\n https://github.com/lxk0301/jd_scripts`) + } else { + $.msg($.name, '', `京东账号${$.index} ${$.nickName}\n${message}`); + } + resolve() + }) +} +function getRedRain() { + return new Promise(resolve => { + const body = {"actId":"RRA318jCtaXhZJgiLryM1iydEhc7Jna"}; + $.get(taskUrl('noahRedRainLottery', body), (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data.subCode === '0') { + console.log(`领取成功,获得${JSON.stringify(data.lotteryResult)}`) + // message+= `领取成功,获得${JSON.stringify(data.lotteryResult)}\n` + message+= `${data.lotteryResult.jPeasList[0].ext}:${(data.lotteryResult.jPeasList[0].quantity)}京豆\n` + + } else if (data.subCode === '8') { + console.log(`今日次数已满`) + message += `领取失败,今日已签到\n`; + } else { + console.log(`异常:${JSON.stringify(data)}`) + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} +function taskUrl(function_id, body = {}) { + return { + url: `${JD_API_HOST}?functionId=${function_id}&body=${escape(JSON.stringify(body))}&client=wh5&clientVersion=1.0.0&_=${new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000}`, + headers: { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-cn", + "Connection": "keep-alive", + "Content-Type": "application/x-www-form-urlencoded", + "Host": "api.m.jd.com", + "Referer": "https://h5.m.jd.com/active/redrain/index.html", + "Cookie": cookie, + "User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0") : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0"), + } + } +} +function TotalBean() { + return new Promise(async resolve => { + const options = { + "url": `https://wq.jd.com/user/info/QueryJDUserInfo?sceneval=2`, + "headers": { + "Accept": "application/json,text/plain, */*", + "Content-Type": "application/x-www-form-urlencoded", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-cn", + "Connection": "keep-alive", + "Cookie": cookie, + "Referer": "https://wqs.jd.com/my/jingdou/my.shtml?sceneval=2", + "User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0") : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0") + } + } + $.post(options, (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (data) { + data = JSON.parse(data); + if (data['retcode'] === 13) { + $.isLogin = false; //cookie过期 + return + } + $.nickName = data['base'].nickname; + } else { + console.log(`京东服务器返回空数据`) + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} +function safeGet(data) { + try { + if (typeof JSON.parse(data) == "object") { + return true; + } + } catch (e) { + console.log(e); + console.log(`京东服务器访问数据为空,请检查自身设备网络情况`); + return false; + } +} +function jsonParse(str) { + if (typeof str == "string") { + try { + return JSON.parse(str); + } catch (e) { + console.log(e); + $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') + return []; + } + } +} +// prettier-ignore +function Env(t,e){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("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}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("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(a,(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();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){let e={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).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}}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r)));let h=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];h.push(e),s&&h.push(s),i&&h.push(i),console.log(h.join("\n")),this.logs=this.logs.concat(h)}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("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)} diff --git a/activity/jd_pubg.js b/activity/jd_pubg.js index bed15df4..cc22b60c 100644 --- a/activity/jd_pubg.js +++ b/activity/jd_pubg.js @@ -330,7 +330,7 @@ function readShareCode() { console.log(`${$.name} API请求失败,请检查网路重试`) } else { if (data) { - console.log(`随机取${randomCount}个码放到您固定的互助码后面`) + console.log(`随机取${randomCount}个码放到您固定的互助码后面(不影响已有固定互助)`) data = JSON.parse(data); } } diff --git a/activity/jd_watch.js b/activity/jd_watch.js new file mode 100644 index 00000000..f1f9f25a --- /dev/null +++ b/activity/jd_watch.js @@ -0,0 +1,418 @@ +/* +发现-看一看 +活动结束时间未知 +已支持IOS双京东账号,Node.js支持N个京东账号 +脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js +脚本已内置需要抓的各40个包,但还建议自行抓包使用。 +使用 Charles 抓包,使用正则表达式:functionId=disc(AcceptTask|DoTask) 过滤请求 +选中所有请求,将所有请求保存为 JSON Session File 名称为 watch.chlsj,将该文件与jd_watch.js放在相同目录中 +使用手机抓包,将functionId=discAcceptTask的请求填入acceptBody,将discDoTask的body填入doBody +云端使用:将所抓的两种包使用@符号隔开后,分别填入到WATCH_ACCEPTBODY、WATCH_DOBODY环境变量 +============Quantumultx=============== +[task_local] +#京东看一看 +10 9 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_watch.js, tag=京东看一看, enabled=true + +================Loon============== +[Script] +cron "10 9 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_watch.js,tag=京东看一看 + +===============Surge================= +京东看一看 = type=cron,cronexp="10 9 * * *",wake-system=1,timeout=20,script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_watch.js + +============小火箭========= +京东看一看 = type=cron,script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_watch.js, cronexpr="10 9 * * *", timeout=900, enable=true + */ +const $ = new Env('京东看一看'); +let acceptBody = [ + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22240304968%7C11%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22mType%22%3A0%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=6e2542bc745427327751374bafb0ae9f&st=1608135453301&sv=100&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22232107521%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22mType%22%3A0%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=f1e01b42473e124f529b34d3735dd8cd&st=1608135468216&sv=112&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22239958722%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22mType%22%3A0%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=30a2d1a585cd96bf57e95aef4165243f&st=1608135483804&sv=122&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22236677182%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22mType%22%3A0%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=367aa97b9a7b3f2c655fd5fe06fcd6e8&st=1608135497273&sv=122&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22238431608%7C11%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22mType%22%3A0%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=528497aa9b9b3d932a889878b1bde4bd&st=1608135517143&sv=102&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22241148628%7C11%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22mType%22%3A0%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=7fa66f4476ee64d6085e472882b6a2ae&st=1608135530948&sv=112&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22239304423%7C11%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22mType%22%3A0%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=c96cdb81d78ce1863e4f8f04de9ab02d&st=1608135545789&sv=112&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22239883460%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22mType%22%3A0%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=94024b2f8b9601b287eb892b77a8d664&st=1608135560829&sv=111&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22240083804%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22mType%22%3A0%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=fdf5ae7ba7b94629ba7c2b80e2fbdb9f&st=1608135574998&sv=111&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22240424814%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22mType%22%3A0%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=39272f2f00f8bef1907dfe4cd6d6bd2b&st=1608135588583&sv=120&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22241354811%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22mType%22%3A0%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=2bf2bf47ea7372328e7d5e86db706a7c&st=1608135602797&sv=101&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22239763353%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22mType%22%3A0%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=fe03d9b6a1d711b9c16956a2a2eccc4c&st=1608135616512&sv=102&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22239887467%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22mType%22%3A0%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=4dd106e346bc57c4d5f8f5d2094b8ca4&st=1608135633772&sv=121&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22239911566%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22mType%22%3A0%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=78041fe3337060c1c6dc93f87828b0f2&st=1608135656081&sv=101&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22239209307%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22mType%22%3A0%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=1c56c633ea8664a1254a615cb9e08608&st=1608135674705&sv=102&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22232756870%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22mType%22%3A0%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=005a17ff4b97e822c5ba0f4ad82e82a6&st=1608135691877&sv=111&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22239906757%7C11%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22mType%22%3A0%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=aaef3fdea5bffafe30c5a8038e924ea2&st=1608135705696&sv=122&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22238055250%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22mType%22%3A0%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=5a7f7629dcf9714cf849eb7c198e75d4&st=1608135719481&sv=121&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22239911025%7C11%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22mType%22%3A0%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=bc5d52bc1ae461b861efdc0e80b53fb9&st=1608135732696&sv=111&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22232075505%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22mType%22%3A0%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=e3159f46f03193f4ff37555ac2ce3347&st=1608135747723&sv=101&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22230306175%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22mType%22%3A0%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=ef74243798ed813e1a7318002fd9b658&st=1608135764036&sv=122&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22232072753%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22mType%22%3A0%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=9c9bd997e65ffce799fe117bbe700e83&st=1608135777862&sv=110&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22230354156%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22mType%22%3A0%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=f4bd50d42d37d901f2eae9aeb92097be&st=1608135793215&sv=120&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22230474392%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22mType%22%3A0%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=8e7774c8053ff1b365d9742064b575e8&st=1608135807319&sv=101&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22241113475%7C11%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22mType%22%3A0%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=8a9a3baa7ad9de8752f40a020d02b9ed&st=1608135821860&sv=100&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22240814080%7C11%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22mType%22%3A0%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=cf060e827388757075639b488e10a271&st=1608135837068&sv=102&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22239281739%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22mType%22%3A0%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=265def4ee8405300076ebecb8bc16244&st=1608135850992&sv=111&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22239326056%7C11%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22mType%22%3A0%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=0c06232d2d28875540ba2be7e3cf0248&st=1608135864617&sv=102&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22239966731%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22mType%22%3A0%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=a57bc6809cb01c4bf0807c15be141100&st=1608135879159&sv=110&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22228925366%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22mType%22%3A0%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=7cfec28169bec339ca5d58083bff413e&st=1608135892590&sv=102&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22241141664%7C11%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22mType%22%3A0%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=1268ce3aa86c9fd1ceb3dab244801be1&st=1608135922596&sv=102&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22239879879%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22mType%22%3A0%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=727339ecac9c040a6a8020b4462ed085&st=1608135944029&sv=120&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22240921105%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22mType%22%3A0%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=dad6edd5a8f5352039637e55b853c58b&st=1608135958263&sv=122&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22239913667%7C11%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22mType%22%3A0%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=263a98386f5a2ce3317727d5cd35ae31&st=1608135972412&sv=110&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22228195657%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22mType%22%3A0%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=bca8c830cb94089c31fa4039596d49e8&st=1608135986945&sv=102&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22232232068%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22mType%22%3A0%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=40a4ee9d60a14b3fcba4586502f0940b&st=1608136001520&sv=111&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22231078213%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22mType%22%3A0%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=83672faa82ff55d2e01a86551c53bf57&st=1608136015469&sv=122&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22228889429%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22mType%22%3A0%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=1d5f374fe483ee83e8b10a4c213c3e4f&st=1608136032181&sv=122&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22239891037%7C11%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22mType%22%3A0%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=98bc0ee5edf5790cb968ac5705939a23&st=1608136046783&sv=111&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22239349437%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22mType%22%3A0%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=a0851d4dd20ea28e463b38c2604220c5&st=1608135079843&sv=120&uts=0f31TVRjBSsqndu4/jgUPz6uymy50MQJbL8Z8Ji5qW2Orjpl0%2BzyRPbn4M%2BsWaSKGP0oBktuYYM5pyBaI0RqkeXBgu6TJZdGHo2xvPne18Dzkk1A7m%2BLqBuD2mrzLZjK%2BrWdDdNBD9pQPajs0rQAp%2Bu4eLnMSDTc7xxKGmxZ6YlvLbYtQu1%2B/z4woT25IKqETrcboP4nZzsjKlRbBnlsrQ%3D%3D&uuid=hjudwgohxzVu96krv/T6Hg%3D%3D&wifiBssid=unknown` +] +let doBody = [ + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22240304968%7C11%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22role%22%3A1%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=a33e35fe4dbaebc0bb6cf31acf696624&st=1608135463915&sv=100&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22232107521%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22role%22%3A1%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=a3133bb0bdd798b3264b94fbe25fe39f&st=1608135478529&sv=112&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22239958722%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22role%22%3A1%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=01e35c947f923e9818180e6e7aa7767f&st=1608135494151&sv=112&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22236677182%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22role%22%3A1%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=8fe3ce466b10be78b721560d8ae37a0c&st=1608135507710&sv=102&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22238431608%7C11%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22role%22%3A1%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=76dbae0f7044496b445996cce4625462&st=1608135527407&sv=112&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22241148628%7C11%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22role%22%3A1%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=77a5ee97b33f4a3278899e68136ece47&st=1608135541366&sv=111&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22239304423%7C11%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22role%22%3A1%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=4e06a172b3fd68a0f61af4eb9bd96f3b&st=1608135556280&sv=121&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22239883460%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22role%22%3A1%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=20ab69a69fbe79c35b5ef680330957bc&st=1608135571343&sv=110&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22240083804%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22role%22%3A1%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=a62f9e3a83f38109038ce6542ca47791&st=1608135585500&sv=112&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22240424814%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22role%22%3A1%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=fc5c80a2660f1f02c5c7dec0b1fd3a28&st=1608135599007&sv=122&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22241354811%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22role%22%3A1%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=a5d979f12d580c2704cc109542567501&st=1608135613226&sv=111&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22239763353%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22role%22%3A1%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=65c634dfc07ea15edfb40d55db1e5af4&st=1608135626981&sv=122&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22239887467%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22role%22%3A1%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=4c2e554b8a38234c0bcd2c96bb84b980&st=1608135644097&sv=121&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22239911566%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22role%22%3A1%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=bd2ea3163b169eae08a50ba193248ff2&st=1608135666530&sv=102&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22239209307%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22role%22%3A1%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=7a89d628a4f83130accce92ea928ff31&st=1608135684848&sv=100&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22232756870%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22role%22%3A1%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=cb6fe5ac83bd71f14ab1d1603158df43&st=1608135702313&sv=120&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22239906757%7C11%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22role%22%3A1%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=ec6f3b9600854f398e6938b3db66f644&st=1608135716033&sv=111&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22238055250%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22role%22%3A1%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=074730c1d3a2f27f3dc90f791d9b5a6d&st=1608135729763&sv=110&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22239911025%7C11%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22role%22%3A1%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=fb2c75fd39c07ced2c72c58d7d17fd61&st=1608135742970&sv=121&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22232075505%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22role%22%3A1%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=2df23f8cf9f729caf39cfc37be2e5cbb&st=1608135758073&sv=100&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22230306175%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22role%22%3A1%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=9661628a4a9fbea9090851a711ce493e&st=1608135774356&sv=101&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22232072753%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22role%22%3A1%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=fd5871c8c2f6cdd7aeec608b9a920a15&st=1608135788189&sv=120&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22230354156%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22role%22%3A1%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=53de468b75938e0f97bf3ac565e6541f&st=1608135803533&sv=110&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22230474392%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22role%22%3A1%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=969330bffe9c6ad2ea30e5675d58c8a0&st=1608135817731&sv=110&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22241113475%7C11%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22role%22%3A1%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=154516384d1cd467fe64e11444b2c731&st=1608135832187&sv=112&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22240814080%7C11%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22role%22%3A1%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=517e373df7f0929524dc36fe6dad630d&st=1608135847506&sv=112&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22239281739%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22role%22%3A1%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=9238b4f17dbb8f46f3f61898588c09f2&st=1608135861442&sv=122&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22239326056%7C11%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22role%22%3A1%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=c440b5ccd3393566befc3da4a3a32c23&st=1608135874985&sv=101&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22239966731%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22role%22%3A1%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=4e92a93c2985165670d4bdd8fac62b62&st=1608135889532&sv=100&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22228925366%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22role%22%3A1%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=462d9bb4f828f495797d82e6b403789d&st=1608135902900&sv=102&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22241141664%7C11%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22role%22%3A1%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=7283e2c5a24e392c66dc02b1e073f154&st=1608135932827&sv=120&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22239879879%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22role%22%3A1%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=2efca2d6ae6971cb924ca2de521548cf&st=1608135954339&sv=121&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22240921105%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22role%22%3A1%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=24cff3a417bb95f9360cbae5a90dc2df&st=1608135968677&sv=122&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22239913667%7C11%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22role%22%3A1%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=1f3983c32ad4f6aff614018e06ba0210&st=1608135982853&sv=122&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22228195657%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22role%22%3A1%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=cd5639e8f4e8ae35ab8ac9593d71f2ed&st=1608135997381&sv=102&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22232232068%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22role%22%3A1%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=5270d376f680afaee053c7d3a760f24c&st=1608136011993&sv=120&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22231078213%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22role%22%3A1%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=103ba8fdc7fcf377e40360a089bbba6d&st=1608136025797&sv=102&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22228889429%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22role%22%3A1%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=b57fa95ca54dd0a6104c5aff99efa60e&st=1608136042516&sv=111&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22239891037%7C11%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22role%22%3A1%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK\/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A\/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=37907fdd42eb90cdb38b1534b5f82623&st=1608136057117&sv=112&uts=0f31TVRjBSsqndu4\/jgUPz6uymy50MQJeV3gx7opiKtygGyo92leRFrPVOIo20NforiduH91mLoQ1o2qJ8daXhf\/xhRJmtkYS6BpaDYFbcnRsHq1NWDoHNSdz0IHasLR0qvMInTX\/zXP6xhvVS%2BkNhIG3OBassF9hJCEvZYn2fZrNJ0pGMFd1nSajoLNxMEL\/CpQOaWCkDUj2zuEy%2BNBnw%3D%3D&uuid=hjudwgohxzVu96krv\/T6Hg%3D%3D&wifiBssid=unknown`, + `area=19_1601_50258_51885&body=%7B%22referPageId%22%3A%22discRecommend%22%2C%22itemId%22%3A%22239349437%7C2%22%2C%22bizType%22%3A1%2C%22taskId%22%3A%223%22%2C%22role%22%3A1%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone11%2C8&eid=eidIf12a8121eas2urxgGc%2BzS5%2BUYGu1Nbed7bq8YY%2BgPd0Q0t%2BiviZdQsxnK/HTA7AxZzZBrtu1ulwEviYSV3QUuw2XHHC%2BPFHdNYx1A/3Zt8xYR%2Bd3&isBackground=N&joycious=230&lang=zh_CN&networkType=4g&networklibtype=JDNetworkBaseAF&openudid=88732f840b77821b345bf07fd71f609e6ff12f43&osVersion=14.2&partner=apple&rfs=0000&scope=11&screen=828%2A1792&sign=de5492702084ea8d64e77b5a05a26508&st=1608135090210&sv=111&uts=0f31TVRjBSsqndu4/jgUPz6uymy50MQJbL8Z8Ji5qW2Orjpl0%2BzyRPbn4M%2BsWaSKGP0oBktuYYM5pyBaI0RqkeXBgu6TJZdGHo2xvPne18Dzkk1A7m%2BLqBuD2mrzLZjK%2BrWdDdNBD9pQPajs0rQAp%2Bu4eLnMSDTc7xxKGmxZ6YlvLbYtQu1%2B/z4woT25IKqETrcboP4nZzsjKlRbBnlsrQ%3D%3D&uuid=hjudwgohxzVu96krv/T6Hg%3D%3D&wifiBssid=unknown`, +] + +function preload(){ + const fs = require('fs'); + let raw = fs.readFileSync('watch.chlsj'); + let s = JSON.parse(raw); + s.map(vo=>{ + let doTask = vo.request.header.headers.filter(vo=>vo['name'] === ":path" && vo['value'].indexOf('discDoTask')>0)[0] + if(doTask){ + doBody.push(vo.request.body.text) + }else{ + acceptBody.push(vo.request.body.text) + } + }) +} +const notify = $.isNode() ? require('./sendNotify') : ''; +//Node.js用户请在jdCookie.js处填写京东ck; +const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; +let jdNotify = true;//是否关闭通知,false打开通知推送,true关闭通知推送 +//IOS等用户直接用NobyDa的jd cookie +let cookiesArr = [], cookie = '', message; +if ($.isNode()) { + Object.keys(jdCookieNode).forEach((item) => { + cookiesArr.push(jdCookieNode[item]) + }) + if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {}; +} else { + let cookiesData = $.getdata('CookiesJD') || "[]"; + cookiesData = jsonParse(cookiesData); + cookiesArr = cookiesData.map(item => item.cookie); + cookiesArr.reverse(); + cookiesArr.push(...[$.getdata('CookieJD2'), $.getdata('CookieJD')]); + cookiesArr.reverse(); + cookiesArr = cookiesArr.filter(item => item !== "" && item !== null && item !== undefined); +} +const JD_API_HOST = 'https://api.m.jd.com/client.action'; +!(async () => { + if ($.isNode()) { + const fs = require('fs'); + try { + if (fs.existsSync('watch.chlsj')) { + preload() + if (doBody.length < 40) { + console.log(`${$.name}Body数小于40,无法完成任务!`) + } + } + if (process.env.WATCH_ACCEPTBODY && process.env.WATCH_DOBODY) { + acceptBody = process.env.WATCH_ACCEPTBODY.split('@'); + doBody = process.env.WATCH_DOBODY.split('@'); + console.log(`\n环境变量提供的acceptBody数量:${acceptBody.length}`) + console.log(`环境变量提供的doBody:数量${doBody.length}\n`) + } + } catch (err) { + console.error(err) + } + console.log(`\nacceptBody数量:${acceptBody.length}`) + console.log(`doBody:数量${doBody.length}\n`) + } + if (!cookiesArr[0]) { + $.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"}); + return; + } + for (let i = 0; i < cookiesArr.length; i++) { + if (cookiesArr[i]) { + cookie = cookiesArr[i]; + $.UserName = decodeURIComponent(cookie.match(/pt_pin=(.+?);/) && cookie.match(/pt_pin=(.+?);/)[1]) + $.index = i + 1; + $.isLogin = true; + $.nickName = ''; + message = ''; + 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/"}); + + if ($.isNode()) { + await notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`); + } + continue + } + await jdHealth() + await showMsg(); + } + } +})() + .catch((e) => { + $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '') + }) + .finally(() => { + $.done(); + }) +async function jdHealth() { + $.bean = 0 + await getTaskList() + if($.task) { + console.log(`${$.name}浏览次数:${$.task.times}/${$.task.maxTimes}`) + let i = 0, j = $.task.times + while(j < $.task.maxTimes) { + if (!acceptBody[i]) break + let res = await acceptTask(acceptBody[i++]) + if (res['success']) { + await $.wait(10000) + await doTask(doBody[i-1]) + j++ + } + await $.wait(500); + } + await getTaskList() + if ($.task.times===$.task.maxTimes) + await reward() + } +} + +function showMsg() { + return new Promise(async resolve => { + // $.msg($.name, '', `京东账号${$.index} ${$.nickName}\n${message}`); + let nowTime = new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000; + if (nowTime > new Date('2020/12/31 23:59:59+08:00').getTime()) { + $.msg($.name, '活动已结束', `咱江湖再见\nhttps://github.com/lxk0301/jd_scripts`, {"open-url": "https://github.com/lxk0301/jd_scripts"}); + if ($.isNode()) await notify.sendNotify($.name + '活动已结束', `咱江湖再见\n https://github.com/lxk0301/jd_scripts`) + } else { + $.msg($.name, '', `京东账号${$.index} ${$.nickName}\n${message}`); + } + resolve() + }) +} +// 任务列表 +function getTaskList() { + let body = "body=%7B%22bizType%22%3A1%2C%22referPageId%22%3A%22discRecommend%22%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone10%2C2&eid=eidIF3CF0112RTIyQTVGQTEtRDVCQy00Qg%3D%3D6HAJa9%2B/4Vedgo62xKQRoAb47%2Bpyu1EQs/6971aUvk0BQAsZLyQAYeid%2BPgbJ9BQoY1RFtkLCLP5OMqU&isBackground=N&joycious=200&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&openudid=53f4d9c70c1c81f1c8769d2fe2fef0190a3f60d2&osVersion=14.2&partner=apple&rfs=0000&scope=01&screen=1242%2A2208&sign=7ac41799deb4b174516255f911adb612&st=1607942822112&sv=100&uts=0f31TVRjBStSN/KN45aFsqdm3cWx37OzS1DDtk92Jjb1GFDLcR3WqIplv0XA1h/hn4ycbABQbxmY2Z6OJ41XlUNqODg0xhlFxdy9vzwBobHzhtVmCcORklu9W1cB6YcW0kYJNzSsy5ypxaQvGUf1oq/yMw/Hbo5lD3f4srHsrWzrsnKQ4K7HYtCFiZ5kn/AC%2B/tEmJRu9yM5j2nCMqdvmg%3D%3D&uuid=hjudwgohxzVu96krv/T6Hg%3D%3D" + return new Promise(resolve => { + $.post(taskPostUrl("discTaskList", body), (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data.busiCode === '0') { + $.task = data['data']['discTasks'][1] + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(data); + } + }) + }) +} +// 开始看 +function acceptTask(body) { + return new Promise(resolve => { + $.post(taskPostUrl("discAcceptTask", body), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if(data.success){ + // console.log('浏览开始请求成功') + }else{ + // console.log(`${data.message}`) + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(data); + } + }) + }) +} +// 完成看 +function doTask(body) { + return new Promise(resolve => { + $.post(taskPostUrl("discDoTask", body), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if(data.success){ + console.log(`浏览成功,浏览进度:${data.data.alreadyBrowseNum}/${data.data.totalBrowseNum}`) + }else{ + console.log(`${data.message}`) + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(data); + } + }) + }) +} +// 完成看 +function reward() { + let body = "area=12_904_908_57903&body=%7B%22taskId%22%3A%223%22%2C%22bizType%22%3A1%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone10%2C2&eid=eidIF3CF0112RTIyQTVGQTEtRDVCQy00Qg%3D%3D6HAJa9%2B/4Vedgo62xKQRoAb47%2Bpyu1EQs/6971aUvk0BQAsZLyQAYeid%2BPgbJ9BQoY1RFtkLCLP5OMqU&isBackground=N&joycious=200&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&openudid=53f4d9c70c1c81f1c8769d2fe2fef0190a3f60d2&osVersion=14.2&partner=apple&rfs=0000&scope=01&screen=1242%2A2208&sign=17715aee2221001db42054582e246b12&st=1608106937687&sv=102&uts=0f31TVRjBSueCA6d1433N/VvOpFVgTQ3ayM3m/f8v%2B5SZcxHDy1W0aeMpwRE60%2B5NCC1QBAEVnTfdyUBY1v5dzjJYNmtBpfPHeEOqjU2lcvvt9i4lMwuL6cFvhiheX1QlG4SCsmZu6Zhj5aCQji0PhIRINWPoPq7tOwraAhYokfkEoI1Vcv3DgT8TKdKMtBfCtTr%2BEIaEPSfItFIJPlqXw%3D%3D&uuid=hjudwgohxzVu96krv/T6Hg%3D%3D" + return new Promise(resolve => { + $.post(taskPostUrl("discReceiveTaskAward", body), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if(data.success){ + console.log(`领奖成功,${$.task.taskSubTitleExt}`) + message += `京东看一看:${$.task.taskSubTitleExt}`; + await showMsg(); + }else{ + console.log(`领奖失败,${data.message}`) + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(data); + } + }) + }) +} +function taskPostUrl(function_id, body = {}) { + $.log(`${function_id}`) + return { + url: `${JD_API_HOST}?functionId=${function_id}`, + body: body, + headers: { + "Cookie": cookie, + 'Content-Type': 'application/x-www-form-urlencoded', + "User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0") : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0"), + } + } +} + +function TotalBean() { + return new Promise(async resolve => { + const options = { + "url": `https://wq.jd.com/user/info/QueryJDUserInfo?sceneval=2`, + "headers": { + "Accept": "application/json,text/plain, */*", + "Content-Type": "application/x-www-form-urlencoded", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-cn", + "Connection": "keep-alive", + "Cookie": cookie, + "Referer": "https://wqs.jd.com/my/jingdou/my.shtml?sceneval=2", + "User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0") : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0") + } + } + $.post(options, (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (data) { + data = JSON.parse(data); + if (data['retcode'] === 13) { + $.isLogin = false; //cookie过期 + return + } + $.nickName = data['base'].nickname; + } else { + console.log(`京东服务器返回空数据`) + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} +function safeGet(data) { + try { + if (typeof JSON.parse(data) == "object") { + return true; + } + } catch (e) { + console.log(e); + console.log(`京东服务器访问数据为空,请检查自身设备网络情况`); + return false; + } +} +function jsonParse(str) { + if (typeof str == "string") { + try { + return JSON.parse(str); + } catch (e) { + console.log(e); + $.msg($.name, '', '不要在BoxJS手动复制粘贴修改cookie') + return []; + } + } +} +// prettier-ignore +function Env(t,e){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("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}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("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(a,(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();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){let e={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).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}}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r)));let h=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];h.push(e),s&&h.push(s),i&&h.push(i),console.log(h.join("\n")),this.logs=this.logs.concat(h)}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("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)} diff --git a/activity/jr_sign.js b/activity/jr_sign.js new file mode 100644 index 00000000..40c9a018 --- /dev/null +++ b/activity/jr_sign.js @@ -0,0 +1,199 @@ +/* +金融打卡领年终奖 +活动时间:2020-12-8 到 2020-12-31 +更新地址:https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jr_sign.js +已支持IOS双京东账号, Node.js支持N个京东账号 +脚本兼容: QuantumultX, Surge, Loon, 小火箭,JSBox, Node.js +============Quantumultx=============== +[task_local] +#金融打卡领年终奖 +10 6 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jr_sign.js, tag=金融打卡领年终奖, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_redPacket.png, enabled=true + +================Loon============== +[Script] +cron "10 6 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jr_sign.js, tag=金融打卡领年终奖 + +===============Surge================= +金融打卡领年终奖 = type=cron,cronexp="10 6 * * *",wake-system=1,timeout=20,script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jr_sign.js + +============小火箭========= +金融打卡领年终奖 = type=cron,script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jr_sign.js, cronexpr="10 6 * * *", timeout=200, enable=true + */ +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 = '', message; +if ($.isNode()) { + Object.keys(jdCookieNode).forEach((item) => { + cookiesArr.push(jdCookieNode[item]) + }) + if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => { + }; +} else { + let cookiesData = $.getdata('CookiesJD') || "[]"; + cookiesData = jsonParse(cookiesData); + cookiesArr = cookiesData.map(item => item.cookie); + cookiesArr.reverse(); + cookiesArr.push(...[$.getdata('CookieJD2'), $.getdata('CookieJD')]); + cookiesArr.reverse(); + cookiesArr = cookiesArr.filter(item => item !== "" && item !== null && item !== undefined); +} +const JD_API_HOST = 'https://api.m.jd.com/api'; +!(async () => { + if (!cookiesArr[0]) { + $.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"}); + return; + } + for (let i = 0; i < cookiesArr.length; i++) { + if (cookiesArr[i]) { + cookie = cookiesArr[i]; + $.UserName = decodeURIComponent(cookie.match(/pt_pin=(.+?);/) && cookie.match(/pt_pin=(.+?);/)[1]) + $.index = i + 1; + $.isLogin = true; + $.nickName = ''; + message = ''; + 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/"}); + + if ($.isNode()) { + await notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`); + } + continue + } + await sign() + await showMsg(); + } + } +})() + .catch((e) => { + $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '') + }) + .finally(() => { + $.done(); + }) + +function showMsg() { + return new Promise(async resolve => { + let nowTime = new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000; + if (nowTime > new Date('2020/12/31 23:59:59+08:00').getTime()) { + $.msg($.name, '活动已结束', `咱江湖再见\nhttps://github.com/lxk0301/jd_scripts`, {"open-url": "https://github.com/lxk0301/jd_scripts"}); + if ($.isNode()) await notify.sendNotify($.name + '活动已结束', `咱江湖再见\n https://github.com/lxk0301/jd_scripts`) + } else { + $.msg($.name, '', `【京东账号${$.index}】${$.nickName}\n${message}`); + } + resolve() + }) +} + + +function sign() { + return new Promise(resolve => { + $.post(taskUrl(), (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + console.log(data.resultData.message) + message += `${data.resultData.message}` + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} + +function taskUrl() { + return { + url: `https://ms.jr.jd.com/gw/generic/hy/h5/m/signIn12?_=${new Date().getTime() + new Date().getTimezoneOffset() * 60 * 1000 + 8 * 60 * 60 * 1000}`, + body : 'reqData=%7B%22channelLv%22%3A%22changjinglouceng%22%2C%22site%22%3A%22JD_JR_APP%22%7D', + headers: { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-cn", + "Connection": "keep-alive", + "Content-Type": "application/x-www-form-urlencoded", + "Host": "ms.jr.jd.com", + "Referer": "https://member.jr.jd.com/activities/signin-annual/index.html?channelLv=changjinglouceng&jrcontainer=h5&jrlogin=true", + "Cookie": cookie, + "User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0") : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0"), + } + } +} + +function TotalBean() { + return new Promise(async resolve => { + const options = { + "url": `https://wq.jd.com/user/info/QueryJDUserInfo?sceneval=2`, + "headers": { + "Accept": "application/json,text/plain, */*", + "Content-Type": "application/x-www-form-urlencoded", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-cn", + "Connection": "keep-alive", + "Cookie": cookie, + "Referer": "https://wqs.jd.com/my/jingdou/my.shtml?sceneval=2", + "User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0") : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0") + } + } + $.post(options, (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (data) { + data = JSON.parse(data); + if (data['retcode'] === 13) { + $.isLogin = false; //cookie过期 + return + } + $.nickName = data['base'].nickname; + } else { + console.log(`京东服务器返回空数据`) + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} + +function safeGet(data) { + try { + if (typeof JSON.parse(data) == "object") { + return true; + } + } catch (e) { + console.log(e); + console.log(`京东服务器访问数据为空,请检查自身设备网络情况`); + return false; + } +} +function jsonParse(str) { + if (typeof str == "string") { + try { + return JSON.parse(str); + } catch (e) { + console.log(e); + $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') + return []; + } + } +} +// prettier-ignore +function Env(t,e){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("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}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("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(a,(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();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){let e={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).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}}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r)));let h=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];h.push(e),s&&h.push(s),i&&h.push(i),console.log(h.join("\n")),this.logs=this.logs.concat(h)}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("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)} diff --git a/backUp/iCloud.md b/backUp/iCloud.md new file mode 100644 index 00000000..22696205 --- /dev/null +++ b/backUp/iCloud.md @@ -0,0 +1,208 @@ +## 1.安装 Node.js 环境 + +[下载地址](https://nodejs.org/zh-tw/download/ ) + +根据自己的操作系统下载 + +傻瓜式安装,一直下一步即可。 + + + +## 2.下载源码 + +![BclSld.png](https://s1.ax1x.com/2020/11/04/BclSld.png) + +点击红框处下载压缩包 + +## 3.安装依赖、增加入口文件、增加cookie + +压缩包解压后进入项目文件夹 + +- Windows 用户按住 **shift** 点击右键,点击 **在此处打开命令窗口** +- Mac 用户通过终端,自行进入该文件夹 + +在命令行内输入 `npm i `,等待运行完成。 + +此时,项目文件夹内会多出一个 `node_modules`文件夹 + + **增加入口文件** + +方案一:同一个仓库下同一个时间,执行多个脚本 + +在项目文件夹内新建 `index.js` + +编辑文件 + +```javascript +'use strict'; +exports.main_handler = async (event, context, callback) => { + //解决云函数热启动问题 + delete require.cache[require.resolve('./jd_xtg1.js')]; + require('./jd_xtg1.js') //这里写你想要的脚本 + require('./jd_xtg2.js') //这里写你想要的脚本 + require('./jd_xtg3.js') //这里写你想要的脚本 +} + +``` +此时,同一时间点下,会同时执行多个脚本,触发器触发后,index.js文件中require()下的所有脚本都会被执行 + +**优点**:同一时间下可以同时执行多个脚本,适合脚本种类少的repository,对脚本数量少的repository推荐使用此方案
**缺点**:多个脚本不同时间点运行无法满足 + +方案二:同一个仓库下不同的时间点,分别执行不同的脚本(类似GitHub Action执行机制) + +在项目文件夹内新建 `index.js` + +编辑文件 + +```javascript +'use strict'; +exports.main_handler = async (event, context, callback) => { + for (const v of event["Message"].split("\r\n")) { + //解决云函数热启动问题 + delete require.cache[require.resolve(`./${v}.js`)]; + console.log(v); + require(`./${v}.js`) + } +} + +``` + +此时触发管理按照下图中进行设置,附加信息选择“是”,内容填写需要传递执行的具体脚本文件名,以回车键换行。触发器触发后,附加信息栏内的脚本会被执行,设置多个不同时间点的触发器达到类似GitHub Action的效果 + +**优点**:可以满足个性化需求,同一个repository下只需要设置不同的触发器,可以实现不同时间点分别执行不同的脚本
**缺点**:repository下脚本过多,如果需要设置多个触发器,实现个性化运行效果,由于云函数的限制,最多只能设置10个 + +[![B20KxI.png](https://s1.ax1x.com/2020/11/05/B20KxI.png)](https://imgchr.com/i/B20KxI) +[![BRCG0H.png](https://s1.ax1x.com/2020/11/05/BRCG0H.png)](https://imgchr.com/i/BRCG0H) + +**注意:**
+Ⅰ方案一与方案二不能混合到同一个index.js文件中使用,同一个仓库下,二者只能选择其一。
+Ⅱ感谢[issues#115](https://github.com/lxk0301/jd_scripts/issues/115)中的解决方案,目前云函数连续测试已经可以规避热启动问题了。
+Ⅲ在确保完全按照本教程设置的情况下测试云函数运行情况,对于部分人运行日志中出现某些脚本运行失败其他正常,并且错误提示带有strict字样的,请自行删除index.js中的```'use strict';```,再做测试
+ + **增加cookie** + +打开项目文件内的 `jdCookie.js` + +在最上面的 `CookieJDs`里写入 cookie ,多个账号以逗号分隔 + +例如 + +```javascript +let CookieJDs = [ + 'pt_key=xxx;pt_pin=xxx;', + 'pt_key=zzz;pt_pin=zzz;', + 'pt_key=aaa;pt_pin=xxxaaa' +] +``` + + + +## 4.上传至腾讯云 + +[腾讯云函数地址]( https://console.cloud.tencent.com/scf/index ) + +编写函数 + +登录后,点击管理控制台 + +单击左侧导航栏**函数服务**,进入“函数服务”页面。 +在页面上方选择一个地域,最好选择离你常用地区近点的,不至于导致账号异常。单击**新建**。如下图所示: + +![iCloud1](../icon/iCloud1.png) + +在“新建函数”页面填写函数基础信息,单击**下一步**。如下图所示: + +![iCloud2](../icon/iCloud2.png) + +**函数名称**:可以自定义,比如为jd。
**运行环境**:选择 “Nodejs 12.16”。
**创建方式**:选择 “空白函数”。 + +确保环境为Nodejs 12.16,执行方法改为:index.main_handler,提交方式建议选本地文件夹,然后从GitHub项目克隆Zip压缩包,解压成文件夹,然后点击这个上传把文件夹上传进来(记得node_modules文件夹一并上传或者将node_modules文件夹上传到“层”,之后选择“函数管理”-“层管理”绑定上传好的层),完了后点击下面的高级设置。 + +![iCloud3](../icon/iCloud3.png) + +内存用不了太大,64MB就够了(64M内存,免费时长6,400,000秒,内存与免费时长大致关系可以参看云函数官方说明),超时时间改为最大的900秒,然后点击最下面的完成。 + +![iCloud4](../icon/iCloud4.png) + +## 5.设置触发器 + +点击刚创建的函数 + +![BcGa8O.png](https://s1.ax1x.com/2020/11/04/BcGa8O.png) + +点击如图所示 + +![BcGvM4.png](https://s1.ax1x.com/2020/11/04/BcGvM4.png) + +创建触发器 + +![iCloud6](../icon/iCloud6.png) + +触发方式默认“**定时触发**”,定时任务名称随便起个名字,触发周期根据自己需要自行设置。 + +想进阶使用触发器的自行查看本文中方案一和方案二中的说明 + +关于触发周期中的自定义触发周期,使用的是 Cron表达式,这个自行学习下吧 + + +[Corn文档](https://cloud.tencent.com/document/product/583/9708#cron-.E8.A1.A8.E8.BE.BE.E5.BC.8F) + +目前repo中按照每个脚本一个定时器的方式设置到云函数中,大约需要触发器10多个,由于云函数触发器限制最多10个,需要对触发器进行整合,整合后触发器保持在10个以内,以下设置仅供参考
+ +| **JavaScript** | **脚本名称** | **活动时间** | **原Repository UTC时间** | **适用于云函数的北京时间** | **serverless.yml** | +| :----------------------: | :----------------------: | :----------: | :-----------------------: | :-------------------------: | :----------------: | +| `jd_bean_change` | 京豆变动通知 | 长期 | 0 2 * * * | 0 1 */1 * * | 30 7 * * * | +| `jd_bean_home` | 领京豆额外奖励 | 长期 | / | 0 1 */1 * * | 30 7 * * * | +| `jd_bean_sign` | 京豆签到 | 长期 | 0 16 * * * | 0 0 */1 * * | 0 0 * * * | +| `jd_blueCoin` | 京小超兑换奖品 | 长期 | 0 16 * * * | 0 1 */1 * * | 0 0 * * * | +| `jd_car` | 京东汽车 | 长期 | / | 0 0 */1 * * | 0 0 * * * | +| `jd_club_lottery` | 摇京豆 | 长期 | 0 16 * * * | 0 0 */1 * * | 0 0 * * * | +| `jd_crazy_joy` | 疯狂的joy | 长期 | / | / | 30 7 * * * | +| `jd_crazy_joy_coin` | 疯狂的joy挂机 | 长期 | / | / | / | +| `jd_daily_egg` | 京东金融-天天提额 | 长期 | 10 */3 * * * | 0-12/3 */3 * * * | 8 */3 * * * | +| `jd_dreamFactory` | 京喜工厂 | 长期 | / | */30 * * * * | 3 */1 * * * | +| `jd_ds` | 京东代属(校园用户) | 长期 | / | / | / | +| `jd_fruit` | 东东农场 | 长期 | 20 23,4,10 * * * | 0,5,10 8,9,12,18,23,0 * * * | 5 6-18/6 * * * | +| `jd_health` | 健康抽奖机 | 短期 | / | 0 0 */1 * * | 10 0 * * * | +| `jd_jdfactory` | 东东工厂 | 长期 | / | */30 * * * * | 3 */1 * * * | +| `jd_jdh` | 京东健康APP | 短期 | / | / | 30 7 * * * | +| `jd_jdzz` | 京东赚赚 | 长期 | / | / | 3 1 * * * | +| `jd_joy` | 宠汪汪 | 长期 | 0 0,1,4,10,15,16 * * * | 0,5,10 8,9,12,18,23,0 * * * | 3 */1 * * * | +| `jd_joy_feedPets` | 宠汪汪单独喂食 | 长期 | */20 */1 * * * | 0-12/3 */3 * * * | 3 */1 * * * | +| `jd_joy_help` | 宠汪汪强制为别人助力 | 长期 | / | / | / | +| `jd_joy_reward` | 宠汪汪兑换奖品 | 长期 | 0 0,4,8,16 * * * | 0 8,12,16,0 */1 * * | 0 0-16/8,20 * * * | +| `jd_joy_run` | 宠汪汪邀请助力与赛跑助力 | 长期 | / | / | / | +| `jd_joy_steal` | 宠汪汪偷好友狗粮与积分 | 长期 | 0 16,22 * * * | 0 0,6,20 */1 * * | 0 0-16/8,20 * * * | +| `jd_kd` | 京东快递 | 长期 | / | 0 1 */1 * * | 3 1 * * * | +| `jd_live` | 京东直播18豆 | 长期 | / | / | 0 0-16/8,20 * * * | +| `jd_live_redrain` | 超级直播间红包雨 | 短期 | / | 0 0,20,9-23/2 * * MON-FRI | / | +| `jd_lotteryMachine` | 京东抽奖机 | 长期 | 11 17 * * * | 0 0 */1 * * | 10 0 * * * | +| `jd_moneyTree` | 摇钱树 | 长期 | 40 */3 * * * | 0-12/3 */3 * * * | 3 */1 * * * | +| `jd_ms_redrain` | 秒杀红包雨 | 短期 | / | 0 1 */1 * * | 10 0 * * * | +| `jd_necklace` | 点点券 | 长期 | / | 0 0,6,20 */1 * * | 0 0-16/8,20 * * * | +| `jd_pet` | 东东萌宠 | 长期 | 35 23,4,10 * * * | 0,5,10 8,9,12,18,23,0 * * * | 5 6-18/6 * * * | +| `jd_petTreasureBox` | 宠汪汪聚宝盆 | 长期 | / | / | / | +| `jd_pigPet` | 京东金融-养猪猪 | 长期 | / | 0-12/3 */3 * * * | 3 1 * * * | +| `jd_plantBean` | 种豆得豆 | 长期 | 0 23,0-14/1 * * * | 0-12/3 */3 * * * | 3 */1 * * * | +| `jd_rankingList` | 京东排行榜 | 长期 | 11 18 * * * | 0 0 */1 * * | 30 7 * * * | +| `jd_redPacket` | 全民开红包 | 长期 | 0 17 * * * | 0 1 */1 * * | 10 0 * * * | +| `jd_shop` | 进店领豆 | 长期 | 0 16 * * * | 0 0 */1 * * | 10 0 * * * | +| `jd_small_home` | 东东小窝 | 长期 | / | 0 0,6,20 */1 * * | 10 0 * * * | +| `jd_speed` | 天天加速 | 长期 | 33 */3 * * * | 0-12/3 */3 * * * | 8 */3 * * * | +| `jd_superMarket` | 东东超市 | 长期 | 15 * * * * | */30 * * * * | 15 * * * * | +| `jd_syj` | 十元街 | 长期 | / | 0 1 */1 * * | 3 1 * * * | +| `jd_unbind` | 注销京东会员卡 | 长期 | / | / | 10 0 * * * | +| `jd_unsubscribe` | 取关京东店铺和商品 | 长期 | 45 15 * * * | 0 1 */1 * * | 10 0 * * * | +| `jd_watch` | 发现-看一看 | 长期 | / | / | 3 1 * * * | +| `jr_sign` | 金融打卡年终奖 | 短期 | / | / | 3 1 * * * | +| `jd_818` | 京东手机狂欢城 | 短期 | 0 1,4,7,10,12,16,22 * * * | 0 9,12,15,16,20,0,6 */1 * * | / | +| `jd_apple_live` | 苹果抽奖机 | 短期 | / | / | / | +| `jd_collectProduceScore` | 双十一活动领金币 | 短期 | 30 * * * * | */30 * * * * | / | +| `jd_digital_floor` | 数码加购京豆 | 短期 | / | / | / | +| `jd_jxstory` | 京喜故事 | 短期 | / | / | / | +| `jd_mohe` | 热8超级魔盒 | 短期 | / | / | / | +| `jd_pubg` | PUBG | 短期 | / | / | / | +| `jd_split` | 金榜年终奖 | 短期 | / | / | / | +| `jd_xtg` | 双十一星推官 | 短期 | 0 16 * * * | 0 0 */1 * * | / | + +点击提交,所有流程就结束了。 diff --git a/backUp/iOS_Weather_AQI_Standard.js b/backUp/iOS_Weather_AQI_Standard.js new file mode 100644 index 00000000..dfb22941 --- /dev/null +++ b/backUp/iOS_Weather_AQI_Standard.js @@ -0,0 +1,138 @@ +// Developed by Hackl0us (https://github.com/hackl0us) + +// STEP 1: 前往 https://aqicn.org/data-platform/token/ 注册账户,将申请的 API Token 填入下方 +let aqicnToken = '' +// STEP 2: 参考下方配置片段,在代理工具的配置文件中添加对应的配置。注意:script-path 后应该替换为添加 apicnToken 值后的脚本路径 +/* +===============Surge================= +[Script] +AQI-US = type=http-response, pattern=https://weather-data.apple.com/v1/weather/[\w-]+/[0-9]+\.[0-9]+/[0-9]+\.[0-9]+\?, requires-body=true, script-path=/path/to/iOS_Weather_AQI_Standard.js + +[MITM] +hostname = weather-data.apple.com +*/ +const $ = new Env('牛逼天气'); +aqicnToken = $.getdata('hackl0us_aqi_token'); + +const AirQualityStandard = { + CN: 'HJ6332012.1', + US: 'EPA_NowCast.1' +} + +const AirQualityLevel = { + GOOD: 1, + MODERATE: 2, + UNHEALTHY_FOR_SENSITIVE: 3, + UNHEALTHY: 4, + VERY_UNHEALTHY: 5, + HAZARDOUS: 6 +} + +const coordRegex = /https:\/\/weather-data\.apple\.com\/v1\/weather\/[\w-]+\/([0-9]+\.[0-9]+)\/([0-9]+\.[0-9]+)\?/ +const [_, lat, lng] = $request.url.match(coordRegex) + +function classifyAirQualityLevel(aqiIndex) { + if (aqiIndex >= 0 && aqiIndex <= 50) { + return AirQualityLevel.GOOD; + } else if (aqiIndex >= 51 && aqiIndex <= 100) { + return AirQualityLevel.MODERATE; + } else if (aqiIndex >= 101 && aqiIndex <= 150) { + return AirQualityLevel.UNHEALTHY_FOR_SENSITIVE; + } else if (aqiIndex >= 151 && aqiIndex <= 200) { + return AirQualityLevel.UNHEALTHY; + } else if (aqiIndex >= 201 && aqiIndex <= 300) { + return AirQualityLevel.VERY_UNHEALTHY; + } else if (aqiIndex >= 301 && aqiIndex <= 500) { + return AirQualityLevel.HAZARDOUS; + } +} + +function modifyWeatherResp(weatherRespBody, aqicnRespBody) { + let weatherRespJson = JSON.parse(weatherRespBody) + let aqicnRespJson = JSON.parse(aqicnRespBody).data + weatherRespJson.air_quality = constructAirQuailityNode(aqicnRespJson) + return JSON.stringify(weatherRespJson) +} + +function getPrimaryPollutant(pollutant) { + switch (pollutant) { + case 'co': + return 'CO2'; + case 'so2': + return 'SO2'; + case 'no2': + return 'NO2'; + case 'pm25': + return 'PM2.5'; + case 'pm10': + return 'PM10'; + case 'o3': + return 'OZONE'; + default: + console.log('Unknown pollutant ' + pollutant); + } +} + +function constructAirQuailityNode(aqicnData) { + let airQualityNode = { "source": "", "learnMoreURL": "", "isSignificant": true, "airQualityCategoryIndex": 1, "airQualityScale": "", "airQualityIndex": 0, "pollutants": { "CO": { "name": "CO", "amount": 0, "unit": "μg/m3" }, "SO2": { "name": "SO2", "amount": 0, "unit": "μg/m3" }, "NO2": { "name": "NO2", "amount": 0, "unit": "μg/m3" }, "PM2.5": { "name": "PM2.5", "amount": 0, "unit": "μg/m3" }, "OZONE": { "name": "OZONE", "amount": 0, "unit": "μg/m3" }, "PM10": { "name": "PM10", "amount": 0, "unit": "μg/m3" } }, "metadata": { "reported_time": 0, "longitude": 0, "provider_name": "aqicn.org", "expire_time": 2, "provider_logo": "https://i.loli.net/2020/12/27/UqW23eZLFAIbxGV.png", "read_time": 2, "latitude": 0, "v": 1, "language": "", "data_source": 0 }, "name": "AirQuality", "primaryPollutant": "" } + const aqicnIndex = aqicnData.aqi + airQualityNode.source = aqicnData.city.name + airQualityNode.learnMoreURL = aqicnData.city.url + '/cn/m' + airQualityNode.airQualityCategoryIndex = classifyAirQualityLevel(aqicnIndex) + airQualityNode.airQualityScale = AirQualityStandard.US + airQualityNode.airQualityIndex = aqicnIndex + airQualityNode.pollutants.CO.amount = aqicnData.iaqi.co?.v || -1 + airQualityNode.pollutants.SO2.amount = aqicnData.iaqi.so2?.v || -1 + airQualityNode.pollutants.NO2.amount = aqicnData.iaqi.no2?.v || -1 + airQualityNode.pollutants["PM2.5"].amount = aqicnData.iaqi.pm25?.v || -1 + airQualityNode.pollutants.OZONE.amount = aqicnData.iaqi.o3?.v || -1 + airQualityNode.pollutants.PM10.amount = aqicnData.iaqi.pm10?.v || -1 + airQualityNode.metadata.latitude = aqicnData.city.geo[0] + airQualityNode.metadata.longitude = aqicnData.city.geo[1] + airQualityNode.metadata.read_time = roundHours(new Date(), 'down') + airQualityNode.metadata.expire_time = roundHours(new Date(), 'up') + airQualityNode.metadata.reported_time = aqicnData.time.v + //airQualityNode.metadata.language = $request.headers['Accept-Language'] + airQualityNode.primaryPollutant = getPrimaryPollutant(aqicnData.dominentpol) + return airQualityNode +} + +function roundHours(time, method) { + switch (method) { + case 'up': + time.setHours(time.getHours() + Math.ceil(time.getMinutes() / 60)); + break; + case 'down': + time.setHours(time.getHours() + Math.floor(time.getMinutes() / 60)); + break; + default: + console.log("Error rounding method"); + } + time.setMinutes(2, 0, 0); + return time; +} + +// $httpClient.get(`https://api.waqi.info/feed/geo:${lat};${lng}/?token=${aqicnToken}`, function (error, _response, data) { +// if (error) { +// let body = $response.body +// $done({ body }) +// } else { +// let body = modifyWeatherResp($response.body, data) +// $done({ body }) +// } +// }); +$.get({ url: `https://api.waqi.info/feed/geo:${lat};${lng}/?token=${aqicnToken}`, headers: $request.headers },(err, resp, data) => { + try { + if (err) { + $.logErr(err, resp); + } else { + console.log(`${JSON.stringify(resp.body)}`); + let body = modifyWeatherResp($response.body, resp.body); + $.done({body}); + } + } catch (e) { + $.logErr(e, resp); + $.done(); + } +}); +function Env(t,e){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("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}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("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(a,(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){let e={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).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=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];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("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)} \ No newline at end of file diff --git a/backUp/tencentscf.md b/backUp/tencentscf.md new file mode 100644 index 00000000..30c04ca2 --- /dev/null +++ b/backUp/tencentscf.md @@ -0,0 +1,128 @@ + +# 云函数快速部署京东脚本 +> +> - 本地安装依赖使用serverless部署,[点这里](tencentscf.md#1-安装-nodejs-环境) +> - Github Action 部署[点这里](tencentscf.md#github-action-部署) + +## 1. 安装 Node.js 环境 + +Node.js 环境 [下载地址](https://nodejs.org/zh-tw/download/) ,根据自己的操作系统下载和安装。 + +## 2. 下载代码 + +点击红框处下载压缩包 +![下载代码](https://imgbed-bucket-1251971143.cos.ap-guangzhou.myqcloud.com/1605497672397-zip.png) + +## 3. 安装依赖,配置 cookie + +### 3.1 安装依赖 + +压缩包解压后进入项目文件夹 + +- Windows 用户按住 **shift** 点击右键,点击 **在此处打开命令窗口** +- Mac 用户通过终端,自行进入该文件夹 + +在命令行内输入 `npm i `,等待运行完成。 + +此时,项目文件夹内会多出一个 `node_modules`文件夹 + +### 3.2 配置 cookie + +打开项目文件内的 `jdCookie.js` + +在最上面的 `CookieJDs`里写入 cookie ,多个账号以逗号分隔 + +例如 + +```javascript +let CookieJDs = [ + 'pt_key=xxx;pt_pin=xxx;', + 'pt_key=zzz;pt_pin=zzz;', + 'pt_key=aaa;pt_pin=xxxaaa' +] +``` + +> 注:获取京东 cookie 教程参考 [浏览器获取京东cookie教程](https://github.com/lxk0301/jd_scripts/blob/master/backUp/GetJdCookie.md) , [插件获取京东cookie教程](https://github.com/lxk0301/jd_scripts/blob/master/backUp/GetJdCookie2.md) + + +## 4. 部署到云函数 + +### 4.1 开通服务 + +依次登录 [SCF 云函数控制台](https://console.cloud.tencent.com/scf) 和 [SLS 控制台](https://console.cloud.tencent.com/sls) 开通相关服务,确保账户下已开通服务并创建相应[服务角色](https://console.cloud.tencent.com/cam/role) **SCF_QcsRole、SLS_QcsRole** + +> 注意!为了确保权限足够,获取这两个参数时不要使用子账户!此外,腾讯云账户需要[实名认证](https://console.cloud.tencent.com/developer/auth)。 + +### 4.2 工具部署 + +下载 Serverless 工具,快速部署函数 +``` +npm install -g serverless +``` + +执行部署命令 +``` +serverless deploy +``` + +如果已经配置了永久秘钥,则可以直接部署,如果没有,可以直接**微信扫码**登录腾讯云,并且授权部署。 + +过几秒后,查看输出,可以看到函数和定时触发器都已经配置完成。 +``` +serverless ⚡framework +Action: "deploy" - Stage: "dev" - App: "jdscript" - Instance: "jdscript" + +functionName: scf-jdscript +description: This is a function in jdscript application. +namespace: default +runtime: Nodejs12.16 +handler: index.main_handler +memorySize: 64 +lastVersion: $LATEST +traffic: 1 +triggers: + timer: + - timer-jdscript-dev + +36s › jdscript › Success +``` + +## 5. 查看和测试 + +登录后,在 [腾讯云函数地址](https://console.cloud.tencent.com/scf/index) 点击管理控制台,查看最新部署的函数。 + +在左侧栏的日志查询中,可以查看到触发的日志,包括是否打卡成功等。 + +![测试函数](https://user-images.githubusercontent.com/6993269/99628053-5a9eea80-2a70-11eb-906f-f1d5ea2bfa3a.png) + +> 如果需要配置永久秘钥,则可以在[访问秘钥页面](https://console.cloud.tencent.com/cam/capi)获取账号的 TENCENT_SECRET_ID,TENCENT_SECRET_KEY,并配置在代码根目录 .env 文件中。 + + +# Github Action 部署 +## 1. 开通服务 + +依次登录 [SCF 云函数控制台](https://console.cloud.tencent.com/scf) 和 [SLS 控制台](https://console.cloud.tencent.com/sls) 开通相关服务,确保账户下已开通服务并创建相应[服务角色](https://console.cloud.tencent.com/cam/role) **SCF_QcsRole、SLS_QcsRole** + +> 注意!为了确保权限足够,获取这两个参数时不要使用子账户!此外,腾讯云账户需要[实名认证](https://console.cloud.tencent.com/developer/auth)。 + +## 2. 在这里新建一个访问密钥[新建密钥](https://console.cloud.tencent.com/cam/capi) +> 将SecretId和SecretKey分别配置在仓库的secrets变量里面, TENCENT_SECRET_ID对应你的SecretId的值,TENCENT_SECRET_KEY对应你的SecretKey的值 + +## 3. 配置自己需要secrets变量[参考这里](githubAction.md#下方提供使用到的-secrets全集合) +### __重要的说三遍__ +### 如果涉及一个变量配置多个值,如多个cookie,多个取消订阅关键字,去掉里面的 *__[空格]()__* 和 __*[换行]()*__ 使用 `&` 连接 +### 如果涉及一个变量配置多个值,如多个cookie,多个取消订阅关键字,去掉里面的 *__[空格]()__* 和 __*[换行]()*__ 使用 `&` 连接 +### 如果涉及一个变量配置多个值,如多个cookie,多个取消订阅关键字,去掉里面的 *__[空格]()__* 和 __*[换行]()*__ 使用 `&` 连接 +> 排查问题第一步先看自己[腾讯云函数](https://console.cloud.tencent.com/scf/list-detail?rid=5&ns=default&id=scf-jdscript)那边的环境变量跟自己在仓库配置的 `secrets` 是否一致 +![image](https://user-images.githubusercontent.com/6993269/99937191-06617680-2da0-11eb-99ea-033f2c655683.png) + + +## 4.执行action workflow进行部署,workflow未报错即部署成功 +![image](https://user-images.githubusercontent.com/6993269/99513289-6a152980-29c5-11eb-9266-3f56ba13d3b2.png) +## 5. 查看和测试 +登录后,在 [腾讯云函数地址](https://console.cloud.tencent.com/scf/index) 点击管理控制台,查看最新部署的函数。 + +在左侧栏的日志查询中,可以查看到触发的日志,包括是否打卡成功等。 + +![测试函数](https://user-images.githubusercontent.com/6993269/99628053-5a9eea80-2a70-11eb-906f-f1d5ea2bfa3a.png) +## 6. 设置触发器[看这里](iCloud.md#5设置触发器) 或者看这里的[注释说明](https://github.com/iouAkira/jd_scripts/blob/patch-1/index.js#L4) diff --git a/docker/Readme.md b/docker/Readme.md index beb03302..922a84a7 100644 --- a/docker/Readme.md +++ b/docker/Readme.md @@ -1,4 +1,24 @@ ### Usage +```diff ++ 2021-01-03更新 增加 CUSTOM_SHELL_FILE 参数配置执行自定义shell脚本 ++ 例1:配置远程shell脚本, 我自己写了一个shell脚本https://raw.githubusercontent.com/iouAkira/someDockerfile/master/jd_scripts/shell_script_mod.sh 内容很简单下载惊喜农场并添加定时任务 ++ CUSTOM_SHELL_FILE=https://raw.githubusercontent.com/iouAkira/someDockerfile/master/jd_scripts/shell_script_mod.sh ++ ++ 例2:配置docker挂载本地自定义shell脚本,/scripts/docker/shell_script_mod.sh 为你在docker-compose.yml里面挂载到容器里面绝对路径 ++ CUSTOM_SHELL_FILE=/scripts/docker/shell_script_mod.sh ++ ++ tip:如果使用远程自定义,请保证网络畅通或者选择合适的国内仓库,例如有部分人的容器里面就下载不到github的raw文件,那就可以把自己的自定义shell写在gitee上,或者换本地挂载 ++ 如果是 docker 挂载本地,请保重文件挂载进去了,并且配置的是绝对路径。 ++ 自定义 shell 脚本里面如果要加 crontab 任务请使用 echo 追加到 /scripts/docker/merged_list_file.sh 里面否者不生效 ++ 注⚠️ 建议无shell能力的不要轻易使用,当然你可以找别人写好适配了这个docker镜像的脚本直接远程配置 ++ 上面写了这么多如果还看不懂,不建议使用该变量功能。 +_____ +! ⚠️⚠️⚠️2020-12-11更新镜像启动方式,虽然兼容旧版的运行启动方式,但是强烈建议更新镜像和配置后使用 +! 更新后`command:`指令配置不再需要 +! 更新后可以使用自定义任务文件追加在默任务文件之后,比以前的完全覆盖多一个选择 +! - 新的自定两个环境变量为 `CUSTOM_LIST_MERGE_TYPE`:自定文件的生效方式可选值为`append`,`overwrite`默认为`append` ; `CUSTOM_LIST_FILE`: 自定义文件的名字 +! 更新镜像增减镜像更新通知,以后镜像如果更新之后,会通知用户更新 +``` > 推荐使用`docker-compose`所以这里只介绍`docker-compose`使用方式 - `docker-compose` 安装(群晖nas docker自带安装了docker-compose) @@ -21,12 +41,6 @@ pip install docker-compose ### 如果需要使用 docker 多个账户独立并发执行定时任务,[参考这里](https://github.com/iouAkira/scripts/blob/patch-1/docker/docker%E5%A4%9A%E8%B4%A6%E6%88%B7%E4%BD%BF%E7%94%A8%E7%8B%AC%E7%AB%8B%E5%AE%B9%E5%99%A8%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E.md#%E4%BD%BF%E7%94%A8%E6%AD%A4%E6%96%B9%E5%BC%8F%E8%AF%B7%E5%85%88%E7%90%86%E8%A7%A3%E5%AD%A6%E4%BC%9A%E4%BD%BF%E7%94%A8docker%E5%8A%9E%E6%B3%95%E4%B8%80%E7%9A%84%E4%BD%BF%E7%94%A8%E6%96%B9%E5%BC%8F) -⚠️⚠️⚠️2020-12-11更新镜像启动方式,虽然兼容旧版的运行启动方式,但是强烈建议更新镜像和配置后使用 -- 更新后`command:`指令配置不再需要 -- 更新后可以使用自定义任务文件追加在默任务文件之后,比以前的完全覆盖多一个选择 -- - 新的自定两个环境变量为 `CUSTOM_LIST_MERGE_TYPE`:自定文件的生效方式可选值为`append`,`overwrite`默认为`append` ; `CUSTOM_LIST_FILE`: 自定义文件的名字 -- 更新镜像增减镜像更新通知,以后镜像如果更新之后,会通知用户更新 - > 注⚠️:前提先理解学会使用这下面的教程 ### 创建一个目录`jd_scripts`用于存放备份配置等数据,迁移重装的时候只需要备份整个jd_scripts目录即可 需要新建的目录文件结构参考如下: diff --git a/docker/crontab_list.sh b/docker/crontab_list.sh index 046099de..4dbf59b8 100644 --- a/docker/crontab_list.sh +++ b/docker/crontab_list.sh @@ -4,19 +4,8 @@ 50 23 */3 * * rm -rf /scripts/logs/*.log ##############短期活动############## -# 秒杀红包雨(2020.12.31活动过期) -40 8 1-31 12 * node /scripts/jd_ms_redrain.js >> /scripts/logs/jd_ms_redrain.log 2>&1 # 健康抽奖机(2020.12.31活动过期) -10 0 1-31 12 * node /scripts/jd_health.js >> /scripts/logs/jd_health.log 2>&1 -# 直播红包雨(2020.12.31活动过期) -1 0,20,9-23/2 15-31 12 * node /scripts/jd_live_redrain.js >> /scripts/logs/jd_live_redrain.log 2>&1 -# 京东金融打卡领年终奖(2020.12.31活动过期) -10 6 1-31 12 * node /scripts/jr_sign.js >> /scripts/logs/jr_sign.log 2>&1 -# 京东健康APP集汪汪卡瓜分百万红包(2021.1.6活动过期) -10 8 * * * node /scripts/jd_jdh.js >> /scripts/logs/jd_jdh.log 2>&1 -# crazyJoy自动每日任务 -10 7 * * * node /scripts/jd_crazy_joy.js >> /scripts/logs/jd_crazy_joy.log 2>&1 - +10 0 * * * node /scripts/jd_health.js >> /scripts/logs/jd_health.log 2>&1 ##############长期活动############## # 签到 0 0,18 * * * cd /scripts && node jd_bean_sign.js >> /scripts/logs/jd_bean_sign.log 2>&1 @@ -71,11 +60,11 @@ # 十元街 36 8,18 * * * node /scripts/jd_syj.js >> /scripts/logs/jd_syj.log 2>&1 # 京东代属(注:限校园用户可使用) -36 9 * * * node /scripts/jd_ds.js >> /scripts/logs/jd_ds.log 2>&1 +# 36 9 * * * node /scripts/jd_ds.js >> /scripts/logs/jd_ds.log 2>&1 # 京东快递签到 23 1 * * * node /scripts/jd_kd.js >> /scripts/logs/jd_kd.log 2>&1 # 京东汽车(签到满500赛点可兑换500京豆) -33 2 * * * node /scripts/jd_car.js >> /scripts/logs/jd_car.log 2>&1 +0 0 * * * node /scripts/jd_car.js >> /scripts/logs/jd_car.log 2>&1 # 领京豆额外奖励(每日可获得3京豆) 33 4 * * * node /scripts/jd_bean_home.js >> /scripts/logs/jd_bean_home.log 2>&1 # 京东直播(每日18豆) @@ -84,7 +73,7 @@ 10 11 * * * node /scripts/jd_jdzz.js >> /scripts/logs/jd_jdzz.log 2>&1 # 宠汪汪邀请助力 10 10,11 * * * node /scripts/jd_joy_run.js >> /scripts/logs/jd_joy_run.log 2>&1 -# 京东发现-看一看,看40个视频领80京豆(非常耗时) -13 11,14 * * * node /scripts/jd_watch.js >> /scripts/logs/jd_watch.log 2>&1 # 注销京东已开的店铺会员,不是注销京东plus会员,个别店铺无法注销 44 4 * * 6 node /scripts/jd_unbind.js >> /scripts/logs/jd_unbind.log 2>&1 +# crazyJoy自动每日任务 +10 7 * * * node /scripts/jd_crazy_joy.js >> /scripts/logs/jd_crazy_joy.log 2>&1 diff --git a/docker/default_task.sh b/docker/default_task.sh index caf4f6d1..26da7f0f 100644 --- a/docker/default_task.sh +++ b/docker/default_task.sh @@ -107,7 +107,7 @@ if [ $(grep -c "default_task.sh" $mergedListFile) -eq '0' ]; then echo "52 */1 * * * sh /scripts/docker/default_task.sh |ts >> /scripts/logs/default_task.log 2>&1" >>$mergedListFile fi -if [ $RANDOM_DELAY_MAX ];then +if [ $RANDOM_DELAY_MAX ]; then if [ $RANDOM_DELAY_MAX -ge 1 ]; then echo "已设置随机延迟为 $RANDOM_DELAY_MAX , 设置延迟任务中... " sed -i "/\(jd_bean_sign.js\|jd_blueCoin.js\|jd_joy_reward.js\|jd_joy_steal.js\|jd_joy_feedPets.js\)/!s/node/sleep \$((RANDOM % \$RANDOM_DELAY_MAX)); node/g" $mergedListFile @@ -116,6 +116,27 @@ else echo "未配置随即延迟对应的环境变量,故不设置延迟任务" fi +##增加自定义shell脚本 +if [ 0"$CUSTOM_SHELL_FILE" = "0" ]; then + echo "未配置自定shell脚本文件,跳过执行。" +else + if expr "$CUSTOM_SHELL_FILE" : 'http.*' &>/dev/null; then + echo "自定义shell脚本为远程脚本,开始下在自定义远程脚本。" + wget -O /scripts/docker/shell_script_mod.sh $CUSTOM_SHELL_FILE + echo "下载完成,开始执行..." + sh -x /scripts/docker/shell_script_mod.sh + echo "自定义远程shell脚本下载并执行结束。" + else + if [ !$CUSTOM_SHELL_FILE ]; then + echo "自定义shell脚本为docker挂载脚本文件,但是指定挂载文件不存在,跳过执行。" + else + echo "docker挂载的自定shell脚本,开始执行..." + sh -x $CUSTOM_SHELL_FILE + echo "docker挂载的自定shell脚本,执行结束。" + fi + fi +fi + echo "加载最新的定时任务文件..." crontab $mergedListFile diff --git a/jdCookie.js b/jdCookie.js index 4eb2bb76..0dcadb23 100644 --- a/jdCookie.js +++ b/jdCookie.js @@ -15,19 +15,14 @@ if (process.env.JD_COOKIE) { } else if (process.env.JD_COOKIE.indexOf('\n') > -1) { console.log(`您的cookie选择的是用换行隔开\n`) CookieJDs = process.env.JD_COOKIE.split('\n'); - } else if (process.env.JD_COOKIE.indexOf('\\n') > -1) { - //环境变量兼容腾讯云和docker下\n会被转义成\\n - console.log(`您的cookie选择的是用换行隔开\\n`) - CookieJDs = process.env.JD_COOKIE.split('\\n'); } else { CookieJDs = [process.env.JD_COOKIE]; } - CookieJDs = [...new Set(CookieJDs)] - console.log(`\n====================共有${CookieJDs.length}个京东账号Cookie=========\n`); - console.log(`==================脚本执行- 北京时间(UTC+8):${new Date(new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000).toLocaleString()}=====================\n`) - // console.log(`\n==================脚本执行来自 github action=====================\n`) } +CookieJDs = [...new Set(CookieJDs.filter(item => item !== "" && item !== null && item !== undefined))] +console.log(`\n====================共有${CookieJDs.length}个京东账号Cookie=========\n`); +console.log(`==================脚本执行- 北京时间(UTC+8):${new Date(new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000).toLocaleString()}=====================\n`) for (let i = 0; i < CookieJDs.length; i++) { const index = (i + 1 === 1) ? '' : (i + 1); - exports['CookieJD' + index] = CookieJDs[i]; + exports['CookieJD' + index] = CookieJDs[i].trim(); } diff --git a/jd_bean_home.js b/jd_bean_home.js index 7a84357b..666ad746 100644 --- a/jd_bean_home.js +++ b/jd_bean_home.js @@ -112,11 +112,15 @@ const JD_API_HOST = 'https://api.m.jd.com/'; async function jdBeanHome() { $.doneState = false - for (let i = 0; i < 3; ++i) { + // for (let i = 0; i < 3; ++i) { + // await doTask2() + // await $.wait(1000) + // if ($.doneState) break + // } + do { await doTask2() - await $.wait(1000) - if ($.doneState) break - } + await $.wait(3000) + } while (!$.doneState) await $.wait(1000) await award("feeds") await $.wait(1000) @@ -142,10 +146,16 @@ function doTask2() { } else { if (safeGet(data)) { data = JSON.parse(data); - if(data.code === '0' && data.data){ + if (data.code === '0' && data.data){ console.log(`任务完成进度:${data.data.taskProgress} / ${data.data.taskThreshold}`) - if(data.data.taskProgress===data.data.taskThreshold) + if(data.data.taskProgress === data.data.taskThreshold) $.doneState = true + } else if (data.code === '0' && data.errorCode === 'HT201') { + $.doneState = true + } else { + //HT304风控用户 + $.doneState = true + console.log(`做任务异常:${JSON.stringify(data)}`) } } } diff --git a/jd_bean_sign.js b/jd_bean_sign.js index accf5990..fb3fee0e 100644 --- a/jd_bean_sign.js +++ b/jd_bean_sign.js @@ -1,7 +1,7 @@ /* 京豆签到,自用,可N个京东账号,IOS软件用户请使用 https://raw.githubusercontent.com/NobyDa/Script/master/JD-DailyBonus/JD_DailyBonus.js Node.JS专用 -更新时间:2020-12-21 +更新时间:2021-1-4 从 github @ruicky改写而来 version v0.0.1 create by ruicky @@ -17,6 +17,7 @@ const download = require('download'); let resultPath = "./result.txt"; let JD_DailyBonusPath = "./JD_DailyBonus.js"; let outPutUrl = './'; +let NodeSet = 'CookieSet.json'; let cookiesArr = [], cookie = ''; if ($.isNode()) { @@ -130,6 +131,7 @@ async function downFile () { async function changeFile (content) { console.log(`开始替换变量`) let newContent = content.replace(/var Key = ''/, `var Key = '${cookie}'`); + newContent = newContent.replace(/const NodeSet = 'CookieSet.json'/, `const NodeSet = '${NodeSet}'`) if (process.env.JD_BEAN_STOP && process.env.JD_BEAN_STOP !== '0') { newContent = newContent.replace(/var stop = 0/, `var stop = ${process.env.JD_BEAN_STOP * 1}`); } @@ -219,6 +221,7 @@ function requireConfig() { resultPath = err ? '/tmp/result.txt' : resultPath; JD_DailyBonusPath = err ? '/tmp/JD_DailyBonus.js' : JD_DailyBonusPath; outPutUrl = err ? '/tmp/' : outPutUrl; + NodeSet = err ? '/tmp/CookieSet.json' : NodeSet; resolve() }); }) diff --git a/jd_crazy_joy.js b/jd_crazy_joy.js index a87e8711..f1d1f5d9 100644 --- a/jd_crazy_joy.js +++ b/jd_crazy_joy.js @@ -666,7 +666,7 @@ function readShareCode() { console.log(`${$.name} API请求失败,请检查网路重试`) } else { if (data) { - console.log(`随机取${randomCount}个码放到您固定的互助码后面`) + console.log(`随机取${randomCount}个码放到您固定的互助码后面(不影响已有固定互助)`) data = JSON.parse(data); } } diff --git a/jd_crazy_joy_coin.js b/jd_crazy_joy_coin.js index 4e4a5a3b..8824b85a 100644 --- a/jd_crazy_joy_coin.js +++ b/jd_crazy_joy_coin.js @@ -204,6 +204,12 @@ async function jdJxStory() { await $.wait(1000) await getJoyShop() await $.wait(1000) + if ($.joyIds && $.joyIds.length > 0) { + $.log('当前JOY分布情况') + $.log(`\n${$.joyIds[0]} ${$.joyIds[1]} ${$.joyIds[2]} ${$.joyIds[3]}`) + $.log(`${$.joyIds[4]} ${$.joyIds[5]} ${$.joyIds[6]} ${$.joyIds[7]}`) + $.log(`${$.joyIds[8]} ${$.joyIds[9]} ${$.joyIds[10]} ${$.joyIds[11]}\n`) + } for (let i = 0; i < $.joyIds.length; ++i) { if (!$.canBuy) { $.log(`金币不足,跳过购买`) @@ -280,8 +286,14 @@ function getJoyShop() { data = JSON.parse(data); if (data.success && data.data && data.data.shop) { const shop = data.data.shop.filter(vo => vo.status === 1) || [] - $.buyJoyLevel = shop.length ? shop[shop.length - 1]['joyId'] : 1 - $.cost = shop.length ? shop[shop.length - 1]['coins'] : Infinity + $.buyJoyLevel = shop.length ? shop[shop.length - 1]['joyId'] : 1;//可购买的最大等级 + if ($.isNode() && process.env.BUY_JOY_LEVEL) { + $.log(`当前可购买的最高JOY等级为${$.buyJoyLevel}级\n`) + $.buyJoyLevel = (process.env.BUY_JOY_LEVEL * 1) > $.buyJoyLevel ? $.buyJoyLevel : process.env.BUY_JOY_LEVEL * 1; + $.cost = shop[$.buyJoyLevel - 1]['coins'] + } else { + $.cost = shop.length ? shop[shop.length - 1]['coins'] : Infinity + } } } } catch (e) { diff --git a/jd_dreamFactory.js b/jd_dreamFactory.js index 2333f2f8..713a46f9 100644 --- a/jd_dreamFactory.js +++ b/jd_dreamFactory.js @@ -34,7 +34,7 @@ const randomCount = $.isNode() ? 20 : 5; let tuanActiveId = `6S9y4sJUfA2vPQP6TLdVIQ==`; const jxOpenUrl = `openjd://virtual?params=%7B%20%22category%22:%20%22jump%22,%20%22des%22:%20%22m%22,%20%22url%22:%20%22https://wqsd.jd.com/pingou/dream_factory/index.html%22%20%7D`; let cookiesArr = [], cookie = '', message = ''; -const inviteCodes = ['V5LkjP4WRyjeCKR9VRwcRX0bBuTz7MEK0-E99EJ7u0k=', 'PDPM257r_KuQhil2Y7koNw==', "gB99tYLjvPcEFloDgamoBw==", '-OvElMzqeyeGBWazWYjI1Q==', 'GFwo6PntxDHH95ZRzZ5uAg==']; +const inviteCodes = ['V5LkjP4WRyjeCKR9VRwcRX0bBuTz7MEK0-E99EJ7u0k=@0WtCMPNq7jekehT6d3AbFw==', 'PDPM257r_KuQhil2Y7koNw==', "gB99tYLjvPcEFloDgamoBw==", '-OvElMzqeyeGBWazWYjI1Q==', 'GFwo6PntxDHH95ZRzZ5uAg==']; const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; if ($.isNode()) { Object.keys(jdCookieNode).forEach((item) => { @@ -1305,7 +1305,7 @@ function readShareCode() { console.log(`${$.name} API请求失败,请检查网路重试`) } else { if (data) { - console.log(`随机取${randomCount}个码放到您固定的互助码后面`) + console.log(`随机取${randomCount}个码放到您固定的互助码后面(不影响已有固定互助)`) data = JSON.parse(data); } } diff --git a/jd_fruit.js b/jd_fruit.js index 03185eb1..0b4b3ba2 100644 --- a/jd_fruit.js +++ b/jd_fruit.js @@ -1,6 +1,6 @@ /* 东东水果:脚本更新地址 https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_fruit.js -更新时间:2020-12-25 +更新时间:2021-1-5 东东农场活动链接:https://h5.m.jd.com/babelDiy/Zeus/3KSjXqQabiTuD1cJ28QskrpWoBKT/index.html 已支持IOS双京东账号,Node.js支持N个京东账号 脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js @@ -29,9 +29,9 @@ let cookiesArr = [], cookie = '', jdFruitShareArr = [], isBox = false, notify, n //下面给出两个账号的填写示例(iOS只支持2个京东账号) let shareCodes = [ // 这个列表填入你要助力的好友的shareCode //账号一的好友shareCode,不同好友的shareCode中间用@符号隔开 - '0a74407df5df4fa99672a037eec61f7e@dbb21614667246fabcfd9685b6f448f3@6fbd26cc27ac44d6a7fed34092453f77@61ff5c624949454aa88561f2cd721bf6@56db8e7bc5874668ba7d5195230d067a', + '0a74407df5df4fa99672a037eec61f7e@dbb21614667246fabcfd9685b6f448f3@6fbd26cc27ac44d6a7fed34092453f77@61ff5c624949454aa88561f2cd721bf6@56db8e7bc5874668ba7d5195230d067a@', //账号二的好友shareCode,不同好友的shareCode中间用@符号隔开 - 'b1638a774d054a05a30a17d3b4d364b8@f92cb56c6a1349f5a35f0372aa041ea0@9c52670d52ad4e1a812f894563c746ea@8175509d82504e96828afc8b1bbb9cb3', + 'b1638a774d054a05a30a17d3b4d364b8@f92cb56c6a1349f5a35f0372aa041ea0@9c52670d52ad4e1a812f894563c746ea@8175509d82504e96828afc8b1bbb9cb3@2673c3777d4443829b2a635059953a28', ] let message = '', subTitle = '', option = {}, isFruitFinished = false; const retainWater = 100;//保留水滴大于多少g,默认100g; @@ -771,24 +771,31 @@ async function clockInIn() { // async function getAwardInviteFriend() { await friendListInitForFarm();//查询好友列表 - console.log(`\n今日已邀请好友${$.friendList.inviteFriendCount}个 / 每日邀请上限${$.friendList.inviteFriendMax}个`); - console.log(`开始删除${$.friendList.friends.length}个好友,可拿每天的邀请奖励`); - for (let friend of $.friendList.friends) { - console.log(`\n开始删除好友 [${friend.shareCode}]`); - const deleteFriendForFarm = await request('deleteFriendForFarm', { "shareCode": `${friend.shareCode}`,"version":8,"channel":1 }); - if (deleteFriendForFarm && deleteFriendForFarm.code === '0') { - console.log(`删除好友 [${friend.shareCode}] 成功\n`); + console.log(`查询好友列表数据:${JSON.stringify($.friendList)}\n`) + if ($.friendList) { + console.log(`\n今日已邀请好友${$.friendList.inviteFriendCount}个 / 每日邀请上限${$.friendList.inviteFriendMax}个`); + console.log(`开始删除${$.friendList.friends && $.friendList.friends.length}个好友,可拿每天的邀请奖励`); + if ($.friendList.friends && $.friendList.friends.length > 0) { + for (let friend of $.friendList.friends) { + console.log(`\n开始删除好友 [${friend.shareCode}]`); + const deleteFriendForFarm = await request('deleteFriendForFarm', { "shareCode": `${friend.shareCode}`,"version":8,"channel":1 }); + if (deleteFriendForFarm && deleteFriendForFarm.code === '0') { + console.log(`删除好友 [${friend.shareCode}] 成功\n`); + } + } } - } - await receiveFriendInvite();//为他人助力,接受邀请成为别人的好友 - if ($.friendList.inviteFriendCount > 0) { - if ($.friendList.inviteFriendCount > $.friendList.inviteFriendGotAwardCount) { - console.log('开始领取邀请好友的奖励'); - await awardInviteFriendForFarm(); - console.log(`领取邀请好友的奖励结果::${JSON.stringify($.awardInviteFriendRes)}`); + await receiveFriendInvite();//为他人助力,接受邀请成为别人的好友 + if ($.friendList.inviteFriendCount > 0) { + if ($.friendList.inviteFriendCount > $.friendList.inviteFriendGotAwardCount) { + console.log('开始领取邀请好友的奖励'); + await awardInviteFriendForFarm(); + console.log(`领取邀请好友的奖励结果::${JSON.stringify($.awardInviteFriendRes)}`); + } + } else { + console.log('今日未邀请过好友') } } else { - console.log('今日未邀请过好友') + console.log(`查询好友列表失败\n`); } } //给好友浇水 @@ -1239,7 +1246,7 @@ function readShareCode() { console.log(`${$.name} API请求失败,请检查网路重试`) } else { if (data) { - console.log(`随机取个${randomCount}码放到您固定的互助码后面`) + console.log(`随机取个${randomCount}码放到您固定的互助码后面(不影响已有固定互助)`) data = JSON.parse(data); } } diff --git a/jd_get_share_code.js b/jd_get_share_code.js new file mode 100644 index 00000000..5b44c5cb --- /dev/null +++ b/jd_get_share_code.js @@ -0,0 +1,665 @@ +const $ = new Env("获取互助码"); +const JD_API_HOST = "https://api.m.jd.com/client.action"; +let cookiesArr = [], cookie = '', message; +const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; +!function (n) { + "use strict"; + + function t(n, t) { + var r = (65535 & n) + (65535 & t); + return (n >> 16) + (t >> 16) + (r >> 16) << 16 | 65535 & r + } + + function r(n, t) { + return n << t | n >>> 32 - t + } + + function e(n, e, o, u, c, f) { + return t(r(t(t(e, n), t(u, f)), c), o) + } + + function o(n, t, r, o, u, c, f) { + return e(t & r | ~t & o, n, t, u, c, f) + } + + function u(n, t, r, o, u, c, f) { + return e(t & o | r & ~o, n, t, u, c, f) + } + + function c(n, t, r, o, u, c, f) { + return e(t ^ r ^ o, n, t, u, c, f) + } + + function f(n, t, r, o, u, c, f) { + return e(r ^ (t | ~o), n, t, u, c, f) + } + + function i(n, r) { + n[r >> 5] |= 128 << r % 32, + n[14 + (r + 64 >>> 9 << 4)] = r; + var e, i, a, d, h, l = 1732584193, g = -271733879, v = -1732584194, m = 271733878; + for (e = 0; e < n.length; e += 16) + i = l, + a = g, + d = v, + h = m, + g = f(g = f(g = f(g = f(g = c(g = c(g = c(g = c(g = u(g = u(g = u(g = u(g = o(g = o(g = o(g = o(g, v = o(v, m = o(m, l = o(l, g, v, m, n[e], 7, -680876936), g, v, n[e + 1], 12, -389564586), l, g, n[e + 2], 17, 606105819), m, l, n[e + 3], 22, -1044525330), v = o(v, m = o(m, l = o(l, g, v, m, n[e + 4], 7, -176418897), g, v, n[e + 5], 12, 1200080426), l, g, n[e + 6], 17, -1473231341), m, l, n[e + 7], 22, -45705983), v = o(v, m = o(m, l = o(l, g, v, m, n[e + 8], 7, 1770035416), g, v, n[e + 9], 12, -1958414417), l, g, n[e + 10], 17, -42063), m, l, n[e + 11], 22, -1990404162), v = o(v, m = o(m, l = o(l, g, v, m, n[e + 12], 7, 1804603682), g, v, n[e + 13], 12, -40341101), l, g, n[e + 14], 17, -1502002290), m, l, n[e + 15], 22, 1236535329), v = u(v, m = u(m, l = u(l, g, v, m, n[e + 1], 5, -165796510), g, v, n[e + 6], 9, -1069501632), l, g, n[e + 11], 14, 643717713), m, l, n[e], 20, -373897302), v = u(v, m = u(m, l = u(l, g, v, m, n[e + 5], 5, -701558691), g, v, n[e + 10], 9, 38016083), l, g, n[e + 15], 14, -660478335), m, l, n[e + 4], 20, -405537848), v = u(v, m = u(m, l = u(l, g, v, m, n[e + 9], 5, 568446438), g, v, n[e + 14], 9, -1019803690), l, g, n[e + 3], 14, -187363961), m, l, n[e + 8], 20, 1163531501), v = u(v, m = u(m, l = u(l, g, v, m, n[e + 13], 5, -1444681467), g, v, n[e + 2], 9, -51403784), l, g, n[e + 7], 14, 1735328473), m, l, n[e + 12], 20, -1926607734), v = c(v, m = c(m, l = c(l, g, v, m, n[e + 5], 4, -378558), g, v, n[e + 8], 11, -2022574463), l, g, n[e + 11], 16, 1839030562), m, l, n[e + 14], 23, -35309556), v = c(v, m = c(m, l = c(l, g, v, m, n[e + 1], 4, -1530992060), g, v, n[e + 4], 11, 1272893353), l, g, n[e + 7], 16, -155497632), m, l, n[e + 10], 23, -1094730640), v = c(v, m = c(m, l = c(l, g, v, m, n[e + 13], 4, 681279174), g, v, n[e], 11, -358537222), l, g, n[e + 3], 16, -722521979), m, l, n[e + 6], 23, 76029189), v = c(v, m = c(m, l = c(l, g, v, m, n[e + 9], 4, -640364487), g, v, n[e + 12], 11, -421815835), l, g, n[e + 15], 16, 530742520), m, l, n[e + 2], 23, -995338651), v = f(v, m = f(m, l = f(l, g, v, m, n[e], 6, -198630844), g, v, n[e + 7], 10, 1126891415), l, g, n[e + 14], 15, -1416354905), m, l, n[e + 5], 21, -57434055), v = f(v, m = f(m, l = f(l, g, v, m, n[e + 12], 6, 1700485571), g, v, n[e + 3], 10, -1894986606), l, g, n[e + 10], 15, -1051523), m, l, n[e + 1], 21, -2054922799), v = f(v, m = f(m, l = f(l, g, v, m, n[e + 8], 6, 1873313359), g, v, n[e + 15], 10, -30611744), l, g, n[e + 6], 15, -1560198380), m, l, n[e + 13], 21, 1309151649), v = f(v, m = f(m, l = f(l, g, v, m, n[e + 4], 6, -145523070), g, v, n[e + 11], 10, -1120210379), l, g, n[e + 2], 15, 718787259), m, l, n[e + 9], 21, -343485551), + l = t(l, i), + g = t(g, a), + v = t(v, d), + m = t(m, h); + return [l, g, v, m] + } + + function a(n) { + var t, r = "", e = 32 * n.length; + for (t = 0; t < e; t += 8) + r += String.fromCharCode(n[t >> 5] >>> t % 32 & 255); + return r + } + + function d(n) { + var t, r = []; + for (r[(n.length >> 2) - 1] = void 0, + t = 0; t < r.length; t += 1) + r[t] = 0; + var e = 8 * n.length; + for (t = 0; t < e; t += 8) + r[t >> 5] |= (255 & n.charCodeAt(t / 8)) << t % 32; + return r + } + + function h(n) { + return a(i(d(n), 8 * n.length)) + } + + function l(n, t) { + var r, e, o = d(n), u = [], c = []; + for (u[15] = c[15] = void 0, + o.length > 16 && (o = i(o, 8 * n.length)), + r = 0; r < 16; r += 1) + u[r] = 909522486 ^ o[r], + c[r] = 1549556828 ^ o[r]; + return e = i(u.concat(d(t)), 512 + 8 * t.length), + a(i(c.concat(e), 640)) + } + + function g(n) { + var t, r, e = ""; + for (r = 0; r < n.length; r += 1) + t = n.charCodeAt(r), + e += "0123456789abcdef".charAt(t >>> 4 & 15) + "0123456789abcdef".charAt(15 & t); + return e + } + + function v(n) { + return unescape(encodeURIComponent(n)) + } + + function m(n) { + return h(v(n)) + } + + function p(n) { + return g(m(n)) + } + + function s(n, t) { + return l(v(n), v(t)) + } + + function C(n, t) { + return g(s(n, t)) + } + + function A(n, t, r) { + return t ? r ? s(t, n) : C(t, n) : r ? m(n) : p(n) + } + + $.md5 = A +}(this); +if ($.isNode()) { + Object.keys(jdCookieNode).forEach((item) => { + cookiesArr.push(jdCookieNode[item]) + }) + if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {}; +} else { + let cookiesData = $.getdata('CookiesJD') || "[]"; + cookiesData = jsonParse(cookiesData); + cookiesArr = cookiesData.map(item => item.cookie); + cookiesArr.reverse(); + cookiesArr.push(...[$.getdata('CookieJD2'), $.getdata('CookieJD')]); + cookiesArr.reverse(); +} +!(async () => { + if (!cookiesArr[0]) { + $.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"}); + return; + } + for (let i = 0; i < cookiesArr.length; i++) { + if (cookiesArr[i]) { + cookie = cookiesArr[i]; + $.UserName = decodeURIComponent(cookie.match(/pt_pin=(.+?);/) && cookie.match(/pt_pin=(.+?);/)[1]) + $.index = i + 1; + $.isLogin = true; + $.nickName = ''; + message = ''; + await TotalBean(); + if (!$.isLogin) { + continue + } + console.log(`======账号${$.index}开始======`) + await getShareCode() + console.log(`======账号${$.index}结束======\n`) + } + } +})() + .catch((e) => { + $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '') + }) + .finally(() => { + $.done(); + }) +function getJdFactory() { + return new Promise(resolve => { + $.post( + taskPostUrl("jdfactory_getTaskDetail", {}, "jdfactory_getTaskDetail"), + async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`); + console.log(`$东东工厂 API请求失败,请检查网路重试`); + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data.data.bizCode === 0) { + $.taskVos = data.data.result.taskVos; //任务列表 + $.taskVos.map((item) => { + if (item.taskType === 14) { + console.log( + `【账号${$.index}(${$.nickName || $.UserName})东东工厂】${item.assistTaskDetailVo.taskToken}` + ); + } + }); + } + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + } + ); + }) +} +function getJxFactory(){ + const JX_API_HOST = "https://m.jingxi.com"; + + function JXGC_taskurl(functionId, body = "") { + return { + url: `${JX_API_HOST}/dreamfactory/${functionId}?zone=dream_factory&${body}&sceneval=2&g_login_type=1&_time=${Date.now()}&_=${Date.now()}`, + headers: { + Cookie: cookie, + Host: "m.jingxi.com", + Accept: "*/*", + Connection: "keep-alive", + "User-Agent": + "jdpingou;iPhone;3.14.4;14.0;ae75259f6ca8378672006fc41079cd8c90c53be8;network/wifi;model/iPhone10,2;appBuild/100351;ADID/00000000-0000-0000-0000-000000000000;supportApplePay/1;hasUPPay/0;pushNoticeIsOpen/1;hasOCPay/0;supportBestPay/0;session/62;pap/JA2015_311210;brand/apple;supportJDSHWK/1;Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148", + "Accept-Language": "zh-cn", + Referer: "https://wqsd.jd.com/pingou/dream_factory/index.html", + "Accept-Encoding": "gzip, deflate, br", + }, + }; + } + + return new Promise(resolve => { + $.get( + JXGC_taskurl( + "userinfo/GetUserInfo", + `pin=&sharePin=&shareType=&materialTuanPin=&materialTuanId=` + ), + async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`); + console.log(`惊喜工厂 API请求失败,请检查网路重试`); + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data["ret"] === 0) { + data = data["data"]; + $.unActive = true; //标记是否开启了京喜活动或者选购了商品进行生产 + $.encryptPin = ""; + $.shelvesList = []; + if (data.factoryList && data.productionList) { + const production = data.productionList[0]; + const factory = data.factoryList[0]; + const productionStage = data.productionStage; + $.factoryId = factory.factoryId; //工厂ID + $.productionId = production.productionId; //商品ID + $.commodityDimId = production.commodityDimId; + $.encryptPin = data.user.encryptPin; + // subTitle = data.user.pin; + console.log(`【账号${$.index}(${$.nickName || $.UserName})惊喜工厂】${data.user.encryptPin}`); + } + } else { + $.unActive = false; //标记是否开启了京喜活动或者选购了商品进行生产 + if (!data.factoryList) { + console.log( + `【提示】京东账号${$.index}[${$.nickName}]京喜工厂活动未开始请手动去京东APP->游戏与互动->查看更多->京喜工厂 开启活动` + ); + } else if (data.factoryList && !data.productionList) { + console.log( + `【提示】京东账号${$.index}[${$.nickName}]京喜工厂未选购商品请手动去京东APP->游戏与互动->查看更多->京喜工厂 选购` + ); + } + } + } else { + console.log(`GetUserInfo异常:${JSON.stringify(data)}`); + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve() + } + } + ); + }) +} +function getJdPet(){ + const JDPet_API_HOST = "https://api.m.jd.com/client.action"; + + function jdPet_Url(function_id, body = {}) { + body["version"] = 2; + body["channel"] = "app"; + return { + url: `${JDPet_API_HOST}?functionId=${function_id}`, + body: `body=${escape( + JSON.stringify(body) + )}&appid=wh5&loginWQBiz=pet-town&clientVersion=9.0.4`, + headers: { + Cookie: cookie, + "User-Agent": $.isNode() + ? process.env.JD_USER_AGENT + ? process.env.JD_USER_AGENT + : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0" + : $.getdata("JDUA") + ? $.getdata("JDUA") + : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0", + Host: "api.m.jd.com", + "Content-Type": "application/x-www-form-urlencoded", + }, + }; + } + return new Promise(resolve => { + $.post(jdPet_Url("initPetTown"), async (err, resp, data) => { + try { + if (err) { + console.log("东东萌宠: API查询请求失败 ‼️‼️"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + data = JSON.parse(data); + + const initPetTownRes = data; + + message = `【京东账号${$.index}】${$.nickName}`; + if ( + initPetTownRes.code === "0" && + initPetTownRes.resultCode === "0" && + initPetTownRes.message === "success" + ) { + $.petInfo = initPetTownRes.result; + if ($.petInfo.userStatus === 0) { + /*console.log( + `【提示】京东账号${$.index}${$.nickName}萌宠活动未开启请手动去京东APP开启活动入口:我的->游戏与互动->查看更多开启` + );*/ + return; + } + + console.log( + `【账号${$.index}(${$.nickName || $.UserName})京东萌宠】${$.petInfo.shareCode}` + ); + + } else if (initPetTownRes.code === "0") { + console.log(`初始化萌宠失败: ${initPetTownRes.message}`); + } else { + console.log("shit"); + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(data); + } + }); + }) +} +async function getJdZZ() { + const JDZZ_API_HOST = "https://api.m.jd.com/client.action"; + + function getUserInfo() { + return new Promise(resolve => { + $.get(taskZZUrl("interactIndex"), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data.data.shareTaskRes) { + console.log(`【账号${$.index}(${$.nickName || $.UserName})京东赚赚】${data.data.shareTaskRes.itemId}`); + } else { + //console.log(`已满5人助力,暂时看不到您的京东赚赚好友助力码`) + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(data); + } + }) + }) + } + + function taskZZUrl(functionId, body = {}) { + return { + url: `${JDZZ_API_HOST}?functionId=${functionId}&body=${escape(JSON.stringify(body))}&client=wh5&clientVersion=9.1.0`, + headers: { + 'Cookie': cookie, + 'Host': 'api.m.jd.com', + 'Connection': 'keep-alive', + 'Content-Type': 'application/json', + 'Referer': 'http://wq.jd.com/wxapp/pages/hd-interaction/index/index', + 'User-Agent': $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0") : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0"), + 'Accept-Language': 'zh-cn', + 'Accept-Encoding': 'gzip, deflate, br', + } + } + } + + await getUserInfo() +} +async function getPlantBean() { + const JDplant_API_HOST = "https://api.m.jd.com/client.action"; + + async function plantBeanIndex() { + $.plantBeanIndexResult = await plant_request("plantBeanIndex"); //plantBeanIndexBody + } + + function plant_request(function_id, body = {}) { + return new Promise(async (resolve) => { + $.post(plant_taskUrl(function_id, body), (err, resp, data) => { + try { + if (err) { + console.log("种豆得豆: API查询请求失败 ‼️‼️"); + console.log(`function_id:${function_id}`); + $.logErr(err); + } else { + data = JSON.parse(data); + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(data); + } + }); + }); + } + + function plant_taskUrl(function_id, body) { + body["version"] = "9.0.0.1"; + body["monitor_source"] = "plant_app_plant_index"; + body["monitor_refer"] = ""; + return { + url: JDplant_API_HOST, + body: `functionId=${function_id}&body=${escape( + JSON.stringify(body) + )}&appid=ld&client=apple&area=5_274_49707_49973&build=167283&clientVersion=9.1.0`, + headers: { + Cookie: cookie, + Host: "api.m.jd.com", + Accept: "*/*", + Connection: "keep-alive", + "User-Agent": $.isNode() + ? process.env.JD_USER_AGENT + ? process.env.JD_USER_AGENT + : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0" + : $.getdata("JDUA") + ? $.getdata("JDUA") + : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0", + "Accept-Language": "zh-Hans-CN;q=1,en-CN;q=0.9", + "Accept-Encoding": "gzip, deflate, br", + "Content-Type": "application/x-www-form-urlencoded", + }, + }; + } + + function getParam(url, name) { + const reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); + const r = url.match(reg); + if (r != null) return unescape(r[2]); + return null; + } + + async function jdPlantBean() { + await plantBeanIndex(); + // console.log(plantBeanIndexResult.data.taskList); + if ($.plantBeanIndexResult.code === "0") { + const shareUrl = $.plantBeanIndexResult.data.jwordShareInfo.shareUrl; + $.myPlantUuid = getParam(shareUrl, "plantUuid"); + console.log(`【账号${$.index}(${$.nickName || $.UserName})种豆得豆】${$.myPlantUuid}`); + + } else { + console.log( + `种豆得豆-初始失败: ${JSON.stringify($.plantBeanIndexResult)}` + ); + } + } + + await jdPlantBean(); +} +async function getJDFruit() { + async function initForFarm() { + return new Promise((resolve) => { + const option = { + url: `${JD_API_HOST}?functionId=initForFarm`, + body: `body=${escape( + JSON.stringify({version: 4}) + )}&appid=wh5&clientVersion=9.1.0`, + headers: { + accept: "*/*", + "accept-encoding": "gzip, deflate, br", + "accept-language": "zh-CN,zh;q=0.9", + "cache-control": "no-cache", + cookie: cookie, + origin: "https://home.m.jd.com", + pragma: "no-cache", + referer: "https://home.m.jd.com/myJd/newhome.action", + "sec-fetch-dest": "empty", + "sec-fetch-mode": "cors", + "sec-fetch-site": "same-site", + "User-Agent": $.isNode() + ? process.env.JD_USER_AGENT + ? process.env.JD_USER_AGENT + : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0" + : $.getdata("JDUA") + ? $.getdata("JDUA") + : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0", + "Content-Type": "application/x-www-form-urlencoded", + }, + }; + $.post(option, (err, resp, data) => { + try { + if (err) { + console.log("东东农场: API查询请求失败 ‼️‼️"); + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + if (safeGet(data)) { + $.farmInfo = JSON.parse(data); + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); + } + + async function jdFruit() { + await initForFarm(); + if ($.farmInfo.farmUserPro) { + console.log( + `【账号${$.index}(${$.nickName || $.UserName})京东农场】${$.farmInfo.farmUserPro.shareCode}` + ); + + } else { + /*console.log( + `初始化农场数据异常, 请登录京东 app查看农场0元水果功能是否正常,农场初始化数据: ${JSON.stringify( + $.farmInfo + )}` + );*/ + } + } + + await jdFruit(); +} +async function getJoy(){ + function taskUrl(functionId, body = '') { + let t = Date.now().toString().substr(0, 10) + let e = body || "" + e = $.md5("aDvScBv$gGQvrXfva8dG!ZC@DA70Y%lX" + e + t) + e = e + Number(t).toString(16) + return { + url: `${JD_API_HOST}?uts=${e}&appid=crazy_joy&functionId=${functionId}&body=${escape(body)}&t=${t}`, + headers: { + 'Cookie': cookie, + 'Host': 'api.m.jd.com', + 'Accept': '*/*', + 'Connection': 'keep-alive', + "User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0") : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0"), + 'Accept-Language': 'zh-cn', + 'Referer': 'https://crazy-joy.jd.com/', + 'origin': 'https://crazy-joy.jd.com', + 'Accept-Encoding': 'gzip, deflate, br', + } + } + } + let body = {"paramData": {}} + return new Promise(async resolve => { + $.get(taskUrl('crazyJoy_user_gameState', JSON.stringify(body)), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data.success && data.data && data.data.userInviteCode) { + console.log(`【账号${$.index}(${$.nickName || $.UserName})crazyJoy】${data.data.userInviteCode}`) + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} +async function getShareCode() { + await getJdFactory() + await getJxFactory() + await getJdPet() + await getPlantBean() + await getJDFruit() + await getJdZZ() + await getJoy() +} + +function safeGet(data) { + try { + if (typeof JSON.parse(data) == "object") { + return true; + } + } catch (e) { + console.log(e); + console.log(`京东服务器访问数据为空,请检查自身设备网络情况`); + return false; + } +} +function TotalBean() { + return new Promise(async resolve => { + const options = { + "url": `https://wq.jd.com/user/info/QueryJDUserInfo?sceneval=2`, + "headers": { + "Accept": "application/json,text/plain, */*", + "Content-Type": "application/x-www-form-urlencoded", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-cn", + "Connection": "keep-alive", + "Cookie": cookie, + "Referer": "https://wqs.jd.com/my/jingdou/my.shtml?sceneval=2", + "User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0") : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0") + } + } + $.post(options, (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (data) { + data = JSON.parse(data); + if (data['retcode'] === 13) { + $.isLogin = false; //cookie过期 + return + } + $.nickName = data['base'].nickname; + } else { + console.log(`京东服务器返回空数据`) + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} +function taskPostUrl(function_id, body = {}, function_id2) { + let url = `${JD_API_HOST}`; + if (function_id2) { + url += `?functionId=${function_id2}`; + } + return { + url, + body: `functionId=${function_id}&body=${escape( + JSON.stringify(body) + )}&client=wh5&clientVersion=9.1.0`, + headers: { + Cookie: cookie, + origin: "https://h5.m.jd.com", + referer: "https://h5.m.jd.com/", + "Content-Type": "application/x-www-form-urlencoded", + "User-Agent": $.isNode() + ? process.env.JD_USER_AGENT + ? process.env.JD_USER_AGENT + : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0" + : $.getdata("JDUA") + ? $.getdata("JDUA") + : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0", + }, + }; +} +// prettier-ignore +function Env(t,e){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("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}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("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(a,(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();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){let e={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).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}}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r)));let h=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];h.push(e),s&&h.push(s),i&&h.push(i),console.log(h.join("\n")),this.logs=this.logs.concat(h)}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("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)} diff --git a/jd_health.js b/jd_health.js index ee4ffe9b..b05005d0 100644 --- a/jd_health.js +++ b/jd_health.js @@ -265,7 +265,7 @@ function readShareCode() { console.log(`${$.name} API请求失败,请检查网路重试`) } else { if (data) { - console.log(`随机取${randomCount}个码放到您固定的互助码后面`) + console.log(`随机取${randomCount}个码放到您固定的互助码后面(不影响已有固定互助)`) data = JSON.parse(data); } } diff --git a/jd_jdfactory.js b/jd_jdfactory.js index 5f16249c..546b7109 100644 --- a/jd_jdfactory.js +++ b/jd_jdfactory.js @@ -108,8 +108,8 @@ function showMsg() { } else { $.log(`京东账号${$.index}${$.nickName}\n${message}`); } - if (new Date().getHours() === 23) { - $.msg($.name, '', `京东账号${$.index}${$.nickName}\n${message}`); + if (new Date().getHours() === 12) { + $.msg($.name, '', `${message}`); } resolve() }) @@ -181,6 +181,7 @@ async function algorithm() { } } else { console.log(`\n此账号${$.index}${$.nickName}暂未选择商品\n`); + message += `京东账号${$.index} ${$.nickName}\n`; message += `已选商品:暂无\n`; message += `心仪商品:${wantProduct ? wantProduct : '暂无'}\n`; if (wantProduct) { @@ -216,17 +217,17 @@ async function algorithm() { } else { console.log(`BoxJs或环境变量暂未提供心仪商品\n如需兑换心仪商品,请提供心仪商品名称\n`); await jdfactory_getProductList(true); - message += `当前剩余最多商品:${$.canMakeList[0].name}\n`; - message += `兑换所需电量:${$.canMakeList[0].fullScore}\n`; + message += `当前剩余最多商品:${$.canMakeList[0] && $.canMakeList[0].name}\n`; + message += `兑换所需电量:${$.canMakeList[0] && $.canMakeList[0].fullScore}\n`; message += `您当前总电量:${$.batteryValue * 1}\n`; - if ($.canMakeList[0].couponCount > 0 && $.batteryValue * 1 >= $.canMakeList[0].fullScore) { + if ($.canMakeList[0] && $.canMakeList[0].couponCount > 0 && $.batteryValue * 1 >= $.canMakeList[0] && $.canMakeList[0].fullScore) { let nowTimes = new Date(new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000); if (new Date(nowTimes).getHours() === 12) { - $.msg($.name, '', `京东账号${$.index}${$.nickName}\n${message}【满足】兑换${$.canMakeList[0].name}所需总电量:${$.canMakeList[0].fullScore}\n请点击弹窗直达活动页面\n选择此心仪商品并手动投入电量兑换`, {'open-url': 'openjd://virtual?params=%7B%20%22category%22:%20%22jump%22,%20%22des%22:%20%22m%22,%20%22url%22:%20%22https://h5.m.jd.com/babelDiy/Zeus/2uSsV2wHEkySvompfjB43nuKkcHp/index.html%22%20%7D'}); - if ($.isNode()) await notify.sendNotify(`${$.name} - 账号${$.index} - ${$.nickName}`, `【京东账号${$.index}】${$.nickName}\n${message}【满足】兑换${$.canMakeList[0].name}所需总电量:${$.canMakeList[0].fullScore}\n请速去活动页面查看`); + $.msg($.name, '', `京东账号${$.index}${$.nickName}\n${message}【满足】兑换${$.canMakeList[0] && $.canMakeList[0] && [0].name}所需总电量:${$.canMakeList[0] && $.canMakeList[0].fullScore}\n请点击弹窗直达活动页面\n选择此心仪商品并手动投入电量兑换`, {'open-url': 'openjd://virtual?params=%7B%20%22category%22:%20%22jump%22,%20%22des%22:%20%22m%22,%20%22url%22:%20%22https://h5.m.jd.com/babelDiy/Zeus/2uSsV2wHEkySvompfjB43nuKkcHp/index.html%22%20%7D'}); + if ($.isNode()) await notify.sendNotify(`${$.name} - 账号${$.index} - ${$.nickName}`, `【京东账号${$.index}】${$.nickName}\n${message}【满足】兑换${$.canMakeList[0] && $.canMakeList[0].name}所需总电量:${$.canMakeList[0].fullScore}\n请速去活动页面查看`); } } else { - console.log(`\n目前电量${$.batteryValue * 1},不满足兑换 ${$.canMakeList[0].name}所需的 ${$.canMakeList[0].fullScore}电量\n`) + console.log(`\n目前电量${$.batteryValue * 1},不满足兑换 ${$.canMakeList[0] && $.canMakeList[0].name}所需的 ${$.canMakeList[0] && $.canMakeList[0].fullScore}电量\n`) } } } @@ -355,7 +356,8 @@ async function doTask() { //领取做完任务的奖励 function jdfactory_collectScore(taskToken) { - return new Promise(resolve => { + return new Promise(async resolve => { + await $.wait(1000); $.post(taskPostUrl("jdfactory_collectScore", { taskToken }, "jdfactory_collectScore"), async (err, resp, data) => { try { if (err) { @@ -534,17 +536,20 @@ function jdfactory_getProductList(flag = false) { if (safeGet(data)) { data = JSON.parse(data); if (data.data.bizCode === 0) { + $.canMakeList = []; $.canMakeList = data.data.result.canMakeList;//当前可选商品列表 sellOut:1为已抢光,0为目前可选择 - $.canMakeList.sort(sortCouponCount); - console.log(`商品名称 可选状态 剩余量`) - for (let item of $.canMakeList) { - console.log(`${item.name.slice(-4)} ${item.sellOut === 1 ? '已抢光':'可 选'} ${item.couponCount}`); - } - if (!flag) { + if ($.canMakeList && $.canMakeList.length > 0) { + $.canMakeList.sort(sortCouponCount); + console.log(`商品名称 可选状态 剩余量`) for (let item of $.canMakeList) { - if (item.name.indexOf(wantProduct) > -1 && item.couponCount > 0 && item.sellOut === 0) { - await jdfactory_makeProduct(item.skuId); - break + console.log(`${item.name.slice(-4)} ${item.sellOut === 1 ? '已抢光':'可 选'} ${item.couponCount}`); + } + if (!flag) { + for (let item of $.canMakeList) { + if (item.name.indexOf(wantProduct) > -1 && item.couponCount > 0 && item.sellOut === 0) { + await jdfactory_makeProduct(item.skuId); + break + } } } } @@ -623,7 +628,7 @@ function readShareCode() { console.log(`${$.name} API请求失败,请检查网路重试`) } else { if (data) { - console.log(`随机取${randomCount}个码放到您固定的互助码后面`) + console.log(`随机取${randomCount}个码放到您固定的互助码后面(不影响已有固定互助)`) data = JSON.parse(data); } } diff --git a/jd_jdzz.js b/jd_jdzz.js index f5da3632..5ea61aa2 100644 --- a/jd_jdzz.js +++ b/jd_jdzz.js @@ -343,7 +343,7 @@ function readShareCode() { console.log(`${$.name} API请求失败,请检查网路重试`) } else { if (data) { - console.log(`随机取${randomCount}个码放到您固定的互助码后面`) + console.log(`随机取${randomCount}个码放到您固定的互助码后面(不影响已有固定互助)`) data = JSON.parse(data); } } diff --git a/jd_joy_reward.js b/jd_joy_reward.js index 6878e769..2eaf482d 100644 --- a/jd_joy_reward.js +++ b/jd_joy_reward.js @@ -60,6 +60,7 @@ const JD_API_HOST = 'https://jdjoy.jd.com'; } continue } + console.log(`本地时间与京东服务器时间差(毫秒):${await get_diff_time()}`); await joyReward(); // $.msg($.name, '兑换脚本暂不能使用', `请停止使用,等待后期更新\n如果新版本兑换您有兑换机会,请抓包兑换\n再把抓包数据发送telegram用户@lxk0301`); } @@ -273,6 +274,35 @@ function TotalBean() { }) }) } +function getJDServerTime() { + return new Promise(resolve => { + // console.log(Date.now()) + $.get({url: "https://a.jd.com//ajax/queryServerData.html",headers:{ + "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1 Edg/87.0.4280.88" + }}, async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} 获取京东服务器时间失败,请检查网路重试`) + } else { + data = JSON.parse(data); + $.jdTime = data['serverTime']; + // console.log(data['serverTime']); + // console.log(data['serverTime'] - Date.now()) + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve($.jdTime); + } + }) + }) +} +async function get_diff_time() { + // console.log(`本机时间戳 ${Date.now()}`) + // console.log(`京东服务器时间戳 ${await getJDServerTime()}`) + return Date.now() - await getJDServerTime(); +} function jsonParse(str) { if (typeof str == "string") { try { diff --git a/jd_pet.js b/jd_pet.js index 9b19c20f..cde3fd7f 100644 --- a/jd_pet.js +++ b/jd_pet.js @@ -442,7 +442,7 @@ function readShareCode() { console.log(`${$.name} API请求失败,请检查网路重试`) } else { if (data) { - console.log(`随机取个${randomCount}码放到您固定的互助码后面`) + console.log(`随机取个${randomCount}码放到您固定的互助码后面(不影响已有固定互助)`) data = JSON.parse(data); } } diff --git a/jd_plantBean.js b/jd_plantBean.js index 9497a079..c573903e 100644 --- a/jd_plantBean.js +++ b/jd_plantBean.js @@ -1,6 +1,6 @@ /* 种豆得豆 脚本更新地址:https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_plantBean.js -更新时间:2020-11-04 +更新时间:2020-12-31 已支持IOS京东双账号,云端N个京东账号 脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js 注:会自动关注任务中的店铺跟商品,介意者勿使用。 @@ -161,14 +161,27 @@ async function stealFriendWater() { return } if ($.stealFriendList.data && $.stealFriendList.data.friendInfoList && $.stealFriendList.data.friendInfoList.length > 0) { + let nowTimes = new Date(new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000); for (let item of $.stealFriendList.data.friendInfoList) { - if (item.nutrCount >= 3) { - // console.log(`可以偷的好友的信息::${JSON.stringify(item)}`); - console.log(`可以偷的好友的信息paradiseUuid::${JSON.stringify(item.paradiseUuid)}`); - await collectUserNutr(item.paradiseUuid); - console.log(`偷取好友营养液情况:${JSON.stringify($.stealFriendRes)}`) - if ($.stealFriendRes.code === '0') { - console.log(`偷取好友营养液成功`) + if (new Date(nowTimes).getHours() === 20) { + if (item.nutrCount >= 2) { + // console.log(`可以偷的好友的信息::${JSON.stringify(item)}`); + console.log(`可以偷的好友的信息paradiseUuid::${JSON.stringify(item.paradiseUuid)}`); + await collectUserNutr(item.paradiseUuid); + console.log(`偷取好友营养液情况:${JSON.stringify($.stealFriendRes)}`) + if ($.stealFriendRes.code === '0') { + console.log(`偷取好友营养液成功`) + } + } + } else { + if (item.nutrCount >= 3) { + // console.log(`可以偷的好友的信息::${JSON.stringify(item)}`); + console.log(`可以偷的好友的信息paradiseUuid::${JSON.stringify(item.paradiseUuid)}`); + await collectUserNutr(item.paradiseUuid); + console.log(`偷取好友营养液情况:${JSON.stringify($.stealFriendRes)}`) + if ($.stealFriendRes.code === '0') { + console.log(`偷取好友营养液成功`) + } } } } @@ -508,7 +521,7 @@ function readShareCode() { console.log(`${$.name} API请求失败,请检查网路重试`) } else { if (data) { - console.log(`随机取个${randomCount}码放到您固定的互助码后面`) + console.log(`随机取个${randomCount}码放到您固定的互助码后面(不影响已有固定互助)`) data = JSON.parse(data); } } diff --git a/jd_small_home.js b/jd_small_home.js index 096519e6..46a21a0b 100644 --- a/jd_small_home.js +++ b/jd_small_home.js @@ -2,7 +2,7 @@ * @Author: lxk0301 https://github.com/lxk0301 * @Date: 2020-11-12 11:42:12 * @Last Modified by: lxk0301 - * @Last Modified time: 2020-12-23 14:27:20 + * @Last Modified time: 2021-1-4 14:27:20 */ /* 东东小窝 https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_small_home.js @@ -274,25 +274,27 @@ function queryFurnituresCenterList() { if (safeGet(data)) { data = JSON.parse(data); if (data.head.code === 200) { - let { buy, list } = data.body; - $.canBuyList = []; - list.map((item, index) => { - if (buy.some((buyItem) => buyItem === item.id)) return - $.canBuyList.push(item); - }) - $.canBuyList.sort(sortByjdBeanNum); - if ($.canBuyList[0].needWoB <= $.woB) { - await furnituresCenterPurchase($.canBuyList[0].id, $.canBuyList[0].jdBeanNum); - } else { - console.log(`\n兑换${$.canBuyList[0].jdBeanNum}京豆失败:当前wo币${$.woB}不够兑换所需的${$.canBuyList[0].needWoB}WO币`) - message += `【装饰领京豆】兑换${$.canBuyList[0].jdBeanNum}京豆失败,原因:WO币不够\n`; + if (data.body) { + let { buy, list } = data.body; + $.canBuyList = []; + list.map((item, index) => { + if (buy.some((buyItem) => buyItem === item.id)) return + $.canBuyList.push(item); + }) + $.canBuyList.sort(sortByjdBeanNum); + if ($.canBuyList[0].needWoB <= $.woB) { + await furnituresCenterPurchase($.canBuyList[0].id, $.canBuyList[0].jdBeanNum); + } else { + console.log(`\n兑换${$.canBuyList[0].jdBeanNum}京豆失败:当前wo币${$.woB}不够兑换所需的${$.canBuyList[0].needWoB}WO币`) + message += `【装饰领京豆】兑换${$.canBuyList[0].jdBeanNum}京豆失败,原因:WO币不够\n`; + } + // for (let canBuyItem of $.canBuyList) { + // if (canBuyItem.needWoB <= $.woB) { + // await furnituresCenterPurchase(canBuyItem.id, canBuyItem.jdBeanNum); + // break + // } + // } } - // for (let canBuyItem of $.canBuyList) { - // if (canBuyItem.needWoB <= $.woB) { - // await furnituresCenterPurchase(canBuyItem.id, canBuyItem.jdBeanNum); - // break - // } - // } } } } diff --git a/jd_syj.js b/jd_syj.js index cd6dabfa..ea75fc27 100644 --- a/jd_syj.js +++ b/jd_syj.js @@ -2,7 +2,7 @@ * @Author: lxk0301 https://github.com/lxk0301 * @Date: 2020-11-27 09:19:21 * @Last Modified by: lxk0301 - * @Last Modified time: 2020-11-27 09:58:02 + * @Last Modified time: 2021-1-1 16:58:02 */ /* 十元街脚本,一周签到下来可获得30京豆,一天任意时刻运行一次即可 @@ -93,7 +93,7 @@ function showMsg() { let signFlag = 0; function userSignIn() { return new Promise(resolve => { - const body = {"activityId":"8d6845fe2e77425c82d5078d314d33c5","inviterId":"VMIQlLQqjQyjZokQmv5bIDgq011L0Ov8","channel":"MiniProgram"}; + const body = {"activityId":"ccd8067defcd4787871b7f0c96fcbf5c","inviterId":"","channel":"MiniProgram"}; $.get(taskUrl('userSignIn', body), async (err, resp, data) => { try { if (err) { @@ -122,6 +122,10 @@ function userSignIn() { signFlag ++; await userSignIn(); } + } else if (data.code === 66) { + //此处有时会遇到 服务器繁忙 导致签到失败,故重复三次签到 + $.log(`${$.name}签到失败:${data.msg}`); + message += `【签到】失败,${data.msg}`; } else { console.log(`异常:${JSON.stringify(data)}`) } diff --git a/sendNotify.js b/sendNotify.js index eadb860b..b23e2e12 100644 --- a/sendNotify.js +++ b/sendNotify.js @@ -2,7 +2,7 @@ * @Author: lxk0301 https://github.com/lxk0301 * @Date: 2020-08-19 16:12:40 * @Last Modified by: lxk0301 - * @Last Modified time: 2020-12-21 13:52:54 + * @Last Modified time: 2021-1-5 17:52:54 */ const querystring = require("querystring"); const $ = new Env(); @@ -49,7 +49,7 @@ let DD_BOT_SECRET = ''; let QYWX_KEY = ''; // =======================================企业微信应用消息通知设置区域=========================================== -//此处填你企业微信应用消息的 值(详见文档 https://work.weixin.qq.com/api/doc/90000/90135/90236),依次填上corpid的值,corpsecret的值,touser的值,agentid的值,注意用,号隔开,例如:wwcff56746d9adwers,B-791548lnzXBE6_BWfxdf3kSTMJr9vFEPKAbh6WERQ,mingcheng,1000001 +//此处填你企业微信应用消息的 值(详见文档 https://work.weixin.qq.com/api/doc/90000/90135/90236),依次填上corpid的值,corpsecret的值,touser的值,agentid的值,素材库图片id(见https://github.com/lxk0301/jd_scripts/issues/519) 注意用,号隔开,例如:wwcff56746d9adwers,B-791548lnzXBE6_BWfxdf3kSTMJr9vFEPKAbh6WERQ,mingcheng,1000001,2COXgjH2UIfERF2zxrtUOKgQ9XklUqMdGSWLBoW_lSDAdafat //注:此处设置github action用户填写到Settings-Secrets里面(Name输入QYWX_AM) let QYWX_AM = ''; @@ -132,17 +132,21 @@ if (process.env.PUSH_PLUS_USER) { async function sendNotify(text, desp, params = {}) { //提供7种通知 - await serverNotify(text, desp);//微信server酱 - await pushPlusNotify(text, desp);//pushplus(推送加) + await Promise.all([ + serverNotify(text, desp),//微信server酱 + pushPlusNotify(text, desp)//pushplus(推送加) + ]) //由于上述两种微信通知需点击进去才能查看到详情,故text(标题内容)携带了账号序号以及昵称信息,方便不点击也可知道是哪个京东哪个活动 text = text.match(/.*?(?=\s?-)/g) ? text.match(/.*?(?=\s?-)/g)[0] : text; - await BarkNotify(text, desp, params);//iOS Bark APP - await tgBotNotify(text, desp);//telegram 机器人 - await ddBotNotify(text, desp);//钉钉机器人 - await qywxBotNotify(text, desp); //企业微信机器人 - await qywxamNotify(text, desp); //企业微信应用消息推送 - await iGotNotify(text, desp, params);//iGot - await CoolPush(text, desp);//QQ酷推 + await Promise.all([ + BarkNotify(text, desp, params),//iOS Bark APP + tgBotNotify(text, desp),//telegram 机器人 + ddBotNotify(text, desp),//钉钉机器人 + qywxBotNotify(text, desp), //企业微信机器人 + qywxamNotify(text, desp), //企业微信应用消息推送 + iGotNotify(text, desp, params),//iGot + CoolPush(text, desp)//QQ酷推 + ]) } function serverNotify(text, desp, timeout = 2100) { @@ -430,7 +434,8 @@ function qywxamNotify(text, desp) { 'Content-Type': 'application/json', }, }; - $.post(options_accesstoken, (err, resp, data) => { + $.post(options_accesstoken, (err, resp, data) => { + html=desp.replace(/\n/g,"
") var json = JSON.parse(data); accesstoken = json.access_token; const options = { @@ -438,12 +443,18 @@ function qywxamNotify(text, desp) { json: { touser:`${QYWX_AM_AY[2]}`, agentid:`${QYWX_AM_AY[3]}`, - msgtype: 'textcard', - textcard: { + msgtype: 'mpnews', + mpnews: { + articles: [ + { title: `${text}`, - description: `${desp}`, - url: '127.0.0.1', - btntxt: '更多' + thumb_media_id: `${QYWX_AM_AY[4]}`, + author : `智能助手` , + content_source_url: ``, + content : `${html}`, + digest: `${desp}` + } + ] }, safe:'0', }, diff --git a/serverless.yml b/serverless.yml index 98a0be61..d78fe00b 100644 --- a/serverless.yml +++ b/serverless.yml @@ -46,12 +46,12 @@ inputs: cronExpression: "0 0 0-16/8,20 * * * *" enable: true argument: jd_joy_reward&jd_joy_steal&jd_necklace&jd_live - - timer: #京东全民开红包 #进店领豆 #取关京东店铺商品 #注销京东会员卡 #京东抽奖机 #东东小窝 #秒杀红包雨 #健康抽奖机 + - timer: #京东全民开红包 #进店领豆 #取关京东店铺商品 #注销京东会员卡 #京东抽奖机 #东东小窝 #健康抽奖机 parameters: - name: redPacket_shop_unsubscribe_unbind_lotteryMachine_small_home_ms_redrain_health + name: redPacket_shop_unsubscribe_unbind_lotteryMachine_small_home_health cronExpression: "0 10 0 * * * *" enable: true - argument: jd_redPacket&jd_shop&jd_unsubscribe&jd_unbind&jd_lotteryMachine&jd_small_home&jd_ms_redrain&jd_health + argument: jd_redPacket&jd_shop&jd_unsubscribe&jd_unbind&jd_lotteryMachine&jd_small_home&jd_health - timer: # 京东天天加速# 天天提鹅 parameters: name: jd_speed_jd_daily_egg @@ -64,18 +64,18 @@ inputs: cronExpression: "0 15 * * * * *" enable: true argument: jd_superMarket - - timer: #京豆变动通知 #疯狂的joy #京东排行榜 #领京豆额外奖励 #京东健康APP + - timer: #京豆变动通知 #疯狂的joy #京东排行榜 #领京豆额外奖励 parameters: - name: bean_change_crazy_joy_rankingList_bean_home_jdh + name: bean_change_crazy_joy_rankingList_bean_home cronExpression: "0 30 7 * * * *" enable: true - argument: jd_bean_change&jd_crazy_joy&jd_rankingList&jd_bean_home&jd_car&jd_jdh - - timer: #金融养猪 #十元街 #京东快递 #发现-看一看 #京东赚赚 #金融打卡领年终奖 + argument: jd_bean_change&jd_crazy_joy&jd_rankingList&jd_bean_home&jd_car + - timer: #金融养猪 #十元街 #京东快递 #京东赚赚 parameters: - name: pigPet_syj_kd_watch_jdzz_jr_sign + name: pigPet_syj_kd_jdzz cronExpression: "0 3 1 * * * *" enable: true - argument: jd_pigPet&jd_syj&jd_kd&jd_watch&jd_jdzz&jr_sign + argument: jd_pigPet&jd_syj&jd_kd&jd_jdzz environment: # 环境变量 variables: # 环境变量对象 AAA: BBB # 不要删除,用来格式化对齐追加的变量的 From 5e6dff72f4f394b986d26aee2db638b34da0bcdc Mon Sep 17 00:00:00 2001 From: lxk0301 <778732665@qq.com> Date: Tue, 5 Jan 2021 20:48:14 +0800 Subject: [PATCH 21/30] Update qqread.js --- backUp/qqread.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backUp/qqread.js b/backUp/qqread.js index f72fe1f4..0ff1d2d9 100644 --- a/backUp/qqread.js +++ b/backUp/qqread.js @@ -62,7 +62,9 @@ const jsname = '企鹅读书' const $ = Env(jsname) let task = '', config, ssr2 = '', wktime, day = 0; console.log(`\n========= 脚本执行时间(TM):${new Date(new Date().getTime() + 0 * 60 * 60 * 1000).toLocaleString('zh', {hour12: false})} =========\n`) -const notify = require('../sendNotify'); + +const notify = $.isNode() ? require('../sendNotify') : ''; + const logs = 1; //0为关闭日志,1为开启 const TIME = 30//单次时长上传限制,默认5分钟 From 059bbaad660b7a13a54e582b6b685bd81fdd2d86 Mon Sep 17 00:00:00 2001 From: huang28 <52352624+Huang28@users.noreply.github.com> Date: Wed, 6 Jan 2021 03:10:22 +0800 Subject: [PATCH 22/30] Update sendNotify.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 企业微信应用消息通知 增加一个选择推送消息类型,用图文消息直接填写素材库图片id的值,用卡片消息就填写0(就是数字零) --- sendNotify.js | 76 +++++++++++++++++++++++++++++++-------------------- 1 file changed, 47 insertions(+), 29 deletions(-) diff --git a/sendNotify.js b/sendNotify.js index b23e2e12..47079790 100644 --- a/sendNotify.js +++ b/sendNotify.js @@ -50,6 +50,7 @@ let QYWX_KEY = ''; // =======================================企业微信应用消息通知设置区域=========================================== //此处填你企业微信应用消息的 值(详见文档 https://work.weixin.qq.com/api/doc/90000/90135/90236),依次填上corpid的值,corpsecret的值,touser的值,agentid的值,素材库图片id(见https://github.com/lxk0301/jd_scripts/issues/519) 注意用,号隔开,例如:wwcff56746d9adwers,B-791548lnzXBE6_BWfxdf3kSTMJr9vFEPKAbh6WERQ,mingcheng,1000001,2COXgjH2UIfERF2zxrtUOKgQ9XklUqMdGSWLBoW_lSDAdafat +//增加一个选择推送消息类型,用图文消息直接填写素材库图片id的值,用卡片消息就填写0(就是数字零) //注:此处设置github action用户填写到Settings-Secrets里面(Name输入QYWX_AM) let QYWX_AM = ''; @@ -423,31 +424,48 @@ function qywxBotNotify(text, desp) { function qywxamNotify(text, desp) { return new Promise(resolve => { if (QYWX_AM) { - var QYWX_AM_AY = QYWX_AM.split(','); - const options_accesstoken = { - url: `https://qyapi.weixin.qq.com/cgi-bin/gettoken`, - json: { - corpid:`${QYWX_AM_AY[0]}`, - corpsecret:`${QYWX_AM_AY[1]}`, - }, - headers: { - 'Content-Type': 'application/json', - }, - }; - $.post(options_accesstoken, (err, resp, data) => { - html=desp.replace(/\n/g,"
") + var QYWX_AM_AY = QYWX_AM.split(','); + const options_accesstoken = { + url: `https://qyapi.weixin.qq.com/cgi-bin/gettoken`, + json: { + corpid:`${QYWX_AM_AY[0]}`, + corpsecret:`${QYWX_AM_AY[1]}`, + }, + headers: { + 'Content-Type': 'application/json', + }, + }; + $.post(options_accesstoken, (err, resp, data) => { + html=desp.replace(/\n/g,"
") var json = JSON.parse(data); accesstoken = json.access_token; - const options = { - url: `https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=${accesstoken}`, - json: { - touser:`${QYWX_AM_AY[2]}`, - agentid:`${QYWX_AM_AY[3]}`, - msgtype: 'mpnews', - mpnews: { + const options_textcard = { + url: `https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=${accesstoken}`, + json: { + touser:`${QYWX_AM_AY[2]}`, + agentid:`${QYWX_AM_AY[3]}`, + msgtype: 'textcard', + textcard: { + title: `${text}`, + description: `${desp}`, + url: '127.0.0.1', + }, + safe:'0', + }, + headers: { + 'Content-Type': 'application/json', + }, + }; + const options_mpnews = { + url: `https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=${accesstoken}`, + json: { + touser:`${QYWX_AM_AY[2]}`, + agentid:`${QYWX_AM_AY[3]}`, + msgtype: 'mpnews', + mpnews: { articles: [ { - title: `${text}`, + title: `${text}`, thumb_media_id: `${QYWX_AM_AY[4]}`, author : `智能助手` , content_source_url: ``, @@ -455,14 +473,14 @@ function qywxamNotify(text, desp) { digest: `${desp}` } ] - }, - safe:'0', - }, - headers: { - 'Content-Type': 'application/json', - }, - }; - $.post(options, (err, resp, data) => { + }, + safe:'0', + }, + headers: { + 'Content-Type': 'application/json', + }, + }; + $.post((QYWX_AM_AY[4]==0)?options_textcard:options_mpnews, (err, resp, data) => { try { if (err) { console.log('企业微信应用消息发送通知消息失败!!\n'); From e0c1483b83cbf3098ad16d71f4dad7215f27e6a0 Mon Sep 17 00:00:00 2001 From: huang28 <52352624+Huang28@users.noreply.github.com> Date: Wed, 6 Jan 2021 03:14:37 +0800 Subject: [PATCH 23/30] =?UTF-8?q?=E4=BC=81=E4=B8=9A=E5=BE=AE=E4=BF=A1?= =?UTF-8?q?=E5=BA=94=E7=94=A8=E6=B6=88=E6=81=AF=E9=80=9A=E7=9F=A5=20?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=80=E4=B8=AA=E9=80=89=E6=8B=A9=E6=8E=A8?= =?UTF-8?q?=E9=80=81=E6=B6=88=E6=81=AF=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 增加一个选择推送消息类型,用图文消息直接填充素材库图片id的值,用卡片消息就填写0(就是数字零) --- sendNotify.js | 1 + 1 file changed, 1 insertion(+) diff --git a/sendNotify.js b/sendNotify.js index 47079790..9c950f07 100644 --- a/sendNotify.js +++ b/sendNotify.js @@ -449,6 +449,7 @@ function qywxamNotify(text, desp) { title: `${text}`, description: `${desp}`, url: '127.0.0.1', + btntxt: '更多' }, safe:'0', }, From f13d4d7ee1b1a3f1d10049aa82e7c20f896360d0 Mon Sep 17 00:00:00 2001 From: lxk0301 <778732665@qq.com> Date: Wed, 6 Jan 2021 09:20:23 +0800 Subject: [PATCH 24/30] =?UTF-8?q?=E5=9B=A0=E4=B8=9C=E4=B8=9C=E8=90=8C?= =?UTF-8?q?=E5=AE=A01.6=E6=97=A5=E5=A5=BD=E5=8F=8B=E5=8A=A9=E5=8A=9B?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E4=B8=8B=E7=BA=BF=E3=80=82=E6=95=85=E6=9A=82?= =?UTF-8?q?=E6=97=B6=E5=B1=8F=E8=94=BD=E5=A5=BD=E5=8F=8B=E4=BA=92=E5=8A=A9?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E3=80=82=E4=BF=AE=E5=A4=8D=E9=83=A8=E5=88=86?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E4=BD=BF=E7=94=A8=E8=84=9A=E6=9C=AC=E5=87=BA?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jd_pet.js | 14 ++++++++++---- sendNotify.js | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/jd_pet.js b/jd_pet.js index cde3fd7f..3586c920 100644 --- a/jd_pet.js +++ b/jd_pet.js @@ -1,6 +1,6 @@ /* 东东萌宠 更新地址: https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_pet.js -更新时间:2020-12-26 +更新时间:2021-01-06 已支持IOS双京东账号,Node.js支持N个京东账号 脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js @@ -231,8 +231,10 @@ async function masterHelpInit() { if(!res.result.addedBonusFlag) { console.log("开始领取额外奖励"); let getHelpAddedBonusResult = await request('getHelpAddedBonus'); + if (getHelpAddedBonusResult.resultCode === '0') { + message += `【额外奖励${getHelpAddedBonusResult.result.reward}领取】${getHelpAddedBonusResult.message}\n`; + } console.log(`领取30g额外奖励结果:【${getHelpAddedBonusResult.message}】`); - message += `【额外奖励${getHelpAddedBonusResult.result.reward}领取】${getHelpAddedBonusResult.message}\n`; } else { console.log("已经领取过5好友助力额外奖励"); message += `【额外奖励】已领取\n`; @@ -261,6 +263,8 @@ async function masterHelpInit() { * 运行脚本时你自己的shareCode会在控制台输出, 可以将其分享给他人 */ async function slaveHelp() { + $.log(`\n因1.6日好友助力功能下线。故暂时屏蔽\n`) + return let helpPeoples = ''; for (let code of newShareCodes) { console.log(`开始助力京东账号${$.index} - ${$.nickName}的好友: ${code}`); @@ -281,7 +285,7 @@ async function slaveHelp() { console.log(`助力其他情况:${JSON.stringify(response)}`); } } else { - console.log(`助理好友结果: ${response.message}`); + console.log(`助力好友结果: ${response.message}`); } } if (helpPeoples && helpPeoples.length > 0) { @@ -467,7 +471,9 @@ function shareCodesFormat() { const tempIndex = $.index > shareCodes.length ? (shareCodes.length - 1) : ($.index - 1); newShareCodes = shareCodes[tempIndex].split('@'); } - const readShareCodeRes = await readShareCode(); + //因好友助力功能下线。故暂时屏蔽 + // const readShareCodeRes = await readShareCode(); + const readShareCodeRes = null; if (readShareCodeRes && readShareCodeRes.code === 200) { newShareCodes = [...new Set([...newShareCodes, ...(readShareCodeRes.data || [])])]; } diff --git a/sendNotify.js b/sendNotify.js index b23e2e12..11257565 100644 --- a/sendNotify.js +++ b/sendNotify.js @@ -569,7 +569,7 @@ function pushPlusNotify(text, desp) { } }) } else { - console.log('\n您未提供push+推送所需的PUSH_PLUS_TOKEN,取消push+推送消息通知\n'); + console.log('您未提供push+推送所需的PUSH_PLUS_TOKEN,取消push+推送消息通知\n'); resolve() } }) From da4bf30c2439f86169eda38f84013e8c516d3e73 Mon Sep 17 00:00:00 2001 From: lxk0301 <778732665@qq.com> Date: Wed, 6 Jan 2021 09:26:10 +0800 Subject: [PATCH 25/30] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=85=91=E6=8D=A2?= =?UTF-8?q?=E4=BA=AC=E8=B1=86=E6=88=90=E5=8A=9F=E5=90=8E=E7=9A=84=E5=BC=B9?= =?UTF-8?q?=E7=AA=97=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jd_joy_reward.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jd_joy_reward.js b/jd_joy_reward.js index 2eaf482d..76ed0fe4 100644 --- a/jd_joy_reward.js +++ b/jd_joy_reward.js @@ -1,6 +1,6 @@ /* 宠汪汪积分兑换奖品脚本, 目前脚本只兑换京豆,兑换京豆成功,才会发出通知提示,其他情况不通知。 -更新时间:2020-12-23 +更新时间:2021-1-6 兑换规则:一个账号一天只能兑换一次京豆。 兑换奖品成功后才会有系统弹窗通知 每日京豆库存会在0:00、8:00、16:00更新,经测试发现中午12:00也会有补发京豆。 @@ -127,9 +127,9 @@ async function joyReward() { ctrTemp = `${jdNotify}` === 'false'; } if (ctrTemp) { - $.msg($.name, `兑换${giftValue}京豆成功`, `【京东账号${$.index}】${$.nickName}\n【宠物等级】${data.level}\n【积分详情】消耗积分 ${salePrice}, 剩余积分 ${data.coin - salePrice}`); + $.msg($.name, ``, `【京东账号${$.index}】${$.nickName}\n【${giftValue}京豆】兑换成功\n【宠物等级】${data.level}\n【积分详情】消耗积分 ${salePrice}, 剩余积分 ${data.coin - salePrice}`); if ($.isNode()) { - await notify.sendNotify(`${$.name} - 账号${$.index} - ${$.nickName}`, `【京东账号${$.index}】 ${$.nickName}\n【兑换${giftValue}京豆】成功\n【宠物等级】${data.level}\n【积分详情】消耗积分 ${salePrice}, 剩余积分 ${data.coin - salePrice}`); + await notify.sendNotify(`${$.name} - 账号${$.index} - ${$.nickName}`, `【京东账号${$.index}】 ${$.nickName}\n【${giftValue}京豆】兑换成功\n【宠物等级】${data.level}\n【积分详情】消耗积分 ${salePrice}, 剩余积分 ${data.coin - salePrice}`); } } // if ($.isNode()) { From 98c47625e8397a2177dfdfa377ea3da3aa9907dd Mon Sep 17 00:00:00 2001 From: lxk0301 <778732665@qq.com> Date: Wed, 6 Jan 2021 10:05:11 +0800 Subject: [PATCH 26/30] =?UTF-8?q?=E4=BC=81=E9=B9=85=E9=98=85=E8=AF=BB?= =?UTF-8?q?=E6=96=B0=E5=A2=9Ecookie=E8=BF=87=E6=9C=9F=E6=8F=90=E9=86=92?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=EF=BC=8C=E4=B8=80=E5=A4=A9=E5=8F=AA=E6=8E=A8?= =?UTF-8?q?=E9=80=81=E4=B8=A4=E6=AC=A1=E9=80=9A=E7=9F=A5(=E8=87=AA?= =?UTF-8?q?=E7=94=A8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backUp/qqread.js | 40 +++++++++++++++++----------------------- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/backUp/qqread.js b/backUp/qqread.js index 0ff1d2d9..3f8aa651 100644 --- a/backUp/qqread.js +++ b/backUp/qqread.js @@ -14,27 +14,6 @@ ziye 本人github地址 https://github.com/ziye12/JavaScript 转载请备注个名字,谢谢 -11.25 增加 阅读时长上传,阅读金币,阅读随机金币 -11.25 修复翻倍宝箱不同时领取的问题.增加阅读金币判定 -11.25 修复阅读时长问题,阅读金币问题,请重新获取时长cookie -11.26 随机金币只有一次,故去除,调整修复阅读金币问题,增加时长上传限制 -11.26 增加领取周时长奖励 -11.26 增加结束命令 -11.27 调整通知为,成功开启宝箱再通知 -11.28 修复错误 -12.1 调整通知为15次宝箱通知一次 -12.1 优化通知 - -⚠️cookie获取方法: - -进 https://m.q.qq.com/a/s/d3eacc70120b9a37e46bad408c0c4c2a 点我的 获取cookie - -进一本书 看 10秒以下 然后退出,获取阅读时长cookie,看书一定不能超过10秒 - -可能某些页面会卡住,但是能获取到cookie,再注释cookie重写就行了! - - - ⚠️宝箱奖励为20分钟一次,自己根据情况设置定时,建议设置11分钟一次 hostname=mqqapi.reader.qq.com @@ -80,6 +59,7 @@ let qqreadtimeurlVal = $.getdata(qqreadtimeurlKey) const qqreadtimeheaderKey = 'qqreadtimehd' let qqreadtimeheaderVal = $.getdata(qqreadtimeheaderKey) +let nowTimes = new Date(new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000); //云函数使用在下面填写 let QQ_READ_COOKIES = [ { @@ -180,6 +160,7 @@ async function QQ_READ() { for (let i = 0; i < QQ_READ_COOKIES.length; i++) { $.log(`\n*************开始QQ账号${i + 1}**************\n`); tz = ''; + $.isLogin = true; if (!QQ_READ_COOKIES[i]["qqreadbodyVal"] || !QQ_READ_COOKIES[i]['qqreadtimeurlVal'] || !QQ_READ_COOKIES[i]['qqreadtimeheaderVal']) { $.log(`账号${i + 1}暂未提供脚本执行所需的cookie`); continue @@ -188,6 +169,13 @@ async function QQ_READ() { qqreadtimeurlVal = QQ_READ_COOKIES[i]['qqreadtimeurlVal']; qqreadtimeheaderVal = QQ_READ_COOKIES[i]['qqreadtimeheaderVal']; await qqreadinfo();//用户名 + if (!$.isLogin) { + $.log(`企鹅阅读账号${i + 1} cookie过期`); + if (nowTimes.getHours() % 12 === 0 && (nowTimes.getMinutes() > 0 && nowTimes.getMinutes() <= 15)) { + await notify.sendNotify(`企鹅阅读账号${i + 1} cookie过期`, '请及时更新 QQ_READ_TIME_HEADER_VAL') + } + continue + } await qqreadwktime();//周时长查询 await qqreadtrack(); await qqreadconfig();//时长查询 @@ -236,8 +224,7 @@ async function QQ_READ() { } function showmsg() { return new Promise(async resolve => { - let nowTimes = new Date(new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000); - if (nowTimes.getHours() === 22 && (nowTimes.getMinutes() >= 0 && nowTimes.getMinutes() <= 15)) { + if (nowTimes.getHours() === 22 && (nowTimes.getMinutes() > 0 && nowTimes.getMinutes() <= 15)) { await notify.sendNotify(jsname, tz); } $.msg(jsname, "", tz); @@ -328,6 +315,13 @@ function qqreadinfo() { $.get(toqqreadinfourl, (error, response, data) => { if (logs) $.log(`${jsname}, 用户名: ${data}`); let info = JSON.parse(data); + if (info.code === 0) { + $.isLogin = info.data['isLogin']; + if (!$.isLogin) { + resolve(); + return + } + } kz += `\n========== 【${info.data.user.nickName}】 ==========\n`; tz += `\n========== 【${info.data.user.nickName}】 ==========\n`; From f51c1fa4c4ac998fd23418aa7028a2ee80add692 Mon Sep 17 00:00:00 2001 From: lxk0301 <778732665@qq.com> Date: Wed, 6 Jan 2021 10:53:02 +0800 Subject: [PATCH 27/30] =?UTF-8?q?=E4=BC=81=E9=B9=85=E9=98=85=E8=AF=BB?= =?UTF-8?q?=E5=8D=95=E7=8B=AC=E5=BC=80=E5=AE=9D=E7=AE=B1(=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E8=87=AA=E7=94=A8)=EF=BC=8C=E5=85=A8=E9=83=A8?= =?UTF-8?q?=E8=B4=A6=E5=8F=B7=E5=8F=AA=E9=80=9A=E7=9F=A5=E4=B8=80=E6=AC=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backUp/qqread.js | 1 - backUp/qqreadOpenBox.js | 293 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 293 insertions(+), 1 deletion(-) create mode 100644 backUp/qqreadOpenBox.js diff --git a/backUp/qqread.js b/backUp/qqread.js index 3f8aa651..e1e2639b 100644 --- a/backUp/qqread.js +++ b/backUp/qqread.js @@ -159,7 +159,6 @@ function GetCookie() { async function QQ_READ() { for (let i = 0; i < QQ_READ_COOKIES.length; i++) { $.log(`\n*************开始QQ账号${i + 1}**************\n`); - tz = ''; $.isLogin = true; if (!QQ_READ_COOKIES[i]["qqreadbodyVal"] || !QQ_READ_COOKIES[i]['qqreadtimeurlVal'] || !QQ_READ_COOKIES[i]['qqreadtimeheaderVal']) { $.log(`账号${i + 1}暂未提供脚本执行所需的cookie`); diff --git a/backUp/qqreadOpenBox.js b/backUp/qqreadOpenBox.js new file mode 100644 index 00000000..5182b6e5 --- /dev/null +++ b/backUp/qqreadOpenBox.js @@ -0,0 +1,293 @@ +/* +lxk0301修改自用,单独开宝箱 +****************************************************************************** +本人github地址 https://github.com/ziye12/JavaScript +转载请备注个名字,谢谢 + +1.5 调整宝箱策略,20分钟运行一次就行 +*/ +const $ = Env(`企鹅读书开宝箱`) +const notify = $.isNode() ? require("../sendNotify") : ""; +const logs = 1; //0为关闭日志,1为开启 + +let task, tz = '', kz, config = '', CASH = '', COOKIES_SPLIT = '' ; +let dk,ljyd,sp,ydrw,wktime; + +let qqreadbodyVal = ``; +let qqreadtimeurlVal = ``; +let qqreadtimeheaderVal = ``; +let nowTimes = new Date(new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000); +//云函数使用在下面填写 +let QQ_READ_COOKIES = [ + { + "qqreadbodyVal": ``, + "qqreadtimeurlVal": ``, + "qqreadtimeheaderVal": `` + } +] + +!(async () => { + await getNodeCookie(); + await open_box(); +})() +.catch((e) => { + $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '') +}) +.finally(() => { + $.done(); +}) + +async function open_box() { + for (let i = 0; i < QQ_READ_COOKIES.length; i++) { + $.log(`\n*************开始QQ账号${i + 1}**************\n`); + // tz = ''; + $.isLogin = true; + if (!QQ_READ_COOKIES[i]["qqreadbodyVal"] || !QQ_READ_COOKIES[i]['qqreadtimeurlVal'] || !QQ_READ_COOKIES[i]['qqreadtimeheaderVal']) { + $.log(`账号${i + 1}暂未提供脚本执行所需的cookie`); + continue + } + qqreadbodyVal = QQ_READ_COOKIES[i]['qqreadbodyVal']; + qqreadtimeurlVal = QQ_READ_COOKIES[i]['qqreadtimeurlVal']; + qqreadtimeheaderVal = QQ_READ_COOKIES[i]['qqreadtimeheaderVal']; + await qqreadinfo();//用户名 + if (!$.isLogin) { + $.log(`企鹅阅读账号${i + 1} cookie过期`); + if (nowTimes.getHours() % 12 === 0 && (nowTimes.getMinutes() > 0 && nowTimes.getMinutes() <= 15)) { + await notify.sendNotify(`企鹅阅读账号${i + 1} cookie过期`, '请及时更新 QQ_READ_TIME_HEADER_VAL') + } + continue + } + //单独开宝箱 + if (nowTimes.getHours() === 0 && (nowTimes.getMinutes() >= 0 && nowTimes.getMinutes() <= 59)) { + await qqreadtrack();//更新 + } + await qqreadtask();//任务列表 + if (task.data && ljyd.doneFlag == 0) { + await qqreaddayread();//阅读任务 + } + if (task.data && task.data.treasureBox.timeInterval <= 10000) { + await $.wait(task.data.treasureBox.timeInterval) + await qqreadbox();//宝箱 + } + if (task.data && task.data.treasureBox.timeInterval - 600000 <= 10000) { + await $.wait(task.data.treasureBox.timeInterval - 600000) + await qqreadbox2();//宝箱翻倍 + } + } + await showmsg();//通知 +} + + +function showmsg() { + return new Promise(async resolve => { + if (nowTimes.getHours() === 23 && (nowTimes.getMinutes() > 0 && nowTimes.getMinutes() <= 15)) { + await notify.sendNotify($.name, tz); + } + $.msg($.name, "", tz); + resolve() + }) +} + + +// 更新 +function qqreadtrack() { + return new Promise((resolve, reject) => { + const body = qqreadbodyVal.replace(new RegExp(/"dis":[0-9]{13}/), `"dis":${new Date().getTime()}`) + const toqqreadtrackurl = { + url: "https://mqqapi.reader.qq.com/log/v4/mqq/track", + headers: JSON.parse(qqreadtimeheaderVal), + body: body, + timeout: 60000, + }; + $.post(toqqreadtrackurl, (error, response, data) => { + if (logs) $.log(`更新: ${data}`); + let track = JSON.parse(data); + const date = new Date(JSON.parse(qqreadbodyVal).dataList[0].dis) + let Y = date.getFullYear() + '-'; + let M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'; + let D = date.getDate() + ' '; + let h = date.getHours() + ':'; + let m = date.getMinutes() + ':'; + let s = date.getSeconds(); + let time = Y + M + D + h + m + s; + tz += `【数据更新】:更新${track.msg},\n【cookie获取时间】${time}\n`; + kz += `【数据更新】:更新${track.msg},\n【cookie获取时间】${time}\n`; + resolve(); + }); + }); +} +// 用户名 +function qqreadinfo() { + return new Promise((resolve, reject) => { + const toqqreadinfourl = { + url: "https://mqqapi.reader.qq.com/mqq/user/init", + headers: JSON.parse(qqreadtimeheaderVal), + timeout: 60000, + }; + $.get(toqqreadinfourl, (error, response, data) => { + if (logs) $.log(`用户名: ${data}`); + const info = JSON.parse(data); + if (info.code === 0) { + $.isLogin = info.data['isLogin']; + if (!$.isLogin) { + resolve(); + return + } + } + kz += `\n========== 【${info.data.user.nickName}】 ==========\n`; + tz += `\n========== 【${info.data.user.nickName}】 ==========\n`; + + resolve(); + }); + }); +} +// 任务列表 +function qqreadtask() { + return new Promise((resolve, reject) => { + const toqqreadtaskurl = { + url: "https://mqqapi.reader.qq.com/mqq/red_packet/user/page?fromGuid=", + headers: JSON.parse(qqreadtimeheaderVal), + timeout: 60000, + }; + $.get(toqqreadtaskurl, (error, response, data) => { + if (logs) $.log(`任务列表: ${data}`); + task = JSON.parse(data); + dk = task.data.taskList.find(item => item.type === 200); + ljyd = task.data.taskList.find(item => item.type === 210); + ydrw = task.data.taskList.find(item => item.type === 220); + sp = task.data.taskList.find(item => item.type === 230); + + if (task.data.invite.nextInviteConfig) { + tz += + `【现金余额】:${(task.data.user.amount / 10000).toFixed(2)}元\n` + + `【第${task.data.invite.issue}期】:时间${task.data.invite.dayRange}\n` + + ` 已邀请${task.data.invite.inviteCount}人,再邀请${task.data.invite.nextInviteConfig.count}人获得${task.data.invite.nextInviteConfig.amount}金币\n` + + `【${dk.title}】:${dk.amount}金币,${dk.actionText}\n` + + `【${ljyd.title}】:${ljyd.amount}金币,${ljyd.actionText}\n` + + `【${ydrw.title}】:${ydrw.amount}金币,${ydrw.actionText}\n` + + `【${sp.title}】:${sp.amount}金币,${sp.actionText}\n` + + `【宝箱任务${task.data.treasureBox.count + 1}】:${task.data.treasureBox.timeInterval / 1000 + }秒后领取\n` + + `【${task.data.fans.title}】:${task.data.fans.fansCount}个好友,${task.data.fans.todayAmount}金币\n`; + } + + kz += + `【现金余额】:${(task.data.user.amount / 10000).toFixed(2)}元\n` + + `【宝箱任务${task.data.treasureBox.count + 1}】:${task.data.treasureBox.timeInterval / 1000 + }秒后领取\n` + + `【已开宝箱】:${task.data.treasureBox.count}个\n`; + + resolve(); + }); + }); +} +// 每日阅读 +function qqreaddayread() { + return new Promise((resolve, reject) => { + const toqqreaddayreadurl = { + url: "https://mqqapi.reader.qq.com/mqq/red_packet/user/read_book", + headers: JSON.parse(qqreadtimeheaderVal), + timeout: 60000, + }; + $.get(toqqreaddayreadurl, (error, response, data) => { + if (logs) $.log(`每日阅读: ${data}`); + let dayread = JSON.parse(data); + if (dayread.code == 0) { + tz += `【每日阅读】:获得${dayread.data.amount}金币\n`; + kz += `【每日阅读】:获得${dayread.data.amount}金币\n`; + } + resolve(); + }); + }); +} +// 宝箱奖励 +function qqreadbox() { + return new Promise((resolve, reject) => { + const toqqreadboxurl = { + url: "https://mqqapi.reader.qq.com/mqq/red_packet/user/treasure_box", + headers: JSON.parse(qqreadtimeheaderVal), + timeout: 60000, + }; + $.get(toqqreadboxurl, (error, response, data) => { + if (logs) $.log(`宝箱奖励: ${data}`); + let box = JSON.parse(data); + if (box.code == 0 && box.data.amount) { + tz += `【宝箱奖励${box.data.count}】:获得${box.data.amount}金币\n`; + kz += `【宝箱奖励${box.data.count}】:获得${box.data.amount}金币\n`; + } + + resolve(); + }); + }); +} +// 宝箱奖励翻倍 +function qqreadbox2() { + return new Promise((resolve, reject) => { + const toqqreadbox2url = { + url: + "https://mqqapi.reader.qq.com/mqq/red_packet/user/treasure_box_video", + headers: JSON.parse(qqreadtimeheaderVal), + timeout: 60000, + }; + $.get(toqqreadbox2url, (error, response, data) => { + if (logs) $.log(`宝箱奖励翻倍: ${data}`); + let box2 = JSON.parse(data); + if (box2.code == 0 && box2.data.amount) { + tz += `【宝箱翻倍】:获得${box2.data.amount}金币\n`; + kz += `【宝箱翻倍】:获得${box2.data.amount}金币\n`; + } + resolve(); + }); + }); +} +function getNodeCookie() { + if ($.isNode()) { + let QQ_READ_BODY_VAL = [], QQ_READ_TIME_URL_VAL = [], QQ_READ_TIME_HEADER_VAL = []; + if (process.env.QQ_READ_HEADER_VAL) { + if (process.env.QQ_READ_HEADER_VAL.indexOf('@') > -1) { + console.log(`您的QQ_READ_HEADER_VAL选择的是用@隔开\n`) + QQ_READ_BODY_VAL = process.env.QQ_READ_HEADER_VAL.split('@'); + } else if (process.env.QQ_READ_HEADER_VAL.indexOf('\n') > -1) { + console.log(`您的QQ_READ_HEADER_VAL选择的是用换行隔开\n`) + QQ_READ_BODY_VAL = process.env.QQ_READ_HEADER_VAL.split('\n'); + } else { + QQ_READ_BODY_VAL = [process.env.QQ_READ_HEADER_VAL]; + } + } + if (process.env.QQ_READ_TIME_URL_VAL) { + if (process.env.QQ_READ_TIME_URL_VAL.indexOf('@') > -1) { + console.log(`您的QQ_READ_TIME_URL_VAL选择的是用@隔开\n`) + QQ_READ_TIME_URL_VAL = process.env.QQ_READ_TIME_URL_VAL.split('@'); + } else if (process.env.QQ_READ_HEADER_VAL.indexOf('\n') > -1) { + console.log(`您的QQ_READ_TIME_URL_VAL选择的是用换行隔开\n`) + QQ_READ_TIME_URL_VAL = process.env.QQ_READ_TIME_URL_VAL.split('\n'); + } else { + QQ_READ_TIME_URL_VAL = [process.env.QQ_READ_TIME_URL_VAL]; + } + // QQ_READ_TIME_URL_VAL = [...new Set(QQ_READ_TIME_URL_VAL)] + } + if (process.env.QQ_READ_TIME_HEADER_VAL) { + if (process.env.QQ_READ_TIME_HEADER_VAL.indexOf('@') > -1) { + console.log(`您的QQ_READ_TIME_HEADER_VAL选择的是用@隔开\n`) + QQ_READ_TIME_HEADER_VAL = process.env.QQ_READ_TIME_HEADER_VAL.split('@'); + } else if (process.env.QQ_READ_TIME_HEADER_VAL.indexOf('\n') > -1) { + console.log(`您的QQ_READ_TIME_HEADER_VAL选择的是用换行隔开\n`) + QQ_READ_TIME_HEADER_VAL = process.env.QQ_READ_TIME_HEADER_VAL.split('\n'); + } else { + QQ_READ_TIME_HEADER_VAL = [process.env.QQ_READ_TIME_HEADER_VAL]; + } + // QQ_READ_TIME_HEADER_VAL = [...new Set(QQ_READ_TIME_HEADER_VAL)] + } + if (QQ_READ_BODY_VAL && QQ_READ_BODY_VAL.length > 0) QQ_READ_COOKIES = []; + for (let i = 0; i < QQ_READ_BODY_VAL.length; i ++) { + QQ_READ_COOKIES.push({ + "qqreadbodyVal": QQ_READ_BODY_VAL[i] || "", + "qqreadtimeurlVal": QQ_READ_TIME_URL_VAL[i] || "", + "qqreadtimeheaderVal": QQ_READ_TIME_HEADER_VAL[i] || "" + }) + } + // console.log(`${JSON.stringify(QQ_READ_COOKIES)}`) + } +} +// prettier-ignore +function Env(t, e) { 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("", `\ud83d\udd14${this.name}, \u5f00\u59cb!`) } 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("@"), a = { url: `http://${h}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": o, Accept: "*/*" } }; this.post(a, (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(); 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) { let e = { "M+": (new Date).getMonth() + 1, "d+": (new Date).getDate(), "H+": (new Date).getHours(), "m+": (new Date).getMinutes(), "s+": (new Date).getSeconds(), "q+": Math.floor(((new Date).getMonth() + 3) / 3), S: (new Date).getMilliseconds() }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, ((new Date).getFullYear() + "").substr(4 - RegExp.$1.length))); for (let s in e) new RegExp("(" + s + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? e[s] : ("00" + e[s]).substr(("" + e[s]).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 } } } }; this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))); let h = ["", "==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="]; h.push(e), s && h.push(s), i && h.push(i), console.log(h.join("\n")), this.logs = this.logs.concat(h) } 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("", `\u2757\ufe0f${this.name}, \u9519\u8bef!`, t.stack) : this.log("", `\u2757\ufe0f${this.name}, \u9519\u8bef!`, t) } wait(t) { return new Promise(e => setTimeout(e, t)) } done(t = {}) { const e = (new Date).getTime(), s = (e - this.startTime) / 1e3; this.log("", `\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) } }(t, e) } \ No newline at end of file From 79f90930ba1152eabaa9a7a15dff4d3be115aab1 Mon Sep 17 00:00:00 2001 From: lxk0301 <778732665@qq.com> Date: Wed, 6 Jan 2021 11:40:21 +0800 Subject: [PATCH 28/30] fix --- jd_get_share_code.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/jd_get_share_code.js b/jd_get_share_code.js index 5b44c5cb..a23754d1 100644 --- a/jd_get_share_code.js +++ b/jd_get_share_code.js @@ -661,5 +661,16 @@ function taskPostUrl(function_id, body = {}, function_id2) { }, }; } +function jsonParse(str) { + if (typeof str == "string") { + try { + return JSON.parse(str); + } catch (e) { + console.log(e); + $.msg($.name, '', '不要在BoxJS手动复制粘贴修改cookie') + return []; + } + } +} // prettier-ignore function Env(t,e){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("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}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("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(a,(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();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){let e={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).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}}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r)));let h=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];h.push(e),s&&h.push(s),i&&h.push(i),console.log(h.join("\n")),this.logs=this.logs.concat(h)}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("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)} From 63403f4a2f45b6784f1ad69664b3697e555fbde1 Mon Sep 17 00:00:00 2001 From: lxk0301 <778732665@qq.com> Date: Wed, 6 Jan 2021 16:02:25 +0800 Subject: [PATCH 29/30] fix jd_joy_run.js --- README.md | 3 ++- jd_joy_run.js | 66 ++++++++++++++++++++++++++------------------------- 2 files changed, 36 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index 245ab57f..68c4d189 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,8 @@ **脚本兼容: [QuantumultX](https://apps.apple.com/us/app/quantumult-x/id1443988620), [Surge](https://apps.apple.com/us/app/surge-4/id1442620678), [Loon](https://apps.apple.com/us/app/loon/id1373567447), 小火箭, JSBox, Node.js** **TODO** -- [ ] 所有活动互助码在一个脚本打印 +- [x] 所有活动互助码在一个脚本打印 +- [ ] 京喜工厂添加预测N天后可兑换功能 ## 邀请码互助 - [邀请码互助入口](https://github.com/lxk0301/jd_scripts/discussions) diff --git a/jd_joy_run.js b/jd_joy_run.js index 2b18c1e0..66e3d520 100644 --- a/jd_joy_run.js +++ b/jd_joy_run.js @@ -1,6 +1,6 @@ /** 宠汪汪邀请助力与赛跑助力脚本,感谢github@Zero-S1提供帮助 -更新时间:2020-12-16(宠汪汪助力更新Token的配置正则表达式已改) +更新时间:2021-1-6(宠汪汪助力更新Token的配置正则表达式已改) token时效很短,几个小时就失效了,闲麻烦的放弃就行 每天拿到token后,可一次性运行完毕即可。 @@ -245,37 +245,39 @@ async function invite(invite_pins) { for (let item of invite_pins.map(item => item.trim())) { console.log(`\n账号${$.index} [${UserName}] 开始给好友 [${item}] 进行邀请助力`) const data = await enterRoom(item); - if (!data.success && data.errorCode === 'B0001') { - console.log('京东Cookie失效'); - $.msg($.name, `【提示】京东cookie已失效`, `京东账号${$.index} ${UserName}\n请重新登录获取\nhttps://bean.m.jd.com/`, {"open-url": "https://bean.m.jd.com/"}); - $.jdLogin = false; - break - } else { - const { helpStatus } = data.data; - console.log(`helpStatus ${helpStatus}`) - if (helpStatus=== 'help_full') { - console.log(`您的邀请助力机会已耗尽\n`) - break; - } else if (helpStatus=== 'cannot_help') { - console.log(`已给该好友 ${item} 助力过或者此friendPin是你自己\n`) - continue; - } else if (helpStatus=== 'invite_full') { - console.log(`助力失败,该好友 ${item} 已经满3人给他助力了,无需您再次助力\n`) - continue; - } else if (helpStatus=== 'can_help') { - console.log(`开始给好友 ${item} 助力\n`) - const LKYL_DATA = await helpInviteFriend(item); - if (LKYL_DATA.errorCode === 'L0001' && !LKYL_DATA.success) { - console.log('来客有礼宠汪汪token失效'); - $.setdata('', 'jdJoyRunToken'); - $.msg($.name, '【提示】来客有礼token失效,请重新获取', "微信搜索'来客有礼'小程序\n点击底部的'发现'Tab\n即可获取Token") - $.LKYLLogin = false; - break - } else { - $.LKYLLogin = true; + if (data) { + if (!data.success && data.errorCode === 'B0001') { + console.log('京东Cookie失效'); + $.msg($.name, `【提示】京东cookie已失效`, `京东账号${$.index} ${UserName}\n请重新登录获取\nhttps://bean.m.jd.com/`, {"open-url": "https://bean.m.jd.com/"}); + $.jdLogin = false; + break + } else { + const { helpStatus } = data.data; + console.log(`helpStatus ${helpStatus}`) + if (helpStatus=== 'help_full') { + console.log(`您的邀请助力机会已耗尽\n`) + break; + } else if (helpStatus=== 'cannot_help') { + console.log(`已给该好友 ${item} 助力过或者此friendPin是你自己\n`) + continue; + } else if (helpStatus=== 'invite_full') { + console.log(`助力失败,该好友 ${item} 已经满3人给他助力了,无需您再次助力\n`) + continue; + } else if (helpStatus=== 'can_help') { + console.log(`开始给好友 ${item} 助力\n`) + const LKYL_DATA = await helpInviteFriend(item); + if (LKYL_DATA.errorCode === 'L0001' && !LKYL_DATA.success) { + console.log('来客有礼宠汪汪token失效'); + $.setdata('', 'jdJoyRunToken'); + $.msg($.name, '【提示】来客有礼token失效,请重新获取', "微信搜索'来客有礼'小程序\n点击底部的'发现'Tab\n即可获取Token") + $.LKYLLogin = false; + break + } else { + $.LKYLLogin = true; + } } + $.jdLogin = true; } - $.jdLogin = true; } } // if ($.inviteReward > 0) { @@ -293,8 +295,8 @@ function enterRoom(invitePin) { $.get(options, (err, resp, data) => { try { if (err) { - $.log('API请求失败') - $.logErr(JSON.stringify(err)); + $.log(`${$.name} API请求失败`) + $.log(JSON.stringify(err)) } else { data = JSON.parse(data); // console.log('进入房间', data) From ffddbd7e0e7c60fbfa50f21306ddf8d569d6e42d Mon Sep 17 00:00:00 2001 From: lxk0301 <778732665@qq.com> Date: Wed, 6 Jan 2021 16:20:10 +0800 Subject: [PATCH 30/30] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20jd=5Fjoy=5Frun.js?= =?UTF-8?q?=E9=82=80=E8=AF=B7=E5=8A=A9=E5=8A=9B=E6=8A=A5=E9=94=99=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jd_joy_run.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/jd_joy_run.js b/jd_joy_run.js index 66e3d520..a8f414d7 100644 --- a/jd_joy_run.js +++ b/jd_joy_run.js @@ -246,12 +246,7 @@ async function invite(invite_pins) { console.log(`\n账号${$.index} [${UserName}] 开始给好友 [${item}] 进行邀请助力`) const data = await enterRoom(item); if (data) { - if (!data.success && data.errorCode === 'B0001') { - console.log('京东Cookie失效'); - $.msg($.name, `【提示】京东cookie已失效`, `京东账号${$.index} ${UserName}\n请重新登录获取\nhttps://bean.m.jd.com/`, {"open-url": "https://bean.m.jd.com/"}); - $.jdLogin = false; - break - } else { + if (data.success) { const { helpStatus } = data.data; console.log(`helpStatus ${helpStatus}`) if (helpStatus=== 'help_full') { @@ -277,6 +272,13 @@ async function invite(invite_pins) { } } $.jdLogin = true; + } else { + if (data.errorCode === 'B0001') { + console.log('京东Cookie失效'); + $.msg($.name, `【提示】京东cookie已失效`, `京东账号${$.index} ${UserName}\n请重新登录获取\nhttps://bean.m.jd.com/`, {"open-url": "https://bean.m.jd.com/"}); + $.jdLogin = false; + break + } } } } @@ -289,10 +291,11 @@ function enterRoom(invitePin) { headers.Cookie = cookie; headers.LKYLToken = $.LKYLToken; const options = { - url: `${JD_BASE_API}/enterRoom?reqSource=weapp&invitePin=${encodeURI(invitePin)}`, + url: `${JD_BASE_API}/enterRoom/h5?reqSource=weapp&invitePin=${encodeURI(invitePin)}&inviteSource=task_invite&shareSource=weapp&inviteTimeStamp=${Date.now()}`, + body: '{}', headers } - $.get(options, (err, resp, data) => { + $.post(options, (err, resp, data) => { try { if (err) { $.log(`${$.name} API请求失败`)