Merge pull request #24 from lxk0301/master

Master
This commit is contained in:
any
2021-01-11 10:30:48 +08:00
committed by GitHub
16 changed files with 1142 additions and 110 deletions

View File

@@ -71,12 +71,15 @@ jobs:
if [ $DREAM_FACTORY_SHARE_CODES ]; then sed -i "/variables/a\ DREAM_FACTORY_SHARE_CODES: $DREAM_FACTORY_SHARE_CODES" serverless.yml; fi;
if [ $JDZZ_SHARECODES ]; then sed -i "/variables/a\ JDZZ_SHARECODES: $JDZZ_SHARECODES" serverless.yml; fi;
if [ $JDJOY_SHARECODES ]; then sed -i "/variables/a\ JDJOY_SHARECODES: $JDJOY_SHARECODES" serverless.yml; fi;
if [ $JXNC_SHARECODES ]; then sed -i "/variables/a\ JXNC_SHARECODES: $JXNC_SHARECODES" serverless.yml; fi;
if [ $BOOKSHOP_SHARECODES ]; then sed -i "/variables/a\ BOOKSHOP_SHARECODES: $BOOKSHOP_SHARECODES" 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;
if [ $WATCH_ACCEPTBODY ]; then sed -i "/variables/a\ WATCH_ACCEPTBODY: $WATCH_ACCEPTBODY" serverless.yml; fi;
if [ $WATCH_DOBODY ]; then sed -i "/variables/a\ WATCH_DOBODY: $WATCH_DOBODY" serverless.yml; fi;
if [ $JXNCTOKENS ]; then sed -i "/variables/a\ JXNCTOKENS: $JXNCTOKENS" serverless.yml; fi;
cat serverless.yml
env
env: #因为直接读取secrets里面的值很多字符不会自动转译导致写入serverless.yml异常所以设置到环境变量在读取环境变量转译过的值
@@ -126,12 +129,15 @@ jobs:
DREAM_FACTORY_SHARE_CODES: ${{ secrets.DREAM_FACTORY_SHARE_CODES}}
JDZZ_SHARECODES: ${{ secrets.JDZZ_SHARECODES}}
JDJOY_SHARECODES: ${{ secrets.JDJOY_SHARECODES}}
JXNC_SHARECODES: ${{ secrets.JXNC_SHARECODES}}
BOOKSHOP_SHARECODES: ${{ secrets.BOOKSHOP_SHARECODES}}
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}}
WATCH_ACCEPTBODY: ${{ secrets.WATCH_ACCEPTBODY}}
WATCH_DOBODY: ${{ secrets.WATCH_DOBODY}}
JXNCTOKENS: ${{ secrets.JXNCTOKENS}}
- name: "部署到腾讯云函数"
run: serverless deploy

View File

