diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
new file mode 100644
index 0000000..00a9d7e
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -0,0 +1,79 @@
+---
+name: Bug 反馈
+about: 运行js脚本时出现bug
+title: ''
+labels: ''
+assignees: ''
+
+---
+
+
+
+
+
+
+
+
+
+
+
+
+## 1.关于你要提交的问题
+
+Q:是否搜索了issue(包括已关闭的issue)
+- [ ] 没有类似的issue
+
+Q:是否仔细阅读了教程
+- [ ] 已仔细阅读教程
+
+## 2. 你使用的哪种部署方法
+
+
+
+
+
+
+- [ ] 方法一:本地安装Node.js
+- [ ] 方法二:腾讯云函数
+- [ ] 方法三:Docker办法一
+- [ ] 方法三:Docker办法二
+- [ ] 方法三:Docker办法三
+- [ ] 方法四:iOS系统的代理软件
+
+
+## 3. 详细叙述
+### (1) 具体问题
+A:
+
+### (2) 详细日志
+A:
+
+
+
+
+
+## 4.软件版本和 npm install 结果
+### (1) Node.js版本
+
+A:
+
+### (2) npm版本
+
+A:
+
+### (3)npm install的日志
+
+A:
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
new file mode 100644
index 0000000..d741913
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request.md
@@ -0,0 +1,44 @@
+---
+name: 功能建议
+about: 请求实现新功能或改进已有功能
+title: ''
+labels: ''
+assignees: ''
+
+---
+
+
+
+
+
+
+
+
+
+
+
+
+## 期望增加的功能
+
+A:
+
+
+
+
+
+## 入口
+
+A:
diff --git a/.github/pull.yml b/.github/pull.yml
deleted file mode 100644
index bbadc61..0000000
--- a/.github/pull.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-version: "1"
-rules: # Array of rules
- - base: master # Required. Target branch
- upstream: lxk0301:master # Required. Must be in the same fork network.
- mergeMethod: hardreset # Optional, one of [none, merge, squash, rebase, hardreset], Default: none.
- mergeUnstable: true # Optional, merge pull request even when the mergeable_state is not clean. Default: false
diff --git a/.github/workflows/deploy_tencent_scf.yml b/.github/workflows/deploy_tencent_scf.yml
new file mode 100644
index 0000000..245675f
--- /dev/null
+++ b/.github/workflows/deploy_tencent_scf.yml
@@ -0,0 +1,116 @@
+name: 部署到腾讯云函数
+
+on:
+ workflow_dispatch:
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ if: github.event.repository.owner.id == github.event.sender.id
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v2
+ with:
+ repository: ${{ github.repository }}
+
+ - name: Use Node.js ${{ matrix.node-version }}
+ uses: actions/setup-node@v1
+ with:
+ node-version: ${{ matrix.node-version }}
+
+ - name: "安装依赖和serverless工具"
+ run: |
+ npm install
+ sudo npm install serverless -g
+
+ - name: "将Secrets里面配置的变量添加到severless.yml里面作为环境变量"
+ run: |
+ if [ $JD_COOKIE ]; then sed -i "/variables/a\ JD_COOKIE: $JD_COOKIE" serverless.yml; fi;
+ if [ $JD_USER_AGENT ]; then sed -i "/variables/a\ JD_USER_AGENT: $JD_USER_AGENT" serverless.yml; fi;
+ if [ $JD_BEAN_STOP ]; then sed -i "/variables/a\ JD_BEAN_STOP: $JD_BEAN_STOP" serverless.yml; fi;
+ if [ $JD_BEAN_SIGN_STOP_NOTIFY ]; then sed -i "/variables/a\ JD_BEAN_SIGN_STOP_NOTIFY: $JD_BEAN_SIGN_STOP_NOTIFY" serverless.yml; fi;
+ if [ $JD_BEAN_SIGN_NOTIFY_SIMPLE ]; then sed -i "/variables/a\ JD_BEAN_SIGN_NOTIFY_SIMPLE: $JD_BEAN_SIGN_NOTIFY_SIMPLE" serverless.yml; fi;
+ if [ $PUSH_KEY ]; then sed -i "/variables/a\ PUSH_KEY: $PUSH_KEY" serverless.yml; fi;
+ if [ $BARK_PUSH ]; then sed -i "/variables/a\ BARK_PUSH: $BARK_PUSH" serverless.yml; fi;
+ if [ $BARK_SOUND ]; then sed -i "/variables/a\ BARK_SOUND: $BARK_SOUND" serverless.yml; fi;
+ if [ $TG_BOT_TOKEN ]; then sed -i "/variables/a\ TG_BOT_TOKEN: $TG_BOT_TOKEN" serverless.yml; fi;
+ if [ $TG_USER_ID ]; then sed -i "/variables/a\ TG_USER_ID: $TG_USER_ID" serverless.yml; fi;
+ if [ $DD_BOT_TOKEN ]; then sed -i "/variables/a\ DD_BOT_TOKEN: $DD_BOT_TOKEN" serverless.yml; fi;
+ if [ $DD_BOT_SECRET ]; then sed -i "/variables/a\ DD_BOT_SECRET: $DD_BOT_SECRET" serverless.yml; fi;
+ if [ $IGOT_PUSH_KEY ]; then sed -i "/variables/a\ IGOT_PUSH_KEY: $IGOT_PUSH_KEY" serverless.yml; fi;
+ if [ $PET_NOTIFY_CONTROL ]; then sed -i "/variables/a\ PET_NOTIFY_CONTROL: $PET_NOTIFY_CONTROL" serverless.yml; fi;
+ if [ $FRUIT_NOTIFY_CONTROL ]; then sed -i "/variables/a\ FRUIT_NOTIFY_CONTROL: $FRUIT_NOTIFY_CONTROL" serverless.yml; fi;
+ if [ $JD_JOY_REWARD_NOTIFY ]; then sed -i "/variables/a\ JD_JOY_REWARD_NOTIFY: $JD_JOY_REWARD_NOTIFY" serverless.yml; fi;
+ if [ $JD_818_SHAREID_NOTIFY ]; then sed -i "/variables/a\ JD_818_SHAREID_NOTIFY: $JD_818_SHAREID_NOTIFY" serverless.yml; fi;
+ if [ $JOY_FEED_COUNT ]; then sed -i "/variables/a\ JOY_FEED_COUNT: $JOY_FEED_COUNT" serverless.yml; fi;
+ if [ $JOY_HELP_FEED ]; then sed -i "/variables/a\ JOY_HELP_FEED: $JOY_HELP_FEED" serverless.yml; fi;
+ if [ $JOY_RUN_FLAG ]; then sed -i "/variables/a\ JOY_RUN_FLAG: $JOY_RUN_FLAG" serverless.yml; fi;
+ if [ $JOY_TEAM_LEVEL ]; then sed -i "/variables/a\ JOY_TEAM_LEVEL: $JOY_TEAM_LEVEL" serverless.yml; fi;
+ if [ $JD_JOY_REWARD_NAME ]; then sed -i "/variables/a\ JD_JOY_REWARD_NAME: $JD_JOY_REWARD_NAME" serverless.yml; fi;
+ if [ $MARKET_COIN_TO_BEANS ]; then sed -i "/variables/a\ MARKET_COIN_TO_BEANS: $MARKET_COIN_TO_BEANS" serverless.yml; fi;
+ if [ $MARKET_REWARD_NOTIFY ]; then sed -i "/variables/a\ MARKET_REWARD_NOTIFY: $MARKET_REWARD_NOTIFY" serverless.yml; fi;
+ if [ $SUPERMARKET_UPGRADE ]; then sed -i "/variables/a\ SUPERMARKET_UPGRADE: $SUPERMARKET_UPGRADE" serverless.yml; fi;
+ if [ $BUSINESS_CIRCLE_JUMP ]; then sed -i "/variables/a\ BUSINESS_CIRCLE_JUMP: $BUSINESS_CIRCLE_JUMP" serverless.yml; fi;
+ if [ $SUPERMARKET_LOTTERY ]; then sed -i "/variables/a\ SUPERMARKET_LOTTERY: $SUPERMARKET_LOTTERY" serverless.yml; fi;
+ if [ $FRUIT_BEAN_CARD ]; then sed -i "/variables/a\ FRUIT_BEAN_CARD: $FRUIT_BEAN_CARD" serverless.yml; fi;
+ if [ $UN_SUBSCRIBES ]; then sed -i "/variables/a\ UN_SUBSCRIBES: $UN_SUBSCRIBES" serverless.yml; fi;
+ if [ $FRUITSHARECODES ]; then sed -i "/variables/a\ FRUITSHARECODES: $FRUITSHARECODES" serverless.yml; fi;
+ if [ $PETSHARECODES ]; then sed -i "/variables/a\ PETSHARECODES: $PETSHARECODES" serverless.yml; fi;
+ if [ $PLANT_BEAN_SHARECODES ]; then sed -i "/variables/a\ PLANT_BEAN_SHARECODES: $PLANT_BEAN_SHARECODES" serverless.yml; fi;
+ if [ $SUPERMARKET_SHARECODES ]; then sed -i "/variables/a\ SUPERMARKET_SHARECODES: $SUPERMARKET_SHARECODES" serverless.yml; fi;
+ if [ $DDFACTORY_SHARECODES ]; then sed -i "/variables/a\ DDFACTORY_SHARECODES: $DDFACTORY_SHARECODES" serverless.yml; fi;
+ if [ $DREAM_FACTORY_SHARE_CODES ]; then sed -i "/variables/a\ DREAM_FACTORY_SHARE_CODES: $DREAM_FACTORY_SHARE_CODES" serverless.yml; fi;
+ if [ $TG_PROXY_HOST ]; then sed -i "/variables/a\ TG_PROXY_HOST: $TG_PROXY_HOST" serverless.yml; fi;
+ if [ $TG_PROXY_PORT ]; then sed -i "/variables/a\ TG_PROXY_PORT: $TG_PROXY_PORT" serverless.yml; fi;
+ if [ $MONEY_TREE_SELL_FRUIT ]; then sed -i "/variables/a\ MONEY_TREE_SELL_FRUIT: $MONEY_TREE_SELL_FRUIT" serverless.yml; fi;
+ if [ $FACTORAY_WANTPRODUCT_NAME ]; then sed -i "/variables/a\ FACTORAY_WANTPRODUCT_NAME: $FACTORAY_WANTPRODUCT_NAME" serverless.yml; fi;
+ cat serverless.yml
+ env
+ env: #因为直接读取secrets里面的值很多字符不会自动转译,导致写入serverless.yml异常,所以设置到环境变量,在读取环境变量转译过的值
+ JD_COOKIE: ${{ secrets.JD_COOKIE}}
+ JD_USER_AGENT: ${{ secrets.JD_USER_AGENT}}
+ JD_BEAN_STOP: ${{ secrets.JD_BEAN_STOP}}
+ JD_BEAN_SIGN_STOP_NOTIFY: ${{ secrets.JD_BEAN_SIGN_STOP_NOTIFY}}
+ JD_BEAN_SIGN_NOTIFY_SIMPLE: ${{ secrets.JD_BEAN_SIGN_NOTIFY_SIMPLE}}
+ PUSH_KEY: ${{ secrets.PUSH_KEY}}
+ BARK_PUSH: ${{ secrets.BARK_PUSH}}
+ BARK_SOUND: ${{ secrets.BARK_SOUND}}
+ TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN}}
+ TG_USER_ID: ${{ secrets.TG_USER_ID}}
+ DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN}}
+ DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET}}
+ IGOT_PUSH_KEY: ${{ secrets.IGOT_PUSH_KEY}}
+ PET_NOTIFY_CONTROL: ${{ secrets.PET_NOTIFY_CONTROL}}
+ FRUIT_NOTIFY_CONTROL: ${{ secrets.FRUIT_NOTIFY_CONTROL}}
+ JD_JOY_REWARD_NOTIFY: ${{ secrets.JD_JOY_REWARD_NOTIFY}}
+ JD_818_SHAREID_NOTIFY: ${{ secrets.JD_818_SHAREID_NOTIFY}}
+ JOY_FEED_COUNT: ${{ secrets.JOY_FEED_COUNT}}
+ JOY_HELP_FEED: ${{ secrets.JOY_HELP_FEED}}
+ JOY_RUN_FLAG: ${{ secrets.JOY_RUN_FLAG}}
+ JOY_TEAM_LEVEL: ${{ secrets.JOY_TEAM_LEVEL}}
+ JD_JOY_REWARD_NAME: ${{ secrets.JD_JOY_REWARD_NAME}}
+ MARKET_COIN_TO_BEANS: ${{ secrets.MARKET_COIN_TO_BEANS}}
+ MARKET_REWARD_NOTIFY: ${{ secrets.MARKET_REWARD_NOTIFY}}
+ SUPERMARKET_UPGRADE: ${{ secrets.SUPERMARKET_UPGRADE}}
+ BUSINESS_CIRCLE_JUMP: ${{ secrets.BUSINESS_CIRCLE_JUMP}}
+ SUPERMARKET_LOTTERY: ${{ secrets.SUPERMARKET_LOTTERY}}
+ FRUIT_BEAN_CARD: ${{ secrets.FRUIT_BEAN_CARD}}
+ UN_SUBSCRIBES: ${{ secrets.UN_SUBSCRIBES}}
+ FRUITSHARECODES: ${{ secrets.FRUITSHARECODES}}
+ PETSHARECODES: ${{ secrets.PETSHARECODES}}
+ PLANT_BEAN_SHARECODES: ${{ secrets.PLANT_BEAN_SHARECODES}}
+ SUPERMARKET_SHARECODES: ${{ secrets.SUPERMARKET_SHARECODES}}
+ DDFACTORY_SHARECODES: ${{ secrets.DDFACTORY_SHARECODES}}
+ DREAM_FACTORY_SHARE_CODES: ${{ secrets.DREAM_FACTORY_SHARE_CODES}}
+ TG_PROXY_HOST: ${{ secrets.TG_PROXY_HOST}}
+ TG_PROXY_PORT: ${{ secrets.TG_PROXY_PORT}}
+ MONEY_TREE_SELL_FRUIT: ${{ secrets.MONEY_TREE_SELL_FRUIT}}
+ FACTORAY_WANTPRODUCT_NAME: ${{ secrets.FACTORAY_WANTPRODUCT_NAME}}
+
+ - name: "部署到腾讯云函数"
+ run: serverless deploy
+ env:
+ STAGE: dev
+ SERVERLESS_PLATFORM_VENDOR: tencent
+ TENCENT_SECRET_ID: ${{ secrets.TENCENT_SECRET_ID }}
+ TENCENT_SECRET_KEY: ${{ secrets.TENCENT_SECRET_KEY }}
diff --git a/.gitignore b/.gitignore
index a8ffa8b..3b50818 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,6 @@
/node_modules/
/.idea
-/index.js
/.history
/box.dat
/CookieSet.json
+/jdCookie.js
diff --git a/JD_extra_cookie.js b/JD_extra_cookie.js
index 10fbcae..f1eed49 100644
--- a/JD_extra_cookie.js
+++ b/JD_extra_cookie.js
@@ -3,7 +3,7 @@
Author: 2Ya
-Github: https://github.com/domping
+Github: https://github.com/dompling
===================
特别说明:
diff --git a/Loon/lxk0301_LoonTask.conf b/Loon/lxk0301_LoonTask.conf
index 678fa1f..b3d8a57 100644
--- a/Loon/lxk0301_LoonTask.conf
+++ b/Loon/lxk0301_LoonTask.conf
@@ -60,24 +60,42 @@ cron "1 1 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_script
#京豆变动通知
cron "2 9 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_bean_change.js, tag=京豆变动通知
+#点点券
+cron "20 0,20 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_necklace.js, tag=点点券
+
+#十元街
+cron "10 7 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_syj.js, tag=十元街
+
+#东东小窝
+cron "16 0 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_small_home.js, tag=东东小窝
+
+#京喜工厂
+cron "26 * * * *" script-path= https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_dreamFactory.js, tag=京喜工厂
+
+#东东工厂
+cron "10 * * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_jdfactory.js,tag=东东工厂
+
+
#京东全民营业领金币
cron "20 * * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_collectProduceScore.js, tag=京东全民营业领金币
#宠汪汪邀请助力与赛跑助力
cron "15 10 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_joy_run.js, tag=宠汪汪邀请助力与赛跑助力
-#宠汪汪助力更新Token
-http-response ^https:\/\/draw\.jdfcloud\.com\/mirror\/\/api\/user\/addUser\?code=\w+& script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_joy_run.js, requires-body=true, timeout=10, tag=宠汪汪助力更新Token
-
-#宠汪汪助力获取Token
-http-request ^https:\/\/draw\.jdfcloud\.com\/mirror\/\/api\/user\/user\/detail\?openId=\w+& script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_joy_run.js, requires-body=true, timeout=10, tag=宠汪汪助力获取Token
-
-# 宠汪汪强制为别人助力
-http-request ^https:\/\/draw\.jdfcloud\.com\/mirror\/\/pet\/enterRoom\/h5\?reqSource=weapp&invitePin=.*+(&inviteSource=task_invite&shareSource=\w+&inviteTimeStamp=\d+&openId=\w+)?|^https:\/\/draw\.jdfcloud\.com\/mirror\/\/pet\/helpFriend\?friendPin script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_joy_help.js, requires-body=true, timeout=10, tag=宠汪汪强制为别人助力
-
-#聚宝盆投狗粮辅助(github@Zero-S1搬的)
-http-response ^https:\/\/jdjoy\.jd\.com\/pet\/getPetTreasureBox|^https:\/\/draw\.jdfcloud\.com\/mirror\/\/pet\/getPetTreasureBox script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_petTreasureBox.js, requires-body=true, timeout=10, tag=聚宝盆投狗粮辅助
-
#小米运动
cron "25 17 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/backUp/xmSports.js, tag=小米运动
+
+#宠汪汪助力更新Token
+http-response ^https:\/\/draw\.jdfcloud\.com(\/mirror)?\/\/api\/user\/addUser\?code= script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_joy_run.js, requires-body=true, timeout=10, tag=宠汪汪助力更新Token
+
+#宠汪汪助力获取Token
+http-request ^https:\/\/draw\.jdfcloud\.com(\/mirror)?\/\/api\/user\/user\/detail\?openId= script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_joy_run.js, requires-body=true, timeout=10, tag=宠汪汪助力获取Token
+
+# 宠汪汪强制为别人助力
+http-request ^https:\/\/draw\.jdfcloud\.com(\/mirror)?\/\/pet\/enterRoom\/h5\?reqSource=weapp&invitePin=.*+(&inviteSource=task_invite&shareSource=\w+&inviteTimeStamp=\d+&openId=\w+)?|^https:\/\/draw\.jdfcloud\.com(\/mirror)?\/\/pet\/helpFriend\?friendPin script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_joy_help.js, requires-body=true, timeout=10, tag=宠汪汪强制为别人助力
+
+#聚宝盆投狗粮辅助(github@Zero-S1搬的)
+http-response ^https:\/\/jdjoy\.jd\.com\/pet\/getPetTreasureBox|^https:\/\/draw\.jdfcloud\.com(\/mirror)?\/\/pet\/getPetTreasureBox script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_petTreasureBox.js, requires-body=true, timeout=10, tag=聚宝盆投狗粮辅助
+
+# 小米运动获取Token
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
\ No newline at end of file
diff --git a/README.md b/README.md
index ab39d7b..3fa86f5 100644
--- a/README.md
+++ b/README.md
@@ -34,38 +34,57 @@
11. 宠汪汪赛跑助力([jd_joy_run.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_joy_run.js))
12. 宠汪汪聚宝盆辅助脚本([jd_petTreasureBox.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_petTreasureBox.js))
13. 取关京东店铺和商品([jd_unsubscribe.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_unsubscribe.js))
-14. 京小超([jd_superMarket.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_superMarket.js))
-15. 京小超兑换奖品([jd_blueCoin.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_blueCoin.js))
+14. 东东超市([jd_superMarket.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_superMarket.js))
+15. 东东超市兑换奖品([jd_blueCoin.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_blueCoin.js))
16. 进店领豆([jd_shop.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_shop.js))
17. 摇京豆([jd_club_lottery.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_club_lottery.js))
18. 全名开红包([jd_redPacket.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_redPacket.js))
-19. 京东多合一签到([jd_bean_sign.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_bean_sign.js)) 【可N个京东账号,Node.js专用,核心脚本是JD_DailyBonus.js, IOS软件用户请使用NobyDa的 [JD_DailyBonus.js](https://raw.githubusercontent.com/NobyDa/Script/master/JD-DailyBonus/JD_DailyBonus.js) 】
+19. 京东多合一签到([jd_bean_sign.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_bean_sign.js)) 【可N个京东账号,Node.js专用,核心脚本是JD_DailyBonus.js,iOS软件用户请使用NobyDa的 [JD_DailyBonus.js](https://raw.githubusercontent.com/NobyDa/Script/master/JD-DailyBonus/JD_DailyBonus.js) 】
20. 京豆变动通知([jd_bean_change.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_bean_change.js))
-21. 以及其他一部分在特定时间可用的薅京豆脚本,如 [手机狂欢城](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_818.js) 、[星推官](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_xtg.js) 等。
+21. 京喜工厂([jd_dreamFactory.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_dreamFactory.js))
+22. 东东小窝([jd_small_home.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_small_home.js))
+23. 东东工厂([jd_jdfactory.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_jdfactory.js))
+24. 点点券([jd_necklace.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_necklace.js))
+25. 十元街([jd_syj.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_syj.js))
+26. 京东金融-天天提鹅([jd_daily_egg.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_daily_egg.js))
+27. 京东金融-养猪猪([jd_pigPet.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_pigPet.js))
+28. 以及其他一部分在特定时间可用的薅京豆脚本:[手机狂欢城](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_818.js) 、[星推官](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_xtg.js) 、[双十一活动领金币](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_collectProduceScore.js) 、[热8超级盲盒](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_mohe.js)
+29. Webhook触发Action([webhook.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/backUp/webhook.js))
+
+搬运脚本
+1. 【[@yangtingxiao](https://github.com/yangtingxiao)】京东抽奖机([jd_lotteryMachine.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_lotteryMachine.js))
+2. 【[@yangtingxiao](https://github.com/yangtingxiao)】京东排行榜([jd_rankingList.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_rankingList.js))
**脚本兼容: [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] 完善京小超脚本[jd_superMarket.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_superMarket.js)
-- [x] 京小超商圈助力功能[jd_superMarket.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_superMarket.js)
+- [ ] 东东工厂相互助力
+- [ ] 京喜工厂相互助力
## 食用方法
### 方法一:本地安装Node.js,下载本库脚本
- - 教程请见:[EvineDeng/jd-base](https://github.com/EvineDeng/jd-base)
+ - 教程请见:[EvineDeng/jd-base](https://github.com/EvineDeng/jd-base),适用于以下系统:
+
+ 1. Armbian/OpenWrt/Debian/Ubuntu/CentOS/Fedora/RedHat等Linux系统
+
+ 2. Android
+
+ 3. MacOS
### 方法二:云服务器、腾讯云函数等等
- 需自行有云服务器,云函数等
-
- - 腾云云函数使用 [教程说明](iCloud.md)
+ - 腾讯云云函数 [快速部署教程](tencentscf.md)(免费)
+ - 腾讯云云函数控制台使用 [教程说明](iCloud.md)
+ - 腾讯云云函数 [GitHub Action部署教程](tencentscf.md#github-action-部署)
### 方法三:Docker(NAS或VPS用户)
- - 可以精确控制任务运行时间,有三种办法:[docker办法一](https://github.com/lxk0301/jd_scripts/tree/master/docker)、[docker办法二(和本地安装Node.js有点类似)](https://github.com/EvineDeng/jd-base)、[docker办法三](https://github.com/chinnkarahoi/jd-scripts-docker)
+ - 可以精确控制任务运行时间,有二种办法:[docker办法一](https://github.com/lxk0301/jd_scripts/tree/master/docker)、[docker办法二(和本地安装Node.js类似)](https://github.com/EvineDeng/jd-base)
- [环境变量](https://github.com/lxk0301/jd_scripts/blob/master/githubAction.md#%E4%B8%8B%E6%96%B9%E6%8F%90%E4%BE%9B%E4%BD%BF%E7%94%A8%E5%88%B0%E7%9A%84-secrets%E5%85%A8%E9%9B%86%E5%90%88)
#### 注:以上三种运行机制都是Node.js,故您需仔细阅读下面几点
diff --git a/Surge/lxk0301_Task.sgmodule.sgmodule b/Surge/lxk0301_Task.sgmodule.sgmodule
index 2f46768..68fbcc7 100644
--- a/Surge/lxk0301_Task.sgmodule.sgmodule
+++ b/Surge/lxk0301_Task.sgmodule.sgmodule
@@ -1,4 +1,4 @@
-#!name=lxk0301 iOS Tasks Module
+#!name=lxk0301 iOS Tasks&Cookies Module
#!desc=iOS Tasks 模块配置
#!system=ios
@@ -29,5 +29,5 @@ cron "15 10 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scri
cron "1 1 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_redPacket.js, wake-system=1, tag=京东全民开红包
# cron "0 0 0 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_xtg.js, timeout=550, wake-system=1, tag=京东星推官
cron "2 9 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_bean_change.js, timeout=650, wake-system=1, tag=京豆变动通知
+cron "20 0,20 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_necklace.js, timeout=650, wake-system=1, tag=点点券
# cron "20 * * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_collectProduceScore.js, wake-system=1, tag=京东全民营业领金币
-
diff --git a/backUp/TG_PUSH.md b/backUp/TG_PUSH.md
new file mode 100644
index 0000000..4004b29
--- /dev/null
+++ b/backUp/TG_PUSH.md
@@ -0,0 +1,17 @@
+**TG_PUSH教程**
+
+利用Telegram机器人推送通知,需要在环境变量填入正确的```TG_BOT_TOKEN```以及```TG_USER_ID```,以下教程简明阐述如何获取token以及UserID
+
+Ⅰ.首先在Telegram上搜索[BotFather](https://t.me/BotFather)机器人
+
+
+
+Ⅱ.利用[BotFather](https://t.me/BotFather)创建一个属于自己的通知机器人,按照下图中的1、2、3步骤拿到token,格式形如```10xxx4:AAFcqxxxxgER5uw```。填入```TG_BOT_TOKEN```
+
+
+
+Ⅲ.再次在Telegram上搜索[getuserIDbot](https://t.me/getuserIDbot)机器人,获取UserID。填入```TG_USER_ID```
+
+
+
+至此,获取**TG_BOT_TOKEN**以及**TG_USER_ID**的教程结束
diff --git a/backUp/jd_Goods.js b/backUp/jd_Goods.js
new file mode 100644
index 0000000..9c6e2ba
--- /dev/null
+++ b/backUp/jd_Goods.js
@@ -0,0 +1,11 @@
+// 半自动提醒心愿单50京豆。
+// 15 */4 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/backUp/jd_Goods.js
+
+const $ = new Env('心愿单50京豆');
+
+$.msg($.name, "领50京豆啦", "https://h5.m.jd.com/babelDiy/Zeus/3mTNcpWt5JYh3aUCyo6gqKuF4pnx/index.html", {"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/3mTNcpWt5JYh3aUCyo6gqKuF4pnx/index.html%22%20%7D"});
+
+$.done();
+
+// 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
diff --git a/backUp/jd_joy_help2.js b/backUp/jd_joy_help2.js
index e908adf..67f67bc 100644
--- a/backUp/jd_joy_help2.js
+++ b/backUp/jd_joy_help2.js
@@ -1,38 +1,9 @@
/**
宠汪汪强制为别人助力(助力一个好友你自己可以获得30积分,一天上限是帮助3个好友,自己获得90积分,不管助力是否成功,对方都会成为你的好友)
-更新地址:https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_joy_help.js
-更新时间:2020-08-28
-目前提供了304位好友的friendPin供使用。脚本随机从里面获取一个,助力成功后,退出小程序重新点击进去开始助力新的好友
-欢迎大家使用 https://jdjoy.jd.com/pet/getFriends?itemsPerPage=20¤tPage=1 (currentPage=1表示第一页好友,=2表示第二页好友)
-提供各自账号列表的friendPin给我
-如果想设置固定好友,那下载下来放到本地使用,可以修改friendPin换好友(助力一好友后,更换一次friendPin里面的内容)
-感谢github @Zero-S1提供
-使用方法:
-①设置好相应软件的重写
-②从京东APP宠汪汪->领狗粮->邀请好友助力,分享给你小号微信或者微信的文件传输助手。 自己再打开刚才的分享,助力成功后,退出小程序重新进去刚才分享的小程序即可
-③如提示好友人气旺,说明此好友已满了三人助力,需重新进出小程序,重新进入来客有礼-宠汪汪。
-[MITM]
-hostname = draw.jdfcloud.com
-surge
-[Script]
-宠汪汪强制为别人助力= type=http-request,pattern=(^https:\/\/draw\.jdfcloud\.com\/\/pet\/enterRoom\?reqSource=weapp&invitePin=.*+(&inviteSource=task_invite&shareSource=\w+&inviteTimeStamp=\d+&openId=\w+)?|^https:\/\/draw\.jdfcloud\.com\/\/pet\/helpFriend\?friendPin),requires-body=1,max-size=0,script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_joy_help.js
-
-圈x
-[rewrite_local]
-^https:\/\/draw\.jdfcloud\.com\/\/pet\/enterRoom\?reqSource=weapp&invitePin=.*+(&inviteSource=task_invite&shareSource=\w+&inviteTimeStamp=\d+&openId=\w+)?|^https:\/\/draw\.jdfcloud\.com\/\/pet\/helpFriend\?friendPin url script-request-header https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_joy_help.js
-
- LOON:
-[Script]
-http-request ^https:\/\/draw\.jdfcloud\.com\/\/pet\/enterRoom\?reqSource=weapp&invitePin=.*+(&inviteSource=task_invite&shareSource=\w+&inviteTimeStamp=\d+&openId=\w+)?|^https:\/\/draw\.jdfcloud\.com\/\/pet\/helpFriend\?friendPin script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_joy_help.js
-, requires-body=true, timeout=10, tag=宠汪汪强制为别人助力
-
-
-你也可从下面链接拿好友的friendPin(复制链接到有京东ck的浏览器打开即可)
-
-https://jdjoy.jd.com/pet/getFriends?itemsPerPage=20¤tPage=1
+自用
**/
let url = $request.url
-const friendsArr = ["jd_136833sjn","jd_131335rbv","jd_4f044bdd67a3f","jd_176968gwf","jd_136744uks","jd_139559isq","jd_151698nhe","jd_182775ekl","jd_139643ldl","jd_159166edm","jd_157100apb","jd_131843tvo","jd_152554vhs","jd_134283prpb","jd_139988mgfo","jd_133590dtg","jd_63636969e55cb","jd_135565fsg","jd_189071npd","jd_138430zvw","jd_139582hlp","jd_815411720","jd_157642zjc","jd_177753pzb","jd_137918wwl","jd_188675alaf","jd_186718otu","jd_139139bew","jd_180436ggd","jd_52315d900a88a","jd_137689rjx","jd_151106nxb","jd_153879dzp","jd_185840vwq","jd_6194e9ae2cebf","jd_186221rph","jd_153810ylu","jd_189288egp","jd_158791okv","jd_139132erd","jd_159304acn","jd_138899zum","jd_187182akf","jd_136324bjqi","jd_131616wdo","jd_155384iof","jd_186326vtm","jd_zoezhu","jd_135075ahc","jd_138141ill","jd_139773zbm","jd_158416jwas","jd_182328ujc","jd_135999wrw","jd_181325tmk","jd_188254zgv","jd_3712425","jd_153711hhx","jd_176020ylg","jd_136436iuk","jd_180430yxp","jd_159958jmr","jd_155382wjy","jd_135819ueh","jd_132125ish","jd_181196mrhz","jd_138403wnm","jd_181568lrk","jd_155785zic","jd_150712koi","jd_137012gwu","jd_137638siy","jd_183011sph","jd_158224asm","jd_1652541161","jd_137332lgt","jd_181991fgs","jd_189347opuc","jd_181898rlw","jd_136526chs","jd_152616rsg","jd_151410rti","jd_139657jxa","jd_187978fdq","jd_136039csx","jd_186029urn","jd_138681pjy","jd_138204hpd","jd_138246wgz","jd_131177aol","jd_182100ofj","jd_282335851","jd_180210xwj","jd_139400bou","jd_189751xfv","jd_133781olg","jd_155229qbl","jd_dady_a","jd_183890opj","jd_136830xsh","jd_138731rkth","jd_135476kin","jd_3302023","jd_suns932","jd_158958xju","jd_688050784","jd_177467uaf","jd_138950cao","jd_181726mer","jd_138194nvx","jd_2010wwk","jd_139295gxw","jd_173931eeb","jd_189713iss","jd_139894msf","jd_158767vct","jd_159210nml","jd_133230bpy","jd_150771igh","jd_4c9dced2ff301","jd_133025pjb","jd_184751jlf","jd_139379bhj","jd_4900071","jd_137188nnv","jd_153678kxr","jd_6b04334c27336","jd_185217cfd","jd_155892hhe","jd_gxq721","jd_duqing821","jd_185087idh","jd_181528ojs","jd_136778wigm","jd_137903zfgq","jd_134785qjj","jd_159536nii","jd_188492aqx","jd_152226ypk","jd_183815eio","jd_139250pva","jd_151739nli","jd_135202pbl","jd_138201yhi","jd_137642nzw","jd_136600ysr","jd_138220eom","jd_178595cqf","jd_186682kjk","jd_136205srq","jd_138820xtj","jd_152322tkj","jd_150225ipi","jd_133287tje","jd_guba01","jd_187568qui","jd_158753hfl","jd_159816boe","jd_139297psw","jd_138564ibo","jd_188105wjm","jd_180199ekd","jd_134164zgp","jd_181547miy","jd_137030gdm","jd_183197ekf","jd_155187jhm","jd_158363nbzh","jd_151335bxo","jd_139616ywb","jd_156600kfm","jd_352215391","jd_620475312","jd_137997ole","jd_186060jol","jd_7824770b3d748","jd_6b8ba51989353","jd_152712oax","jd_177413lgq","jd_134172lqw","jd_135035dya","jd_135388arv","jd_135013mbs","jd_150897xln","jd_133827ois","jd_133307ffi","jd_138326tzrx","jd_186639utz","jd_Thin779","jd_137173yni","jd_159843fjq","jd_152590bui","jd_180225wpx","jd_187579piq","jd_156758shb","jd_139960nex","jd_138817fsp","jd_181696mtg","jd_137911aamo","jd_135891nxk","jd_177761izc","jd_153337fyq","jd_114559761","jd_Xsgfsj","jd_139965zpe","jd_185459vvx","jd_189214its","jd_151615dmb","jd_138460bsc","jd_138618yqc","jd_187290mur","jd_151318bht","jd_155344pmg","jd_137302fjz","jd_182505eyw","jd_136416nan","jd_151651ncw","jd_137131dya","jd_133471mru","jd_181116wrh","jd_139819ahg","jd_138219eja","jd_136695iqb","jd_158215wjb","jd_107071797","jd_155664eni","jd_182384yok","jd_139611sco","jd_157652hlh","jd_137036vhs","jd_188476ctf","jd_178651ldby","jd_158107bvn","jd_150342aox","jd_150283rncu","jd_131367qhs","jd_133052bem","jd_189317gau","jd_134186sbh","jd_138637pbp","jd_glwang2","jd_189557iiq","jd_138906xlbm","jd_152360yuk","jd_134551yla","jd_135832apl","jd_155448yab","jd_138388paz","jd_1352513187","jd_135464sqz","jd_153298yxo","jd_139208nicz","jd_136608wyr","jd_133053kbn","jd_135034bbx","jd_2133952","jd_187382exm","jd_135063kvb","jd_130844lme","jd_137295ajrg","jd_136810xds","jd_182771zcmi","jd_qwertag13568370gf","jd_189200fiu","jd_159871grf","jd_q105946","jd_182028tnj","jd_153718opj","jd_136850dhv","jd_159162dxb","jd_155267dkh","jd_152763ghe","jd_137104jyuf","jd_136426poa","jd_153920qlg","jd_159715spj","jd_135772nxy","jd_321051","jd_fanm537","jd_137104vuum","jd_177212uid","jd_150312pgc","jd_152569xgz","jd_136994ddl","jd_186223kew","jd_139779ovt","jd_181193dok","jd_189461sem","jd_138245yum","jd_134136kgip","jd_189543hpt","jd_132180xif","jd_182857oox","jd_186245aal","jd_3555750","jd_188502cqy","jd_186910cwu","jd_182829qbch","jd_182297xcme","jd_159708cng","jd_133330ift","jd_131904zwu","jd_182801xpy","jd_150075wud","jd_156874jup","jd_189964qzl","jd_158132cle","jd_sun723","jd_182176mee","jd_188503acjo","jd_158537jdm","jd_159485zvu","jd_180011ejj","jd_135829xzp","jd_136921jpe","jd_152629pmx","jd_189710eck","jd_189397oeo","jd_189592sul","jd_150576adh","jd_159411rzd","jd_134601izn","jd_180053tsa","jd_138226cmgb","jd_183757gbgp","jd_139289bij","jd_lx_a","jd_138562oek","jd_183691xyg","jd_151429qhv","jd_139804lhb","jd_136042bzg","jd_138102ldq","jd_135986nkf","jd_truman","jd_181700kju","jd_151064dhx","jd_150907ahj","jd_186652jxh","jd_418fef3fab12f","jd_159527gqz","jd_138237dcn","jd_134119thub","jd_wrrr0","jd_180498ozp","jd_138531irs","jd_131136fru","jd_185228tkh","jd_131910jzm","jd_151063mhz","jd_58096918e5234","jd_187187rvl","jd_157537jpe","jd_6cebe25400109","jd_1175189","jd_42a743e0b8651","jd_153063yds","jd_177692lwq","jd_152020gzy","jd_138898puv","jd_155525lpff","jd_151123xea","jd_2672389178","jd_178258cff","jd_158191ansh","jd_153280zoy","jd_hl31450","jd_150416qyl","jd_152315mcm","jd_135648axo","jd_4cfd4439d158f","jd_134815cgd","jd_135087ela","jd_180921pam","jd_135610gth","jd_156973ipc","jd_188112gxw","jd_188110wps","jd_173589vmd","jd_135604ngz","jd_158219erd","jd_158449aru","jd_166312hcv","jd_151360sty","jd_183282vqt","jd_139208bac","jd_139276cex","jd_626010305","jd_158181bbe","jd_134339ytdb","jd_139206mkrh","jd_181579uxd","jd_137015nmi","jd_511064173","jd_182924yvbk","jd_137378axvd","jd_157351ype","jd_135161rmsc","jd_188425wum","jd_135315ofn","jd_131160xix","jd_186339gil","jd_150862gpa","jd_132385iqb","jd_138132znr","jd_384180113","jd_1362103","jd_139409xbn","jd_133146qwv","jd_132661jmj","jd_158676edk","jd_133316lld","jd_188714irz","jd_159103vma","jd_131148pkg","jd_152769boe","jd_138846yad","jd_132036kqj","jd_183813dsf","jd_189617vkq","jd_185715pgz","jd_159905euu","jd_134631ehy","jd_176278mmr","jd_5161d94861016","jd_135466mil","jd_177287yyr","jd_139720epl","jd_132037mat","jd_139830uaz","jd_138988jgl","jd_137222hds","jd_177038fca","jd_137096jyx","jd_189081vhx","jd_189985hzh","jd_151927ufa","jd_135145znf","jd_139306rrn","jd_130650d","jd_134321vtn","jd_151515epa","jd_135137jaia","jd_137164augj","jd_130024lmi","jd_139602byf","jd_183766qfi","jd_139705lek","jd_133834qau","jd_180157euk","jd_139111kud","jd_155116pea","jd_159626fgnc","jd_185154lww","jd_177435tuc","jd_137292pwe","jd_177395xqs","jd_133053jus","jd_151339jhx","jd_135087ljd","jd_53b1c5c35ac9a","jd_qiuche549","jd_158164uel","jd_138107wud","jd_199771clu","jd_186753jcs","jd_187150ylk","jd_138974rxt","jd_103433211","jd_185821hfr","jd_139502ycf","jd_137713uyd","jd_187698feo","jd_136089okg","jd_4352325","jd_139639yoj","jd_979798715","jd_131321aoc","jd_185224kzc","jd_151639rszh","jd_185669lfi","jd_lideguang_2011","jd_138725hyc","jd_qaa011","jd_135928ucx","jd_649f9eae0be6c","jd_155229vlt","jd_139885sgt","jd_136220wqh","jd_130741cki","jd_151611ebv","jd_189756rue","jd_5e95dcfd762f4","jd_6261731","jd_135495gbf","jd_150042iil","jd_137894frb","jd_135873xqmi","jd_138593nkp","jd_175412852","jd_139690dad","jd_43a2e9c6537f8","jd_138175wuk","jd_131716dfh","jd_138556pnn","jd_5020276315","jd_177316iqo","jd_181375rvj","jd_229003983","jd_180789bug","jd_150682yxz","jd_152181wlw","jd_224275759","jd_136102svi","jd_9929897714","jd_139691wvgh","jd_189305xgc","jd_133211nev","jd_138697wdw","jd_189314rid","jd_182520tcmf","jd_184399ypg","jd_156312gqm","jd_183257kbc","jd_8745170","jd_151758sra","jd_136000dfw","jd_138337tbg","jd_xishuwulu","jd_189shijz","jd_182257jvd","jd_156983msp","jd_316882724","jd_135808jxz","jd_135557shtf","jd_233102237","jd_186099qlx","jd_185263tir","jd_406bfe50a3525","jd_180669zge","jd_6402aba2128d9","jd_181335kmh","jd_137378ult","jd_150022yxf","jd_188540les","jd_133774erh","jd_138784rjl","jd_182817gcd","jd_134724ief","jd_132536dsy","jd_136604veq","jd_189715ich","jd_182876ynp","jd_177737trf","jd_186552tmg","jd_152104bbn","jd_136219qpt","jd_138262kmx","jd_176204injl","jd_183772tnk","jd_152150ixc","jd_139291nono","jd_186430qkb","jd_183182ynu","jd_135980gkl","jd_158520qfph","jd_135592ugy","jd_139445whz","jd_151308una","jd_150849jbh","jd_655789303","jd_136906lqt","jd_156206yfx","jd_137619mem","jd_152667dao","jd_138597bto","jd_189315etn","jd_151132kre","jd_239626183","jd_sdwh1","jd_136817uwz","jd_187119rqc","jd_yzztt","jd_157563ywzn","jd_zran012","jd_178280jig","jd_070889622","jd_132865tfs","jd_137098qlp","jd_159314ahj","jd_135530jsi","jd_156985tlp","jd_182109kiy","jd_183501fyv","jd_151668vpv","jd_138155ahi","jd_zwh082","jd_135647kui","jd_139149ipt","jd_186993pyi","jd_159524eku","jd_135392iff","jd_177019dfk","jd_185008kmg","jd_18259236618"];
+const friendsArr = ["jd_136833sjn","jd_131335rbv","jd_4f044bdd67a3f","jd_176968gwf","jd_136744uks","jd_139559isq","jd_151698nhe","jd_182775ekl","jd_139643ldl","jd_159166edm","jd_157100apb","jd_131843tvo","jd_152554vhs","jd_134283prpb","jd_139988mgfo","jd_133590dtg","jd_63636969e55cb","jd_135565fsg","jd_189071npd","jd_138430zvw","jd_139582hlp","jd_815411720","jd_157642zjc","jd_177753pzb","jd_137918wwl","jd_188675alaf","jd_186718otu","jd_139139bew","jd_180436ggd","jd_52315d900a88a","jd_137689rjx","jd_151106nxb","jd_153879dzp","jd_185840vwq","jd_6194e9ae2cebf","jd_186221rph","jd_153810ylu","jd_189288egp","jd_158791okv","jd_139132erd","jd_159304acn","jd_138899zum","jd_187182akf","jd_136324bjqi","jd_131616wdo","jd_155384iof","jd_186326vtm","jd_zoezhu","jd_135075ahc","jd_138141ill","jd_139773zbm","jd_158416jwas","jd_182328ujc","jd_135999wrw","jd_181325tmk","jd_188254zgv","jd_3712425","jd_153711hhx","jd_176020ylg","jd_136436iuk","jd_180430yxp","jd_159958jmr","jd_155382wjy","jd_135819ueh","jd_132125ish","jd_181196mrhz","jd_138403wnm","jd_181568lrk","jd_155785zic","jd_150712koi","jd_137012gwu","jd_137638siy","jd_183011sph","jd_158224asm","jd_1652541161","jd_137332lgt","jd_181991fgs","jd_189347opuc","jd_181898rlw","jd_136526chs","jd_152616rsg","jd_151410rti","jd_139657jxa","jd_187978fdq","jd_136039csx","jd_186029urn","jd_138681pjy","jd_138204hpd","jd_138246wgz","jd_131177aol","jd_182100ofj","jd_282335851","jd_180210xwj","jd_139400bou","jd_189751xfv","jd_133781olg","jd_155229qbl","jd_dady_a","jd_183890opj","jd_136830xsh","jd_138731rkth","jd_135476kin","jd_3302023","jd_suns932","jd_158958xju","jd_688050784","jd_177467uaf","jd_138950cao","jd_181726mer","jd_138194nvx","jd_2010wwk","jd_139295gxw","jd_173931eeb","jd_189713iss","jd_139894msf","jd_158767vct","jd_159210nml","jd_133230bpy","jd_150771igh","jd_4c9dced2ff301","jd_133025pjb","jd_184751jlf","jd_139379bhj","jd_4900071","jd_137188nnv","jd_153678kxr","jd_6b04334c27336","jd_185217cfd","jd_155892hhe","jd_gxq721","jd_duqing821","jd_185087idh","jd_181528ojs","jd_136778wigm","jd_137903zfgq","jd_134785qjj","jd_159536nii","jd_188492aqx","jd_152226ypk","jd_183815eio","jd_139250pva","jd_151739nli","jd_135202pbl","jd_138201yhi","jd_137642nzw","jd_136600ysr","jd_138220eom","jd_178595cqf","jd_186682kjk","jd_136205srq","jd_138820xtj","jd_152322tkj","jd_150225ipi","jd_133287tje","jd_guba01","jd_187568qui","jd_158753hfl","jd_159816boe","jd_139297psw","jd_138564ibo","jd_188105wjm","jd_180199ekd","jd_134164zgp","jd_181547miy","jd_137030gdm","jd_183197ekf","jd_155187jhm","jd_158363nbzh","jd_151335bxo","jd_139616ywb","jd_156600kfm","jd_352215391","jd_620475312","jd_137997ole","jd_186060jol","jd_7824770b3d748","jd_6b8ba51989353","jd_152712oax","jd_177413lgq","jd_134172lqw","jd_135035dya","jd_135388arv","jd_135013mbs","jd_150897xln","jd_133827ois","jd_133307ffi","jd_138326tzrx","jd_186639utz","jd_Thin779","jd_137173yni","jd_159843fjq","jd_152590bui","jd_180225wpx","jd_187579piq","jd_156758shb","jd_139960nex","jd_138817fsp","jd_181696mtg","jd_137911aamo","jd_135891nxk","jd_177761izc","jd_153337fyq","jd_114559761","jd_Xsgfsj","jd_139965zpe","jd_185459vvx","jd_189214its","jd_151615dmb","jd_138460bsc","jd_138618yqc","jd_187290mur","jd_151318bht","jd_155344pmg","jd_137302fjz","jd_182505eyw","jd_136416nan","jd_151651ncw","jd_137131dya","jd_133471mru","jd_181116wrh","jd_139819ahg","jd_138219eja","jd_136695iqb","jd_158215wjb","jd_107071797","jd_155664eni","jd_182384yok","jd_139611sco","jd_157652hlh","jd_137036vhs","jd_188476ctf","jd_178651ldby","jd_158107bvn","jd_150342aox","jd_150283rncu","jd_131367qhs","jd_133052bem","jd_189317gau","jd_134186sbh","jd_138637pbp","jd_glwang2","jd_189557iiq","jd_138906xlbm","jd_152360yuk","jd_134551yla","jd_135832apl","jd_155448yab","jd_138388paz","jd_1352513187","jd_135464sqz","jd_153298yxo","jd_139208nicz","jd_136608wyr","jd_133053kbn","jd_135034bbx","jd_2133952","jd_187382exm","jd_135063kvb","jd_130844lme","jd_137295ajrg","jd_136810xds","jd_182771zcmi","jd_qwertag13568370gf","jd_189200fiu","jd_159871grf","jd_q105946","jd_182028tnj","jd_153718opj","jd_136850dhv","jd_159162dxb","jd_155267dkh","jd_152763ghe","jd_137104jyuf","jd_136426poa","jd_153920qlg","jd_159715spj","jd_135772nxy","jd_321051","jd_fanm537","jd_137104vuum","jd_177212uid","jd_150312pgc","jd_152569xgz","jd_136994ddl","jd_186223kew","jd_139779ovt","jd_181193dok","jd_189461sem","jd_138245yum","jd_134136kgip","jd_189543hpt","jd_132180xif","jd_182857oox","jd_186245aal","jd_3555750","jd_188502cqy","jd_186910cwu","jd_182829qbch","jd_182297xcme","jd_159708cng","jd_133330ift","jd_131904zwu","jd_182801xpy","jd_150075wud","jd_156874jup","jd_189964qzl","jd_158132cle","jd_sun723","jd_182176mee","jd_188503acjo","jd_158537jdm","jd_159485zvu","jd_180011ejj","jd_135829xzp","jd_136921jpe","jd_152629pmx","jd_189710eck","jd_189397oeo","jd_189592sul","jd_150576adh","jd_159411rzd","jd_134601izn","jd_180053tsa","jd_138226cmgb","jd_183757gbgp","jd_139289bij","jd_lx_a","jd_138562oek","jd_183691xyg","jd_151429qhv","jd_139804lhb","jd_136042bzg","jd_138102ldq","jd_135986nkf","jd_truman","jd_181700kju","jd_151064dhx","jd_150907ahj","jd_186652jxh","jd_418fef3fab12f","jd_159527gqz","jd_138237dcn","jd_134119thub","jd_wrrr0","jd_180498ozp","jd_138531irs","jd_131136fru","jd_185228tkh","jd_131910jzm","jd_151063mhz","jd_58096918e5234","jd_187187rvl","jd_157537jpe","jd_6cebe25400109","jd_1175189","jd_42a743e0b8651","jd_153063yds","jd_177692lwq","jd_152020gzy","jd_138898puv","jd_155525lpff","jd_151123xea","jd_2672389178","jd_178258cff","jd_158191ansh","jd_153280zoy","jd_hl31450","jd_150416qyl","jd_152315mcm","jd_135648axo","jd_4cfd4439d158f","jd_134815cgd","jd_135087ela","jd_180921pam","jd_135610gth","jd_156973ipc","jd_188112gxw","jd_188110wps","jd_173589vmd","jd_135604ngz","jd_158219erd","jd_158449aru","jd_166312hcv","jd_151360sty","jd_183282vqt","jd_139208bac","jd_139276cex","jd_626010305","jd_158181bbe","jd_134339ytdb","jd_139206mkrh","jd_181579uxd","jd_137015nmi","jd_511064173","jd_182924yvbk","jd_137378axvd","jd_157351ype","jd_135161rmsc","jd_188425wum","jd_135315ofn","jd_131160xix","jd_186339gil","jd_150862gpa","jd_132385iqb","jd_138132znr","jd_384180113","jd_1362103","jd_139409xbn","jd_133146qwv","jd_132661jmj","jd_158676edk","jd_133316lld","jd_188714irz","jd_159103vma","jd_131148pkg","jd_152769boe","jd_138846yad","jd_132036kqj","jd_183813dsf","jd_189617vkq","jd_185715pgz","jd_159905euu","jd_134631ehy","jd_176278mmr","jd_5161d94861016","jd_135466mil","jd_177287yyr","jd_139720epl","jd_132037mat","jd_139830uaz","jd_138988jgl","jd_137222hds","jd_177038fca","jd_137096jyx","jd_189081vhx","jd_189985hzh","jd_151927ufa","jd_135145znf","jd_139306rrn","jd_130650d","jd_134321vtn","jd_151515epa","jd_135137jaia","jd_137164augj","jd_130024lmi","jd_139602byf","jd_183766qfi","jd_139705lek","jd_133834qau","jd_180157euk","jd_139111kud","jd_155116pea","jd_159626fgnc","jd_185154lww","jd_177435tuc","jd_137292pwe","jd_177395xqs","jd_133053jus","jd_151339jhx","jd_135087ljd","jd_53b1c5c35ac9a","jd_qiuche549","jd_158164uel","jd_138107wud","jd_199771clu","jd_186753jcs","jd_187150ylk","jd_138974rxt","jd_103433211","jd_185821hfr","jd_139502ycf","jd_137713uyd","jd_187698feo","jd_136089okg","jd_4352325","jd_139639yoj","jd_979798715","jd_131321aoc","jd_185224kzc","jd_151639rszh","jd_185669lfi","jd_lideguang_2011","jd_138725hyc","jd_qaa011","jd_135928ucx","jd_649f9eae0be6c","jd_155229vlt","jd_139885sgt","jd_136220wqh","jd_130741cki","jd_151611ebv","jd_189756rue","jd_5e95dcfd762f4","jd_6261731","jd_135495gbf","jd_150042iil","jd_137894frb","jd_135873xqmi","jd_138593nkp","jd_175412852","jd_139690dad","jd_43a2e9c6537f8","jd_138175wuk","jd_131716dfh","jd_138556pnn","jd_5020276315","jd_177316iqo","jd_181375rvj","jd_229003983","jd_180789bug","jd_150682yxz","jd_152181wlw","jd_224275759","jd_136102svi","jd_9929897714","jd_139691wvgh","jd_189305xgc","jd_133211nev","jd_138697wdw","jd_189314rid","jd_182520tcmf","jd_184399ypg","jd_156312gqm","jd_183257kbc","jd_8745170","jd_151758sra","jd_136000dfw","jd_138337tbg","jd_xishuwulu","jd_189shijz","jd_182257jvd","jd_156983msp","jd_316882724","jd_135808jxz","jd_135557shtf","jd_233102237","jd_186099qlx","jd_185263tir","jd_406bfe50a3525","jd_180669zge","jd_6402aba2128d9","jd_181335kmh","jd_137378ult","jd_150022yxf","jd_188540les","jd_133774erh","jd_138784rjl","jd_182817gcd","jd_134724ief","jd_132536dsy","jd_136604veq","jd_189715ich","jd_182876ynp","jd_177737trf","jd_186552tmg","jd_152104bbn","jd_136219qpt","jd_138262kmx","jd_176204injl","jd_183772tnk","jd_152150ixc","jd_139291nono","jd_186430qkb","jd_183182ynu","jd_135980gkl","jd_158520qfph","jd_135592ugy","jd_139445whz","jd_151308una","jd_150849jbh","jd_655789303","jd_136906lqt","jd_156206yfx","jd_137619mem","jd_152667dao","jd_138597bto","jd_189315etn","jd_151132kre","jd_239626183","jd_sdwh1","jd_136817uwz","jd_187119rqc","jd_yzztt","jd_157563ywzn","jd_zran012","jd_178280jig","jd_070889622","jd_132865tfs","jd_137098qlp","jd_159314ahj","jd_135530jsi","jd_156985tlp","jd_182109kiy","jd_183501fyv","jd_151668vpv","jd_138155ahi","jd_zwh082","jd_135647kui","jd_139149ipt","jd_186993pyi","jd_159524eku","jd_135392iff","jd_177019dfk","jd_185008kmg","jd_18259236618","jd_151227rgpa","jd_4b3c0be45543e","jd_158968lou","jd_150389hzqg","jd_136861rdw","jd_155046rli","jd_136773sqft","jd_zgybon","jd_131035lcq","jd_150342zqz","jd_2402232","jd_136718hfu","jd_176455kih","jd_188621xuu","jd_138719eld","jd_150670lziv","jd_135854sbe","jd_135262oos","jd_188161shx","jd_180136kfc","jd_189843kbz","jd_186041eon","jd_134570eqc","jd_180796xlc","jd_136923ucb","jd_182633vxt","jd_nmge","jd_183208ouaf","jd_155310zrn","jd_157188fmac","jd_158257chj","jd_177727lrh","jd_135397spe","jd_185124djb","jd_183860rvq","jd_157059kmd","jd_180922bpt","jd_183309nqe","jd_188510uou","jd_135909yhz","jd_138438ems","jd_136111kka","jd_138178ifs","jd_137646lxd","jd_188091hsj","jd_138226rqe","jd_159780lcxu","jd_139609eib","jd_135855xcw","jd_138531zvu","jd_186653hgl","jd_187269vtx","jd_138651nbt","jd_jwh788","jd_133387vpc","jd_188293qlb","jd_150403hbmm","jd_Yuton","jd_184wdz","jd_wyxgz","jd_186372kcz","jd_151600bmg","jd_151121uvgb","jd_137789qwb","jd_837751791","jd_153201xmi","jd_189562krx","jd_182519hniq","jd_188254mlj","jd_136893llq","jd_181322mkf","jd_132625cpe","jd_139609gwt","jd_188967afm","jd_136128fuyn","jd_153732jlpo","jd_221890978","jd_183184wfpz","jd_158304rms","jd_133010ltt","jd_135162chg","jd_158170msu","jd_135101jzrs","jd_155335qzm","jd_5701f57639cfe","jd_139502lkx","jd_cloi","jd_151948etv","jd_185502ypm","jd_186915dcn","jd_133672hlv"];
//随机生成m(小)到n(大)的数,包含m和n
function randomFriendPin(m,n) {
return Math.round(Math.random()*(n - m) + m);
diff --git a/backUp/mySelf.boxjs.json b/backUp/mySelf.boxjs.json
new file mode 100644
index 0000000..0aa942c
--- /dev/null
+++ b/backUp/mySelf.boxjs.json
@@ -0,0 +1,25 @@
+{
+ "id": "lxk0301.app.sub2",
+ "name": "自用",
+ "author": "@lxk0301",
+ "icon": "https://avatars0.githubusercontent.com/u/21308593?s=52&v=4",
+ "repo": "https://github.com/lxk0301/jd_scripts/",
+ "apps": [
+ {
+ "id": "QQ_READ",
+ "name": "企鹅阅读(QQ小程序)",
+ "keys": [
+ "qqreadhd",
+ "qqreadtimeurl",
+ "qqreadtimehd"
+ ],
+ "settings": [],
+ "author": "@ziye12",
+ "repo": "https://github.com/ziye12/JavaScript ",
+ "icons": [
+ "https://raw.githubusercontent.com/Orz-3/mini/master/jd.png",
+ "https://raw.githubusercontent.com/Orz-3/task/master/jd.png"
+ ]
+ }
+ ]
+}
diff --git a/backUp/qqread.js b/backUp/qqread.js
new file mode 100644
index 0000000..767c34c
--- /dev/null
+++ b/backUp/qqread.js
@@ -0,0 +1,722 @@
+/*
+******************************************************************************
+ 改用,nodejs云端专用。可N个账号。by;lxk0301
+ 一个账号需三个环境变量/secret
+ 分别为 QQ_READ_HEADER_VAL QQ_READ_TIME_URL_VAL QQ_READ_TIME_HEADER_VAL
+ 多个账号 对应三个环境变量/secret 使用@符号或者换行隔开
+ iOS可使用BoxJs可使用此订阅修改复制所需的环境变量 https://raw.githubusercontent.com/lxk0301/jd_scripts/master/backUp/mySelf.boxjs.json
+ 环境变量与BoxJs里面对应关系
+ QQ_READ_HEADER_VAL ------》 qqreadhd
+ QQ_READ_TIME_URL_VAL ------》 qqreadtimeurl
+ QQ_READ_TIME_HEADER_VAL ------》 qqreadtimehd
+ *****************************************************************************************************************
+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
+
+############## 圈x
+
+#企鹅读书获取cookie
+https:\/\/mqqapi\.reader\.qq\.com\/mqq\/user\/init url script-request-header https://raw.githubusercontent.com/lxk0301/jd_scripts/master/backUp/qqread.js
+
+#企鹅读书获取时长cookie
+https:\/\/mqqapi\.reader\.qq\.com\/mqq\/addReadTimeWithBid? url script-request-header https://raw.githubusercontent.com/lxk0301/jd_scripts/master/backUp/qqread.js
+
+
+############## loon
+
+//企鹅读书获取cookie
+http-request https:\/\/mqqapi\.reader\.qq\.com\/mqq\/user\/init script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/backUp/qqread.js,requires-header=true, tag=企鹅读书获取cookie
+
+//企鹅读书获取时长cookie
+http-request https:\/\/mqqapi\.reader\.qq\.com\/mqq\/addReadTimeWithBid? script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/backUp/qqread.js, requires-header=true, tag=企鹅读书获取时长cookie
+
+
+############## surge
+
+//企鹅读书获取cookie
+企鹅读书 = type=http-request,pattern=https:\/\/mqqapi\.reader\.qq\.com\/mqq\/user\/init,script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/backUp/qqread.js, requires-header=true
+
+//企鹅读书获取时长cookie
+企鹅读书 = type=http-request,pattern=https:\/\/mqqapi\.reader\.qq\.com\/mqq\/addReadTimeWithBid?,script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/backUp/qqread.js, requires-header=true
+
+
+*/
+
+const jsname = '企鹅读书'
+const $ = Env(jsname)
+let task = '', config, ssr2 = '', wktime;
+console.log(`\n========= 脚本执行时间(TM):${new Date(new Date().getTime() + 0 * 60 * 60 * 1000).toLocaleString('zh', {hour12: false})} =========\n`)
+
+const logs = 1; //0为关闭日志,1为开启
+const notifyInterval = 3
+//0为关闭通知,1为所有通知,2为宝箱领取成功通知,3为宝箱每15次通知一次
+
+const dd = 1//单次任务延迟,默认1秒
+const TIME = 30//单次时长上传限制,默认5分钟
+const maxtime = 20//每日上传时长限制,默认20小时
+const wktimess = 1200//周奖励领取标准,默认1200分钟
+var tz = ''
+const qqreadurlVal = `https://mqqapi.reader.qq.com/mqq/user/init`;
+const qqreadurlKey = 'qqreadurl'
+// const qqreadurlVal = $.getdata(qqreadurlKey)
+
+const qqreadheaderKey = 'qqreadhd'
+let qqreadheaderVal = $.getdata(qqreadheaderKey)
+
+const qqreadtimeurlKey = 'qqreadtimeurl'
+let qqreadtimeurlVal = $.getdata(qqreadtimeurlKey)
+
+const qqreadtimeheaderKey = 'qqreadtimehd'
+let qqreadtimeheaderVal = $.getdata(qqreadtimeheaderKey)
+//云函数使用在下面填写
+let QQ_READ_COOKIES = [
+ {
+ qqreadurlVal,
+ "qqreadheaderVal": ``,
+ "qqreadtimeurlVal": ``,
+ "qqreadtimeheaderVal": ``
+ }
+]
+function getNodeCookie() {
+ if ($.isNode()) {
+ let QQ_READ_HEADER_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_HEADER_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_HEADER_VAL = process.env.QQ_READ_HEADER_VAL.split('\n');
+ } else {
+ QQ_READ_HEADER_VAL = [process.env.QQ_READ_HEADER_VAL];
+ }
+ // QQ_READ_HEADER_VAL = [...new Set(QQ_READ_HEADER_VAL)]
+ // $.log(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_HEADER_VAL && QQ_READ_HEADER_VAL.length > 0) QQ_READ_COOKIES = [];
+ for (let i = 0; i < QQ_READ_HEADER_VAL.length; i ++) {
+ QQ_READ_COOKIES.push({
+ qqreadurlVal,
+ "qqreadheaderVal": QQ_READ_HEADER_VAL[i] || "",
+ "qqreadtimeurlVal": QQ_READ_TIME_URL_VAL[i] || "",
+ "qqreadtimeheaderVal": QQ_READ_TIME_HEADER_VAL[i] || ""
+ })
+ }
+ // console.log(`${JSON.stringify(QQ_READ_COOKIES)}`)
+ }
+}
+//CK运行
+let isGetCookie = typeof $request !== 'undefined'
+if (isGetCookie) {
+ GetCookie()
+} else {
+ !(async () => {
+ await getNodeCookie();
+ await QQ_READ();
+ // await all();
+ })()
+ .catch((e) => {
+ $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '')
+ })
+ .finally(() => {
+ $.done();
+ })
+}
+
+function GetCookie() {
+
+ if ($request && $request.url.indexOf("init") >= 0) {
+
+ // const qqreadurlVal = $request.url
+ // if (qqreadurlVal) $.setdata(qqreadurlVal, qqreadurlKey)
+ // $.log(`[${jsname}] 获取url请求: 成功,qqreadurlVal: ${qqreadurlVal}`)
+
+ // const qqreadbodyVal = $request.body
+ // if (qqreadbodyVal) $.setdata(qqreadbodyVal, qqreadbodyKey)
+ // $.log(`[${jsname}] 获取阅读: 成功,qqreadbodyVal: ${qqreadbodyVal}`)
+
+ // $.setdata(qqreadurlVal, qqreadurlKey);
+ const qqreadheaderVal = JSON.stringify($request.headers)
+ if (qqreadheaderVal) $.setdata(qqreadheaderVal, qqreadheaderKey)
+ $.log(`[${jsname}] 获取Cookie: 成功,qqreadheaderVal: ${qqreadheaderVal}`)
+ $.msg(qqreadheaderKey, `获取cookie: 成功🎉`, ``)
+
+ } else if ($request && $request.url.indexOf("addReadTimeWithBid?") >= 0) {
+ const qqreadtimeurlVal = $request.url
+ if (qqreadtimeurlVal) $.setdata(qqreadtimeurlVal, qqreadtimeurlKey)
+ $.log(`[${jsname}] 获取阅读时长url: 成功,qqreadtimeurlVal: ${qqreadtimeurlVal}`)
+
+ const qqreadtimeheaderVal = JSON.stringify($request.headers)
+ if (qqreadtimeheaderVal) $.setdata(qqreadtimeheaderVal, qqreadtimeheaderKey)
+ $.log(`[${jsname}] 获取时长header: 成功,qqreadtimeheaderVal: ${qqreadtimeheaderVal}`)
+ $.msg(qqreadtimeheaderKey, `获取阅读时长cookie: 成功🎉`, ``)
+
+ }
+ $.done();
+}
+async function QQ_READ() {
+ for (let i = 0; i < QQ_READ_COOKIES.length; i++) {
+ $.log(`\n*************开始QQ账号${i + 1}**************\n`);
+ tz = '';
+ if (!QQ_READ_COOKIES[i]["qqreadheaderVal"] || !QQ_READ_COOKIES[i]['qqreadtimeurlVal'] || !QQ_READ_COOKIES[i]['qqreadtimeheaderVal']) {
+ $.log(`账号${i + 1}暂未提供脚本执行所需的cookie`);
+ continue
+ }
+ qqreadheaderVal = QQ_READ_COOKIES[i]['qqreadheaderVal'];
+ qqreadtimeurlVal = QQ_READ_COOKIES[i]['qqreadtimeurlVal'];
+ qqreadtimeheaderVal = QQ_READ_COOKIES[i]['qqreadtimeheaderVal'];
+ await qqreadinfo();//用户名
+ // await $.wait(2000)
+ await qqreadconfig();//时长查询
+ // await $.wait(2000)
+ await qqreadtask();//任务列表
+
+ if (task.data.taskList[0].doneFlag == 0) {
+ // await $.wait(2000)
+ await qqreaddayread();//阅读任务
+ }
+ if (task.data.taskList[2].doneFlag == 0) {
+ // await $.wait(2000)
+ await qqreadsign();//金币签到
+ // await $.wait(2000)
+ await qqreadtake();//阅豆签到
+ // await $.wait(2000)
+ await qqreadsign2();//签到翻倍
+ }
+
+ if (task.data.treasureBox.doneFlag == 0) {
+ // await $.wait(2000)
+ await qqreadbox();//宝箱
+ }
+ if (task.data.taskList[1].doneFlag == 0) {
+ // await $.wait(2000)
+ await qqreadssr1();//阅读金币1
+ await $.wait(3000)
+ await qqreadssr2();//阅读金币2
+ await $.wait(5000)
+ await qqreadssr3();//阅读金币3
+ }
+ if (task.data.taskList[3].doneFlag == 0) {
+ // await $.wait(2000)
+ await qqreadvideo();//视频奖励
+ }
+ if (task.data.treasureBox.videoDoneFlag == 0) {
+ // await $.wait(2000)
+ await qqreadbox2();//宝箱翻倍
+ }
+ if (config.data.pageParams.todayReadSeconds / 3600 <= maxtime) {
+ // await $.wait(2000)
+ await qqreadtime();
+ }
+
+ await qqreadwktime();//周时长查询
+ await qqreadpick();//领周时长奖励
+ await showmsg();//通知
+ }
+}
+
+//任务列表
+function qqreadtask() {
+ return new Promise((resolve, reject) => {
+ const toqqreadtaskurl = {
+ url: 'https://mqqapi.reader.qq.com/mqq/red_packet/user/page?fromGuid=',
+ headers: JSON.parse(qqreadheaderVal),
+ timeout: 60000
+ };
+ $.get(toqqreadtaskurl, (error, response, data) => {
+ if (logs) $.log(`${jsname}, 任务列表: ${data}`)
+ task = JSON.parse(data)
+ 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' +
+ '【' +
+ task.data.taskList[0].title +
+ '】:' +
+ task.data.taskList[0].amount +
+ '金币,' +
+ task.data.taskList[0].actionText +
+ '\n' +
+ '【' +
+ task.data.taskList[1].title +
+ '】:' +
+ task.data.taskList[1].amount +
+ '金币,' +
+ task.data.taskList[1].actionText +
+ '\n' +
+ '【' +
+ task.data.taskList[2].title +
+ '】:' +
+ task.data.taskList[2].amount +
+ '金币,' +
+ task.data.taskList[2].actionText +
+ '\n' +
+ '【' +
+ task.data.taskList[3].title +
+ '】:' +
+ task.data.taskList[3].amount +
+ '金币,' +
+ task.data.taskList[3].actionText +
+ '\n' +
+ '【宝箱任务' +
+ (task.data.treasureBox.count + 1) +
+ '】:' +
+ task.data.treasureBox.tipText +
+ '\n' +
+ '【' + task.data.fans.title +
+ '】:' +
+ task.data.fans.fansCount +
+ '个好友,' +
+ task.data.fans.todayAmount +
+ '金币\n'
+
+ resolve()
+
+ })
+
+ })
+}
+
+
+//用户名
+function qqreadinfo() {
+ return new Promise((resolve, reject) => {
+ const toqqreadinfourl = {
+ url: qqreadurlVal,
+ headers: JSON.parse(qqreadheaderVal),
+ timeout: 60000
+ };
+ $.get(toqqreadinfourl, (error, response, data) => {
+ if (logs) $.log(`${jsname}, 用户名: ${data}`)
+ const info = JSON.parse(data)
+ tz +=
+ '【用户信息】:' + info.data.user.nickName + '\n'
+
+ resolve()
+ })
+ })
+}
+
+
+//阅豆签到
+function qqreadtake() {
+ return new Promise((resolve, reject) => {
+ const toqqreadtakeurl = {
+ url: 'https://mqqapi.reader.qq.com/mqq/sign_in/user',
+ headers: JSON.parse(qqreadheaderVal),
+ timeout: 60000
+ };
+ $.post(toqqreadtakeurl, (error, response, data) => {
+ if (logs) $.log(`${jsname}, 阅豆签到: ${data}`)
+ let take = JSON.parse(data)
+ if (take.data.takeTicket > 0) {
+ tz +=
+ '【阅豆签到】:获得' + take.data.takeTicket + '豆\n'
+ }
+
+ resolve()
+ })
+ })
+}
+
+
+//阅读时长任务
+function qqreadconfig() {
+ return new Promise((resolve, reject) => {
+ const toqqreadconfigurl = {
+ url: 'https://mqqapi.reader.qq.com/mqq/page/config?router=%2Fpages%2Fbook-read%2Findex&options=',
+ headers: JSON.parse(qqreadheaderVal),
+ };
+ $.get(toqqreadconfigurl, (error, response, data) => {
+ if (logs) $.log(`${jsname}, 阅读时长查询: ${data}`)
+ config = JSON.parse(data)
+ if (config.code == 0)
+ tz += '【时长查询】:今日阅读' + (config.data.pageParams.todayReadSeconds / 60).toFixed(0) + '分钟\n'
+
+
+ resolve()
+ })
+ })
+}
+
+
+//阅读时长
+function qqreadtime() {
+ return new Promise((resolve, reject) => {
+ const toqqreadtimeurl = {
+ url: qqreadtimeurlVal.replace(/readTime=/g, `readTime=${TIME}`),
+ headers: JSON.parse(qqreadtimeheaderVal),
+
+ };
+
+ $.get(toqqreadtimeurl, (error, response, data) => {
+ if (logs) $.log(`${jsname}, qqreadtime-阅读时长: ${data}`)
+ let time = JSON.parse(data)
+ if (time && time.code == 0) tz += '【阅读时长】:上传' + TIME / 6 + '分钟\n'
+ resolve()
+ })
+ })
+}
+
+
+//阅读金币1
+function qqreadssr1() {
+ return new Promise((resolve, reject) => {
+ const toqqreadssr1url = {
+ url: `https://mqqapi.reader.qq.com/mqq/red_packet/user/read_time?seconds=30`,
+ headers: JSON.parse(qqreadheaderVal),
+ timeout: 60000
+ };
+ if (config.data.pageParams.todayReadSeconds / 60 >= 1) {
+
+ $.get(toqqreadssr1url, (error, response, data) => {
+ if (logs) $.log(`${jsname}, 金币奖励1: ${data}`)
+ let ssr1 = JSON.parse(data)
+ if (ssr1.data.amount > 0)
+ tz += '【阅读金币1】获得' + ssr1.data.amount + '金币\n'
+
+
+ resolve()
+ })
+ }
+ resolve()
+ })
+}
+
+
+//阅读金币2
+function qqreadssr2() {
+ return new Promise((resolve, reject) => {
+ const toqqreadssr2url = {
+ url: `https://mqqapi.reader.qq.com/mqq/red_packet/user/read_time?seconds=300`,
+ headers: JSON.parse(qqreadheaderVal),
+ timeout: 60000
+ };
+ if (config.data.pageParams.todayReadSeconds / 60 >= 5) {
+
+ $.get(toqqreadssr2url, (error, response, data) => {
+ if (logs) $.log(`${jsname}, 金币奖励2: ${data}`)
+ ssr2 = JSON.parse(data)
+ if (ssr2.code === 0) {
+ if (ssr2.data.amount > 0) tz += '【阅读金币2】获得' + ssr2.data.amount + '金币\n'
+ }
+ resolve()
+ })
+ }
+ resolve()
+ })
+}
+
+
+//阅读金币3
+function qqreadssr3() {
+ return new Promise((resolve, reject) => {
+ const toqqreadssr3url = {
+ url: `https://mqqapi.reader.qq.com/mqq/red_packet/user/read_time?seconds=1800`,
+ headers: JSON.parse(qqreadheaderVal),
+ timeout: 60000
+ };
+
+ if (config.data.pageParams.todayReadSeconds / 60 >= 30) {
+
+ $.get(toqqreadssr3url, (error, response, data) => {
+ if (logs) $.log(`${jsname}, 金币奖励3: ${data}`)
+ let ssr3 = JSON.parse(data)
+ if (ssr3.code === 0) {
+ if (ssr3.data.amount > 0) tz += '【阅读金币3】获得' + ssr3.data.amount + '金币\n'
+ }
+ resolve()
+ })
+ }
+ resolve()
+ })
+}
+
+
+//金币签到
+function qqreadsign() {
+ return new Promise((resolve, reject) => {
+ const toqqreadsignurl = {
+ url: 'https://mqqapi.reader.qq.com/mqq/red_packet/user/clock_in/page',
+ headers: JSON.parse(qqreadheaderVal),
+ timeout: 60000
+ };
+ $.get(toqqreadsignurl, (error, response, data) => {
+ if (logs) $.log(`${jsname}, 金币签到: ${data}`)
+ let sign = JSON.parse(data)
+
+ if (sign.data.videoDoneFlag) {
+ tz +=
+ '【金币签到】:获得' + sign.data.todayAmount + '金币\n'
+ }
+
+
+ resolve()
+ })
+ })
+}
+
+
+//金币签到翻倍
+function qqreadsign2() {
+ return new Promise((resolve, reject) => {
+ const toqqreadsign2url = {
+ url: 'https://mqqapi.reader.qq.com/mqq/red_packet/user/clock_in_video',
+ headers: JSON.parse(qqreadheaderVal),
+ timeout: 60000
+ };
+ $.get(toqqreadsign2url, (error, response, data) => {
+ if (logs) $.log(`${jsname}, 金币签到翻倍: ${data}`)
+ let sign2 = JSON.parse(data)
+
+ if (sign2.code == 0) {
+ tz +=
+ '【签到翻倍】:获得' + sign2.data.amount + '金币\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(qqreadheaderVal),
+ timeout: 60000
+ };
+ $.get(toqqreaddayreadurl, (error, response, data) => {
+ if (logs) $.log(`${jsname}, 每日阅读: ${data}`)
+ let dayread = JSON.parse(data)
+ if (dayread.code == 0) {
+ tz +=
+ '【每日阅读】:获得' + dayread.data.amount + '金币\n'
+
+ }
+
+ resolve()
+ })
+ })
+}
+
+
+//视频奖励
+function qqreadvideo() {
+ return new Promise((resolve, reject) => {
+ const toqqreadvideourl = {
+ url: 'https://mqqapi.reader.qq.com/mqq/red_packet/user/watch_video',
+ headers: JSON.parse(qqreadheaderVal),
+ timeout: 60000
+ };
+ $.get(toqqreadvideourl, (error, response, data) => {
+ if (logs) $.log(`${jsname}, 视频奖励: ${data}`)
+ let video = JSON.parse(data)
+
+ if (video.code == 0) {
+ tz +=
+ '【视频奖励】:获得' + video.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(qqreadheaderVal),
+ timeout: 60000
+ };
+ $.get(toqqreadboxurl, (error, response, data) => {
+ if (logs) $.log(`${jsname}, 宝箱奖励: ${data}`)
+ const box = JSON.parse(data)
+
+ if (box.data.count >= 0) {
+ tz +=
+ '【宝箱奖励' + 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(qqreadheaderVal),
+ timeout: 60000
+ };
+ $.get(toqqreadbox2url, (error, response, data) => {
+ if (logs) $.log(`${jsname}, 宝箱奖励翻倍: ${data}`)
+ let box2 = JSON.parse(data)
+
+ if (box2.code == 0) {
+ tz +=
+ '【宝箱翻倍】:获得' + box2.data.amount + '金币\n'
+ }
+
+ resolve()
+ })
+ })
+}
+
+//本周阅读时长
+function qqreadwktime() {
+ return new Promise((resolve, reject) => {
+
+ const toqqreadwktimeurl = {
+
+ url: `https://mqqapi.reader.qq.com/mqq/v1/bookShelfInit`,
+
+ headers: JSON.parse(qqreadheaderVal),
+
+ };
+
+ $.get(toqqreadwktimeurl, (error, response, data) => {
+ if (logs) $.log(`${jsname}, qqreadwktime 阅读时长: ${data}`)
+ wktime = JSON.parse(data)
+ if (wktime.code == 0) tz += '【本周阅读时长】:' + wktime.data.readTime + '分钟\n'
+ resolve()
+ })
+ })
+}
+
+
+//本周阅读时长奖励任务
+function qqreadpick() {
+ return new Promise((resolve, reject) => {
+ const toqqreadpickurl = {
+ url: `https://mqqapi.reader.qq.com/mqq/pickPackageInit`,
+ headers: JSON.parse(qqreadheaderVal),
+ };
+
+ if (wktime.data.readTime >= wktimess) {
+ $.get(toqqreadpickurl, (error, response, data) => {
+ if (logs) $.log(`${jsname},周阅读时长奖励任务: ${data}`)
+ let pick = JSON.parse(data)
+ if (pick.data[7].isPick == true)
+ tz += '【周时长奖励】:已全部领取\n'
+ for (let i = 0; i < pick.data.length; i++) {
+ setTimeout(() => {
+ var pickid = pick.data[i].readTime
+ var Packageid = ['10', '10', '20', '30', '50', '80', '100', '120']
+ const toqqreadPackageurl = {
+ url: `https://mqqapi.reader.qq.com/mqq/pickPackage?readTime=${pickid}`,
+ headers: JSON.parse(qqreadheaderVal),
+ timeout: 60000
+ };
+ $.get(toqqreadPackageurl, (error, response, data) => {
+ if (logs) $.log(`${jsname}, 领周阅读时长: ${data}`)
+ let Package = JSON.parse(data)
+ if (Package.code == 0)
+ tz += '【周时长奖励' + (i + 1) + '】:领取' + Packageid[i] + '阅豆\n'
+ })
+
+ }, i * 100)
+ }
+
+ })
+ resolve()
+ }
+ resolve()
+ })
+}
+
+
+function showmsg() {
+ return new Promise(async resolve => {
+ console.log(tz)
+
+ if (notifyInterval == 1)
+ $.msg(jsname, '', tz)//显示所有通知
+
+ else if (notifyInterval == 2 && task.data.treasureBox.doneFlag == 0)
+ $.msg(jsname, '', tz)//宝箱领取成功通知
+
+ else if (notifyInterval == 3 && task.data.treasureBox.count == 0 || task.data.treasureBox.count == 15 || task.data.treasureBox.count == 30 || task.data.treasureBox.count == 45 || task.data.treasureBox.count == 60)
+ $.msg(jsname, '', tz)//宝箱每15次通知一次
+ resolve()
+ })
+}
+
+
+// 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/docker/Dockerfile b/docker/Dockerfile
index 47d9920..5615cde 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -11,7 +11,7 @@ RUN git clone https://github.com/lxk0301/jd_scripts /scripts \
&& cd /scripts \
&& mkdir logs \
&& npm install \
- && cd ~ \
+ && cd /tmp \
&& npm install request
ENV CRONTAB_LIST_FILE crontab_list_ts.sh
@@ -20,4 +20,4 @@ RUN crontab /scripts/docker/crontab_list_ts.sh
WORKDIR /scripts
-CMD ["node"]
\ No newline at end of file
+CMD ["node"]
diff --git a/docker/Readme.md b/docker/Readme.md
index 0e4681f..7b5d824 100644
--- a/docker/Readme.md
+++ b/docker/Readme.md
@@ -76,10 +76,11 @@ jd_scripts:
git -C /scripts/ pull
node
```
-- `jd_scripts/my_crontab_list.sh` 参考内容如下(输出日志的最后加上 `|ts` 可在日志每一行前面显示时间):
+- `jd_scripts/my_crontab_list.sh` 参考内容如下,自己根据需要调整增加删除,不熟悉用户推荐使用默认配置:
+
```shell
-0 */1 * * * git -C /scripts/ pull >> /scripts/logs/pull.log 2>&1|ts
-2 0 * * * node /scripts/jd_bean_sign.js >> /scripts/logs/jd_bean_sign.log 2>&1
+0 */1 * * * git -C /scripts/ pull |ts >> /scripts/logs/pull.log 2>&1
+2 0 * * * cd /scripts && node jd_bean_sign.js >> /scripts/logs/jd_bean_sign.log 2>&1
2 0 * * * node /scripts/jd_blueCoin.js >> /scripts/logs/jd_blueCoin.log 2>&1
2 0 * * * node /scripts/jd_club_lottery.js >> /scripts/logs/jd_club_lottery.log 2>&1
20 6-18/6 * * * node /scripts/jd_fruit.js >> /scripts/logs/jd_fruit.log 2>&1
@@ -95,6 +96,8 @@ jd_scripts:
15 * * * * node /scripts/jd_superMarket.js >> /scripts/logs/jd_superMarket.log 2>&1
55 23 * * * node /scripts/jd_unsubscribe.js >> /scripts/logs/jd_unsubscribe.log 2>&1
```
+> 定时任务命之后,也就是 `>>` 符号之前加上 `|ts` 可在日志每一行前面显示时间,如下图:
+> 
- 目录文件配置好之后在 `jd_scripts`目录执行
`docker-compose up -d` 启动;
`docker-compose logs` 打印日志;
diff --git a/docker/crontab_list.sh b/docker/crontab_list.sh
index 3b2a449..4c656d9 100644
--- a/docker/crontab_list.sh
+++ b/docker/crontab_list.sh
@@ -1,18 +1,27 @@
-0 */1 * * * git -C /scripts/ pull >> /scripts/logs/pull.log 2>&1
-2 */1 * * * crontab /scripts/docker/${CRONTAB_LIST_FILE}
-3 */1 * * * npm install --prefix /scripts >> /scripts/logs/npm_install.log 2>&1
+50 */1 * * * git -C /scripts/ pull >> /scripts/logs/pull.log 2>&1
+52 */1 * * * crontab /scripts/docker/${CRONTAB_LIST_FILE}
+53 */1 * * * npm install --prefix /scripts >> /scripts/logs/npm_install.log 2>&1
# 每3天的23:50分清理一次日志
50 23 */3 * * rm -rf /scripts/logs/*.log
##############短期活动##############
-# 暂无
-
-
+# 京喜故事(2020.12.12活动过期)
+10 * * * * node /scripts/jd_jxstory.js >> /scripts/logs/jd_jxstory.log 2>&1
+# 金榜年终奖(2020.12.12活动过期)
+10 7 * * * node /scripts/jd_split.js >> /scripts/logs/jd_split.log 2>&1
+# 秒杀红包雨(2020.12.31活动过期)
+40 8 * * * node /scripts/jd_ms_redrain.js >> /scripts/logs/jd_ms_redrain.log 2>&1
+# 健康抽奖机(2020.12.31活动过期)
+10 0 * * * node /scripts/jd_health.js >> /scripts/logs/jd_health.log 2>&1
+# 直播红包雨(2020.12.12活动过期)
+0 0,9,11,13,15,17,19,20,21,23 * * * node /scripts/jd_live_redrain.js >> /scripts/logs/jd_live_redrain.log 2>&1
+# 数码加购京豆(2020.12.11活动过期)
+ 8 0 * * * node /scripts/jd_digital_floor.js >> /scripts/logs/jd_digital_floor.log 2>&1
##############长期活动##############
# 签到
-0 0,12,18 * * * node /scripts/jd_bean_sign.js >> /scripts/logs/jd_bean_sign.log 2>&1
+0 0,12,18 * * * cd /scripts && node jd_bean_sign.js >> /scripts/logs/jd_bean_sign.log 2>&1
# 京小超兑换奖品
0 0 * * * node /scripts/jd_blueCoin.js >> /scripts/logs/jd_blueCoin.log 2>&1
# 摇京豆
@@ -44,12 +53,30 @@
# 取关京东店铺商品
55 23 * * * node /scripts/jd_unsubscribe.js >> /scripts/logs/jd_unsubscribe.log 2>&1
# 京豆变动通知
-0 2 * * * node /scripts/jd_bean_change.js >> /scripts/logs/jd_bean_change.log 2>&1
+0 10 * * * node /scripts/jd_bean_change.js >> /scripts/logs/jd_bean_change.log 2>&1
# 京东抽奖机
11 1 * * * node /scripts/jd_lotteryMachine.js >> /scripts/logs/jd_lotteryMachine.log 2>&1
# 京东排行榜
11 9 * * * node /scripts/jd_rankingList.js >> /scripts/logs/jd_rankingList.log 2>&1
# 天天提鹅
-18 */3 * * * node /scripts/jd_daily_egg.js >> /scripts/logs/jd_daily_egg.log 2>&1
+18 * * * * node /scripts/jd_daily_egg.js >> /scripts/logs/jd_daily_egg.log 2>&1
# 金融养猪
-12 13 * * * node /scripts/jd_pigPet.js >> /scripts/logs/jd_pigPet.log 2>&1
+12 * * * * node /scripts/jd_pigPet.js >> /scripts/logs/jd_pigPet.log 2>&1
+# 点点券
+20 0,20 * * * node /scripts/jd_necklace.js >> /scripts/logs/jd_necklace.log 2>&1
+# 京喜工厂
+20 * * * * node /scripts/jd_dreamFactory.js >> /scripts/logs/jd_dreamFactory.log 2>&1
+# 东东小窝
+16 6 * * * node /scripts/jd_small_home.js >> /scripts/logs/jd_small_home.log 2>&1
+# 东东工厂
+36 * * * * node /scripts/jd_jdfactory.js >> /scripts/logs/jd_jdfactory.log 2>&1
+#十元街
+36 8 * * * 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
+# 京东快递签到
+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
+# 领京豆额外奖励(每日可获得3京豆)
+33 4 * * * node /scripts/jd_bean_home.js >> /scripts/logs/jd_bean_home.log 2>&1
diff --git a/docker/crontab_list_ts.sh b/docker/crontab_list_ts.sh
index 1d0f210..b1dd621 100644
--- a/docker/crontab_list_ts.sh
+++ b/docker/crontab_list_ts.sh
@@ -1,55 +1,82 @@
-0 */1 * * * git -C /scripts/ pull >> /scripts/logs/pull.log 2>&1|ts
-2 */1 * * * crontab /scripts/docker/${CRONTAB_LIST_FILE}
-3 */1 * * * npm install --prefix /scripts >> /scripts/logs/npm_install.log 2>&1|ts
+50 */1 * * * git -C /scripts/ pull |ts >> /scripts/logs/pull.log 2>&1
+52 */1 * * * crontab /scripts/docker/${CRONTAB_LIST_FILE}
+53 */1 * * * npm install --prefix /scripts |ts >> /scripts/logs/npm_install.log 2>&1
# 每3天的23:50分清理一次日志
50 23 */3 * * rm -rf /scripts/logs/*.log
##############短期活动##############
-# 暂无
-
-
+# 京喜故事(2020.12.12活动过期)
+10 * * * * node /scripts/jd_jxstory.js |ts >> /scripts/logs/jd_jxstory.log 2>&1
+# 金榜年终奖(2020.12.12活动过期)
+10 7 * * * node /scripts/jd_split.js |ts >> /scripts/logs/jd_split.log 2>&1
+# 秒杀红包雨(2020.12.31活动过期)
+40 8 * * * node /scripts/jd_ms_redrain.js |ts >> /scripts/logs/jd_ms_redrain.log 2>&1
+# 健康抽奖机(2020.12.31活动过期)
+10 0 * * * node /scripts/jd_health.js |ts >> /scripts/logs/jd_health.log 2>&1
+# 直播红包雨(2020.12.12活动过期)
+0 0,9,11,13,15,17,19,20,21,23 * * * node /scripts/jd_live_redrain.js |ts >> /scripts/logs/jd_live_redrain.log 2>&1
+# 数码加购京豆(2020.12.11活动过期)
+8 0 * * * node /scripts/jd_digital_floor.js |ts >> /scripts/logs/jd_digital_floor.log 2>&1
##############长期活动##############
# 签到
-0 0,12,18 * * * node /scripts/jd_bean_sign.js >> /scripts/logs/jd_bean_sign.log 2>&1|ts
+0 0,12,18 * * * cd /scripts && node jd_bean_sign.js |ts >> /scripts/logs/jd_bean_sign.log 2>&1
# 京小超兑换奖品
-0 0 * * * node /scripts/jd_blueCoin.js >> /scripts/logs/jd_blueCoin.log 2>&1|ts
+0 0 * * * node /scripts/jd_blueCoin.js |ts >> /scripts/logs/jd_blueCoin.log 2>&1
# 摇京豆
-0 0 * * * node /scripts/jd_club_lottery.js >> /scripts/logs/jd_club_lottery.log 2>&1|ts
+0 0 * * * node /scripts/jd_club_lottery.js |ts >> /scripts/logs/jd_club_lottery.log 2>&1
# 东东农场
-5 6-18/6 * * * node /scripts/jd_fruit.js >> /scripts/logs/jd_fruit.log 2>&1|ts
+5 6-18/6 * * * node /scripts/jd_fruit.js |ts >> /scripts/logs/jd_fruit.log 2>&1
# 宠汪汪
-15 */2 * * * node /scripts/jd_joy.js >> /scripts/logs/jd_joy.log 2>&1|ts
+15 */2 * * * node /scripts/jd_joy.js |ts >> /scripts/logs/jd_joy.log 2>&1
# 宠汪汪喂食
-15 */1 * * * node /scripts/jd_joy_feedPets.js >> /scripts/logs/jd_joy_feedPets.log 2>&1|ts
+15 */1 * * * node /scripts/jd_joy_feedPets.js |ts >> /scripts/logs/jd_joy_feedPets.log 2>&1
# 宠汪汪积分兑换奖品
-0 0-16/8 * * * node /scripts/jd_joy_reward.js >> /scripts/logs/jd_joy_reward.log 2>&1|ts
+0 0-16/8 * * * node /scripts/jd_joy_reward.js |ts >> /scripts/logs/jd_joy_reward.log 2>&1
# 宠汪汪偷好友积分与狗粮
-0 0,6 * * * node /scripts/jd_joy_steal.js >> /scripts/logs/jd_joy_steal.log 2>&1|ts
+0 0,6 * * * node /scripts/jd_joy_steal.js |ts >> /scripts/logs/jd_joy_steal.log 2>&1
# 摇钱树
-0 */2 * * * node /scripts/jd_moneyTree.js >> /scripts/logs/jd_moneyTree.log 2>&1|ts
+0 */2 * * * node /scripts/jd_moneyTree.js |ts >> /scripts/logs/jd_moneyTree.log 2>&1
# 东东萌宠
-5 6-18/6 * * * node /scripts/jd_pet.js >> /scripts/logs/jd_pet.log 2>&1|ts
+5 6-18/6 * * * node /scripts/jd_pet.js |ts >> /scripts/logs/jd_pet.log 2>&1
# 京东种豆得豆
-0 7-22/1 * * * node /scripts/jd_plantBean.js >> /scripts/logs/jd_plantBean.log 2>&1|ts
+0 7-22/1 * * * node /scripts/jd_plantBean.js |ts >> /scripts/logs/jd_plantBean.log 2>&1
# 京东全民开红包
-1 1 * * * node /scripts/jd_redPacket.js >> /scripts/logs/jd_redPacket.log 2>&1|ts
+1 1 * * * node /scripts/jd_redPacket.js |ts >> /scripts/logs/jd_redPacket.log 2>&1
# 进店领豆
-10 0 * * * node /scripts/jd_shop.js >> /scripts/logs/jd_shop.log 2>&1|ts
+10 0 * * * node /scripts/jd_shop.js |ts >> /scripts/logs/jd_shop.log 2>&1
# 京东天天加速
-8 */3 * * * node /scripts/jd_speed.js >> /scripts/logs/jd_speed.log 2>&1|ts
+8 */3 * * * node /scripts/jd_speed.js |ts >> /scripts/logs/jd_speed.log 2>&1
# 东东超市
-11 1-23/5 * * * node /scripts/jd_superMarket.js >> /scripts/logs/jd_superMarket.log 2>&1|ts
+11 1-23/5 * * * node /scripts/jd_superMarket.js |ts >> /scripts/logs/jd_superMarket.log 2>&1
# 取关京东店铺商品
-55 23 * * * node /scripts/jd_unsubscribe.js >> /scripts/logs/jd_unsubscribe.log 2>&1|ts
+55 23 * * * node /scripts/jd_unsubscribe.js |ts >> /scripts/logs/jd_unsubscribe.log 2>&1
# 京豆变动通知
-0 2 * * * node /scripts/jd_bean_change.js >> /scripts/logs/jd_bean_change.log 2>&1|ts
+0 10 * * * node /scripts/jd_bean_change.js |ts >> /scripts/logs/jd_bean_change.log 2>&1
# 京东抽奖机
-11 1 * * * node /scripts/jd_lotteryMachine.js >> /scripts/logs/jd_lotteryMachine.log 2>&1|ts
+11 1 * * * node /scripts/jd_lotteryMachine.js |ts >> /scripts/logs/jd_lotteryMachine.log 2>&1
# 京东排行榜
-11 9 * * * node /scripts/jd_rankingList.js >> /scripts/logs/jd_rankingList.log 2>&1|ts
+11 9 * * * node /scripts/jd_rankingList.js |ts >> /scripts/logs/jd_rankingList.log 2>&1
# 天天提鹅
-18 */3 * * * node /scripts/jd_daily_egg.js >> /scripts/logs/jd_daily_egg.log 2>&1|ts
+18 * * * * node /scripts/jd_daily_egg.js |ts >> /scripts/logs/jd_daily_egg.log 2>&1
# 金融养猪
-12 13 * * * node /scripts/jd_pigPet.js >> /scripts/logs/jd_pigPet.log 2>&1|ts
+12 * * * * node /scripts/jd_pigPet.js |ts >> /scripts/logs/jd_pigPet.log 2>&1
+# 点点券
+20 0,20 * * * node /scripts/jd_necklace.js |ts >> /scripts/logs/jd_necklace.log 2>&1
+# 京喜工厂
+20 * * * * node /scripts/jd_dreamFactory.js |ts >> /scripts/logs/jd_dreamFactory.log 2>&1
+# 东东小窝
+16 6 * * * node /scripts/jd_small_home.js |ts >> /scripts/logs/jd_small_home.log 2>&1
+# 东东工厂
+36 * * * * node /scripts/jd_jdfactory.js |ts >> /scripts/logs/jd_jdfactory.log 2>&1
+# 十元街
+36 8,18 * * * node /scripts/jd_syj.js |ts >> /scripts/logs/jd_syj.log 2>&1
+# 京东代属(注:限校园用户可使用)
+36 9 * * * node /scripts/jd_ds.js |ts >> /scripts/logs/jd_ds.log 2>&1
+# 京东快递签到
+23 1 * * * node /scripts/jd_kd.js |ts >> /scripts/logs/jd_kd.log 2>&1
+# 京东汽车(签到满500赛点可兑换500京豆)
+33 2 * * * node /scripts/jd_car.js |ts >> /scripts/logs/jd_car.log 2>&1
+# 领京豆额外奖励(每日可获得3京豆)
+33 4 * * * node /scripts/jd_bean_home.js |ts >> /scripts/logs/jd_bean_home.log 2>&1
\ No newline at end of file
diff --git a/githubAction.md b/githubAction.md
index 45aaa30..acc3bd2 100644
--- a/githubAction.md
+++ b/githubAction.md
@@ -77,15 +77,16 @@
| Name | 归属 | 属性 | 说明 |
| :---------------------: | :----------: | --------- | ------------------------------------------------------------ |
| `JD_COOKIE` | 京东 | 必须 | 京东cookie,多个账号的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) |
-| `JD_BEAN_STOP` | 京东 | 非必须 | 自定义延迟签到,单位毫秒. 默认分批并发无延迟. 延迟作用于每个签到接口, 如填入延迟则切换顺序签到(耗时较长),如需填写建议输入数字`1` |
+| `JD_USER_AGENT` | 京东 | 非必须 | 自定义此库里京东系列脚本的UserAgent,不懂不知不会UserAgent的请不要随意填写内容。具体获取参考此[issue](https://github.com/lxk0301/jd_scripts/issues/127) |
+| `JD_BEAN_STOP` | 京东 | 非必须 | jd_bean_sign.js自定义延迟签到,单位毫秒. 默认分批并发无延迟. 延迟作用于每个签到接口, 如填入延迟则切换顺序签到(耗时较长),如需填写建议输入数字`1`,详见[此处说明](https://github.com/NobyDa/Script/blob/master/JD-DailyBonus/JD_DailyBonus.js#L93) |
| `JD_BEAN_SIGN_STOP_NOTIFY`| 京东 | 非必须 | `jd_bean_sign.js`脚本运行后不推送签到结果通知,默认推送,填`true`表示不发送通知 |
| `JD_BEAN_SIGN_NOTIFY_SIMPLE`| 京东 | 非必须 | `jd_bean_sign.js`脚本运行后推送签到结果简洁版通知,默认推送全部签到结果,填`true`表示推送简洁通知,[效果图](./icon/bean_sign_simple.jpg) |
| `JD_DEBUG` | 脚本打印log | 非必须 | 运行脚本时,是否显示log,默认显示。改成false表示不显示,注重隐私的人可以在设置secret -> `Name:JD_DEBUG,Value:false` |
| `PUSH_KEY` | 微信推送 | 非必须 | cookie失效推送[server酱的微信通知](http://sc.ftqq.com/3.version) |
| `BARK_PUSH` | [BARK推送](https://apps.apple.com/us/app/bark-customed-notifications/id1403753865) | 非必须 | cookie失效推送BARK这个APP,填写内容是app提供的`设备码`,例如:https://api.day.app/123 ,那么此处的设备码就是`123`,再不懂看 [这个图](icon/bark.jpg) |
| `BARK_SOUND` | [BARK推送](https://apps.apple.com/us/app/bark-customed-notifications/id1403753865) | 非必须 | bark推送声音设置,例如`choo`,具体值请在`bark`-`推送铃声`-`查看所有铃声` |
-| `TG_BOT_TOKEN` | telegram推送 | 非必须 | tg推送,填写自己申请[@BotFather](https://t.me/BotFather)的Token,如`10xxx4:AAFcqxxxxgER5uw` , [具体教程](https://github.com/lxk0301/jd_scripts/pull/37#issuecomment-692415594) |
-| `TG_USER_ID` | telegram推送 | 非必须 | tg推送,填写[@getuseridbot](https://t.me/getuseridbot)中获取到的纯数字ID, [具体教程](https://github.com/lxk0301/jd_scripts/pull/37#issuecomment-692415594) |
+| `TG_BOT_TOKEN` | telegram推送 | 非必须 | tg推送,填写自己申请[@BotFather](https://t.me/BotFather)的Token,如`10xxx4:AAFcqxxxxgER5uw` , [具体教程](./backUp/TG_PUSH.md) |
+| `TG_USER_ID` | telegram推送 | 非必须 | tg推送,填写[@getuseridbot](https://t.me/getuseridbot)中获取到的纯数字ID, [具体教程](./backUp/TG_PUSH.md) |
| `DD_BOT_TOKEN` | 钉钉推送 | 非必须 | 钉钉推送[官方文档](https://ding-doc.dingtalk.com/doc#/serverapi2/qf2nxq) ,只需`https://oapi.dingtalk.com/robot/send?access_token=XXX` 等于符号后面的XXX, 注:如果钉钉推送只填写`DD_BOT_TOKEN`,那么安全设置需勾选`自定义关键词`,内容输入输入`账号`即可,其他安全设置不要勾选 |
| `DD_BOT_SECRET` | 钉钉推送 | 非必须 | 密钥,机器人安全设置页面,加签一栏下面显示的SEC开头的字符串 , 注:填写了`DD_BOT_TOKEN`和`DD_BOT_SECRET`,钉钉机器人安全设置只需勾选`加签`即可,其他选项不要勾选,再不懂看 [这个图](icon/DD_bot.png) |
| `IGOT_PUSH_KEY` | iGot推送 | 非必须 | iGot聚合推送,支持多方式推送,确保消息可达。 [参考文档](https://wahao.github.io/Bark-MP-helper ) |
@@ -95,7 +96,8 @@
| `JD_818_SHAREID_NOTIFY` | 京东818互助码通知开关 | 非必须 | 控制jd_818.js脚本是否在获取互助码后通知,`true`为是(发送推送通知消息),`false`为否(即:不发送推送通知消息) |
| `JOY_FEED_COUNT` | 宠汪汪喂食数量 | 非必须 | 控制jd_joy_feedPets.js脚本喂食数量 ,可以填的数字10,20,40,80 , 其他数字不可. |
| `JOY_HELP_FEED` | 宠汪汪帮好友喂食 | 非必须 | 控制jd_joy_steal.js脚本是否给好友喂食,`false`为否,`true`为是(给好友喂食) |
-| `JOY_RUN_FLAG` | 宠汪汪参加双人赛跑 | 非必须 | 控制jd_joy.js脚本是否参加双人赛跑,`false`为否,`true`为是,脚本默认是`true` |
+| `JOY_RUN_FLAG` | 宠汪汪是否赛跑 | 非必须 | 控制jd_joy.js脚本是否参加赛跑(默认参加双人赛跑),`false`为否,`true`为是,脚本默认是`true` |
+| `JOY_TEAM_LEVEL` | 宠汪汪参加什么级别的赛跑 | 非必须 | 控制jd_joy.js脚本参加几人的赛跑,可选数字为`2`,`10`,`50`,其中2代表参加双人PK赛,10代表参加10人突围赛,50代表参加50人挑战赛(注:此项功能在`JOY_RUN_FLAG`为true的时候才生效) |
| `JD_JOY_REWARD_NAME` | 宠汪汪积分兑换多少京豆 | 非必须 | 目前可填值为`20`或者`500`,脚本默认`20`,`0`表示不兑换京豆 |
| `MARKET_COIN_TO_BEANS` | 京小超兑换京豆数量 | 非必须 | 控制jd_blueCoin.js兑换京豆数量,可输入值为`20`或者`1000`的数字或者其他商品的名称,例如`碧浪洗衣凝珠` |
| `MARKET_REWARD_NOTIFY` | 京小超兑换奖品推送开关 | 非必须 | 控制jd_blueCoin.js兑换奖品成功后是否静默运行, `false`为否(发送推送通知消息),`true`为是(即:不发送推送通知消息) |
@@ -104,13 +106,16 @@
| `SUPERMARKET_LOTTERY` | 京小超抽奖 | 非必须 | 每天运行脚本是否使用金币去抽奖,`true`表示抽奖,`false`表示不抽奖 |
| `FRUIT_BEAN_CARD` | 农场使用水滴换豆卡 | 非必须 | 农场使用水滴换豆卡(如果出现限时活动时100g水换20豆,此时比浇水划算,推荐换豆),`true`表示换豆(不浇水),`false`表示不换豆(继续浇水),脚本默认是浇水 |
| `UN_SUBSCRIBES` | jd_unsubscribe.js | 非必须 | 共四个参数,换行隔开. 四个参数分别表示`取关商品数量`,`取关店铺数量`,`遇到此商品不再进行取关`, `遇到此店铺不再进行取关`,[具体使用往下看](#取关店铺secret的说明)|
-| `FruitShareCodes` | 东东农场互助码 | 非必须 | 填写规则请看 [jdFruitShareCodes.js](https://github.com/lxk0301/jd_scripts/blob/master/jdFruitShareCodes.js) 或见下方[互助码的填写规则](#互助码的填写规则) |
+| `FRUITSHARECODES` | 东东农场互助码 | 非必须 | 填写规则请看 [jdFruitShareCodes.js](https://github.com/lxk0301/jd_scripts/blob/master/jdFruitShareCodes.js) 或见下方[互助码的填写规则](#互助码的填写规则) |
| `PETSHARECODES` | 东东萌宠互助码 | 非必须 | 填写规则请看 [jdPetShareCodes.js](https://github.com/lxk0301/jd_scripts/blob/master/jdPetShareCodes.js) 或见下方[互助码的填写规则](#互助码的填写规则) |
| `PLANT_BEAN_SHARECODES` | 种豆得豆互助码 | 非必须 | 填写规则请看 [jdPlantBeanShareCodes.js](https://github.com/lxk0301/jd_scripts/blob/master/jdPlantBeanShareCodes.js) 或见下方[互助码的填写规则](#互助码的填写规则) |
| `SUPERMARKET_SHARECODES`| 京小超商圈互助码 | 非必须 | 填写规则请看 [jdSuperMarketShareCodes.js](https://github.com/lxk0301/jd_scripts/blob/master/jdSuperMarketShareCodes.js) 或见下方[互助码的填写规则](#互助码的填写规则) |
+| `DDFACTORY_SHARECODES`| 东东工厂互助码 | 非必须 | 填写规则请看 [jdFactoryShareCodes.js](https://github.com/lxk0301/jd_scripts/blob/master/jdFactoryShareCodes.js) 或见下方[互助码的填写规则](#互助码的填写规则) |
+| `DREAM_FACTORY_SHARE_CODES`| 京喜工厂互助码 | 非必须 | 填写规则请看 [jdDreamFactoryShareCodes.js](https://github.com/lxk0301/jd_scripts/blob/master/jdDreamFactoryShareCodes.js) 或见下方[互助码的填写规则](#互助码的填写规则) |
| `TG_PROXY_HOST` | Telegram 代理的 IP | 非必须 | 代理类型为 http。例子:http代理 http://127.0.0.1:1080 则填写 127.0.0.1 |
| `TG_PROXY_PORT` | Telegram 代理的端口 | 非必须 | 例子:http代理 http://127.0.0.1:1080 则填写 1080 |
-
+| `MONEY_TREE_SELL_FRUIT` | 摇钱树是否卖出金果 | 非必须 | 控制摇钱树脚本是否自动卖出金果兑换成金币,`true`卖出,`false`不卖出,默认`true` |
+| `FACTORAY_WANTPRODUCT_NAME` | 东东工厂心仪商品 | 非必须 | 提供心仪商品名称(请尽量填写完整和别的商品有区分度),达到条件后兑换,如不提供则会兑换当前所选商品 |
##### 互助码的填写规则
diff --git a/iCloud.md b/iCloud.md
index 1db8479..4066d16 100644
--- a/iCloud.md
+++ b/iCloud.md
@@ -36,6 +36,8 @@
```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') //这里写你想要的脚本
@@ -44,8 +46,7 @@ exports.main_handler = async (event, context, callback) => {
```
此时,同一时间点下,会同时执行多个脚本,触发器触发后,index.js文件中require()下的所有脚本都会被执行
-**优点**:同一时间下可以同时执行多个脚本,适合脚本种类少的repository,对脚本数量少的repository推荐使用此方案
-**缺点**:多个脚本不同时间点运行无法满足
+**优点**:同一时间下可以同时执行多个脚本,适合脚本种类少的repository,对脚本数量少的repository推荐使用此方案
**缺点**:多个脚本不同时间点运行无法满足
方案二:同一个仓库下不同的时间点,分别执行不同的脚本(类似GitHub Action执行机制)
@@ -57,6 +58,8 @@ exports.main_handler = async (event, context, callback) => {
'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`)
}
@@ -66,14 +69,15 @@ exports.main_handler = async (event, context, callback) => {
此时触发管理按照下图中进行设置,附加信息选择“是”,内容填写需要传递执行的具体脚本文件名,以回车键换行。触发器触发后,附加信息栏内的脚本会被执行,设置多个不同时间点的触发器达到类似GitHub Action的效果
-**优点**:可以满足个性化需求,同一个repository下只需要设置不同的触发器,可以实现不同时间点分别执行不同的脚本
-**缺点**:repository下脚本过多,如果需要设置多个触发器,实现个性化运行效果,由于云函数的限制,最多只能设置10个
+**优点**:可以满足个性化需求,同一个repository下只需要设置不同的触发器,可以实现不同时间点分别执行不同的脚本
**缺点**:repository下脚本过多,如果需要设置多个触发器,实现个性化运行效果,由于云函数的限制,最多只能设置10个
[](https://imgchr.com/i/B20KxI)
[](https://imgchr.com/i/BRCG0H)
-**注意:方案一与方案二不能混合到同一个index.js文件中使用,同一个仓库下,二者只能选择其一。目前由于云函数热启动问题的存在,频繁的触发器启动,虽然日志显示“调用成功”,但实际内容却没有执行,方案一与方案二暂时无法规避此问题,期待之后能解决**
-
+**注意:**
+Ⅰ方案一与方案二不能混合到同一个index.js文件中使用,同一个仓库下,二者只能选择其一。
+Ⅱ感谢[issues#115](https://github.com/lxk0301/jd_scripts/issues/115)中的解决方案,目前云函数连续测试已经可以规避热启动问题了。
+Ⅲ在确保完全按照本教程设置的情况下测试云函数运行情况,对于部分人运行日志中出现某些脚本运行失败其他正常,并且错误提示带有strict字样的,请自行删除index.js中的```'use strict';```,再做测试
**增加cookie**
@@ -110,11 +114,9 @@ let CookieJDs = [

-函数名称:可以自定义,比如为jd。
-运行环境:选择 “Nodejs 12.16”。
-创建方式:选择 “空白函数”。
+**函数名称**:可以自定义,比如为jd。
**运行环境**:选择 “Nodejs 12.16”。
**创建方式**:选择 “空白函数”。
-确保环境为Nodejs 12.16,执行方法改为:index.main_handler,提交方式建议选本地文件夹,然后从GitHub项目克隆Zip压缩包,解压成文件夹,然后点击这个上传把文件夹上传进来(记得node_modules文件夹一并上传),完了后点击下面的高级设置。
+确保环境为Nodejs 12.16,执行方法改为:index.main_handler,提交方式建议选本地文件夹,然后从GitHub项目克隆Zip压缩包,解压成文件夹,然后点击这个上传把文件夹上传进来(记得node_modules文件夹一并上传或者将node_modules文件夹上传到“层”,之后选择“函数管理”-“层管理”绑定上传好的层),完了后点击下面的高级设置。

@@ -132,14 +134,21 @@ let CookieJDs = [

-
+创建触发器
+
+
+
+触发方式默认“**定时触发**”,定时任务名称随便起个名字,触发周期根据自己需要自行设置。
想进阶使用触发器的自行查看本文中方案一和方案二中的说明
关于触发周期中的自定义触发周期,使用的是 Cron表达式,这个自行学习下吧
+
[Corn文档](https://cloud.tencent.com/document/product/583/9708#cron-.E8.A1.A8.E8.BE.BE.E5.BC.8F)
+目前repo中按照每个脚本一个定时器的方式设置到云函数中,大约需要触发器10多个,由于云函数触发器限制最多10个,需要对触发器进行整合,整合后触发器保持在10个以内,以下设置仅供参考
+
点击提交,所有流程就结束了。
diff --git a/icon/TG_PUSH1.png b/icon/TG_PUSH1.png
new file mode 100644
index 0000000..0e2c8a1
Binary files /dev/null and b/icon/TG_PUSH1.png differ
diff --git a/icon/TG_PUSH2.png b/icon/TG_PUSH2.png
new file mode 100644
index 0000000..a9d8c58
Binary files /dev/null and b/icon/TG_PUSH2.png differ
diff --git a/icon/TG_PUSH3.png b/icon/TG_PUSH3.png
new file mode 100644
index 0000000..e213067
Binary files /dev/null and b/icon/TG_PUSH3.png differ
diff --git a/icon/iCloud5.png b/icon/iCloud5.png
new file mode 100644
index 0000000..d565183
Binary files /dev/null and b/icon/iCloud5.png differ
diff --git a/icon/iCloud6.png b/icon/iCloud6.png
new file mode 100644
index 0000000..8210a7f
Binary files /dev/null and b/icon/iCloud6.png differ
diff --git a/index.js b/index.js
new file mode 100644
index 0000000..c70aaa6
--- /dev/null
+++ b/index.js
@@ -0,0 +1,26 @@
+//'use strict';
+exports.main_handler = async (event, context, callback) => {
+ try {
+ //如果想在一个定时触发器里面执行多个js文件需要在定时触发器的【附加信息】里面填写对应的名称,用 & 链接
+ //例如我想一个定时触发器里执行jd_speed.js和jd_bean_change.js,在定时触发器的【附加信息】里面就填写 jd_speed&jd_bean_change
+ for (const v of event["Message"].split("&")) {
+ console.log(v);
+ var request = require('request');
+ //1.执行自己上传的js文件
+ //delete require.cache[require.resolve('./'+v+'.js')];
+ //require('./'+v+'.js')
+
+ //2.执行国内gitee远端js文件如果部署,在国内节点,选择1或2的方式
+ //request('https://gitee.com/lxk0301/jd_scripts/raw/master/'+v+'.js', function (error, response, body) {
+ // eval(response.body)
+ //})
+
+ //3.执行github远端的js文件(因github的raw类型的文件被墙,此方法云函数不推荐)
+ request('https://raw.githubusercontent.com/lxk0301/jd_scripts/master/' + v + '.js', function (error, response, body) {
+ eval(response.body)
+ })
+ }
+ } catch (e) {
+ console.error(e)
+ }
+}
diff --git a/jdCookie.js b/jdCookie.js
index 8395dec..4eb2bb7 100644
--- a/jdCookie.js
+++ b/jdCookie.js
@@ -15,9 +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.split();
+ 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`)
diff --git a/jdDreamFactoryShareCodes.js b/jdDreamFactoryShareCodes.js
new file mode 100644
index 0000000..5f591dc
--- /dev/null
+++ b/jdDreamFactoryShareCodes.js
@@ -0,0 +1,31 @@
+/*
+京喜工厂互助码
+此文件为Node.js专用。其他用户请忽略
+支持京东N个账号
+ */
+//云服务器腾讯云函数等NOde.js用户在此处填写东东萌宠的好友码。
+// github action用户的好友互助码填写到Action->Settings->Secrets->new Secret里面(Name填写 PLANT_BEAN_SHARECODES(此处的Name必须按此来写,不能随意更改),内容处填写互助码,填写规则如下)
+// 同一个京东账号的好友互助码用@符号隔开,不同京东账号之间用&符号或者换行隔开,下面给一个示例
+// 如: 京东账号1的shareCode1@京东账号1的shareCode2&京东账号2的shareCode1@京东账号2的shareCode2
+let shareCodes = [
+ 'V5LkjP4WRyjeCKR9VRwcRX0bBuTz7MEK0-E99EJ7u0k=@Bo-jnVs_m9uBvbRzraXcSA==',//账号一的好友shareCode,不同好友中间用@符号隔开
+ '1uzRU5HkaUgvy0AB5Q9VUg==@PDPM257r_KuQhil2Y7koNw==',//账号二的好友shareCode,不同好友中间用@符号隔开
+]
+// 判断github action里面是否有东东萌宠互助码
+if (process.env.DREAM_FACTORY_SHARE_CODES) {
+ if (process.env.DREAM_FACTORY_SHARE_CODES.indexOf('&') > -1) {
+ console.log(`您的互助码选择的是用&隔开\n`)
+ shareCodes = process.env.DREAM_FACTORY_SHARE_CODES.split('&');
+ } else if (process.env.DREAM_FACTORY_SHARE_CODES.indexOf('\n') > -1) {
+ console.log(`您的互助码选择的是用换行隔开\n`)
+ shareCodes = process.env.DREAM_FACTORY_SHARE_CODES.split('\n');
+ } else {
+ shareCodes = process.env.DREAM_FACTORY_SHARE_CODES.split();
+ }
+} else if (process.env.DREAM_FACTORY_SHARE_CODES) {
+ console.log(`由于您secret里面未提供助力码,故此处运行将会给脚本内置的码进行助力,请知晓!`)
+}
+for (let i = 0; i < shareCodes.length; i++) {
+ const index = (i + 1 === 1) ? '' : (i + 1);
+ exports['shareCodes' + index] = shareCodes[i];
+}
\ No newline at end of file
diff --git a/jdFactoryShareCodes.js b/jdFactoryShareCodes.js
new file mode 100644
index 0000000..99a5008
--- /dev/null
+++ b/jdFactoryShareCodes.js
@@ -0,0 +1,31 @@
+/*
+东东工厂互助码
+此文件为Node.js专用。其他用户请忽略
+支持京东N个账号
+ */
+//云服务器腾讯云函数等NOde.js用户在此处填写东东萌宠的好友码。
+// github action用户的好友互助码填写到Action->Settings->Secrets->new Secret里面(Name填写 PLANT_BEAN_SHARECODES(此处的Name必须按此来写,不能随意更改),内容处填写互助码,填写规则如下)
+// 同一个京东账号的好友互助码用@符号隔开,不同京东账号之间用&符号或者换行隔开,下面给一个示例
+// 如: 京东账号1的shareCode1@京东账号1的shareCode2&京东账号2的shareCode1@京东账号2的shareCode2
+let shareCodes = [
+ '',//账号一的好友shareCode,不同好友中间用@符号隔开
+ '',//账号二的好友shareCode,不同好友中间用@符号隔开
+]
+// 判断github action里面是否有东东工厂互助码
+if (process.env.DDFACTORY_SHARECODES) {
+ if (process.env.DDFACTORY_SHARECODES.indexOf('&') > -1) {
+ console.log(`您的互助码选择的是用&隔开\n`)
+ shareCodes = process.env.DDFACTORY_SHARECODES.split('&');
+ } else if (process.env.DDFACTORY_SHARECODES.indexOf('\n') > -1) {
+ console.log(`您的互助码选择的是用换行隔开\n`)
+ shareCodes = process.env.DDFACTORY_SHARECODES.split('\n');
+ } else {
+ shareCodes = process.env.DDFACTORY_SHARECODES.split();
+ }
+} else if (process.env.DDFACTORY_SHARECODES) {
+ console.log(`由于您secret里面未提供助力码,故此处运行将会给脚本内置的码进行助力,请知晓!`)
+}
+for (let i = 0; i < shareCodes.length; i++) {
+ const index = (i + 1 === 1) ? '' : (i + 1);
+ exports['shareCodes' + index] = shareCodes[i];
+}
\ No newline at end of file
diff --git a/jdJxStoryShareCodes.js b/jdJxStoryShareCodes.js
new file mode 100644
index 0000000..9453429
--- /dev/null
+++ b/jdJxStoryShareCodes.js
@@ -0,0 +1,30 @@
+/*
+京喜故事互助码
+此文件为Node.js专用。其他用户请忽略
+支持京东N个账号
+ */
+//云服务器腾讯云函数等Node.js用户在此处填写京喜故事的好友码。
+// github action用户的好友互助码填写到Action->Settings->Secrets->new Secret里面(Name填写 JXSTORY_SHARECODES(此处的Name必须按此来写,不能随意更改),内容处填写互助码,填写规则如下)
+// 同一个京东账号的好友互助码用@符号隔开,不同京东账号之间用&符号或者换行隔开,下面给一个示例
+// 如: 京东账号1的shareCode1@京东账号1的shareCode2&京东账号2的shareCode1@京东账号2的shareCode2
+let shareCodes = [
+ '',//账号一的好友shareCode,不同好友中间用@符号隔开
+ '',//账号二的好友shareCode
+]
+// 判断github action里面是否有京喜故事互助码
+if (process.env.JXSTORY_SHARECODES) {if (process.env.JXSTORY_SHARECODES.indexOf('&') > -1) {
+ console.log(`您的互助码选择的是用&隔开\n`)
+ shareCodes = process.env.JXSTORY_SHARECODES.split('&');
+ } else if (process.env.JXSTORY_SHARECODES.indexOf('\n') > -1) {
+ console.log(`您的互助码选择的是用换行隔开\n`)
+ shareCodes = process.env.JXSTORY_SHARECODES.split('\n');
+ } else {
+ shareCodes = process.env.JXSTORY_SHARECODES.split();
+ }
+} else if (process.env.JXSTORY_SHARECODES) {
+ console.log(`由于您secret里面未提供助力码,故此处运行将会给脚本内置的码进行助力,请知晓!`)
+}
+for (let i = 0; i < shareCodes.length; i++) {
+ const index = (i + 1 === 1) ? '' : (i + 1);
+ exports['shareCodes' + index] = shareCodes[i];
+}
diff --git a/jdPlantBeanShareCodes.js b/jdPlantBeanShareCodes.js
index 356cc89..3894909 100644
--- a/jdPlantBeanShareCodes.js
+++ b/jdPlantBeanShareCodes.js
@@ -8,7 +8,7 @@
// 同一个京东账号的好友互助码用@符号隔开,不同京东账号之间用&符号或者换行隔开,下面给一个示例
// 如: 京东账号1的shareCode1@京东账号1的shareCode2&京东账号2的shareCode1@京东账号2的shareCode2
let PlantBeanShareCodes = [
- '66j4yt3ebl5ierjljoszp7e4izzbzaqhi5k2unz2afwlyqsgnasq@olmijoxgmjutyrsovl2xalt2tbtfmg6sqldcb3q@e7lhibzb3zek27amgsvywffxx7hxgtzstrk2lba',//账号一的好友shareCode,不同好友中间用@符号隔开
+ '66j4yt3ebl5ierjljoszp7e4izzbzaqhi5k2unz2afwlyqsgnasq@olmijoxgmjutyrsovl2xalt2tbtfmg6sqldcb3q@e7lhibzb3zek27amgsvywffxx7hxgtzstrk2lba@olmijoxgmjutyx55upqaqxrblt7f3h26dgj2riy',//账号一的好友shareCode,不同好友中间用@符号隔开
'4npkonnsy7xi3p6pjfxg6ct5gll42gmvnz7zgoy@6dygkptofggtp6ffhbowku3xgu@mlrdw3aw26j3wgzjipsxgonaoyr2evrdsifsziy@mlrdw3aw26j3wgzjipsxgonaoyr2evrdsifsziy',//账号二的好友shareCode,不同好友中间用@符号隔开
]
// 判断github action里面是否有东东萌宠互助码
diff --git a/jd_818.js b/jd_818.js
index 7fbeb49..5212741 100644
--- a/jd_818.js
+++ b/jd_818.js
@@ -2,7 +2,7 @@
* @Author: lxk0301 https://github.com/lxk0301
* @Date: 2020-11-03 09:25:47
* @Last Modified by: lxk0301
- * @Last Modified time: 2020-11-02 09:26:12
+ * @Last Modified time: 2020-11-23 12:27:07
*/
/*
京东手机狂欢城活动,每日可获得30+以上京豆(其中20京豆是往期奖励,需第一天参加活动后,第二天才能拿到)
@@ -140,7 +140,7 @@ function listMeeting() {
'Accept': 'application/json, text/plain, */*',
'Connection':' keep-alive',
'Cookie': cookie,
- 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/7.0.14(0x17000e2a) NetType/4G Language/zh_CN',
+ '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://rdcseason.m.jd.com/?reloadWQPage=t_${Date.now()}`,
'Accept-Encoding': 'gzip, deflate, br'
@@ -187,7 +187,7 @@ function listGoods() {
'Accept': 'application/json, text/plain, */*',
'Connection':' keep-alive',
'Cookie': cookie,
- 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/7.0.14(0x17000e2a) NetType/4G Language/zh_CN',
+ '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://rdcseason.m.jd.com/?reloadWQPage=t_${Date.now()}`,
'Accept-Encoding': 'gzip, deflate, br'
@@ -233,7 +233,7 @@ function shopInfo() {
'Accept': 'application/json, text/plain, */*',
'Connection':' keep-alive',
'Cookie': cookie,
- 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/7.0.14(0x17000e2a) NetType/4G Language/zh_CN',
+ '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://rdcseason.m.jd.com/?reloadWQPage=t_${Date.now()}`,
'Accept-Encoding': 'gzip, deflate, br'
@@ -286,7 +286,7 @@ function browseGoods(id) {
"Accept": "application/json, text/plain, */*",
"Connection": "keep-alive",
"Cookie": cookie,
- "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.1 Mobile/15E148 Safari/604.1",
+ "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://rdcseason.m.jd.com/",
"Accept-Encoding": "gzip, deflate, br"
@@ -320,7 +320,7 @@ function getGoodsPrize(id) {
"Accept": "application/json, text/plain, */*",
"Connection": "keep-alive",
"Cookie": cookie,
- "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.1 Mobile/15E148 Safari/604.1",
+ "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://rdcseason.m.jd.com/",
"Accept-Encoding": "gzip, deflate, br"
@@ -353,7 +353,7 @@ function browseShop(id) {
"Accept": "application/json, text/plain, */*",
"Connection": "keep-alive",
"Cookie": cookie,
- "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.1 Mobile/15E148 Safari/604.1",
+ "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://rdcseason.m.jd.com/",
"Accept-Encoding": "gzip, deflate, br"
@@ -386,7 +386,7 @@ function getShopPrize(id) {
"Accept": "application/json, text/plain, */*",
"Connection": "keep-alive",
"Cookie": cookie,
- "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.1 Mobile/15E148 Safari/604.1",
+ "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://rdcseason.m.jd.com/",
"Accept-Encoding": "gzip, deflate, br"
@@ -420,7 +420,7 @@ function browseMeeting(id) {
"Accept": "application/json, text/plain, */*",
"Connection": "keep-alive",
"Cookie": cookie,
- "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.1 Mobile/15E148 Safari/604.1",
+ "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://rdcseason.m.jd.com/",
"Accept-Encoding": "gzip, deflate, br"
@@ -453,7 +453,7 @@ function getMeetingPrize(id) {
"Accept": "application/json, text/plain, */*",
"Connection": "keep-alive",
"Cookie": cookie,
- "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.1 Mobile/15E148 Safari/604.1",
+ "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://rdcseason.m.jd.com/",
"Accept-Encoding": "gzip, deflate, br"
@@ -486,7 +486,7 @@ function myRank() {
"Accept": "application/json, text/plain, */*",
"Connection": "keep-alive",
"Cookie": cookie,
- "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.1 Mobile/15E148 Safari/604.1",
+ "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://rdcseason.m.jd.com/",
"Accept-Encoding": "gzip, deflate, br"
@@ -549,7 +549,7 @@ function saveJbean(id) {
"Accept": "application/json, text/plain, */*",
"Connection": "keep-alive",
"Cookie": cookie,
- "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.1 Mobile/15E148 Safari/604.1",
+ "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://rdcseason.m.jd.com/",
"Accept-Encoding": "gzip, deflate, br"
@@ -633,7 +633,7 @@ function toHelp(code) {
"Cookie": cookie,
"Connection": "keep-alive",
"Accept": "application/json, text/plain, */*",
- "User-Agent": "jdapp;iPhone;9.1.0;14.0;e35caf0a69be42084e3c97eef56c3af7b0262d01;network/4g;supportApplePay/3;hasUPPay/0;pushNoticeIsOpen/1;model/iPhone11,8;addressid/2005183373;hasOCPay/0;appBuild/167348;supportBestPay/0;jdSupportDarkMode/0;pv/252.3;apprpd/Home_Main;ref/JDWebViewController;psq/2;ads/;psn/e35caf0a69be42084e3c97eef56c3af7b0262d01|695;jdv/0|kong|t_2010957099_|jingfen|3b5422e836e74037862fea3dcf1a6802|1600647811440|1600647814;adk/;app_device/IOS;pap/JA2015_311210|9.1.0|IOS 14.0;Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
+ "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"),
"Referer": "https://rdcseason.m.jd.com/",
"Content-Length": "44",
"Accept-Language": "zh-cn"
@@ -665,7 +665,7 @@ function getHelp() {
"Accept": "application/json, text/plain, */*",
"Connection": "keep-alive",
"Cookie": cookie,
- "User-Agent": "jdapp;iPhone;9.1.0;14.0;e35caf0a69be42084e3c97eef56c3af7b0262d01;network/4g;supportApplePay/3;hasUPPay/0;pushNoticeIsOpen/1;model/iPhone11,8;addressid/2005183373;hasOCPay/0;appBuild/167348;supportBestPay/0;jdSupportDarkMode/0;pv/255.2;apprpd/Home_Main;ref/JDMainPageViewController;psq/1;ads/;psn/e35caf0a69be42084e3c97eef56c3af7b0262d01|701;jdv/0|kong|t_2010957099_|jingfen|3b5422e836e74037862fea3dcf1a6802|1600647811440|1600647814;adk/;app_device/IOS;pap/JA2015_311210|9.1.0|IOS 14.0;Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
+ "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://rdcseason.m.jd.com",
"Accept-Encoding": "gzip, deflate, br"
@@ -726,7 +726,7 @@ function getListJbean() {
"Accept": "application/json, text/plain, */*",
"Connection": "keep-alive",
"Cookie": cookie,
- "User-Agent": "jdapp;iPhone;9.1.0;14.0;e35caf0a69be42084e3c97eef56c3af7b0262d01;network/4g;supportApplePay/3;hasUPPay/0;pushNoticeIsOpen/1;model/iPhone11,8;addressid/2005183373;hasOCPay/0;appBuild/167348;supportBestPay/0;jdSupportDarkMode/0;pv/255.2;apprpd/Home_Main;ref/JDMainPageViewController;psq/1;ads/;psn/e35caf0a69be42084e3c97eef56c3af7b0262d01|701;jdv/0|kong|t_2010957099_|jingfen|3b5422e836e74037862fea3dcf1a6802|1600647811440|1600647814;adk/;app_device/IOS;pap/JA2015_311210|9.1.0|IOS 14.0;Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
+ "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://rdcseason.m.jd.com",
"Accept-Encoding": "gzip, deflate, br"
@@ -761,7 +761,7 @@ function getListIntegral() {
"Accept": "application/json, text/plain, */*",
"Connection": "keep-alive",
"Cookie": cookie,
- "User-Agent": "jdapp;iPhone;9.1.0;14.0;e35caf0a69be42084e3c97eef56c3af7b0262d01;network/4g;supportApplePay/3;hasUPPay/0;pushNoticeIsOpen/1;model/iPhone11,8;addressid/2005183373;hasOCPay/0;appBuild/167348;supportBestPay/0;jdSupportDarkMode/0;pv/255.2;apprpd/Home_Main;ref/JDMainPageViewController;psq/1;ads/;psn/e35caf0a69be42084e3c97eef56c3af7b0262d01|701;jdv/0|kong|t_2010957099_|jingfen|3b5422e836e74037862fea3dcf1a6802|1600647811440|1600647814;adk/;app_device/IOS;pap/JA2015_311210|9.1.0|IOS 14.0;Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
+ "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://rdcseason.m.jd.com",
"Accept-Encoding": "gzip, deflate, br"
@@ -797,7 +797,7 @@ function getListRank() {
"Accept": "application/json, text/plain, */*",
"Connection": "keep-alive",
"Cookie": cookie,
- "User-Agent": "jdapp;iPhone;9.1.0;14.0;e35caf0a69be42084e3c97eef56c3af7b0262d01;network/4g;supportApplePay/3;hasUPPay/0;pushNoticeIsOpen/1;model/iPhone11,8;addressid/2005183373;hasOCPay/0;appBuild/167348;supportBestPay/0;jdSupportDarkMode/0;pv/255.2;apprpd/Home_Main;ref/JDMainPageViewController;psq/1;ads/;psn/e35caf0a69be42084e3c97eef56c3af7b0262d01|701;jdv/0|kong|t_2010957099_|jingfen|3b5422e836e74037862fea3dcf1a6802|1600647811440|1600647814;adk/;app_device/IOS;pap/JA2015_311210|9.1.0|IOS 14.0;Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
+ "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://rdcseason.m.jd.com",
"Accept-Encoding": "gzip, deflate, br"
@@ -847,7 +847,7 @@ function updateShareCodes(url = 'https://raw.githubusercontent.com/lxk0301/updat
})
})
}
-function updateShareCodesCDN(url = 'https://cdn.jsdelivr.net/gh/lxk0301/updateTeam@master/jd_shareCodes.json') {
+function updateShareCodesCDN(url = 'https://raw.fastgit.org/lxk0301/updateTeam/master/jd_shareCodes.json') {
return new Promise(resolve => {
//https://cdn.jsdelivr.net/gh/lxk0301/updateTeam@master/jd_shareCodes.json
//https://raw.githubusercontent.com/lxk0301/updateTeam/master/jd_shareCodes.json
@@ -879,7 +879,7 @@ function TotalBean() {
"Connection": "keep-alive",
"Cookie": cookie,
"Referer": "https://wqs.jd.com/my/jingdou/my.shtml?sceneval=2",
- "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 14_0_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Mobile/15E148 Safari/604.1"
+ "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) => {
diff --git a/jd_bean_change.js b/jd_bean_change.js
index 731870f..f5448a7 100644
--- a/jd_bean_change.js
+++ b/jd_bean_change.js
@@ -138,7 +138,7 @@ function TotalBean() {
"Connection": "keep-alive",
"Cookie": cookie,
"Referer": "https://wqs.jd.com/my/jingdou/my.shtml?sceneval=2",
- "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 14_0_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Mobile/15E148 Safari/604.1"
+ "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) => {
@@ -175,7 +175,7 @@ function getJingBeanBalanceDetail(page) {
"url": `https://api.m.jd.com/client.action?functionId=getJingBeanBalanceDetail`,
"body": `body=${escape(JSON.stringify({"pageSize": "20", "page": page.toString()}))}&appid=ld`,
"headers": {
- 'User-Agent': 'JD4iPhone/167169 (iPhone; iOS 13.4.1; Scale/3.00)',
+ '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',
'Cookie': cookie,
diff --git a/jd_bean_home.js b/jd_bean_home.js
new file mode 100644
index 0000000..84312da
--- /dev/null
+++ b/jd_bean_home.js
@@ -0,0 +1,257 @@
+/*
+领京豆额外奖励
+入口:首页-领京豆
+更新地址:https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_bean_home.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_bean_home.js, tag=领京豆额外奖励, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_bean_home.png, enabled=true
+
+================Loon==============
+[Script]
+cron "10 7 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_bean_home.js, tag=领京豆额外奖励
+
+===============Surge=================
+领京豆额外奖励 = type=cron,cronexp="10 7 * * *",wake-system=1,timeout=20,script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_bean_home.js
+
+============小火箭=========
+领京豆额外奖励 = type=cron,script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_bean_home.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 {
+ cookiesArr.push(...[$.getdata('CookieJD'), $.getdata('CookieJD2')]);
+}
+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`);
+ } else {
+ $.setdata('', `CookieJD${i ? i + 1 : ""}`);//cookie失效,故清空cookie。$.setdata('', `CookieJD${i ? i + 1 : "" }`);//cookie失效,故清空cookie。
+ }
+ continue
+ }
+ await jdBeanHome();
+ }
+ }
+})()
+ .catch((e) => {
+ $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '')
+ })
+ .finally(() => {
+ $.done();
+ })
+
+async function jdBeanHome() {
+ await getTaskList()
+ await showMsg();
+}
+
+function showMsg() {
+ return new Promise(resolve => {
+ $.msg($.name, '', `【京东账号${$.index}】${$.nickName}\n${message}`);
+ resolve()
+ })
+}
+
+function getTaskList() {
+ return new Promise(resolve => {
+ const body = {"rnVersion": "4.7", "rnClient": "2", "source": "AppHome"};
+ $.post(taskUrl('findBeanHome', 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);
+ let beanTask = data.data.floorList.filter(vo => vo.floorName === "种豆得豆定制化场景")[0]
+ if (!beanTask.viewed) {
+ await receiveTask()
+ await $.wait(3000)
+ }
+
+ let tasks = data.data.floorList.filter(vo => vo.floorName === "赚京豆")[0]['stageList']
+ for (let i = 0; i < tasks.length; ++i) {
+ const vo = tasks[i]
+ if (vo.viewed) continue
+ await receiveTask(vo.stageId, `4_${vo.stageId}`)
+ await $.wait(3000)
+ }
+ await award()
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+
+function receiveTask(itemId = "zddd", type = "3") {
+ return new Promise(resolve => {
+ const body = {"awardFlag": false, "itemId": itemId, "source": "home", "type": type};
+ $.post(taskUrl('beanHomeTask', 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.data) {
+ console.log(`完成任务成功,进度${data.data.taskProgress}/${data.data.taskThreshold}`)
+ }
+ else{
+ console.log(`完成任务失败,${data.errorMessage}`)
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+
+
+function award() {
+ return new Promise(resolve => {
+ const body = {"awardFlag": true, "source": "home"};
+ $.post(taskUrl('beanHomeTask', 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.data) {
+ console.log(`领奖成功,获得 ${data.data.beanNum} 个京豆`)
+ message += `领奖成功,获得 ${data.data.beanNum} 个京豆\n`
+ } else {
+ console.log(`领奖失败,${data.errorMessage}`)
+ message += `领奖失败,${data.errorMessage}\n`
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+
+function taskUrl(function_id, body) {
+ body["version"] = "9.0.0.1";
+ body["monitor_source"] = "plant_app_plant_index";
+ body["monitor_refer"] = "";
+ return {
+ url: JD_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 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;
+ }
+}
+
+// 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,o)=>{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.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 o=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");o=o?1*o:20,o=e&&e.timeout?e.timeout:o;const[r,h]=i.split("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:o},headers:{"X-Key":r,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),o=JSON.stringify(this.data);s?this.fs.writeFileSync(t,o):i?this.fs.writeFileSync(e,o):this.fs.writeFileSync(t,o)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let o=t;for(const t of i)if(o=Object(o)[t],void 0===o)return s;return o}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),o=s?this.getval(s):"";if(o)try{const t=JSON.parse(o);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,o]=/^@(.*?)\.(.*?)$/.exec(e),r=this.getval(i),h=i?"null"===r?null:r||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,o,t),s=this.setval(JSON.stringify(e),i)}catch(e){const r={};this.lodash_set(r,o,t),s=this.setval(JSON.stringify(r),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()?$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)}):this.isQuanX()?$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:o,body:r}=t;e(null,{status:s,statusCode:i,headers:o,body:r},r)},t=>e(t)):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{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:o,body:r}=t;e(null,{status:s,statusCode:i,headers:o,body:r},r)},t=>e(t)))}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())$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",$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:o,body:r}=t;e(null,{status:s,statusCode:i,headers:o,body:r},r)},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:o,body:r}=t;e(null,{status:s,statusCode:i,headers:o,body:r},r)},t=>e(t))}}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="",o){const r=t=>{if(!t||!this.isLoon()&&this.isSurge())return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,r(o)):this.isQuanX()&&$notify(e,s,i,r(o)));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_bean_sign.js b/jd_bean_sign.js
index a013c92..10d51b3 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-11-09
+更新时间:2020-11-27
从 github @ruicky改写而来
version v0.0.1
create by ruicky
@@ -14,8 +14,9 @@ const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
const exec = require('child_process').execSync
const fs = require('fs')
const download = require('download');
-const path = "./result.txt";
-const JD_DailyBonusPath = "./JD_DailyBonus.js";
+let resultPath = "./result.txt";
+let JD_DailyBonusPath = "./JD_DailyBonus.js";
+let outPutUrl = './';
let cookiesArr = [], cookie = '';
if ($.isNode()) {
@@ -29,9 +30,10 @@ if ($.isNode()) {
$.msg($.name, '【提示】请先获取cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"});
return;
}
+ await requireConfig();
// 下载最新代码
await downFile();
- const content = await fs.readFileSync('./JD_DailyBonus.js', 'utf8')
+ const content = await fs.readFileSync(JD_DailyBonusPath, 'utf8')
for (let i =0; i < cookiesArr.length; i++) {
cookie = cookiesArr[i];
if (cookie) {
@@ -40,7 +42,7 @@ if ($.isNode()) {
$.nickName = '';
await TotalBean();
console.log(`*****************开始京东账号${$.index} ${$.nickName || $.UserName}京豆签到*******************\n`);
- console.log(`⚠⚠⚠⚠⚠⚠⚠⚠ 如遇到Bark APP推送通知消息失败的,请换用其他通知方式,Bark对推送内容长度有限制 ⚠⚠⚠⚠⚠⚠⚠⚠⚠\n`)
+ console.log(`⚠️⚠️⚠️⚠️目前Bark APP推送通知消息对推送内容长度有限制,如使用此推送方式脚本会默认转换成简洁内容推送 ⚠️⚠️⚠️⚠️\n`)
await changeFile(content);
await execSign();
}
@@ -52,11 +54,13 @@ async function execSign() {
console.log(`\n开始执行脚本签到,请稍等`)
try {
if (notify.SCKEY || notify.BARK_PUSH || notify.DD_BOT_TOKEN || (notify.TG_BOT_TOKEN && notify.TG_USER_ID) || notify.IGOT_PUSH_KEY) {
- await exec("node JD_DailyBonus.js >> result.txt");
+ await exec(`${process.execPath} ${JD_DailyBonusPath} >> ${resultPath}`);
+ const notifyContent = await fs.readFileSync(resultPath, "utf8");
+ console.log(`👇👇👇👇👇👇👇👇👇👇👇LOG记录👇👇👇👇👇👇👇👇👇👇👇\n${notifyContent}\n👆👆👆👆👆👆👆👆👆LOG记录👆👆👆👆👆👆👆👆👆👆👆`);
} else {
// 如果没有提供通知推送,则打印日志
console.log('没有提供通知推送,则打印脚本执行日志')
- await exec(`node JD_DailyBonus.js`, { stdio: "inherit" });
+ await exec(`${process.execPath} ${JD_DailyBonusPath}`, { stdio: "inherit" });
}
// await exec("node JD_DailyBonus.js", { stdio: "inherit" });
// console.log('执行完毕', new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleDateString())
@@ -64,11 +68,12 @@ async function execSign() {
if ($.isNode()) {
let notifyContent = "";
let BarkContent = '';
- if (fs.existsSync(path)) {
- notifyContent = await fs.readFileSync(path, "utf8");
+ if (fs.existsSync(resultPath)) {
+ notifyContent = await fs.readFileSync(resultPath, "utf8");
const barkContentStart = notifyContent.indexOf('【签到概览】')
const barkContentEnd = notifyContent.length;
if (process.env.JD_BEAN_SIGN_STOP_NOTIFY === 'true') return
+ if (notify.BARK_PUSH) process.env.JD_BEAN_SIGN_NOTIFY_SIMPLE = 'true';
if (process.env.JD_BEAN_SIGN_NOTIFY_SIMPLE === 'true') {
if (barkContentStart > -1 && barkContentEnd > -1) {
BarkContent = notifyContent.substring(barkContentStart, barkContentEnd);
@@ -90,7 +95,7 @@ async function execSign() {
}
//运行完成后,删除下载的文件
console.log('运行完成后,删除下载的文件\n')
- await deleteFile(path);//删除result.txt
+ await deleteFile(resultPath);//删除result.txt
await deleteFile(JD_DailyBonusPath);//删除JD_DailyBonus.js
console.log(`*****************京东账号${$.index} ${$.nickName || $.UserName}京豆签到完成*******************\n`);
} catch (e) {
@@ -112,7 +117,12 @@ async function downFile () {
} else {
url = 'https://cdn.jsdelivr.net/gh/NobyDa/Script@master/JD-DailyBonus/JD_DailyBonus.js';
}
- await download(url, './')
+ try {
+ await download(url, outPutUrl);
+ console.log('文件下载完毕');
+ } catch (e) {
+ console.log("文件下载异常:" + e);
+ }
}
async function changeFile (content) {
@@ -154,7 +164,7 @@ function TotalBean() {
"Connection": "keep-alive",
"Cookie": cookie,
"Referer": "https://wqs.jd.com/my/jingdou/my.shtml?sceneval=2",
- "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 14_0_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Mobile/15E148 Safari/604.1"
+ "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) => {
@@ -200,7 +210,17 @@ function downloadUrl(url = 'https://raw.githubusercontent.com/NobyDa/Script/mast
})
})
}
-
+function requireConfig() {
+ return new Promise(resolve => {
+ const file = 'jd_bean_sign.js';
+ fs.access(file, fs.constants.W_OK, (err) => {
+ resultPath = err ? '/tmp/result.txt' : resultPath;
+ JD_DailyBonusPath = err ? '/tmp/JD_DailyBonus.js' : JD_DailyBonusPath;
+ outPutUrl = err ? '/tmp/' : outPutUrl;
+ resolve()
+ });
+ })
+}
function timeFormat(time) {
let date;
if (time) {
diff --git a/jd_blueCoin.js b/jd_blueCoin.js
index 352e39c..34a85a9 100644
--- a/jd_blueCoin.js
+++ b/jd_blueCoin.js
@@ -1,7 +1,7 @@
/*
京小超兑换奖品 脚本地址:https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_blueCoin.js
感谢@yangtingxiao提供PR
-更新时间:2020-11-05
+更新时间:2020-11-23
支持京东多个账号
脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js
======================quantumultx===============
@@ -18,7 +18,7 @@ const $ = new Env('京小超兑换奖品');
const notify = $.isNode() ? require('./sendNotify') : '';
//Node.js用户请在jdCookie.js处填写京东ck;
const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
-let coinToBeans = $.getdata('coinToBeans') || 0; //兑换多少数量的京豆(20或者1000),0默认兑换不兑换,如需兑换把0改成20或者1000,或者'商品名称'(商品名称放到单引号内)即可
+let coinToBeans = $.getdata('coinToBeans') || 20; //兑换多少数量的京豆(20或者1000),0表示不兑换,默认兑换20京豆,如需兑换把0改成20或者1000,或者'商品名称'(商品名称放到单引号内)即可
let jdNotify = false;//是否开启静默运行,默认false关闭(即:奖品兑换成功后会发出通知提示)
//IOS等用户直接用NobyDa的jd cookie
let cookiesArr = [], cookie = '';
@@ -55,6 +55,7 @@ const JD_API_HOST = `https://api.m.jd.com/api?appid=jdsupermarket`;
$.nickName = '';
await TotalBean();
console.log(`\n开始【京东账号${$.index}】${$.nickName || $.UserName}\n`);
+ console.log(`目前暂无兑换酒类的奖品功能,即使输入酒类名称,脚本也会提示下架\n`)
if (!$.isLogin) {
$.msg($.name, `【提示】cookie已失效`, `京东账号${$.index} ${$.nickName || $.UserName}\n请重新登录获取\nhttps://bean.m.jd.com/`, {"open-url": "https://bean.m.jd.com/"});
@@ -73,7 +74,7 @@ const JD_API_HOST = `https://api.m.jd.com/api?appid=jdsupermarket`;
}
if (`${coinToBeans}` !== '0') {
await smtgHome();//查询蓝币数量,是否满足兑换的条件
- await smtg_queryPrize();
+ await PrizeIndex();
} else {
console.log('查询到您设置的是不兑换京豆选项,现在为您跳过兑换京豆。如需兑换,请去BoxJs设置或者修改脚本coinToBeans\n')
}
@@ -83,7 +84,131 @@ const JD_API_HOST = `https://api.m.jd.com/api?appid=jdsupermarket`;
})()
.catch((e) => $.logErr(e))
.finally(() => $.done())
-
+async function PrizeIndex() {
+ await smtg_queryPrize();
+ // await smtg_materialPrizeIndex();//兑换酒类奖品,此兑换API与之前的兑换京豆类的不一致,故目前无法进行
+ // const prizeList = [...$.queryPrizeData, ...$.materialPrizeIndex];
+ const prizeList = [...$.queryPrizeData];
+ if (`${coinToBeans}` === '1000') {
+ if (prizeList[1].beanType === 'BeanPackage') {
+ console.log(`查询换${prizeList[1].title}ID成功,ID:${prizeList[1].prizeId}`)
+ $.title = prizeList[1].title;
+ $.blueCost = prizeList[1].blueCost;
+ } else {
+ console.log(`查询换1000京豆ID失败`)
+ $.beanerr = `东哥今天不给换`;
+ return ;
+ }
+ if (prizeList[1].inStock === 506) {
+ $.beanerr = `失败,1000京豆领光了,请明天再来`;
+ return ;
+ }
+ if (prizeList[1].targetNum === prizeList[1].finishNum) {
+ $.beanerr = `${prizeList[1].subTitle}`;
+ return ;
+ }
+ //兑换1000京豆
+ if ($.totalBlue > $.blueCost) {
+ await smtg_obtainPrize(prizeList[1].prizeId);
+ } else {
+ console.log(`兑换失败,您目前蓝币${$.totalBlue}个,不足以兑换${$.title}所需的${$.blueCost}个`);
+ $.beanerr = `兑换失败,您目前蓝币${$.totalBlue}个,不足以兑换${$.title}所需的${$.blueCost}个`;
+ }
+ } else if (`${coinToBeans}` === '20') {
+ if (prizeList[0].beanType === 'Bean') {
+ console.log(`查询换${prizeList[0].title}ID成功,ID:${prizeList[0].prizeId}`)
+ $.title = prizeList[0].title;
+ $.blueCost = prizeList[0].blueCost;
+ } else {
+ console.log(`查询换万能的京豆ID失败`)
+ $.beanerr = `东哥今天不给换`;
+ return ;
+ }
+ if (prizeList[0].inStock === 506) {
+ console.log(`失败,万能的京豆领光了,请明天再来`);
+ $.beanerr = `失败,万能的京豆领光了,请明天再来`;
+ return ;
+ }
+ if (prizeList[0].targetNum === prizeList[0].finishNum) {
+ $.beanerr = `${prizeList[0].subTitle}`;
+ return ;
+ }
+ //兑换万能的京豆(1-20京豆)
+ if ($.totalBlue > $.blueCost) {
+ await smtg_obtainPrize(prizeList[0].prizeId,1000);
+ } else {
+ console.log(`兑换失败,您目前蓝币${$.totalBlue}个,不足以兑换${$.title}所需的${$.blueCost}个`);
+ $.beanerr = `兑换失败,您目前蓝币${$.totalBlue}个,不足以兑换${$.title}所需的${$.blueCost}个`;
+ }
+ } else {
+ //自定义输入兑换
+ let prizeId = '', i;
+ for (let index = 0; index < prizeList.length; index ++) {
+ if (prizeList[index].title.indexOf(coinToBeans) > -1) {
+ prizeId = prizeList[index].prizeId;
+ i = index;
+ $.title = prizeList[index].title;
+ $.blueCost = prizeList[index].blueCost;
+ }
+ }
+ if (prizeId) {
+ if (prizeList[i].inStock === 506 || prizeList[i].inStock === -1) {
+ console.log(`失败,您输入设置的${coinToBeans}领光了,请明天再来`);
+ $.beanerr = `失败,您输入设置的${coinToBeans}领光了,请明天再来`;
+ return ;
+ }
+ if ((prizeList[i].targetNum) && prizeList[i].targetNum === prizeList[i].finishNum) {
+ $.beanerr = `${prizeList[0].subTitle}`;
+ return ;
+ }
+ if ($.totalBlue > $.blueCost) {
+ await smtg_obtainPrize(prizeId);
+ } else {
+ console.log(`兑换失败,您目前蓝币${$.totalBlue}个,不足以兑换${$.title}所需的${$.blueCost}个`);
+ $.beanerr = `兑换失败,您目前蓝币${$.totalBlue}个,不足以兑换${$.title}所需的${$.blueCost}个`;
+ }
+ } else {
+ console.log(`奖品兑换列表[${coinToBeans}]已下架,请检查APP是否存在此商品,如存在请检查您的输入是否正确`);
+ $.beanerr = `奖品兑换列表[${coinToBeans}]已下架`;
+ }
+ }
+}
+//查询白酒类奖品列表API
+function smtg_materialPrizeIndex(timeout = 0) {
+ return new Promise((resolve) => {
+ setTimeout( ()=>{
+ let url = {
+ url : `${JD_API_HOST}&functionId=smtg_materialPrizeIndex&clientVersion=8.0.0&client=m&body=%7B%22channel%22:%221%22%7D&t=${Date.now()}`,
+ headers : {
+ 'Origin' : `https://jdsupermarket.jd.com`,
+ 'Cookie' : cookie,
+ 'Connection' : `keep-alive`,
+ 'Accept' : `application/json, text/plain, */*`,
+ 'Referer' : `https://jdsupermarket.jd.com/game/?tt=1597540727225`,
+ 'Host' : `api.m.jd.com`,
+ 'Accept-Encoding' : `gzip, deflate, br`,
+ 'Accept-Language' : `zh-cn`
+ }
+ }
+ $.post(url, async (err, resp, data) => {
+ try {
+ if (safeGet(data)) {
+ data = JSON.parse(data);
+ if (data.data.bizCode !== 0) {
+ $.beanerr = `${data.data.bizMsg}`;
+ return
+ }
+ $.materialPrizeIndex = data.data.result.prizes || [];
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve()
+ }
+ })
+ },timeout)
+ })
+}
//查询任务
function smtg_queryPrize(timeout = 0){
return new Promise((resolve) => {
@@ -112,89 +237,7 @@ function smtg_queryPrize(timeout = 0){
}
if (data.data.bizCode === 0) {
const { prizeList } = data.data.result;
- if (`${coinToBeans}` === '1000') {
- if (prizeList[1].beanType === 'BeanPackage') {
- console.log(`查询换${prizeList[1].title}ID成功,ID:${prizeList[1].prizeId}`)
- $.title = prizeList[1].title;
- $.blueCost = prizeList[1].blueCost;
- } else {
- console.log(`查询换1000京豆ID失败`)
- $.beanerr = `东哥今天不给换`;
- return ;
- }
- if (prizeList[1].inStock === 506) {
- $.beanerr = `失败,1000京豆领光了,请明天再来`;
- return ;
- }
- if (prizeList[1].targetNum === prizeList[1].finishNum) {
- $.beanerr = `${prizeList[1].subTitle}`;
- return ;
- }
- //兑换1000京豆
- if ($.totalBlue > $.blueCost) {
- await smtg_obtainPrize(prizeList[1].prizeId);
- } else {
- console.log(`兑换失败,您目前蓝币${$.totalBlue}个,不足以兑换${$.title}所需的${$.blueCost}个`);
- $.beanerr = `兑换失败,您目前蓝币${$.totalBlue}个,不足以兑换${$.title}所需的${$.blueCost}个`;
- }
- } else if (`${coinToBeans}` === '20') {
- if (prizeList[0].beanType === 'Bean') {
- console.log(`查询换${prizeList[0].title}ID成功,ID:${prizeList[0].prizeId}`)
- $.title = prizeList[0].title;
- $.blueCost = prizeList[0].blueCost;
- } else {
- console.log(`查询换万能的京豆ID失败`)
- $.beanerr = `东哥今天不给换`;
- return ;
- }
- if (prizeList[0].inStock === 506) {
- console.log(`失败,万能的京豆领光了,请明天再来`);
- $.beanerr = `失败,万能的京豆领光了,请明天再来`;
- return ;
- }
- if (prizeList[0].targetNum === prizeList[0].finishNum) {
- $.beanerr = `${prizeList[0].subTitle}`;
- return ;
- }
- //兑换万能的京豆(1-20京豆)
- if ($.totalBlue > $.blueCost) {
- await smtg_obtainPrize(prizeList[0].prizeId,1000);
- } else {
- console.log(`兑换失败,您目前蓝币${$.totalBlue}个,不足以兑换${$.title}所需的${$.blueCost}个`);
- $.beanerr = `兑换失败,您目前蓝币${$.totalBlue}个,不足以兑换${$.title}所需的${$.blueCost}个`;
- }
- } else {
- //自定义输入兑换
- let prizeId = '', i;
- for (let index = 0; index < prizeList.length; index ++) {
- if (prizeList[index].title.indexOf(coinToBeans) > -1) {
- prizeId = prizeList[index].prizeId;
- i = index;
- $.title = prizeList[index].title;
- $.blueCost = prizeList[index].blueCost;
- }
- }
- if (prizeId) {
- if (prizeList[i].inStock === 506) {
- console.log(`失败,您输入设置的${coinToBeans}领光了,请明天再来`);
- $.beanerr = `失败,您输入设置的${coinToBeans}领光了,请明天再来`;
- return ;
- }
- if (prizeList[i].targetNum === prizeList[i].finishNum) {
- $.beanerr = `${prizeList[0].subTitle}`;
- return ;
- }
- if ($.totalBlue > $.blueCost) {
- await smtg_obtainPrize(prizeId);
- } else {
- console.log(`兑换失败,您目前蓝币${$.totalBlue}个,不足以兑换${$.title}所需的${$.blueCost}个`);
- $.beanerr = `兑换失败,您目前蓝币${$.totalBlue}个,不足以兑换${$.title}所需的${$.blueCost}个`;
- }
- } else {
- console.log(`奖品兑换列表[${coinToBeans}]已下架,请检查APP是否存在此商品,如存在请检查您的输入是否正确`);
- $.beanerr = `奖品兑换列表[${coinToBeans}]已下架`;
- }
- }
+ $.queryPrizeData = data.data.result.prizeList || [];
}
}
} catch (e) {
@@ -321,7 +364,7 @@ function TotalBean() {
"Connection": "keep-alive",
"Cookie": cookie,
"Referer": "https://wqs.jd.com/my/jingdou/my.shtml?sceneval=2",
- "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 14_0_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Mobile/15E148 Safari/604.1"
+ "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) => {
@@ -364,7 +407,7 @@ function taskUrl(function_id, body = {}) {
return {
url: `${JD_API_HOST}&functionId=${function_id}&clientVersion=8.0.0&client=m&body=${escape(JSON.stringify(body))}&t=${Date.now()}`,
headers: {
- 'User-Agent': 'jdapp;iPhone;9.0.8;13.6;Mozilla/5.0 (iPhone; CPU iPhone OS 13_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
+ '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',
'Cookie': cookie,
'Referer': 'https://jdsupermarket.jd.com/game',
diff --git a/jd_car.js b/jd_car.js
new file mode 100644
index 0000000..7c91bdc
--- /dev/null
+++ b/jd_car.js
@@ -0,0 +1,321 @@
+/*
+京东汽车,签到满500赛点可兑换500京豆,一天运行一次即可
+长期活动
+活动入口:首页👉京东汽车👉屏幕右中部,车主福利
+更新地址:https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_car.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_car.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_car.js, tag=京东汽车
+
+===============Surge=================
+京东汽车 = type=cron,cronexp="10 7 * * *",wake-system=1,timeout=20,script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_car.js
+
+============小火箭=========
+京东汽车 = type=cron,script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_car.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 {
+ cookiesArr.push(...[$.getdata('CookieJD'), $.getdata('CookieJD2')]);
+}
+const JD_API_HOST = 'https://car-member.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`);
+ } else {
+ $.setdata('', `CookieJD${i ? i + 1 : ""}`);//cookie失效,故清空cookie。$.setdata('', `CookieJD${i ? i + 1 : "" }`);//cookie失效,故清空cookie。
+ }
+ continue
+ }
+ await jdCar();
+ await showMsg();
+ }
+ }
+})()
+ .catch((e) => {
+ $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '')
+ })
+ .finally(() => {
+ $.done();
+ })
+
+async function jdCar() {
+ await sign()
+ await $.wait(1000)
+ await mission()
+ await $.wait(1000)
+ await getPoint()
+}
+
+function showMsg() {
+ return new Promise(resolve => {
+ $.msg($.name, '', `【京东账号${$.index}】${$.nickName}\n${message}`);
+ resolve()
+ })
+}
+
+function sign() {
+ return new Promise(resolve => {
+ $.post(taskUrl('v1/user/sign'), (err, resp, data) => {
+ try {
+ if (err) {
+ data = JSON.parse(resp.body)
+ console.log(`${data.error.msg}`)
+ message += `签到失败,${data.error.msg}\n`
+ } else {
+ if (safeGet(data)) {
+ data = JSON.parse(data);
+ if (data.status) {
+ console.log(`签到成功,获得${data.data.point},已签到${data.data.signDays}天`)
+ message += `签到成功,获得${data.data.point},已签到${data.data.signDays}天\n`
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+
+function mission() {
+ return new Promise(resolve => {
+ $.get(taskUrl('v1/user/mission'), 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.status) {
+ let missions = data.data.missionList
+ for (let i = 0; i < missions.length; ++i) {
+ const mission = missions[i]
+ if (mission['missionStatus'] === 0 && (mission['missionType'] === 1 || mission['missionType'] === 5)) {
+ console.log(`去做任务:${mission['missionName']}`)
+ await doMission(mission['missionId'])
+ await $.wait(1000) // 等待防黑
+ }
+ }
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+
+function doMission(missionId) {
+ return new Promise(resolve => {
+ $.post(taskPostUrl('v1/game/mission', {"missionId": missionId}), async (err, resp, data) => {
+ try {
+ if (err) {
+ data = JSON.parse(resp.body)
+ console.log(`${data.error.msg}`)
+ } else {
+ if (safeGet(data)) {
+ data = JSON.parse(data);
+ if (data.status) {
+ console.log("任务领取成功")
+ await receiveMission(missionId)
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+
+function receiveMission(missionId) {
+ return new Promise(resolve => {
+ $.post(taskPostUrl('v1/user/mission/receive', {"missionId": missionId}), async (err, resp, data) => {
+ try {
+ if (err) {
+ data = JSON.parse(resp.body)
+ console.log(`${data.error.msg}`)
+ } else {
+ if (safeGet(data)) {
+ data = JSON.parse(data);
+ if (data.status) {
+ console.log("任务完成成功")
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+
+function getPoint() {
+ return new Promise(resolve => {
+ $.get(taskUrl('v1/user/point'), async (err, resp, data) => {
+ try {
+ if (err) {
+ data = JSON.parse(resp.body)
+ console.log(`${data.error.msg}`)
+ } else {
+ if (safeGet(data)) {
+ data = JSON.parse(data);
+ if (data.status) {
+ if (data.data.remainPoint >= data.data.oncePoint) {
+ console.log(`当前赛点:${data.data.remainPoint}/${data.data.oncePoint},可以兑换京豆,请打开APP兑换`)
+ message += `当前赛点:${data.data.remainPoint}/${data.data.oncePoint},可以兑换京豆,请打开APP兑换\n`
+ }else{
+ console.log(`当前赛点:${data.data.remainPoint}/${data.data.oncePoint}无法兑换京豆`)
+ message += `当前赛点:${data.data.remainPoint}/${data.data.oncePoint},无法兑换京豆\n`
+ }
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+
+function taskUrl(function_id, body = {}) {
+ return {
+ url: `${JD_API_HOST}${function_id}?timestamp=${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": "car-member.jd.com",
+ "Referer": "https://h5.m.jd.com/babelDiy/Zeus/44bjzCpzH9GpspWeBzYSqBA7jEtP/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 taskPostUrl(function_id, body = {}) {
+ return {
+ url: `${JD_API_HOST}${function_id}?timestamp=${new Date().getTime() + new Date().getTimezoneOffset() * 60 * 1000 + 8 * 60 * 60 * 1000}`,
+ body: JSON.stringify(body),
+ headers: {
+ "Accept": "*/*",
+ "Accept-Encoding": "gzip, deflate, br",
+ "Accept-Language": "zh-cn",
+ "Connection": "keep-alive",
+ "Content-Type": "application/json;charset=UTF-8",
+ "Host": "car-member.jd.com",
+ "activityid": "39443aee3ff74fcb806a6f755240d127",
+ "Referer": "https://h5.m.jd.com/babelDiy/Zeus/44bjzCpzH9GpspWeBzYSqBA7jEtP/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;
+ }
+}
+
+// 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_club_lottery.js b/jd_club_lottery.js
index d21a5a2..bf13da4 100644
--- a/jd_club_lottery.js
+++ b/jd_club_lottery.js
@@ -2,7 +2,7 @@
* @Author: lxk0301
* @Date: 2020-11-03 20:35:07
* @Last Modified by: lxk0301
- * @Last Modified time: 2020-10-12 20:37:10
+ * @Last Modified time: 2020-11-23 12:27:09
摇京豆(京东APP首页-领京豆-摇京豆)
更新时间:2020-10-12
Modified from https://github.com/Zero-S1/JD_tools/blob/master/JD_vvipclub.py
@@ -78,6 +78,8 @@ const JD_API_HOST = 'https://api.m.jd.com/client.action';
async function clubLottery() {
await doTasks();//做任务
await getFreeTimes();//获取摇奖次数
+ await vvipclub_receive_lottery_times();//新版:领取一次免费的机会
+ await vvipclub_shaking_info();//新版:查询多少次摇奖次数
await shaking();//开始摇奖
}
async function doTasks() {
@@ -121,6 +123,20 @@ async function doTasks() {
}
}
async function shaking() {
+ for (let i = 0; i < new Array($.leftShakingTimes).fill('').length; i++) {
+ console.log(`开始新版-摇奖`)
+ // await $.wait(500);
+ const newShakeBeanRes = await vvipclub_shaking_lottery();
+ if (newShakeBeanRes.success) {
+ console.log(`新版-剩余摇奖次数:${newShakeBeanRes.data.remainLotteryTimes}`)
+ if (newShakeBeanRes.data && newShakeBeanRes.data.rewardBeanAmount) {
+ $.prizeBeanCount += newShakeBeanRes.data.rewardBeanAmount;
+ console.log(`恭喜你,中奖了,获得${newShakeBeanRes.data.rewardBeanAmount}京豆\n`)
+ } else {
+ console.log(`未中奖\n`)
+ }
+ }
+ }
for (let i = 0; i < new Array($.freeTimes).fill('').length; i++) {
console.log(`开始摇奖`)
await $.wait(1000);
@@ -140,6 +156,106 @@ function showMsg() {
}
}
//====================API接口=================
+//查询剩余摇奖次数API
+function vvipclub_shaking_info() {
+ return new Promise(resolve => {
+ const options = {
+ url: `https://api.m.jd.com/?t=${Date.now()}&appid=sharkBean&functionId=vvipclub_shaking_info`,
+ headers: {
+ "accept": "application/json",
+ "accept-encoding": "gzip, deflate, br",
+ "accept-language": "zh-CN,zh;q=0.9",
+ "cookie": cookie,
+ "origin": "https://skuivip.jd.com",
+ "referer": "https://skuivip.jd.com/",
+ "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")
+ }
+ }
+ $.get(options, (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`\n${$.name}: API查询请求失败 ‼️‼️`)
+ $.logErr(err);
+ } else {
+ // console.log(data)
+ data = JSON.parse(data);
+ if (data.success) {
+ $.leftShakingTimes = data.data.leftShakingTimes;//剩余抽奖次数
+ console.log(`新版——摇奖次数${$.leftShakingTimes}`);
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+//新版摇奖API
+function vvipclub_shaking_lottery() {
+ return new Promise(resolve => {
+ const options = {
+ url: `https://api.m.jd.com/?t=${Date.now()}&appid=sharkBean&functionId=vvipclub_shaking_lottery&body=%7B%7D`,
+ headers: {
+ "accept": "application/json",
+ "accept-encoding": "gzip, deflate, br",
+ "accept-language": "zh-CN,zh;q=0.9",
+ "cookie": cookie,
+ "origin": "https://skuivip.jd.com",
+ "referer": "https://skuivip.jd.com/",
+ "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")
+ }
+ }
+ $.get(options, (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`\n${$.name}: API查询请求失败 ‼️‼️`)
+ $.logErr(err);
+ } else {
+ // console.log(data)
+ data = JSON.parse(data);
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+//领取新版本摇一摇一次免费的次数
+function vvipclub_receive_lottery_times() {
+ return new Promise(resolve => {
+ const options = {
+ url: `https://api.m.jd.com/?t=${Date.now()}&appid=sharkBean&functionId=vvipclub_receive_lottery_times`,
+ headers: {
+ "accept": "application/json",
+ "accept-encoding": "gzip, deflate, br",
+ "accept-language": "zh-CN,zh;q=0.9",
+ "cookie": cookie,
+ "origin": "https://skuivip.jd.com",
+ "referer": "https://skuivip.jd.com/",
+ "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")
+ }
+ }
+ $.get(options, (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`\n${$.name}: API查询请求失败 ‼️‼️`)
+ $.logErr(err);
+ } else {
+ // console.log(data)
+ data = JSON.parse(data);
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
//查询多少次机会
function getFreeTimes() {
return new Promise(resolve => {
@@ -233,7 +349,7 @@ function TotalBean() {
"Connection": "keep-alive",
"Cookie": cookie,
"Referer": "https://wqs.jd.com/my/jingdou/my.shtml?sceneval=2",
- "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 14_0_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Mobile/15E148 Safari/604.1"
+ "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) => {
@@ -261,13 +377,13 @@ function TotalBean() {
})
})
}
-function taskUrl(function_id, body = {}) {
+function taskUrl(function_id, body = {}, appId = 'vip_h5') {
return {
- url: `${JD_API_HOST}?functionId=${function_id}&appid=vip_h5&body=${escape(JSON.stringify(body))}&_=${Date.now()}`,
+ url: `${JD_API_HOST}?functionId=${function_id}&appid=${appId}&body=${escape(JSON.stringify(body))}&_=${Date.now()}`,
headers: {
'Cookie': cookie,
'Host': 'api.m.jd.com',
- '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`,
+ '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"),
'Referer': 'https://vip.m.jd.com/newPage/reward/123dd/slideContent?page=focus',
}
}
diff --git a/jd_collectProduceScore.js b/jd_collectProduceScore.js
index a49766f..b34f2c5 100644
--- a/jd_collectProduceScore.js
+++ b/jd_collectProduceScore.js
@@ -124,7 +124,7 @@ function taskPostUrl(functionId, body = {}) {
url: `${JD_API_HOST}?functionId=${functionId}`,
body: `functionId=${functionId}&body=${escape(JSON.stringify(body))}&client=wh5&clientVersion=1.0.0`,
headers: {
- 'User-Agent': 'jdapp;iPhone;9.2.0;14.1;;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 14_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
+ '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',
'Host': 'api.m.jd.com',
'Cookie': cookie,
diff --git a/jd_daily_egg.js b/jd_daily_egg.js
index 60dd668..b19ac6b 100644
--- a/jd_daily_egg.js
+++ b/jd_daily_egg.js
@@ -1,3 +1,9 @@
+/*
+ * @Author: lxk0301 https://github.com/lxk0301
+ * @Date: 2020-11-10 14:10:27
+ * @Last Modified by: lxk0301
+ * @Last Modified time: 2020-11-20 14:11:01
+ */
/*
京东金融-天天提鹅
定时收鹅蛋,兑换金币
@@ -8,7 +14,6 @@ const $ = new Env('天天提鹅');
let cookiesArr = [], cookie = '';
const JD_API_HOST = 'https://ms.jr.jd.com/gw/generic/uc/h5/m';
const notify = $.isNode() ? require('./sendNotify') : '';
-let jdNotify = false;//是否开启推送互助码
//Node.js用户请在jdCookie.js处填写京东ck;
const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
if ($.isNode()) {
@@ -43,11 +48,6 @@ if ($.isNode()) {
}
continue
}
- message = '';
- subTitle = '';
- goodsUrl = '';
- taskInfoKey = [];
- option = {};
await jdDailyEgg();
}
}
@@ -175,7 +175,7 @@ function TotalBean() {
"Connection": "keep-alive",
"Cookie": cookie,
"Referer": "https://wqs.jd.com/my/jingdou/my.shtml?sceneval=2",
- "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 14_0_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Mobile/15E148 Safari/604.1"
+ "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) => {
@@ -215,7 +215,7 @@ function taskUrl(function_id, body) {
'Content-Type' : `application/x-www-form-urlencoded;charset=UTF-8`,
'Host' : `ms.jr.jd.com`,
'Connection' : `keep-alive`,
- 'User-Agent' : `jdapp;iPhone;9.0.0;13.4.1;e35caf0a69be42084e3c97eef56c3af7b0262d01;network/4g;ADID/F75E8AED-CB48-4EAC-A213-E8CE4018F214;supportApplePay/3;hasUPPay/0;pushNoticeIsOpen/1;model/iPhone11,8;addressid/2005183373;hasOCPay/0;appBuild/167237;supportBestPay/0;jdSupportDarkMode/0;pv/1287.19;apprpd/MyJD_GameMain;ref/https%3A%2F%2Fuua.jr.jd.com%2Fuc-fe-wxgrowing%2Fmoneytree%2Findex%2F%3Fchannel%3Dyxhd%26lng%3D113.325843%26lat%3D23.204628%26sid%3D2d98e88cf7d182f60d533476c2ce777w%26un_area%3D19_1601_50258_51885;psq/1;ads/;psn/e35caf0a69be42084e3c97eef56c3af7b0262d01|3485;jdv/0|kong|t_1000170135|tuiguang|notset|1593059927172|1593059927;adk/;app_device/IOS;pap/JA2015_311210|9.0.0|IOS 13.4.1;Mozilla/5.0 (iPhone; CPU iPhone OS 13_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1`,
+ '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"),
'Referer' : `https://uua.jr.jd.com/uc-fe-wxgrowing/moneytree/index`,
'Accept-Language' : `zh-cn`
}
diff --git a/jd_digital_floor.js b/jd_digital_floor.js
new file mode 100644
index 0000000..8763900
--- /dev/null
+++ b/jd_digital_floor.js
@@ -0,0 +1,393 @@
+/*
+数码加购京豆
+共计25京豆,一天运行一次即可
+活动时间:2020-12-4 到 2020-12-11
+活动入口:https://prodev.m.jd.com/mall/active/nKxVyPnuLwAsQSTfidZ9z4RKVZy/index.html#/
+更新地址:https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_digital_floor.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_digital_floor.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_digital_floor.js, tag=数码加购京豆
+
+===============Surge=================
+数码加购京豆 = type=cron,cronexp="10 7 * * *",wake-system=1,timeout=20,script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_digital_floor.js
+
+============小火箭=========
+数码加购京豆 = type=cron,script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_digital_floor.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;
+const inviteCodes = [`40cd108f-9eed-4897-b795-45a5b221cd6b@49efb480-d6d7-456b-a4e0-14b170b161e0@`,'9d4262a5-1a02-4ae7-8a86-8d070d531464@687b14e0-ce0a-45eb-bf46-71aa0da05f18'];
+//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 {
+ cookiesArr.push(...[$.getdata('CookieJD'), $.getdata('CookieJD2')]);
+}
+const JD_API_HOST = 'https://digital-floor.m.jd.com/adf/index/';
+!(async () => {
+ await requireConfig()
+ 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`);
+ } else {
+ $.setdata('', `CookieJD${i ? i + 1 : "" }`);//cookie失效,故清空cookie。$.setdata('', `CookieJD${i ? i + 1 : "" }`);//cookie失效,故清空cookie。
+ }
+ continue
+ }
+ await shareCodesFormat()
+ await jdDigitalFloor()
+ }
+ }
+})()
+ .catch((e) => {
+ $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '')
+ })
+ .finally(() => {
+ $.done();
+ })
+async function jdDigitalFloor() {
+ $.bean = 0
+ await helpFriends()
+ await getUserInfo()
+ await getTaskList()
+ await showMsg()
+}
+async function helpFriends() {
+ for (let code of $.newShareCodes) {
+ if (!code) continue
+ let res = await doSupport(code);
+ await $.wait(500)
+ if (res===5) {
+ // 助力次数已用完
+ break
+ }
+ }
+}
+function doSupport(shareId) {
+ return new Promise(resolve => {
+ $.post(taskPostUrl('doSupport',`shareId=${shareId}`), 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 === 200) {
+ console.log(`助力好友${shareId}成功`)
+ await supportCheck(shareId)
+ }else{
+ console.log(`助力好友失败,${data.msg}`)
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data.data);
+ }
+ })
+ })
+}
+function supportCheck(shareId) {
+ return new Promise(resolve => {
+ $.post(taskPostUrl('supportCheck',`shareId=${shareId}`), (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 === 200) {
+ console.log(`检查助力,助力好友${shareId}成功`)
+ }else{
+ console.log(`检查助力失败,${data.msg}`)
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+function showMsg() {
+ return new Promise(resolve => {
+ $.msg($.name, '', `【京东账号${$.index}】${$.nickName}\n${message}`);
+ resolve()
+ })
+}
+function getUserInfo() {
+ return new Promise(resolve => {
+ $.get(taskUrl('shareInfo'), 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 === 200) {
+ $.shareId = data.data.shareId
+ console.log(`\n您的${$.name}好友助力邀请码:${data.data.shareId}\n`)
+ message += `\n您的${$.name}好友助力邀请码:${data.data.shareId}\n`
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+function getTaskList() {
+ return new Promise(resolve => {
+ $.get(taskUrl('indexInfo'), 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 === 200) {
+ const tasks = data.data
+ for(let i = 0; i < tasks.length; ++i){
+ const task = tasks[i]
+ console.log(`去加购物车:${task['skuName']}`)
+ await browseSku(task['skuId'])
+ }
+ message += `共获得${$.bean}个京豆\n`
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+function getPrize(skuId) {
+ return new Promise(resolve => {
+ $.post(taskPostUrl('getPrize',`skuId=${skuId}`), (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 === 200) {
+ $.bean += data.data
+ console.log(`任务领奖成功,获得${data.data}个京豆`)
+ }else{
+ console.log(`任务领奖失败,${data.msg}`)
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+function browseSku(skuId) {
+ return new Promise(resolve => {
+ $.post(taskPostUrl('browseSku',`skuId=${skuId}`), 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 === 200) {
+ console.log(`任务领取成功`)
+ await $.wait(5000)
+ await getPrize(skuId)
+ } else{
+ console.log(data)
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+//格式化助力码
+function shareCodesFormat() {
+ return new Promise(async resolve => {
+ // console.log(`第${$.index}个京东账号的助力码:::${$.shareCodesArr[$.index - 1]}`)
+ $.newShareCodes = [];
+ if ($.shareCodesArr[$.index - 1]) {
+ $.newShareCodes = $.shareCodesArr[$.index - 1].split('@');
+ } else {
+ console.log(`由于您第${$.index}个京东账号未提供shareCode,将采纳本脚本自带的助力码\n`)
+ const tempIndex = $.index > inviteCodes.length ? (inviteCodes.length - 1) : ($.index - 1);
+ $.newShareCodes = inviteCodes[tempIndex].split('@');
+ }
+ const readShareCodeRes = null //await readShareCode();
+ if (readShareCodeRes && readShareCodeRes.code === 200) {
+ $.newShareCodes = [...new Set([...$.newShareCodes, ...(readShareCodeRes.data || [])])];
+ }
+ console.log(`第${$.index}个京东账号将要助力的好友${JSON.stringify($.newShareCodes)}`)
+ resolve();
+ })
+}
+function requireConfig() {
+ return new Promise(resolve => {
+ console.log(`开始获取${$.name}配置文件\n`);
+ //Node.js用户请在jdCookie.js处填写京东ck;
+ const shareCodes = [] //$.isNode() ? require('./jdSplitShareCodes.js') : '';
+ console.log(`共${cookiesArr.length}个京东账号\n`);
+ $.shareCodesArr = [];
+ if ($.isNode()) {
+ Object.keys(shareCodes).forEach((item) => {
+ if (shareCodes[item]) {
+ $.shareCodesArr.push(shareCodes[item])
+ }
+ })
+ }
+ console.log(`您提供了${$.shareCodesArr.length}个账号的${$.name}助力码\n`);
+ resolve()
+ })
+}
+function taskPostUrl(function_id, body) {
+ return {
+ url: `${JD_API_HOST}${function_id}?t=${new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000}`,
+ body: body,
+ headers: {
+ 'Host': 'digital-floor.m.jd.com',
+ 'pragma': 'no-cache',
+ 'cache-control': 'no-cache',
+ 'accept': 'application/json, text/plain, */*',
+ 'dnt': '1',
+ 'content-type': 'application/x-www-form-urlencoded',
+ 'origin': 'https://pro.m.jd.com',
+ 'sec-fetch-site': 'same-site',
+ 'sec-fetch-mode': 'cors',
+ 'sec-fetch-dest': 'empty',
+ 'referer': 'https://pro.m.jd.com/',
+ 'accept-language': 'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6',
+ 'Cookie': cookie,
+ 'user-agent': 'jdapp;iPhone;9.2.0;14.0;53f4d9c70c1c81f1c8769d2fe2fef0190a3f60d2;network/wifi;supportApplePay/3;hasUPPay/1;pushNoticeIsOpen/0;model/iPhone10,2;addressid/138413818;hasOCPay/0;appBuild/167408;supportBestPay/1;jdSupportDarkMode/0;pv/1710.16;apprpd/WorthBuy_List;ref/JDWebViewController;psq/2;ads/;psn/53f4d9c70c1c81f1c8769d2fe2fef0190a3f60d2|5870;jdv/0|kong|t_1000089893_|tuiguang|9a75f97593f344eb9c46b99e196608d2|1605846323;adk/;app_device/IOS;pap/JA2015_311210|9.2.0|IOS 14.0;Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',}
+ }
+}
+function taskUrl(function_id) {
+ return {
+ url: `${JD_API_HOST}${function_id}?t=${new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000}`,
+ headers: {
+ 'Host': 'digital-floor.m.jd.com',
+ 'pragma': 'no-cache',
+ 'cache-control': 'no-cache',
+ 'accept': 'application/json, text/plain, */*',
+ 'dnt': '1',
+ 'content-type': 'application/x-www-form-urlencoded',
+ 'origin': 'https://pro.m.jd.com',
+ 'sec-fetch-site': 'same-site',
+ 'sec-fetch-mode': 'cors',
+ 'sec-fetch-dest': 'empty',
+ 'referer': 'https://pro.m.jd.com/',
+ 'accept-language': 'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6',
+ 'Cookie': cookie,
+ 'user-agent': 'jdapp;iPhone;9.2.0;14.0;53f4d9c70c1c81f1c8769d2fe2fef0190a3f60d2;network/wifi;supportApplePay/3;hasUPPay/1;pushNoticeIsOpen/0;model/iPhone10,2;addressid/138413818;hasOCPay/0;appBuild/167408;supportBestPay/1;jdSupportDarkMode/0;pv/1710.16;apprpd/WorthBuy_List;ref/JDWebViewController;psq/2;ads/;psn/53f4d9c70c1c81f1c8769d2fe2fef0190a3f60d2|5870;jdv/0|kong|t_1000089893_|tuiguang|9a75f97593f344eb9c46b99e196608d2|1605846323;adk/;app_device/IOS;pap/JA2015_311210|9.2.0|IOS 14.0;Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 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;
+ }
+}
+// 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_dreamFactory.js b/jd_dreamFactory.js
index 29b6119..ccb4640 100644
--- a/jd_dreamFactory.js
+++ b/jd_dreamFactory.js
@@ -1,265 +1,1439 @@
/*
京东京喜工厂
-未完,待续
+更新时间:2020-12-07
+活动入口 :京东APP->游戏与互动->查看更多->京喜工厂
+或者: 京东APP首页搜索 "玩一玩" ,造物工厂即可
+
+
+已支持IOS双京东账号,Node.js支持N个京东账号
+脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js
+============Quantumultx===============
+[task_local]
+#京喜工厂
+10 * * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_dreamFactory.js, tag=京喜工厂, enabled=true
+
+================Loon==============
+[Script]
+cron "10 * * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_dreamFactory.js,tag=京喜工厂
+
+===============Surge=================
+京喜工厂 = type=cron,cronexp="10 * * * *",wake-system=1,timeout=20,script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_dreamFactory.js
+
+============小火箭=========
+京喜工厂 = type=cron,script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_dreamFactory.js, cronexpr="10 * * * *", timeout=200, enable=true
+
*/
-const $hammer = (() => {
- const isRequest = "undefined" != typeof $request,
- isSurge = "undefined" != typeof $httpClient,
- isQuanX = "undefined" != typeof $task;
- const log = (...n) => { for (let i in n) console.log(n[i]) };
- const alert = (title, body = "", subtitle = "", link = "", option) => {
- if (isSurge) return $notification.post(title, subtitle, body, link);
- if (isQuanX) return $notify(title, subtitle, (link && !body ? link : body), option);
- log("==============📣系统通知📣==============");
- log("title:", title, "subtitle:", subtitle, "body:", body, "link:", link);
+
+const $ = new Env('京喜工厂');
+const JD_API_HOST = 'https://m.jingxi.com';
+
+const notify = $.isNode() ? require('./sendNotify') : '';
+let jdNotify = true;//是否关闭通知,false打开通知推送,true关闭通知推送
+const randomCount = $.isNode() ? 20 : 5;
+const tuanActiveId = `jfkcidGQavswLOBcAWljrw==`;
+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=="];
+const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
+if ($.isNode()) {
+ Object.keys(jdCookieNode).forEach((item) => {
+ cookiesArr.push(jdCookieNode[item])
+ })
+ if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {
};
- const read = key => {
- if (isSurge) return $persistentStore.read(key);
- if (isQuanX) return $prefs.valueForKey(key);
- },
- write = (key, val) => {
- if (isSurge) return $persistentStore.write(key, val);
- if (isQuanX) return $prefs.setValueForKey(key, val);
- };
- const request = (method, params, callback) => {
- /**
- *
- * params(