@@ -22,42 +22,52 @@
## Script脚本列表
#### 说明
1. 其中 [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)
2. 短期任务仅在特定时间有效请自行在京东APP上查阅恕不再另行说明
2. 以字母排序
| 活动时长 | 名称 | 脚本 |
| ---- | ------------------------------ | -------------------------------------------------------------------------------------------------------- |
| 长期 | 疯狂的joy | [jd_crazy_joy.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_crazy_joy.js) |
| 长期 | 京豆变动通知 | [jd_bean_change.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_bean_change.js) |
| 长期 | 京东多合一签到 | [jd_bean_sign.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_bean_sign.js) |
| 长期 | 东东超市兑换奖品 | [jd_blueCoin.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_blueCoin.js) |
| 长期 | 摇京豆 | [jd_club_lottery.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_club_lottery.js) |
| 长期 | 东东农场 | [jd_fruit.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_fruit.js) |
| 长期 | 宠汪汪 | [jd_joy.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_joy.js) |
| 长期 | 宠汪汪单独喂食 | [jd_joy_feedPets.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_joy_feedPets.js) |
| 长期 | 宠汪汪强制为好友助力iOS端专用 | [jd_joy_help.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_joy_help.js) |
| 长期 | 宠汪汪聚宝盆辅助脚本(iOS端专用) | [jd_petTreasureBox.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_petTreasureBox.js) |
| 长期 | 宠汪汪兑换奖品 | [jd_joy_reward.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_joy_reward.js) |
| 长期 | 宠汪汪赛跑助力 | [jd_joy_run.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_joy_run.js) |
| 长期 | 宠汪汪偷好友狗粮与积分 | [jd_joy_steal.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_joy_steal.js) |
| 长期 | 摇钱树 | [jd_moneyTree.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_moneyTree.js) |
| 长期 | 东东萌宠 | [jd_pet.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_pet.js) |
| 长期 | 金融养猪 | [jd_pigPet.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_pigPet.js) |
| 长期 | 天天提鹅 | [jd_daily_egg.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_daily_egg.js) |
| 长期 | 种豆得豆 | [jd_plantBean.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_plantBean.js) |
| 长期 | 全民开红包 | [jd_redPacket.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_redPacket.js) |
| 长期 | 进店领豆 | [jd_shop.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_shop.js) |
| 长期 | 天天加速 | [jd_speed.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_speed.js) |
| 长期 | 京东快递 | [jd_kd.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_kd.js) |
| 长期 | 东东超市 | [jd_superMarket.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_superMarket.js) |
| 长期 | 京喜工厂 | [jd_dreamFactory.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_dreamFactory.js) |
| 长期 | 东东工厂 | [jd_jdfactory.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_jdfactory.js) |
| 长期 | 东东小窝 | [jd_small_home.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_small_home.js) |
| 长期 | 点点券 | [jd_necklace.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_necklace.js) |
| 长期 | 十元街 | [jd_syj.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_syj.js) |
| 长期 | 京东代属 | [jd_ds.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_ds.js) |
| 长期 | 取关京东店铺和商品 | [jd_unsubscribe.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_unsubscribe.js) |
| | 星推官 | [jd_xtg.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_xtg.js) |
| | 手机狂欢城 | [jd_818.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_818.js) |
| 活动时长 | 名称 | 脚本 |
| -------- | --------------------------------- | -------------------------------------------------------------------------------------------------------- |
| 长期 | 京豆变动通知 | [jd_bean_change.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_bean_change.js) |
| 长期 | 京豆额外奖励&抢京豆 | [jd_bean_home.js](https://raw.githubusercontent.com/lxk0302/jd_scripts/master/jd_bean_home.js) |
| 长期 | 京东多合一签到 | [jd_bean_sign.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_bean_sign.js) |
| 长期 | 东东超市兑换奖品 | [jd_blueCoin.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_blueCoin.js) |
| 长期 | 口袋书店 | [jd_bookshop.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_bookshop.js) |
| 长期 | 京东汽车赛点兑换京豆 | [jd_car_exchange.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_car_exchange.js) |
| 长期 | 京东汽车签到 | [jd_car.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_car.js) |
| 长期 | 摇京豆 | [jd_club_lottery.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_club_lottery.js) |
| 长期 | 疯狂的JOY挂机 | [jd_crazy_joy_coin.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_crazy_joy_coin.js) |
| 长期 | 疯狂的JOY日常任务 | [jd_crazy_joy.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_crazy_joy.js) |
| 长期 | 京东金融-天天提鹅 | [jd_daily_egg.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_daily_egg.js) |
| 长期 | 京喜工厂 | [jd_dreamFactory.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_dreamFactory.js) |
| 长期 | 东东农场 | [jd_fruit.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_fruit.js) |
| 长期 | 宠汪汪 | [jd_joy.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_joy.js) |
| 长期 | 获取所有互助码 | [jd_get_share_code.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_get_share_code.js) |
| 长期 | 东东工厂 | [jd_jdfactory.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_jdfactory.js) |
| 长期 | 京东赚赚 | [jd_jdzz.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_jdzz.js) |
| 长期 | 宠汪汪单独喂食 | [jd_joy_feedPets.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_joy_feedPets.js) |
| 长期 | 宠汪汪强制为好友助力iOS端专用 | [jd_joy_help.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_joy_help.js) |
| 长期 | 宠汪汪聚宝盆辅助脚本iOS端专用 | [jd_petTreasureBox.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_petTreasureBox.js) |
| 长期 | 宠汪汪兑换奖品 | [jd_joy_reward.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_joy_reward.js) |
| 长期 | 宠汪汪赛跑助力 | [jd_joy_run.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_joy_run.js) |
| 长期 | 宠汪汪偷好友狗粮与积分 | [jd_joy_steal.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_joy_steal.js) |
| 长期 | 宠汪汪 | [jd_joy.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_joy.js) |
| 长期 | 京喜农场 | [jd_jxnc.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_jxnc.js) |
| 长期 | 京东快递签到 | [jd_kd.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_kd.js) |
| 长期 | 京东直播 | [jd_live.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live.js) |
| 长期 | 京东抽奖机 | [jd_lotteryMachine.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_lotteryMachine.js) |
| 长期 | 摇钱树 | [jd_moneyTree.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_moneyTree.js) |
| 长期 | 点点券 | [jd_necklace.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_necklace.js) |
| | 东东萌宠 | [jd_pet.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_pet.js) |
| | 金融养猪 | [jd_pigPet.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_pigPet.js) |
| 长期 | 种豆得豆 | [jd_plantBean.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_plantBean.js) |
| 长期 | 京东排行榜签到得京豆 | [jd_rankingList.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_rankingList.js) |
| 长期 | 全民开红包 | [jd_redPacket.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_redPacket.js) |
| 长期 | 进店领豆 | [jd_shop.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_shop.js) |
| 长期 | 东东小窝 | [jd_small_home.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_small_home.js) |
| 长期 | 天天加速 | [jd_speed.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_speed.js) |
| 长期 | 东东超市 | [jd_superMarket.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_superMarket.js) |
| 长期 | 十元街 | [jd_syj.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_syj.js) |
| 长期 | 注销京东会员卡 | [jd_unbind.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_unbind.js) |
| 长期 | 取关京东店铺和商品 | [jd_unsubscribe.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_unsubscribe.js) |
搬运脚本
1. 【[@yangtingxiao](https://github.com/yangtingxiao)】京东抽奖机([jd_lotteryMachine.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_lotteryMachine.js))

View File

@@ -155,17 +155,17 @@ let CookieJDs = [
| `jd_bean_home` | 领京豆额外奖励 | 长期 | / | 0 1 */1 * * | 30 7 * * * |
| `jd_bean_sign` | 京豆签到 | 长期 | 0 16 * * * | 0 0 */1 * * | 0 0 * * * |
| `jd_blueCoin` | 京小超兑换奖品 | 长期 | 0 16 * * * | 0 1 */1 * * | 0 0 * * * |
| `jd_bookshop` | 口袋书店 | 长期 | / | / | 5 6-18/6,8 * * * |
| `jd_car` | 京东汽车 | 长期 | / | 0 0 */1 * * | 0 0 * * * |
| `jd_car_exchange` | 京东汽车兑换 | 长期 | / | / | 0 0 * * * |
| `jd_club_lottery` | 摇京豆 | 长期 | 0 16 * * * | 0 0 */1 * * | 0 0 * * * |
| `jd_crazy_joy` | 疯狂的joy | 长期 | / | / | 30 7 * * * |
| `jd_crazy_joy_coin` | 疯狂的joy挂机 | 长期 | / | / | / |
| `jd_daily_egg` | 京东金融-天天提额 | 长期 | 10 */3 * * * | 0-12/3 */3 * * * | 8 */3 * * * |
| `jd_dreamFactory` | 京喜工厂 | 长期 | / | */30 * * * * | 3 */1 * * * |
| `jd_ds` | 京东代属(校园用户) | 长期 | / | / | / |
| `jd_fruit` | 东东农场 | 长期 | 20 23,4,10 * * * | 0,5,10 8,9,12,18,23,0 * * * | 5 6-18/6 * * * |
| `jd_health` | 健康抽奖机 | 短期 | / | 0 0 */1 * * | 10 0 * * * |
| `jd_fruit` | 东东农场 | 长期 | 20 23,4,10 * * * | 0,5,10 8,9,12,18,23,0 * * * | 5 6-18/6,8 * * * |
| `jd_get_share_code` | 获取互助码 | 长期 | / | / | / |
| `jd_jdfactory` | 东东工厂 | 长期 | / | */30 * * * * | 3 */1 * * * |
| `jd_jdh` | 京东健康APP | 短期 | / | / | 30 7 * * * |
| `jd_jdzz` | 京东赚赚 | 长期 | / | / | 3 1 * * * |
| `jd_joy` | 宠汪汪 | 长期 | 0 0,1,4,10,15,16 * * * | 0,5,10 8,9,12,18,23,0 * * * | 3 */1 * * * |
| `jd_joy_feedPets` | 宠汪汪单独喂食 | 长期 | */20 */1 * * * | 0-12/3 */3 * * * | 3 */1 * * * |
@@ -173,14 +173,13 @@ let CookieJDs = [
| `jd_joy_reward` | 宠汪汪兑换奖品 | 长期 | 0 0,4,8,16 * * * | 0 8,12,16,0 */1 * * | 0 0-16/8,20 * * * |
| `jd_joy_run` | 宠汪汪邀请助力与赛跑助力 | 长期 | / | / | / |
| `jd_joy_steal` | 宠汪汪偷好友狗粮与积分 | 长期 | 0 16,22 * * * | 0 0,6,20 */1 * * | 0 0-16/8,20 * * * |
| `jd_jxnc` | 京喜农场 | 长期 | / | / | / |
| `jd_kd` | 京东快递 | 长期 | / | 0 1 */1 * * | 3 1 * * * |
| `jd_live` | 京东直播18豆 | 长期 | / | / | 0 0-16/8,20 * * * |
| `jd_live_redrain` | 超级直播间红包雨 | 短期 | / | 0 0,20,9-23/2 * * MON-FRI | / |
| `jd_lotteryMachine` | 京东抽奖机 | 长期 | 11 17 * * * | 0 0 */1 * * | 10 0 * * * |
| `jd_moneyTree` | 摇钱树 | 长期 | 40 */3 * * * | 0-12/3 */3 * * * | 3 */1 * * * |
| `jd_ms_redrain` | 秒杀红包雨 | 短期 | / | 0 1 */1 * * | 10 0 * * * |
| `jd_necklace` | 点点券 | 长期 | / | 0 0,6,20 */1 * * | 0 0-16/8,20 * * * |
| `jd_pet` | 东东萌宠 | 长期 | 35 23,4,10 * * * | 0,5,10 8,9,12,18,23,0 * * * | 5 6-18/6 * * * |
| `jd_pet` | 东东萌宠 | 长期 | 35 23,4,10 * * * | 0,5,10 8,9,12,18,23,0 * * * | 5 6-18/6,8 * * * |
| `jd_petTreasureBox` | 宠汪汪聚宝盆 | 长期 | / | / | / |
| `jd_pigPet` | 京东金融-养猪猪 | 长期 | / | 0-12/3 */3 * * * | 3 1 * * * |
| `jd_plantBean` | 种豆得豆 | 长期 | 0 23,0-14/1 * * * | 0-12/3 */3 * * * | 3 */1 * * * |
@@ -193,16 +192,21 @@ let CookieJDs = [
| `jd_syj` | 十元街 | 长期 | / | 0 1 */1 * * | 3 1 * * * |
| `jd_unbind` | 注销京东会员卡 | 长期 | / | / | 10 0 * * * |
| `jd_unsubscribe` | 取关京东店铺和商品 | 长期 | 45 15 * * * | 0 1 */1 * * | 10 0 * * * |
| `jd_watch` | 发现-看一看 | 长期 | / | / | 3 1 * * * |
| `jr_sign` | 金融打卡年终奖 | 短期 | / | / | 3 1 * * * |
| `jd_818` | 京东手机狂欢城 | 短期 | 0 1,4,7,10,12,16,22 * * * | 0 9,12,15,16,20,0,6 */1 * * | / |
| `jd_apple_live` | 苹果抽奖机 | 短期 | / | / | / |
| `jd_collectProduceScore` | 双十一活动领金币 | 短期 | 30 * * * * | */30 * * * * | / |
| `jd_digital_floor` | 数码加购京豆 | 短期 | / | / | / |
| `jd_ds` | 京东代属(校园用户) | 短期 | / | / | / |
| `jd_health` | 健康抽奖机 | 短期 | / | 0 0 */1 * * | 10 0 * * * |
| `jd_jdh` | 京东健康APP | 短期 | / | / | 30 7 * * * |
| `jd_jxstory` | 京喜故事 | 短期 | / | / | / |
| `jd_live_redrain` | 超级直播间红包雨 | 短期 | / | 0 0,20,9-23/2 * * MON-FRI | / |
| `jd_mohe` | 热8超级魔盒 | 短期 | / | / | / |
| `jd_ms_redrain` | 秒杀红包雨 | 短期 | / | 0 1 */1 * * | 10 0 * * * |
| `jd_pubg` | PUBG | 短期 | / | / | / |
| `jd_split` | 金榜年终奖 | 短期 | / | / | / |
| `jd_watch` | 发现-看一看 | 短期 | / | / | 3 1 * * * |
| `jd_xtg` | 双十一星推官 | 短期 | 0 16 * * * | 0 0 */1 * * | / |
| `jr_sign` | 金融打卡年终奖 | 短期 | / | / | 3 1 * * * |
点击提交,所有流程就结束了。

View File

@@ -79,3 +79,7 @@
0 0 * * * node /scripts/jd_car_exchange.js >> /scripts/logs/jd_car_exchange.log 2>&1
# 导到所有互助码
47 7 * * * node /scripts/jd_get_share_code.js >> /scripts/logs/jd_get_share_code.log 2>&1
# 口袋书店
7 8,12,18 * * * node /scripts/jd_bookshop.js >> /scripts/logs/jd_bookshop.log 2>&1
# 京喜农场
0 9,12,18 * * * node /scripts/jd_jxnc.js >> /scripts/logs/jd_jxnc.log 2>&1

View File

@@ -110,7 +110,7 @@ fi
if [ $RANDOM_DELAY_MAX ]; then
if [ $RANDOM_DELAY_MAX -ge 1 ]; then
echo "已设置随机延迟为 $RANDOM_DELAY_MAX , 设置延迟任务中... "
sed -i "/\(jd_bean_sign.js\|jd_blueCoin.js\|jd_joy_reward.js\|jd_joy_steal.js\|jd_joy_feedPets.js\)/!s/node/sleep \$((RANDOM % \$RANDOM_DELAY_MAX)); node/g" $mergedListFile
sed -i "/\(jd_bean_sign.js\|jd_blueCoin.js\|jd_joy_reward.js\|jd_joy_steal.js\|jd_joy_feedPets.js\|jd_car_exchange.js\)/!s/node/sleep \$((RANDOM % \$RANDOM_DELAY_MAX)); node/g" $mergedListFile
fi
else
echo "未配置随即延迟对应的环境变量,故不设置延迟任务"

View File

@@ -35,49 +35,50 @@
##### 互助码类环境变量
| Name | 归属 | 属性 | 说明 |
| :---------------------: | :----------: | --------- | ------------------------------------------------------------ |
| `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) 或见下方[互助码的填写规则](#互助码的填写规则) |
| `JDZZ_SHARECODES` | 京东赚赚(jd_jdzz.js)脚本互助码 | 非必须 | 填写规则和上面类似,或见下方[互助码的填写规则](#互助码的填写规则) |
| `JDJOY_SHARECODES` | 疯狂的joy(jd_crazy_joy.js)脚本互助码 | 非必须 | 填写规则和上面类似,或见下方[互助码的填写规则](#互助码的填写规则) |
| Name | 归属 | 属性 | 说明 |
| --------------------------- | ------------------ | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `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)或见下方[互助码的填写规则](#互助码的填写规则) |
| `JDZZ_SHARECODES` | 京东赚赚互助码 | 非必须 | 填写规则和上面类似,或见下方[互助码的填写规则](#互助码的填写规则) |
| `JDJOY_SHARECODES` | 疯狂的JOY互助码 | 非必须 | 填写规则和上面类似,或见下方[互助码的填写规则](#互助码的填写规则) |
| `BOOKSHOP_SHARECODES` | 京东书店互助码 | 非必须 | 填写规则和上面类似,或见下方[互助码的填写规则](#互助码的填写规则) |
| `JXNC_SHARECODES` | 京喜农场互助码 | 非必须 | 填写规则和上面类似,或见下方[互助码的填写规则](#互助码的填写规则) |
##### 控制脚本功能环境变量
| Name | 归属 | 属性 | 说明 |
| :---------------------: | :----------: | --------- | ------------------------------------------------------------ |
| `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) |
| `PET_NOTIFY_CONTROL` | 东东萌宠推送开关 | 非必须 | 控制京东萌宠是否静默运行,`false`为否(发送推送通知消息),`true`为是(即:不发送推送通知消息) |
| `FRUIT_NOTIFY_CONTROL` | 东东农场推送开关 | 非必须 | 控制京东农场是否静默运行,`false`为否(发送推送通知消息),`true`为是(即:不发送推送通知消息) |
| `JD_JOY_REWARD_NOTIFY` | 宠汪汪兑换京豆推送开关 | 非必须 | 控制`jd_joy_reward.js`脚本是否静默运行,`false`为否(发送推送通知消息),`true`为是(即:不发送推送通知消息)
| `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_TEAM_LEVEL` | 宠汪汪参加什么级别的赛跑 | 非必须 | 控制`jd_joy.js`脚本参加几人的赛跑,可选数字为`2`,`10`,`50`其中2代表参加双人PK赛10代表参加10人突围赛50代表参加50人挑战赛(注:此项功能在`JOY_RUN_FLAG`为true的时候才生效),如若想设置不同账号参加不同类别的比赛则用&区分即可(如下三个账号:`2&10&50`) |
| `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`为是(即:不发送推送通知消息) |
| `SUPERMARKET_UPGRADE` | 京小超自动升级 | 非必须 | 自动升级,顺序:解锁升级商品、升级货架,`true`表示自动升级,`false`表示关闭自动升级 |
| `BUSINESS_CIRCLE_JUMP` | 京小超自动更换商圈 | 非必须 | 小于对方300热力值自动更换商圈队伍,`true`表示运行,`false`表示禁止 |
| `SUPERMARKET_LOTTERY` | 京小超抽奖 | 非必须 | 每天运行脚本是否使用金币去抽奖,`true`表示抽奖,`false`表示不抽奖 |
| `FRUIT_BEAN_CARD` | 农场使用水滴换豆卡 | 非必须 | 农场使用水滴换豆卡(如果出现限时活动时100g水换20豆,此时比浇水划算,推荐换豆),`true`表示换豆(不浇水),`false`表示不换豆(继续浇水),脚本默认是浇水 |
| `UN_SUBSCRIBES` | jd_unsubscribe.js | 非必须 | 共四个参数,换行隔开. 四个参数分别表示`取关商品数量`,`取关店铺数量`,`遇到此商品不再进行取关`, `遇到此店铺不再进行取关`[具体使用往下看](#取关店铺secret的说明)|
| `UN_BIND_CARD_NUM` | jd_unbind.js | 非必须 | 注销京东已开的店铺会员不是注销京东plus会员个别店铺无法注销。此参数控制每次运行脚本时注销多少个店铺会员默认200。|
| `UN_BIND_STOP_CARD` | jd_unbind.js | 非必须 | 注销京东已开的店铺会员不是注销京东plus会员个别店铺无法注销。遇到此参数设定的会员卡则跳过不注销多个会员卡之间以`&`分隔,默认值"京东PLUS会员"。 |
| `JDJOY_HELPSELF` | 疯狂的joy | 非必须 | 疯狂的joy循环助力,`true`表示循环助力,`false`表示不循环助力,默认不开启循环助力。|
| `JDJOY_APPLYJDBEAN` | 疯狂的joy | 非必须 | 疯狂的joy京豆兑换目前最小值为500/1000京豆默认不开启京豆兑换。|
| `MONEY_TREE_SELL_FRUIT` | 摇钱树是否卖出金果 | 非必须 | 控制摇钱树脚本是否自动卖出金果兑换成金币,`true`卖出,`false`不卖出,默认`false` |
| `FACTORAY_WANTPRODUCT_NAME` | 东东工厂心仪商品 | 非必须 | 提供心仪商品名称(请尽量填写完整和别的商品有区分度),达到条件后兑换,如不提供则会兑换当前所选商品 |
| `WATCH_ACCEPTBODY` | 京东看一看(jd_watch.js)脚本 | 非必须 | 抓包`functionId=discAcceptTask`(需40个每个之间使用@符号隔开) |
| `WATCH_DOBODY` | 京东看一看(jd_watch.js)脚本 | 非必须 | 抓包`functionId=discDoTask`(需40个每个之间使用@符号隔开) |
| Name | 归属 | 属性 | 说明 |
| ---------------------------- | --------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `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) |
| `PET_NOTIFY_CONTROL` | 东东萌宠推送开关 | 非必须 | 控制京东萌宠是否静默运行,`false`为否(发送推送通知消息),`true`为是(即:不发送推送通知消息) |
| `FRUIT_NOTIFY_CONTROL` | 东东农场推送开关 | 非必须 | 控制京东农场是否静默运行,`false`为否(发送推送通知消息),`true`为是(即:不发送推送通知消息) |
| `JD_JOY_REWARD_NOTIFY` | 宠汪汪兑换京豆推送开关 | 非必须 | 控制`jd_joy_reward.js`脚本是否静默运行,`false`为否(发送推送通知消息),`true`为是(即:不发送推送通知消息) |
| `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_TEAM_LEVEL` | 宠汪汪参加什么级别的赛跑 | 非必须 | 控制`jd_joy.js`脚本参加几人的赛跑,可选数字为`2`,`10`,`50`其中2代表参加双人PK赛10代表参加10人突围赛50代表参加50人挑战赛(注:此项功能在`JOY_RUN_FLAG`为true的时候才生效),如若想设置不同账号参加不同类别的比赛则用&区分即可(如下三个账号:`2&10&50`) |
| `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`为是(即:不发送推送通知消息) |
| `SUPERMARKET_UPGRADE` | 京小超自动升级 | 非必须 | 自动升级,顺序:解锁升级商品、升级货架,`true`表示自动升级,`false`表示关闭自动升级 |
| `BUSINESS_CIRCLE_JUMP` | 京小超自动更换商圈 | 非必须 | 小于对方300热力值自动更换商圈队伍,`true`表示运行,`false`表示禁止 |
| `SUPERMARKET_LOTTERY` | 京小超抽奖 | 非必须 | 每天运行脚本是否使用金币去抽奖,`true`表示抽奖,`false`表示不抽奖 |
| `FRUIT_BEAN_CARD` | 农场使用水滴换豆卡 | 非必须 | 农场使用水滴换豆卡(如果出现限时活动时100g水换20豆,此时比浇水划算,推荐换豆),`true`表示换豆(不浇水),`false`表示不换豆(继续浇水),脚本默认是浇水 |
| `UN_SUBSCRIBES` | jd_unsubscribe.js | 非必须 | 共四个参数,换行隔开.四个参数分别表示`取关商品数量`,`取关店铺数量`,`遇到此商品不再进行取关`,`遇到此店铺不再进行取关`[具体使用往下看](#取关店铺secret的说明) |
| `UN_BIND_CARD_NUM` | jd_unbind.js | 非必须 | 注销京东已开的店铺会员不是注销京东plus会员个别店铺无法注销。此参数控制每次运行脚本时注销多少个店铺会员默认200。 |
| `UN_BIND_STOP_CARD` | jd_unbind.js | 非必须 | 注销京东已开的店铺会员不是注销京东plus会员个别店铺无法注销。遇到此参数设定的会员卡则跳过不注销多个会员卡之间以`&`分隔,默认值"京东PLUS会员"。 |
| `JDJOY_HELPSELF` | 疯狂的JOY | 非必须 | 疯狂的JOY循环助力,`true`表示循环助力,`false`表示不循环助力,默认不开启循环助力。 |
| `JDJOY_APPLYJDBEAN` | 疯狂的JOY | 非必须 | 疯狂的JOY京豆兑换目前最小值为500/1000京豆默认不开启京豆兑换。 |
| `BUY_JOY_LEVEL` | 疯狂的JOY | 非必须 | 疯狂的JOY自动购买什么等级的JOY |
| `MONEY_TREE_SELL_FRUIT` | 摇钱树是否卖出金果 | 非必须 | 控制摇钱树脚本是否自动卖出金果兑换成金币,`true`卖出,`false`不卖出,默认`false` |
| `FACTORAY_WANTPRODUCT_NAME` | 东东工厂心仪商品 | 非必须 | 提供心仪商品名称(请尽量填写完整和别的商品有区分度),达到条件后兑换,如不提供则会兑换当前所选商品 |
| `JXNCTOKENS` | 京喜农场TOKEN | 非必须 | 每个账号 token 是一个 json示例{"farm_jstoken":"749a90f871adsfads8ffda7bf3b1576760","timestamp":"1610165423873","phoneid":"42c7e3dadfadsfdsaac-18f0e4f4a0cf"},多账单间使用`&`或换行分开。 |
##### 互助码的填写规则

32
jdJxncShareCodes.js Normal file
View File

@@ -0,0 +1,32 @@
/*
京喜农场助力码
此助力码要求种子 active 相同才能助力,多个账号的话可以种植同样的种子,如果种子不同的话,会自动跳过使用云端助力
此文件为Node.js专用。其他用户请忽略
支持京东N个账号
*/
//云服务器腾讯云函数等NOde.js用户在此处填写京京喜农场的好友码。
// github action用户的好友助力码填写到Action->Settings->Secrets->new Secret里面(Name填写 JxncShareCodes(此处的Name必须按此来写,不能随意更改),内容处填写助力码,填写规则如下)
// 同一个京东账号的好友助力码用@符号隔开,不同京东账号之间用&符号或者换行隔开,下面给一个示例
// 如: 京东账号1的shareCode1@京东账号1的shareCode2&京东账号2的shareCode1@京东账号2的shareCode2
let JxncShareCodes = [
'',//账号一的好友shareCode,不同好友中间用@符号隔开
'',//账号二的好友shareCode不同好友中间用@符号隔开
]
// 判断github action里面是否有京喜农场助力码
if (process.env.JXNC_SHARECODES) {
if (process.env.JXNC_SHARECODES.indexOf('&') > -1) {
console.log(`您的京喜农场助力码选择的是用&隔开\n`)
JxncShareCodes = process.env.JXNC_SHARECODES.split('&');
} else if (process.env.JXNC_SHARECODES.indexOf('\n') > -1) {
console.log(`您的京喜农场助力码选择的是用换行隔开\n`)
JxncShareCodes = process.env.JXNC_SHARECODES.split('\n');
} else {
JxncShareCodes = process.env.JXNC_SHARECODES.split();
}
} else if (process.env.JD_COOKIE) {
// console.log(`由于您secret里面未提供助力码故此处运行将会给脚本内置的码进行助力请知晓`)
}
for (let i = 0; i < JxncShareCodes.length; i++) {
const index = (i + 1 === 1) ? '' : (i + 1);
exports['JxncShareCode' + index] = JxncShareCodes[i];
}

29
jdJxncTokens.js Normal file
View File

@@ -0,0 +1,29 @@
/*
京喜农场 Tokens
此文件为Node.js专用。其他用户请忽略
支持京东N个账号
*/
// 每个账号 token 是一个 json示例如下
// {"farm_jstoken":"749a90f871adsfads8ffda7bf3b1576760","timestamp":"1610165423873","phoneid":"42c7e3dadfadsfdsaac-18f0e4f4a0cf"}
let JxncTokens = [
'',//账号一的好友shareCode,不同好友中间用@符号隔开
'',//账号二的好友shareCode不同好友中间用@符号隔开
]
// 判断github action里面是否有京喜农场 token
if (process.env.JXNCTOKENS) {
if (process.env.JXNCTOKENS.indexOf('&') > -1) {
console.log(`您的京喜农场 token 选择的是用&隔开\n`)
JxncTokens = process.env.JXNCTOKENS.split('&');
} else if (process.env.JXNCTOKENS.indexOf('\n') > -1) {
console.log(`您的京喜农场 token 选择的是用换行隔开\n`)
JxncTokens = process.env.JXNCTOKENS.split('\n');
} else {
JxncTokens = process.env.JXNCTOKENS.split();
}
} else if (process.env.JD_COOKIE) {
console.log(`由于您secret里面未提供 tokens当种植 APP 种子时,将不能正常进行任务,请提供 token 或 种植非 APP 种子!`)
}
for (let i = 0; i < JxncTokens.length; i++) {
const index = (i + 1 === 1) ? '' : (i + 1);
exports['JXNCTOKEN' + index] = JxncTokens[i];
}

View File

@@ -686,10 +686,18 @@ function requireConfig() {
return new Promise(resolve => {
console.log(`开始获取${$.name}配置文件\n`);
//Node.js用户请在jdCookie.js处填写京东ck;
const shareCodes = []
let shareCodes = []
console.log(`${cookiesArr.length}个京东账号\n`);
$.shareCodesArr = [];
if ($.isNode()) {
//自定义助力码
if (process.env.BOOKSHOP_SHARECODES) {
if (process.env.BOOKSHOP_SHARECODES.indexOf('\n') > -1) {
shareCodes = process.env.BOOKSHOP_SHARECODES.split('\n');
} else {
shareCodes = process.env.BOOKSHOP_SHARECODES.split('&');
}
}
Object.keys(shareCodes).forEach((item) => {
if (shareCodes[item]) {
$.shareCodesArr.push(shareCodes[item])

View File

@@ -7,22 +7,23 @@
活动网页地址https://h5.m.jd.com/babelDiy/Zeus/44bjzCpzH9GpspWeBzYSqBA7jEtP/index.html#/journey
更新地址https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_car_exchange
已支持IOS双京东账号, Node.js支持N个京东账号
已支持IOS, Node.js支持N个京东账号
脚本兼容: QuantumultX, Surge, Loon, 小火箭JSBox, Node.js
============Quantumultx===============
[task_local]
#京东汽车兑换
0 0 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_car_exchange, tag=京东汽车兑换, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_redPacket.png, enabled=true
0 0 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_car_exchange.js, tag=京东汽车兑换, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_redPacket.png, enabled=true
================Loon==============
[Script]
cron "0 0 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_car_exchange, tag=京东汽车兑换
cron "0 0 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_car_exchange.js, tag=京东汽车兑换
===============Surge=================
京东汽车兑换 = type=cron,cronexp="0 0 * * *",wake-system=1,timeout=20,script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_car_exchange
京东汽车兑换 = type=cron,cronexp="0 0 * * *",wake-system=1,timeout=2000,script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_car_exchange.js
============小火箭=========
京东汽车兑换 = type=cron,script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_car_exchange, cronexpr="0 0 * * *", timeout=200, enable=true
京东汽车兑换 = type=cron,script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_car_exchange.js, cronexpr="0 0 * * *", timeout=2000, enable=true
*/
const $ = new Env('京东汽车兑换');

View File

@@ -210,6 +210,16 @@ async function jdJxStory() {
$.log(`${$.joyIds[4]} ${$.joyIds[5]} ${$.joyIds[6]} ${$.joyIds[7]}`)
$.log(`${$.joyIds[8]} ${$.joyIds[9]} ${$.joyIds[10]} ${$.joyIds[11]}\n`)
}
// 如果格子全部被占有且没有可以合并的JOY只能回收低级的JOY (没有34级JOY时才会执行)
if(checkHasFullOccupied() && !checkCanMerge() && !checkHas34Level()) {
const minJoyId = Math.min(...$.joyIds);
const boxId = $.joyIds.indexOf(minJoyId);
console.log(`格子全部被占有且没有可以合并的JOY回收${boxId + 1}号位等级为${minJoyId}的JOY`)
await sellJoy(minJoyId, boxId);
await getJoyList();
}
for (let i = 0; i < $.joyIds.length; ++i) {
if (!$.canBuy) {
$.log(`金币不足,跳过购买`)
@@ -248,6 +258,31 @@ async function jdJxStory() {
console.log(`当前信息:${$.bean} 京豆,${$.coin} 金币`)
}
function checkHasFullOccupied() {
return !$.joyIds.includes(0);
}
// 查询是否有34级JOY
function checkHas34Level() {
return $.joyIds.includes(34);
}
function checkCanMerge() {
let obj = {};
let canMerge = false;
$.joyIds.forEach((vo, idx) => {
if (vo !== 0 && vo !== 34) {
if (obj[vo]) {
obj[vo].push(idx)
canMerge = true;
} else {
obj[vo] = [idx]
}
}
});
return canMerge;
}
function getJoyList() {
$.joyIds = []
return new Promise(async resolve => {
@@ -362,6 +397,38 @@ function buyJoy(joyId) {
})
}
// 出售回收joy
function sellJoy(joyId, boxId) {
const body = {"action": "SELL", "joyId": joyId, "boxId": boxId}
return new Promise((resolve) => {
$.get(taskUrl('crazyJoy_joy_trade', JSON.stringify(body)), async (err, resp, data) => {
try {
if (err) {
console.log(`${JSON.stringify(err)}`)
console.log(`${$.name} API请求失败请检查网路重试`)
} else {
data = JSON.parse(data);
if (data.success) {
if (data.data.eventInfo) {
await openBox(data.data.eventInfo.eventType, data.data.eventInfo.eventRecordId)
$.canBuy = false
return
}
$.log(`回收${joyId}级joy成功剩余金币【${data.data.totalCoins}`)
$.coin = data.data.totalCoins
} else {
console.log(data.message)
}
}
} catch (e) {
$.logErr(e, resp);
} finally {
resolve(data);
}
})
})
}
function hourBenefit() {
let body = {"eventType": "HOUR_BENEFIT"}
return new Promise(async resolve => {

View File

@@ -244,7 +244,7 @@ function getJxFactory(){
try {
if (err) {
console.log(`${JSON.stringify(err)}`);
console.log(`喜工厂 API请求失败请检查网路重试`);
console.log(`喜工厂 API请求失败请检查网路重试`);
} else {
if (safeGet(data)) {
data = JSON.parse(data);
@@ -262,7 +262,7 @@ function getJxFactory(){
$.commodityDimId = production.commodityDimId;
$.encryptPin = data.user.encryptPin;
// subTitle = data.user.pin;
console.log(`【账号${$.index}${$.nickName || $.UserName}喜工厂】${data.user.encryptPin}`);
console.log(`【账号${$.index}${$.nickName || $.UserName}喜工厂】${data.user.encryptPin}`);
}
} else {
$.unActive = false; //标记是否开启了京喜活动或者选购了商品进行生产
@@ -289,6 +289,60 @@ function getJxFactory(){
);
})
}
function getJxNc(){
const JXNC_API_HOST = "https://wq.jd.com/";
function JXNC_taskurl(function_path, body) {
return {
url: `${JXNC_API_HOST}cubeactive/farm/${function_path}?${body}&farm_jstoken=&phoneid=&timestamp=&sceneval=2&g_login_type=1&_=${Date.now()}&g_ty=ls`,
headers: {
Cookie: cookie,
Accept: `*/*`,
Connection: `keep-alive`,
Referer: `https://st.jingxi.com/pingou/dream_factory/index.html`,
'Accept-Encoding': `gzip, deflate, br`,
Host: `wq.jd.com`,
'Accept-Language': `zh-cn`,
},
};
}
return new Promise(resolve => {
$.get(
JXNC_taskurl('query', `type=1`),
async (err, resp, data) => {
try {
if (err) {
console.log(`${JSON.stringify(err)}`);
console.log(`京喜农场 API请求失败请检查网路重试`);
} else {
data = data.match(/try\{Query\(([\s\S]*)\)\;\}catch\(e\)\{\}/)[1];
if (safeGet(data)) {
data = JSON.parse(data);
if (data["ret"] === 0) {
console.log(`【账号${$.index}${$.nickName || $.UserName})京喜农场助力码】${data.smp}`);
if (data.active) {
console.log(`【账号${$.index}${$.nickName || $.UserName}京喜农场active】${data.active}`);
} else {
console.log( `【账号${$.index}${$.nickName || $.UserName})京喜农场】未选择种子,请先去京喜农场选择种子`);
}
}
} else {
console.log(`京喜农场返回值解析异常:${JSON.stringify(data)}`);
}
}
} catch (e) {
$.logErr(e, resp);
} finally {
resolve()
}
}
);
})
}
function getJdPet(){
const JDPet_API_HOST = "https://api.m.jd.com/client.action";
@@ -373,7 +427,7 @@ async function getJdZZ() {
data = JSON.parse(data);
if (data.data.shareTaskRes) {
console.log(`【账号${$.index}${$.nickName || $.UserName})京东赚赚】${data.data.shareTaskRes.itemId}`);
} else {
} else {
//console.log(`已满5人助力,暂时看不到您的京东赚赚好友助力码`)
}
}
@@ -600,6 +654,7 @@ async function getShareCode() {
console.log(`======账号${$.index}开始======`)
await getJdFactory()
await getJxFactory()
await getJxNc()
await getJdPet()
await getPlantBean()
await getJDFruit()

785
jd_jxnc.js Normal file
View File

@@ -0,0 +1,785 @@
/*
特别声明:
本脚本搬运自 https://github.com/whyour/hundun/blob/master/quanx/jx_nc.js
感谢 @whyour 大佬
京喜农场:脚本更新地址 https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_jxnc.js
更新时间2021-01-10 22:47:51
东东农场活动链接https://wqsh.jd.com/sns/201912/12/jxnc/detail.html?ptag=7155.9.32&smp=b47f4790d7b2a024e75279f55f6249b9&active=jdnc_1_chelizi1205_2
已支持IOS双京东账号,Node.js支持N个京东账号
理论上脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js
助力码shareCode请先手动运行脚本查看打印可看到
==========================Quantumultx=========================
[task_local]
0 9,12,18 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_jxnc.js, tag=京喜农场, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jxnc.png, enabled=true
[rewrite_local]
^https\:\/\/wq\.jd\.com\/cubeactive\/farm\/dotask url script-request-header https://raw.githubusercontent.com/whyour/hundun/master/quanx/jx_nc.cookie.js
=========================Loon=============================
[Script]
http-request ^https\:\/\/wq\.jd\.com\/cubeactive\/farm\/dotask script-path=https://raw.githubusercontent.com/whyour/hundun/master/quanx/jx_nc.cookie.js, requires-body=false, timeout=10, tag=京喜农场cookie
cron "0 9,12,18 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_jxnc.js,tag=京喜农场
=========================Surge============================
京喜农场 = type=cron,cronexp="0 9,12,18 * * *",timeout=60,script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_jxnc.js
京喜农场cookie = type=http-request,pattern=^https\:\/\/wq\.jd\.com\/cubeactive\/farm\/dotask,requires-body=0,max-size=0,script-path= https://raw.githubusercontent.com/whyour/hundun/master/quanx/jx_nc.cookie.js
=========================小火箭===========================
京喜农场 = type=cron,script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_jxnc.js, cronexpr="0 9,12,18 * * *", timeout=200, enable=true
京喜农场APP种子cookie = type=http-request,script-path=https://raw.githubusercontent.com/whyour/hundun/master/quanx/jx_nc.cookie.js,pattern=^https\:\/\/wq\.jd\.com\/cubeactive\/farm\/dotask,max-size=131072,timeout=110,enable=true
*/
const $ = new Env('京喜农场');
let notify = ''; // nodejs 发送通知脚本
let cookieArr = []; // 用户 cookie 数组
let currentCookie = ''; // 当前用户 cookie
let tokenNull = {'farm_jstoken': '', 'phoneid': '', 'timestamp': ''}; // 内置一份空的 token
let tokenArr = []; // 用户 token 数组
let currentToken = {}; // 当前用户 token
const shareCode = '22bd6fbbabbaa770a45ab2607e7a1e8a@197c6094e965fdf3d33621b47719e0b1'; // 内置助力码
let jxncShareCodeArr = []; // 用户 助力码 数组
let currentShareCode = []; // 当前用户 要助力的助力码
const openUrl = `openjd://virtual?params=${encodeURIComponent('{ "category": "jump", "des": "m", "url": "https://wqsh.jd.com/sns/201912/12/jxnc/detail.html?ptag=7155.9.32&smp=b47f4790d7b2a024e75279f55f6249b9&active=jdnc_1_chelizi1205_2"}',)}`; // 打开京喜农场
let subTitle = '', message = '', option = {'open-url': openUrl}; // 消息副标题,消息正文,消息扩展参数
const JXNC_API_HOST = 'https://wq.jd.com/';
$.helpTask = null;
$.allTask = []; // 任务列表
$.info = {}; // 用户信息
$.answer = 0;
$.drip = 0;
$.maxHelpNum = shareCode.split('@').length; // 助力 ret 1011 错误最大计数
$.helpNum = 0; // 当前账号 助力 ret 1011 次数
!(async () => {
await requireConfig();
if (!cookieArr[0]) {
$.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"});
return;
}
for (let i = 0; i < cookieArr.length; i++) {
if (cookieArr[i]) {
currentCookie = cookieArr[i];
$.UserName = decodeURIComponent(currentCookie.match(/pt_pin=(.+?);/) && currentCookie.match(/pt_pin=(.+?);/)[1])
$.index = i + 1;
$.isLogin = true;
$.nickName = '';
$.log(`检查【京东账号${$.index}${$.UserName} cookie 是否有效`);
await TotalBean();
$.log(`开始【京东账号${$.index}${$.nickName || $.UserName}\n`);
if (!$.isLogin) {
$.msg($.name, `【提示】cookie已失效`, `京东账号${$.index} ${$.nickName || $.UserName}\n请重新登录获取\nhttps://bean.m.jd.com/`, {"open-url": "https://bean.m.jd.com/"});
if ($.isNode()) {
await notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`);
}
continue
}
subTitle = '';
message = '';
option = {};
$.helpNum = 0;
await tokenFormat(); // 处理当前账号 token
await shareCodesFormat(); // 处理当前账号 助力码
await jdJXNC(); // 执行当前账号 主代码流程
}
}
})()
.catch((e) => {
$.log('', `${$.name}, 失败! 原因: ${e}!`, '')
console.log(e);
})
.finally(() => {
$.done();
})
// 加载配置 cookie token shareCode
function requireConfig() {
return new Promise(resolve => {
$.log('开始获取配置文件\n')
notify = $.isNode() ? require('./sendNotify') : '';
//Node.js用户请在jdCookie.js处填写京东ck;
const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
const jdTokenNode = $.isNode() ? require('./jdJxncTokens.js') : '';
const jdJxncShareCodeNode = $.isNode() ? require('./jdJxncShareCodes.js') : '';
//IOS等用户直接用NobyDa的jd cookie
if ($.isNode()) {
Object.keys(jdCookieNode).forEach((item) => {
if (jdCookieNode[item]) {
cookieArr.push(jdCookieNode[item]);
}
})
if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {
};
} else {
cookieArr.push(...[$.getdata('CookieJD'), $.getdata('CookieJD2')]);
}
$.log(`${cookieArr.length}个京东账号\n`);
if ($.isNode()) {
Object.keys(jdTokenNode).forEach((item) => {
tokenArr.push(tokenArr[item] ? JSON.parse(jxncShareCodeArr[item]) : tokenNull)
})
} else {
tokenArr.push(...[$.getdata('jxnc_token1') || tokenNull, $.getdata('jxnc_token2') || tokenNull]);
}
if ($.isNode()) {
Object.keys(jdJxncShareCodeNode).forEach((item) => {
if (jdJxncShareCodeNode[item]) {
jxncShareCodeArr.push(jdJxncShareCodeNode[item])
}
})
}
// console.log(`jdFruitShareArr::${JSON.stringify(jdFruitShareArr)}`)
// console.log(`jdFruitShareArr账号长度::${jdFruitShareArr.length}`)
$.log(`您提供了${jxncShareCodeArr.length}个账号的京喜农场助力码`);
resolve()
})
}
// 查询京东账户信息(检查 cookie 是否有效)
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": currentCookie,
"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();
}
})
})
}
// 处理当前账号token
function tokenFormat() {
return new Promise(async resolve => {
if (tokenArr[$.index - 1] && tokenArr[$.index - 1].farm_jstoken) {
currentToken = tokenArr[$.index - 1];
} else {
currentToken = tokenNull;
}
resolve();
})
}
// 处理当前账号助力码
function shareCodesFormat() {
return new Promise(async resolve => {
// console.log(`第${$.index}个京东账号的助力码:::${jdFruitShareArr[$.index - 1]}`)
if (jxncShareCodeArr[$.index - 1]) {
currentShareCode = jxncShareCodeArr[$.index - 1].split('@');
let length = currentShareCode.length;
if (length < 3) {
currentShareCode.push(...(shareCode.split('@').splice(0, 3 - length)));
}
} else {
$.log(`由于您第${$.index}个京东账号未提供shareCode,将采纳本脚本自带的助力码`)
currentShareCode = shareCode.split('@');
}
$.log(`${$.index}个京东账号将要助力的好友${JSON.stringify(currentShareCode)}`)
resolve();
})
}
async function jdJXNC() {
subTitle = `【京东账号${$.index}${$.nickName}`;
$.log(`获取用户信息 & 任务列表`);
const startInfo = await getTaskList();
if (!startInfo) { // 未选择种子时,当前账号流程结束
return false;
}
message += `【水果名称】${startInfo.prizename}\n`;
$.log(`【京东账号${$.index}${$.nickName || $.UserName})的${$.name}好友互助码】 ${$.info.smp}`);
$.log(`【京东账号${$.index}${$.nickName || $.UserName})的${$.name}种子active】 ${$.info.active}`);
await $.wait(500);
const isOk = await browserTask();
if (!isOk) {
return false;
}
await $.wait(500);
await answerTask();
await $.wait(500);
const endInfo = await getTaskList();
getMessage(endInfo, startInfo);
const next = await helpFriends();
if (next) {
await submitInviteId($.UserName);
await $.wait(500);
await createAssistUser();
}
await showMsg()
}
// 获取任务列表与用户信息
function getTaskList() {
return new Promise(async resolve => {
$.get(taskUrl('query', `type=1`), async (err, resp, data) => {
try {
const res = data.match(/try\{whyour\(([\s\S]*)\)\;\}catch\(e\)\{\}/)[1];
const {detail, msg, task = [], retmsg, ...other} = JSON.parse(res);
$.helpTask = task.filter(x => x.tasktype === 2)[0] || { eachtimeget: 0, limit: 0 };
$.allTask = task.filter(x => x.tasktype !== 3 && x.tasktype !== 2 && parseInt(x.left) > 0);
$.info = other;
$.log(`获取任务列表 ${retmsg} 总共${$.allTask.length}个任务!`);
if (!$.info.active) {
$.log('账号未选择种子,请先去京喜农场选择种子,选择 APP 专属种子时,必须提供 token');
$.msg($.name, subTitle, '请先去京喜农场选择种子!\n选择app专属种子时请参考脚本头部说明获取token点击通知跳转', option);
if ($.isNode()) {
await notify.sendNotify(`${$.name}`, `京东账号${$.index}[${$.nickName || $.UserName}]请先去京喜农场选择种子!\n选择app专属种子时请参考脚本头部说明获取token`);
}
resolve(false);
}
resolve(other);
} catch (e) {
$.logErr(e, resp);
} finally {
resolve(true);
}
});
});
}
function browserTask() {
return new Promise(async resolve => {
const tasks = $.allTask.filter(x => x.tasklevel !== 6);
const times = Math.max(...[...tasks].map(x => x.limit));
for (let i = 0; i < tasks.length; i++) {
const task = tasks[i];
$.log(`开始第${i + 1}个任务:${task.taskname}`);
const status = [0];
for (let i = 0; i < times; i++) {
const random = Math.random() * 3;
await $.wait(random * 1000);
if (status[0] === 0) {
status[0] = await doTask(task);
}
if (status[0] !== 0) {
break;
}
}
if (status[0] === 1032) {
$.log('任务执行失败,种植的 APP 专属种子,请提供 token 或种植非 APP 种子');
$.msg($.name, '请参考脚本头部说明获取token', '或者改中非app专属种子点击通知跳转', option);
if ($.isNode()) {
await notify.sendNotify(`${$.name}`, `京东账号${$.index}[${$.nickName || $.UserName}]请参考脚本头部说明获取token\n或者改中非app专属种子`);
}
resolve(false);
return;
}
$.log(`结束第${i + 1}个任务:${task.taskname}`);
}
resolve(true);
});
}
function answerTask() {
const _answerTask = $.allTask.filter(x => x.tasklevel === 6);
if (!_answerTask || !_answerTask[0]) return;
const {tasklevel, left, taskname, eachtimeget} = _answerTask[0];
$.log(`准备做答题任务:${taskname}`);
return new Promise(async resolve => {
if (parseInt(left) <= 0) {
resolve(false);
$.log(`${taskname}[做任务] 任务已完成,跳过`);
return;
}
$.get(
taskUrl(
'dotask',
`active=${$.info.active}&answer=${$.info.indexday}:${['A', 'B', 'C', 'D'][$.answer]}:0&joinnum=${
$.info.joinnum
}&tasklevel=${tasklevel}`,
),
async (err, resp, data) => {
try {
const res = data.match(/try\{whyour\(([\s\S]*)\)\;\}catch\(e\)\{\}/)[1];
let {ret, retmsg, right} = JSON.parse(res);
retmsg = retmsg !== '' ? retmsg : '成功';
$.log(`${taskname}[做任务]ret:${ret} retmsg:"${retmsg.indexOf('活动太火爆了') !== -1 ? '任务进行中或者未到任务时间' : retmsg}"`);
if (ret === 0 && right === 1) {
$.drip += eachtimeget;
}
if (((ret !== 0 && ret !== 1029) || retmsg === 'ans err') && $.answer < 4) {
$.answer++;
await $.wait(1000);
await answerTask();
}
} catch (e) {
$.logErr(e, resp);
} finally {
resolve();
}
},
);
});
}
function getMessage(endInfo) {
const need = endInfo.target - endInfo.score;
const get = $.drip;
message += `【水滴】获得水滴${get} 还需水滴${need}\n`;
if (get > 0) {
const max = parseInt(need / get);
const min = parseInt(need / (get + $.helpTask.limit * $.helpTask.eachtimeget));
message += `【预测】还需 ${min} ~ ${max}\n`;
}
}
// 提交助力码
function submitInviteId(userName) {
return new Promise(resolve => {
if (!$.info || !$.info.smp) {
resolve();
return;
}
$.post(
{
url: `https://api.ninesix.cc/api/jx-nc/${$.info.smp}/${encodeURIComponent(userName)}?active=${$.info.active}`,
},
(err, resp, _data) => {
try {
const {code, data = {}} = JSON.parse(_data);
$.log(`邀请码提交:${code}`);
if (data.value) {
message += '【邀请码】提交成功!\n';
}
} catch (e) {
$.logErr(e, resp);
} finally {
resolve();
}
},
);
});
}
// 获取随机助力码并助力
function createAssistUser() {
return new Promise(resolve => {
$.get({url: `https://api.ninesix.cc/api/jx-nc?active=${$.info.active}`}, async (err, resp, _data) => {
try {
const {code, data = {}} = JSON.parse(_data);
$.log(`获取随机助力码 ${code}`);
if (!data.value) {
$.log('随机助力码不存在,跳过助力');
resolve();
return;
}
const next = await helpShareCode(data.value);
if (next) {
await createAssistUser();
} else {
resolve();
}
} catch (e) {
$.logErr(e, resp);
}
});
});
}
// 为好友助力 return true 继续助力 false 助力结束
async function helpFriends() {
for (let code of currentShareCode) {
if (!code) {
continue
}
const next = await helpShareCode(code);
if (!next) {
return false;
}
}
return true;
}
// 执行助力 return true 继续助力 false 助力结束
function helpShareCode(code) {
return new Promise(async resolve => {
$.get(
taskUrl('help', `active=${$.info.active}&joinnum=${$.info.joinnum}&smp=${code}`),
async (err, resp, data) => {
try {
const res = data.match(/try\{whyour\(([\s\S]*)\)\;\}catch\(e\)\{\}/)[1];
const {ret, retmsg = ''} = JSON.parse(res);
$.log(`助力结果ret=${ret} retmsg="${retmsg ? retmsg : '助力成功'}"`);
if (ret === 0 || ret === 1021) { // 0 助力成功 1021 不能助力自己
resolve(true);
}
if (ret === 1011) { // 1011 active 不同
$.helpNum++;
if ($.helpNum <= $.maxHelpNum) {
resolve(true);
}
}
// ret 1016 助力上限
} catch (e) {
$.logErr(e, resp);
} finally {
resolve(false);
}
},
);
});
}
function doTask({tasklevel, left, taskname, eachtimeget}) {
return new Promise(async resolve => {
if (parseInt(left) <= 0) {
$.log(`${taskname}[做任务] 任务已完成,跳过`);
resolve(false);
}
$.get(
taskUrl(
'dotask',
`active=${$.info.active}&answer=${$.info.indexday}:D:0&joinnum=${$.info.joinnum}&tasklevel=${tasklevel}`,
),
(err, resp, data) => {
try {
const res = data.match(/try\{whyour\(([\s\S]*)\)\;\}catch\(e\)\{\}/)[1];
let {ret, retmsg} = JSON.parse(res);
retmsg = retmsg !== '' ? retmsg : '成功';
$.log(`${taskname}[做任务]ret:${ret} retmsg:"${retmsg.indexOf('活动太火爆了') !== -1 ? '任务进行中或者未到任务时间' : retmsg}"`);
if (ret === 0) {
$.drip += eachtimeget;
}
resolve(ret);
} catch (e) {
$.logErr(e, resp);
} finally {
resolve();
}
},
);
});
}
function taskUrl(function_path, body) {
return {
url: `${JXNC_API_HOST}cubeactive/farm/${function_path}?${body}&farm_jstoken=${currentToken['farm_jstoken']}&phoneid=${currentToken['phoneid']}&timestamp=${currentToken['timestamp']}&sceneval=2&g_login_type=1&callback=whyour&_=${Date.now()}&g_ty=ls`,
headers: {
Cookie: currentCookie,
Accept: `*/*`,
Connection: `keep-alive`,
Referer: `https://st.jingxi.com/pingou/dream_factory/index.html`,
'Accept-Encoding': `gzip, deflate, br`,
Host: `wq.jd.com`,
'Accept-Language': `zh-cn`,
},
};
}
async function showMsg() {
$.msg($.name, subTitle, message, option);
if ($.isNode()) {
await notify.sendNotify(`${$.name} - 账号${$.index} - ${$.nickName}`, `${subTitle}\n${message}`);
}
}
// 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)
}

View File

@@ -1,6 +1,6 @@
/*
东东萌宠 更新地址: https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_pet.js
更新时间2021-01-06
更新时间2021-01-10
已支持IOS双京东账号,Node.js支持N个京东账号
脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js
@@ -123,7 +123,7 @@ async function jdPet() {
await petSport();//遛弯
await slaveHelp();//助力好友
//await masterHelpInit();//获取助力的信息
await masterHelpInit();//获取助力的信息
await doTask();//做日常任务
await feedPetsAgain();//再次投食
await energyCollect();//收集好感度
@@ -263,8 +263,8 @@ async function masterHelpInit() {
* 运行脚本时你自己的shareCode会在控制台输出, 可以将其分享给他人
*/
async function slaveHelp() {
$.log(`\n因1.6日好友助力功能下线。故暂时屏蔽\n`)
return
//$.log(`\n因1.6日好友助力功能下线。故暂时屏蔽\n`)
//return
let helpPeoples = '';
for (let code of newShareCodes) {
console.log(`开始助力京东账号${$.index} - ${$.nickName}的好友: ${code}`);
@@ -472,8 +472,8 @@ function shareCodesFormat() {
newShareCodes = shareCodes[tempIndex].split('@');
}
//因好友助力功能下线。故暂时屏蔽
// const readShareCodeRes = await readShareCode();
const readShareCodeRes = null;
const readShareCodeRes = await readShareCode();
//const readShareCodeRes = null;
if (readShareCodeRes && readShareCodeRes.code === 200) {
newShareCodes = [...new Set([...newShareCodes, ...(readShareCodeRes.data || [])])];
}

View File

@@ -16,7 +16,7 @@ let SCKEY = '';
//此处填你申请的SKEY(具体详见文档 https://cp.xuthus.cc/)
//注此处设置github action用户填写到Settings-Secrets里面(Name输入QQ_SKEY)
let QQ_SKEY = '';
//此处填写私聊或群组推送,默认私聊(send或group或者wx)
//此处填写私聊或群组推送,默认私聊(send[私聊]、group[群聊]、wx[个微]、ww[企微]、email[邮件])
let QQ_MODE = 'send';
// =======================================Bark App通知设置区域===========================================
@@ -196,24 +196,54 @@ function serverNotify(text, desp, timeout = 2100) {
function CoolPush(text, desp) {
return new Promise(resolve => {
if (QQ_SKEY) {
const options = {
let options = {
url: `https://push.xuthus.cc/${QQ_MODE}/${QQ_SKEY}`,
body: `${text}\n\n${desp}`,
headers: {
'Content-Type': 'application/json'
}
}
switch (QQ_MODE) {
case "email":
options.json = {
"t": text,
"c": desp,
};
break;
default:
options.body = `${text}\n\n${desp}`;
}
let pushMode = function(t) {
switch (t){
case "send":
return "个人";
case "group":
return "QQ群";
case "wx":
return "微信";
case "ww":
return "企业微信";
case "email":
return "邮件";
default:
return "未知方式"
}
}
$.post(options, (err, resp, data) => {
try {
if (err) {
console.log(`发送${QQ_MODE === 'send' ? '个人' : QQ_MODE === 'group' ? 'QQ群' : QQ_MODE === 'wx' ? '微信' : ''}通知调用API失败\n`)
console.log(`发送${pushMode(QQ_MODE)}通知调用API失败\n`)
console.log(err);
} else {
data = JSON.parse(data);
if (data.code === 200) {
console.log(`酷推发送${QQ_MODE === 'send' ? '个人' : QQ_MODE === 'group' ? 'QQ群' : QQ_MODE === 'wx' ? '微信' : ''}通知消息成功\n`)
console.log(`酷推发送${pushMode(QQ_MODE)}通知消息成功\n`)
} else if (data.code === 400) {
console.log(`QQ酷推(Cool Push)发送${QQ_MODE === 'send' ? '个人' : QQ_MODE === 'group' ? 'QQ群' : QQ_MODE === 'wx' ? '微信' : ''}推送失败:${data.msg}\n`)
console.log(`QQ酷推(Cool Push)发送${pushMode(QQ_MODE)}推送失败:${data.msg}\n`)
}else{
console.log(`酷推推送异常: ${data.msg}`);
}
}
} catch (e) {

View File

@@ -28,12 +28,12 @@ inputs:
cronExpression: "0 0 0 * * * *"
enable: true
argument: jd_blueCoin&jd_club_lottery&jd_car&jd_car_exchange
- timer: # 东东农场# 东东萌宠
- timer: #东东农场 #东东萌宠 #口袋书店
parameters:
name: jd_fruit_jd_pet
cronExpression: "0 5 6-18/6 * * * *"
name: jd_fruit_jd_pet_bookshop
cronExpression: "0 5 6-18/6,8 * * * *"
enable: true
argument: jd_fruit&jd_pet
argument: jd_fruit&jd_pet&jd_bookshop
- timer: # 宠汪汪喂食# 宠汪汪# 摇钱树# 京东种豆得豆# 京喜工厂 #东东工厂
parameters:
name: joy_feedPets_joy_moneyTree_plantBean_dreamFactory_jdfactory