diff --git a/JD_extra_cookie.js b/JD_extra_cookie.js index f1eed495..504eda2d 100644 --- a/JD_extra_cookie.js +++ b/JD_extra_cookie.js @@ -7,11 +7,10 @@ Github: https://github.com/dompling =================== 特别说明: -1.获取多个京东cookie文件,不和野比大佬的文件冲突。暂不支持野比大佬脚本签到。 -2.若是要使用京东多合一签到,请使用修改版地址:https://raw.githubusercontent.com/dompling/Script/master/jd/JD_extra.js +1.获取多个京东cookie的脚本,不和NobyDa的京东cookie冲突。 =================== =================== -使用方式:复制 https://home.m.jd.com/myJd/newhome.action 到浏览器打开 ,在个人中心自动获取 cookie, +使用方式:在代理软件配置好下方配置后,复制 https://home.m.jd.com/myJd/newhome.action 到浏览器打开 ,在个人中心自动获取 cookie, 若弹出成功则正常使用。否则继续再此页面继续刷新一下试试 =================== diff --git a/Loon/lxk0301_LoonTask.conf b/Loon/lxk0301_LoonTask.conf index d2fbd7ae..63977d1f 100644 --- a/Loon/lxk0301_LoonTask.conf +++ b/Loon/lxk0301_LoonTask.conf @@ -37,7 +37,7 @@ cron "3 */5 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scri cron "11 1-23/2 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_superMarket.js,tag=京小超 # 京小超兑换奖品 -cron "0 0 0 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_blueCoin.js,tag=京小超兑换奖品 +cron "0,30 0 0 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_blueCoin.js,tag=京小超兑换奖品 # 取关京东店铺商品 cron "55 23 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_unsubscribe.js,tag=取关京东店铺商品 @@ -91,13 +91,13 @@ http-response ^https:\/\/jdjoy\.jd\.com\/pet\/getPetTreasureBox|^https:\/\/draw\ http-response ^https:\/\/account\.huami\.com\/v2\/client\/login script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/backUp/xmSports.js, requires-body=true, timeout=10, tag=小米运动获取Token # 京东代属 -cron "10 7 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_ds.js, tag=京东代属 +# cron "10 7 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_ds.js, tag=京东代属 # 京东快递 cron "10 0 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_kd.js, tag=京东快递签到 # 京东汽车 -cron "10 7 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_car.js, tag=京东汽车 +cron "0 0 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_car.js, tag=京东汽车 # 领京豆额外奖励 cron "10 7 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_bean_home.js, tag=领京豆额外奖励 @@ -107,17 +107,19 @@ cron "3 8 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_script # 京东赚赚 cron "10 11 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_jdzz.js, tag=京东赚赚 # 京东秒杀红包雨 -cron "10 7 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_ms_redrain.js, tag=秒杀红包雨 +# cron "10 7 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_ms_redrain.js, tag=秒杀红包雨 #注销京东店铺会员卡 cron "23 12 * * 6" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_unbind.js, tag=注销京东店铺会员卡 # 京东直播 cron "10-20/5 12 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live.js, tag=京东直播 # 京东看一看 -cron "40 9,10 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_watch.js, tag=京东看一看 +# cron "40 9,10 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_watch.js, tag=京东看一看 #直播红包雨 -cron "1 0,20,9-23/2 15-31 12 *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live_redrain.js, tag=直播红包雨 +# cron "1 0,20,9-23/2 15-31 12 *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live_redrain.js, tag=直播红包雨 # 金融打卡领年终奖 -cron "10 6 1-31 12 *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jr_sign.js, tag=金融打卡领年终奖 +# cron "10 6 1-31 12 *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jr_sign.js, tag=金融打卡领年终奖 # 健康抽奖机 -cron "10 0 1-31 12 *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_health.js,tag=健康抽奖机 \ No newline at end of file +cron "10 0 1-31 12 *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_health.js,tag=健康抽奖机 +# 疯狂的joy日常任务 +cron "30 8 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_crazy_joy.js,tag=疯狂的joy日常任务 diff --git a/QuantumultX/lxk0301_gallery.json b/QuantumultX/lxk0301_gallery.json index bc4aee1c..a3709536 100644 --- a/QuantumultX/lxk0301_gallery.json +++ b/QuantumultX/lxk0301_gallery.json @@ -13,7 +13,7 @@ "15 */5 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_moneyTree.js , tag=京东摇钱树 , img-url=https://raw.githubusercontent.com/58xinian/icon/master/jdyqs.png", "5 0 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_club_lottery.js , tag=摇京豆 , img-url=https://raw.githubusercontent.com/58xinian/icon/master/jdyjd.png", "11 1-23/5 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_superMarket.js , tag=京小超 , img-url=https://raw.githubusercontent.com/58xinian/icon/master/jxc.png", - "0 0 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_blueCoin.js , tag=京小超兑换奖品 , img-url=https://raw.githubusercontent.com/58xinian/icon/master/jxc.png", + "0,30 0 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_blueCoin.js , tag=京小超兑换奖品 , img-url=https://raw.githubusercontent.com/58xinian/icon/master/jxc.png", "55 23 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_unsubscribe.js , tag=取关京东店铺商品 , img-url=https://raw.githubusercontent.com/Orz-3/task/master/jd.png", "10 0 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_shop.js , tag=进店领豆 , img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_shop.png", "15 10 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_joy_run.js , tag=宠汪汪邀请助力与赛跑助力 , img-url=https://raw.githubusercontent.com/58xinian/icon/master/jdcww.png", @@ -26,7 +26,7 @@ "0 7 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_syj.js, tag=十元街, img-url=https://github.com/58xinian/icon/raw/master/jd_syj.png", "15 7 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_ms_redrain.js, tag=秒杀红包雨, img-url=https://raw.githubusercontent.com/Orz-3/task/master/jd.png", "10 6 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_bean_home.js, tag=领京豆额外奖励, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_bean_home.png", - "20 7 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_car.js, tag=京东汽车, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_car.png", + "0 0 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_car.js, tag=京东汽车, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_car.png", "10 0 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_kd.js, tag=京东快递签到, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_kd.png", "30 7 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_ds.js, tag=京东代属, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_ds.png", "30 0 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_health.js, tag=健康抽奖机, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_redPacket.png", @@ -35,6 +35,7 @@ "10 8 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_jdh.js, tag=京东健康, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_jdh.png", "14 11 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_jdzz.js, tag=京东赚赚, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jdzz.png", "44 12 * * 6 https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_unbind.js, tag=注销京东店铺会员卡, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_unbind.png", + "30 8 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_crazy_joy.js, tag=crazyJoy任务, img-url=https://raw.githubusercontent.com/Orz-3/task/master/jd.png", "1 0,20,9-23/2 15-31 12 * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live_redrain.js, tag=直播红包雨, img-url= https://raw.githubusercontent.com/58xinian/icon/master/jd_live_redrain.png", "10 12 1-31 12 * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jr_sign.js, tag=京东金融打卡, img-url= https://raw.githubusercontent.com/58xinian/icon/master/jd_redPacket.png", "15 17 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/backUp/xmSports.js, tag=小米运动, img-url=https://raw.githubusercontent.com/58xinian/icon/master/xmyd.png" diff --git a/README.md b/README.md index 7002d51d..8783d737 100644 --- a/README.md +++ b/README.md @@ -20,36 +20,44 @@ > ***您使用或者复制了本仓库且本人制作的任何脚本,则视为`已接受`此声明,请仔细阅读*** ## 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上查阅,恕不再另行说明。 -1. 京东水果([jd_fruit.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_fruit.js)) -2. 东东萌宠([jd_pet.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_pet.js)) -4. 种豆得豆([jd_plantBean.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_plantBean.js)) -5. 天天加速([jd_speed.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_speed.js)) -6. 摇钱树([jd_moneyTree.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_moneyTree.js)) -6. 宠汪汪([jd_joy.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_joy.js)) -7. 宠汪汪偷好友狗粮与积分([jd_joy_steal.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_joy_steal.js)) -8. 宠汪汪单独喂食([jd_joy_feedPets.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_joy_feedPets.js)) -9. 宠汪汪兑换奖品([jd_joy_reward.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_joy_reward.js)) -10. 宠汪汪强制为好友助力(刷好友)([jd_joy_help.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_joy_help.js)) -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)) -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) 】 -20. 京豆变动通知([jd_bean_change.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_bean_change.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)) +| 活动时长 | 名称 | 脚本 | +| ---- | ------------------------------ | -------------------------------------------------------------------------------------------------------- | +| 长期 | 疯狂的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) | 搬运脚本 1. 【[@yangtingxiao](https://github.com/yangtingxiao)】京东抽奖机([jd_lotteryMachine.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_lotteryMachine.js)) @@ -58,7 +66,9 @@ **脚本兼容: [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** +- [ ] 所有活动互助码在一个脚本打印 +## [邀请码互助入口](https://github.com/lxk0301/jd_scripts/discussions) ## 食用方法 @@ -97,26 +107,7 @@ ### 方法四:iOS系统的代理软件(QuantumultX, Surge, Loon, 小火箭) -#### 以下内容只针对iOS用户 - -#### ios使用多个京东账号,需要使用BoxJs保存多会话进行切换 - -##### BoxJs简单说明可看作者[BoxJs仓库地址](https://github.com/chavyleung/scripts/) - -使用box可以实现远程订阅助力好友(需订阅此 [链接](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/lxk0301.boxjs.json)) - -- [BoxJs使用教程](https://chavyleung.gitbook.io/boxjs/) - -- [BoxJs教程视频](https://youtu.be/eIpBrRxiy0w) - - -【用box订阅的好处】 - - 1、脚本也可以远程挂载。京东活动助力功能的分享码只需在box里面填写。以后只需远程更新就行。 - - 2、所有脚本的cookie都可以备份,方便你迁移到其他支持box的软件。 - - 3、box可以支持多账号 +#### [京东cookie获取脚本](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/JD_extra_cookie.js) ### 赞赏码(开发维护不易,请赏杯茶水费)
diff --git a/Surge/lxk0301_Task.sgmodule.sgmodule b/Surge/lxk0301_Task.sgmodule.sgmodule index 5a277b26..ac722056 100644 --- a/Surge/lxk0301_Task.sgmodule.sgmodule +++ b/Surge/lxk0301_Task.sgmodule.sgmodule @@ -32,7 +32,7 @@ cron "5 0 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_script #京小超 cron "11 1-23/5 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_superMarket.js,timeout=530, wake-system=1, tag=京小超 京小超兑换奖品 -cron "0 0 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_blueCoin.js,timeout=130, wake-system=1, tag=京小超兑换奖品 +cron "0,30 0 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_blueCoin.js,timeout=130, wake-system=1, tag=京小超兑换奖品 #取关京东店铺商品 cron "55 23 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_unsubscribe.js,timeout=250, wake-system=1, tag=取关京东店铺商品 #进店领豆 @@ -53,12 +53,10 @@ cron "40 * * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scrip cron "10 7 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_small_home.js, timeout=650, wake-system=1, tag=东东小窝 #十元街 cron "40 8 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_syj.js, timeout=650, wake-system=1, tag=十元街 -#京东代属(仅京东学生认证用户可用) -cron "30 8 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_ds.js, timeout=650, wake-system=1, tag=京东代属 #领京豆额外奖励 cron "30 10 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_bean_home.js, timeout=750, wake-system=1, tag=领京豆额外奖励 #京东汽车 -cron "30 11 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_car.js, timeout=750, wake-system=1, tag=京东汽车 +cron "0 0 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_car.js, timeout=750, wake-system=1, tag=京东汽车 #京东快递签到 cron "20 11 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_kd.js, timeout=750, wake-system=1, tag=京东快递签到 #京东直播(活动结束时间未知) @@ -71,13 +69,9 @@ cron "20 23 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scri cron "20 11 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_jdzz.js, timeout=750, wake-system=1, tag=京东赚赚 #注销京东店铺会员卡 cron "20 12 * * 6" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_unbind.js, timeout=750, wake-system=1, tag=注销京东店铺会员卡 +#疯狂的joy日常任务 +cron "30 8 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_crazy_joy.js, timeout=1750, wake-system=1, tag=疯狂的joy日常任务 #以下为短期活动 -#金融打卡领年终奖 -cron "30 7 1-31 12 *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jr_sign.js, timeout=750, wake-system=1, tag=金融打卡领年终奖 #健康抽奖机 cron "30 2 1-31 12 *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_health.js, timeout=750, wake-system=1, tag=健康抽奖机 -#直播红包雨(2020-12-31活动结束) -cron "1 0,20,9-23/2 15-31 12 *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live_redrain.js, timeout=750, wake-system=1, tag=直播红包雨 -#秒杀红包雨(2020-12-31活动结束) -cron "20 9 1-31 12 *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_ms_redrain.js, timeout=750, wake-system=1, tag=秒杀红包雨 diff --git a/backUp/qqread.js b/backUp/qqread.js index e2db6bd6..f72fe1f4 100644 --- a/backUp/qqread.js +++ b/backUp/qqread.js @@ -235,7 +235,7 @@ async function QQ_READ() { function showmsg() { return new Promise(async resolve => { let nowTimes = new Date(new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000); - if (nowTimes.getHours() === 22 && (nowTimes.getMinutes() >= 0 && nowTimes.getMinutes() <= 20)) { + if (nowTimes.getHours() === 22 && (nowTimes.getMinutes() >= 0 && nowTimes.getMinutes() <= 15)) { await notify.sendNotify(jsname, tz); } $.msg(jsname, "", tz); diff --git a/docker/crontab_list.sh b/docker/crontab_list.sh index c2510d14..29945110 100644 --- a/docker/crontab_list.sh +++ b/docker/crontab_list.sh @@ -4,24 +4,13 @@ 50 23 */3 * * rm -rf /scripts/logs/*.log ##############短期活动############## -# 秒杀红包雨(2020.12.31活动过期) -40 8 1-31 12 * node /scripts/jd_ms_redrain.js >> /scripts/logs/jd_ms_redrain.log 2>&1 # 健康抽奖机(2020.12.31活动过期) 10 0 1-31 12 * node /scripts/jd_health.js >> /scripts/logs/jd_health.log 2>&1 -# 直播红包雨(2020.12.31活动过期) -1 0,20,9-23/2 15-31 12 * node /scripts/jd_live_redrain.js >> /scripts/logs/jd_live_redrain.log 2>&1 -# 京东金融打卡领年终奖(2020.12.31活动过期) -10 6 1-31 12 * node /scripts/jr_sign.js >> /scripts/logs/jr_sign.log 2>&1 -# 京东健康APP集汪汪卡瓜分百万红包(2021.1.6活动过期) -10 8 * * * node /scripts/jd_jdh.js >> /scripts/logs/jd_jdh.log 2>&1 -# crazyJoy自动每日任务 -10 7 * * * node /scripts/jd_crazy_joy.js >> /scripts/logs/jd_crazy_joy.log 2>&1 - ##############长期活动############## # 签到 -0 0,12,18 * * * cd /scripts && node jd_bean_sign.js >> /scripts/logs/jd_bean_sign.log 2>&1 +0 0,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 +0,30 0 * * * node /scripts/jd_blueCoin.js >> /scripts/logs/jd_blueCoin.log 2>&1 # 摇京豆 0 0 * * * node /scripts/jd_club_lottery.js >> /scripts/logs/jd_club_lottery.log 2>&1 # 东东农场 @@ -71,11 +60,11 @@ # 十元街 36 8,18 * * * node /scripts/jd_syj.js >> /scripts/logs/jd_syj.log 2>&1 # 京东代属(注:限校园用户可使用) -36 9 * * * node /scripts/jd_ds.js >> /scripts/logs/jd_ds.log 2>&1 +# 36 9 * * * node /scripts/jd_ds.js >> /scripts/logs/jd_ds.log 2>&1 # 京东快递签到 23 1 * * * node /scripts/jd_kd.js >> /scripts/logs/jd_kd.log 2>&1 # 京东汽车(签到满500赛点可兑换500京豆) -33 2 * * * node /scripts/jd_car.js >> /scripts/logs/jd_car.log 2>&1 +0 0 * * * node /scripts/jd_car.js >> /scripts/logs/jd_car.log 2>&1 # 领京豆额外奖励(每日可获得3京豆) 33 4 * * * node /scripts/jd_bean_home.js >> /scripts/logs/jd_bean_home.log 2>&1 # 京东直播(每日18豆) @@ -84,7 +73,7 @@ 10 11 * * * node /scripts/jd_jdzz.js >> /scripts/logs/jd_jdzz.log 2>&1 # 宠汪汪邀请助力 10 10,11 * * * node /scripts/jd_joy_run.js >> /scripts/logs/jd_joy_run.log 2>&1 -# 京东发现-看一看,看40个视频领80京豆(非常耗时) -13 11,14 * * * node /scripts/jd_watch.js >> /scripts/logs/jd_watch.log 2>&1 # 注销京东已开的店铺会员,不是注销京东plus会员,个别店铺无法注销 44 4 * * 6 node /scripts/jd_unbind.js >> /scripts/logs/jd_unbind.log 2>&1 +# crazyJoy自动每日任务 +10 7 * * * node /scripts/jd_crazy_joy.js >> /scripts/logs/jd_crazy_joy.log 2>&1 diff --git a/iCloud.md b/iCloud.md index 4066d16d..9eb86134 100644 --- a/iCloud.md +++ b/iCloud.md @@ -149,6 +149,60 @@ let CookieJDs = [ 目前repo中按照每个脚本一个定时器的方式设置到云函数中,大约需要触发器10多个,由于云函数触发器限制最多10个,需要对触发器进行整合,整合后触发器保持在10个以内,以下设置仅供参考
-![iCloud5](./icon/iCloud5.png) +| **JavaScript** | **脚本名称** | **活动时间** | **原Repository UTC时间** | **适用于云函数的北京时间** | **serverless.yml** | +| :----------------------: | :----------------------: | :----------: | :-----------------------: | :-------------------------: | :----------------: | +| `jd_bean_change` | 京豆变动通知 | 长期 | 0 2 * * * | 0 1 */1 * * | 30 7 * * * | +| `jd_bean_home` | 领京豆额外奖励 | 长期 | / | 0 1 */1 * * | 30 7 * * * | +| `jd_bean_sign` | 京豆签到 | 长期 | 0 16 * * * | 0 0 */1 * * | 0 0 * * * | +| `jd_blueCoin` | 京小超兑换奖品 | 长期 | 0 16 * * * | 0 1 */1 * * | 0 0 * * * | +| `jd_car` | 京东汽车 | 长期 | / | 0 0 */1 * * | 0 0 * * * | +| `jd_club_lottery` | 摇京豆 | 长期 | 0 16 * * * | 0 0 */1 * * | 0 0 * * * | +| `jd_crazy_joy` | 疯狂的joy | 长期 | / | / | 30 7 * * * | +| `jd_crazy_joy_coin` | 疯狂的joy挂机 | 长期 | / | / | / | +| `jd_daily_egg` | 京东金融-天天提额 | 长期 | 10 */3 * * * | 0-12/3 */3 * * * | 8 */3 * * * | +| `jd_dreamFactory` | 京喜工厂 | 长期 | / | */30 * * * * | 3 */1 * * * | +| `jd_ds` | 京东代属(校园用户) | 长期 | / | / | / | +| `jd_fruit` | 东东农场 | 长期 | 20 23,4,10 * * * | 0,5,10 8,9,12,18,23,0 * * * | 5 6-18/6 * * * | +| `jd_health` | 健康抽奖机 | 短期 | / | 0 0 */1 * * | 10 0 * * * | +| `jd_jdfactory` | 东东工厂 | 长期 | / | */30 * * * * | 3 */1 * * * | +| `jd_jdh` | 京东健康APP | 短期 | / | / | 30 7 * * * | +| `jd_jdzz` | 京东赚赚 | 长期 | / | / | 3 1 * * * | +| `jd_joy` | 宠汪汪 | 长期 | 0 0,1,4,10,15,16 * * * | 0,5,10 8,9,12,18,23,0 * * * | 3 */1 * * * | +| `jd_joy_feedPets` | 宠汪汪单独喂食 | 长期 | */20 */1 * * * | 0-12/3 */3 * * * | 3 */1 * * * | +| `jd_joy_help` | 宠汪汪强制为别人助力 | 长期 | / | / | / | +| `jd_joy_reward` | 宠汪汪兑换奖品 | 长期 | 0 0,4,8,16 * * * | 0 8,12,16,0 */1 * * | 0 0-16/8,20 * * * | +| `jd_joy_run` | 宠汪汪邀请助力与赛跑助力 | 长期 | / | / | / | +| `jd_joy_steal` | 宠汪汪偷好友狗粮与积分 | 长期 | 0 16,22 * * * | 0 0,6,20 */1 * * | 0 0-16/8,20 * * * | +| `jd_kd` | 京东快递 | 长期 | / | 0 1 */1 * * | 3 1 * * * | +| `jd_live` | 京东直播18豆 | 长期 | / | / | 0 0-16/8,20 * * * | +| `jd_live_redrain` | 超级直播间红包雨 | 短期 | / | 0 0,20,9-23/2 * * MON-FRI | / | +| `jd_lotteryMachine` | 京东抽奖机 | 长期 | 11 17 * * * | 0 0 */1 * * | 10 0 * * * | +| `jd_moneyTree` | 摇钱树 | 长期 | 40 */3 * * * | 0-12/3 */3 * * * | 3 */1 * * * | +| `jd_ms_redrain` | 秒杀红包雨 | 短期 | / | 0 1 */1 * * | 10 0 * * * | +| `jd_necklace` | 点点券 | 长期 | / | 0 0,6,20 */1 * * | 0 0-16/8,20 * * * | +| `jd_pet` | 东东萌宠 | 长期 | 35 23,4,10 * * * | 0,5,10 8,9,12,18,23,0 * * * | 5 6-18/6 * * * | +| `jd_petTreasureBox` | 宠汪汪聚宝盆 | 长期 | / | / | / | +| `jd_pigPet` | 京东金融-养猪猪 | 长期 | / | 0-12/3 */3 * * * | 3 1 * * * | +| `jd_plantBean` | 种豆得豆 | 长期 | 0 23,0-14/1 * * * | 0-12/3 */3 * * * | 3 */1 * * * | +| `jd_rankingList` | 京东排行榜 | 长期 | 11 18 * * * | 0 0 */1 * * | 30 7 * * * | +| `jd_redPacket` | 全民开红包 | 长期 | 0 17 * * * | 0 1 */1 * * | 10 0 * * * | +| `jd_shop` | 进店领豆 | 长期 | 0 16 * * * | 0 0 */1 * * | 10 0 * * * | +| `jd_small_home` | 东东小窝 | 长期 | / | 0 0,6,20 */1 * * | 10 0 * * * | +| `jd_speed` | 天天加速 | 长期 | 33 */3 * * * | 0-12/3 */3 * * * | 8 */3 * * * | +| `jd_superMarket` | 东东超市 | 长期 | 15 * * * * | */30 * * * * | 15 * * * * | +| `jd_syj` | 十元街 | 长期 | / | 0 1 */1 * * | 3 1 * * * | +| `jd_unbind` | 注销京东会员卡 | 长期 | / | / | 10 0 * * * | +| `jd_unsubscribe` | 取关京东店铺和商品 | 长期 | 45 15 * * * | 0 1 */1 * * | 10 0 * * * | +| `jd_watch` | 发现-看一看 | 长期 | / | / | 3 1 * * * | +| `jr_sign` | 金融打卡年终奖 | 短期 | / | / | 3 1 * * * | +| `jd_818` | 京东手机狂欢城 | 短期 | 0 1,4,7,10,12,16,22 * * * | 0 9,12,15,16,20,0,6 */1 * * | / | +| `jd_apple_live` | 苹果抽奖机 | 短期 | / | / | / | +| `jd_collectProduceScore` | 双十一活动领金币 | 短期 | 30 * * * * | */30 * * * * | / | +| `jd_digital_floor` | 数码加购京豆 | 短期 | / | / | / | +| `jd_jxstory` | 京喜故事 | 短期 | / | / | / | +| `jd_mohe` | 热8超级魔盒 | 短期 | / | / | / | +| `jd_pubg` | PUBG | 短期 | / | / | / | +| `jd_split` | 金榜年终奖 | 短期 | / | / | / | +| `jd_xtg` | 双十一星推官 | 短期 | 0 16 * * * | 0 0 */1 * * | / | 点击提交,所有流程就结束了。 diff --git a/jdDreamFactoryShareCodes.js b/jdDreamFactoryShareCodes.js index 61148552..8092924b 100644 --- a/jdDreamFactoryShareCodes.js +++ b/jdDreamFactoryShareCodes.js @@ -11,7 +11,7 @@ let shareCodes = [ 'V5LkjP4WRyjeCKR9VRwcRX0bBuTz7MEK0-E99EJ7u0k=@Bo-jnVs_m9uBvbRzraXcSA==@-OvElMzqeyeGBWazWYjI1Q==',//账号一的好友shareCode,不同好友中间用@符号隔开 '1uzRU5HkaUgvy0AB5Q9VUg==@PDPM257r_KuQhil2Y7koNw==@-OvElMzqeyeGBWazWYjI1Q==',//账号二的好友shareCode,不同好友中间用@符号隔开 ] -// 判断github action里面是否有东东萌宠互助码 +// 判断github action里面是否有京喜工厂互助码 if (process.env.DREAM_FACTORY_SHARE_CODES) { if (process.env.DREAM_FACTORY_SHARE_CODES.indexOf('&') > -1) { console.log(`您的互助码选择的是用&隔开\n`) @@ -28,4 +28,4 @@ if (process.env.DREAM_FACTORY_SHARE_CODES) { 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/jdFruitShareCodes.js b/jdFruitShareCodes.js index 4ddbd3da..d06c92d1 100644 --- a/jdFruitShareCodes.js +++ b/jdFruitShareCodes.js @@ -1,5 +1,5 @@ /* -水果互助码 +东东农场互助码 此文件为Node.js专用。其他用户请忽略 支持京东N个账号 */ @@ -11,7 +11,7 @@ let FruitShareCodes = [ '0a74407df5df4fa99672a037eec61f7e@dbb21614667246fabcfd9685b6f448f3@6fbd26cc27ac44d6a7fed34092453f77@61ff5c624949454aa88561f2cd721bf6@56db8e7bc5874668ba7d5195230d067a',//账号一的好友shareCode,不同好友中间用@符号隔开 '6fbd26cc27ac44d6a7fed34092453f77@61ff5c624949454aa88561f2cd721bf6@9c52670d52ad4e1a812f894563c746ea@8175509d82504e96828afc8b1bbb9cb3',//账号二的好友shareCode,不同好友中间用@符号隔开 ] -// 判断github action里面是否有水果互助码 +// 判断github action里面是否有东东农场互助码 if (process.env.FRUITSHARECODES) { if (process.env.FRUITSHARECODES.indexOf('&') > -1) { console.log(`您的东东农场互助码选择的是用&隔开\n`) diff --git a/jdPlantBeanShareCodes.js b/jdPlantBeanShareCodes.js index 3894909b..faba2b6b 100644 --- a/jdPlantBeanShareCodes.js +++ b/jdPlantBeanShareCodes.js @@ -11,7 +11,7 @@ let PlantBeanShareCodes = [ '66j4yt3ebl5ierjljoszp7e4izzbzaqhi5k2unz2afwlyqsgnasq@olmijoxgmjutyrsovl2xalt2tbtfmg6sqldcb3q@e7lhibzb3zek27amgsvywffxx7hxgtzstrk2lba@olmijoxgmjutyx55upqaqxrblt7f3h26dgj2riy',//账号一的好友shareCode,不同好友中间用@符号隔开 '4npkonnsy7xi3p6pjfxg6ct5gll42gmvnz7zgoy@6dygkptofggtp6ffhbowku3xgu@mlrdw3aw26j3wgzjipsxgonaoyr2evrdsifsziy@mlrdw3aw26j3wgzjipsxgonaoyr2evrdsifsziy',//账号二的好友shareCode,不同好友中间用@符号隔开 ] -// 判断github action里面是否有东东萌宠互助码 +// 判断github action里面是否有种豆得豆互助码 if (process.env.PLANT_BEAN_SHARECODES) { if (process.env.PLANT_BEAN_SHARECODES.indexOf('&') > -1) { console.log(`您的种豆互助码选择的是用&隔开\n`) @@ -28,4 +28,4 @@ if (process.env.PLANT_BEAN_SHARECODES) { for (let i = 0; i < PlantBeanShareCodes.length; i++) { const index = (i + 1 === 1) ? '' : (i + 1); exports['PlantBeanShareCodes' + index] = PlantBeanShareCodes[i]; -} \ No newline at end of file +} diff --git a/jd_bean_home.js b/jd_bean_home.js index 7a84357b..666ad746 100644 --- a/jd_bean_home.js +++ b/jd_bean_home.js @@ -112,11 +112,15 @@ const JD_API_HOST = 'https://api.m.jd.com/'; async function jdBeanHome() { $.doneState = false - for (let i = 0; i < 3; ++i) { + // for (let i = 0; i < 3; ++i) { + // await doTask2() + // await $.wait(1000) + // if ($.doneState) break + // } + do { await doTask2() - await $.wait(1000) - if ($.doneState) break - } + await $.wait(3000) + } while (!$.doneState) await $.wait(1000) await award("feeds") await $.wait(1000) @@ -142,10 +146,16 @@ function doTask2() { } else { if (safeGet(data)) { data = JSON.parse(data); - if(data.code === '0' && data.data){ + if (data.code === '0' && data.data){ console.log(`任务完成进度:${data.data.taskProgress} / ${data.data.taskThreshold}`) - if(data.data.taskProgress===data.data.taskThreshold) + if(data.data.taskProgress === data.data.taskThreshold) $.doneState = true + } else if (data.code === '0' && data.errorCode === 'HT201') { + $.doneState = true + } else { + //HT304风控用户 + $.doneState = true + console.log(`做任务异常:${JSON.stringify(data)}`) } } } diff --git a/jd_crazy_joy.js b/jd_crazy_joy.js index f85bb81d..a87e8711 100644 --- a/jd_crazy_joy.js +++ b/jd_crazy_joy.js @@ -16,10 +16,10 @@ crazyJoy任务 cron "10 7 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_crazy_joy.js,tag=crazyJoy任务 ===============Surge================= -crazyJoy任务 = type=cron,cronexp="10 * * * *",wake-system=1,timeout=20,script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_crazy_joy.js +crazyJoy任务 = type=cron,cronexp="10 7 * * *",wake-system=1,timeout=20,script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_crazy_joy.js ============小火箭========= -crazyJoy任务 = type=cron,script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_crazy_joy.js, cronexpr="10 * * * *", timeout=200, enable=true +crazyJoy任务 = type=cron,script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_crazy_joy.js, cronexpr="10 7 * * *", timeout=200, enable=true */ @@ -36,7 +36,7 @@ const inviteCodes = [ 'EdLPh8A6X5G1iWXu-uPYfA==@0gUO7F7N-4HVDh9mdQC2hg==@fUJTgR9z26fXdQgTvt_bgqt9zd5YaBeE@nCQQXQHKGjPCb7jkd8q2U-aCTjZMxL3s@2boGLV7TonMex8-nrT6EGat9zd5YaBeE', 'EdLPh8A6X5G1iWXu-uPYfA==@0gUO7F7N-4HVDh9mdQC2hg==@fUJTgR9z26fXdQgTvt_bgqt9zd5YaBeE@nCQQXQHKGjPCb7jkd8q2U-aCTjZMxL3s@2boGLV7TonMex8-nrT6EGat9zd5YaBeE' ]; -const randomCount = 5; +const randomCount = $.isNode() ? 10 : 5; const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; if ($.isNode()) { Object.keys(jdCookieNode).forEach((item) => { @@ -175,7 +175,8 @@ if ($.isNode()) { return; } await requireConfig(); - $.nextCode = "EdLPh8A6X5G1iWXu-uPYfA==" + $.nextCode = ["EdLPh8A6X5G1iWXu-uPYfA==", "nCQQXQHKGjPCb7jkd8q2U-aCTjZMxL3s"]; + $.nextCode = $.nextCode[randomNumber(0, $.nextCode.length)]; $.selfCodes = [] for (let i = 0; i < cookiesArr.length; i++) { if (cookiesArr[i]) { @@ -184,6 +185,8 @@ if ($.isNode()) { $.index = i + 1; $.isLogin = true; $.nickName = ''; + message = ''; + $.GROWTH_REWARD_BEAN = 0;//解锁等级奖励的京豆 await TotalBean(); console.log(`\n开始【京东账号${$.index}】${$.nickName || $.UserName}\n`); if (!$.isLogin) { @@ -258,22 +261,26 @@ async function jdCrazyJoy() { $.bean = 0 await getUserInfo($.nextCode) await doSign() - // 帮助作者 + // 助力好友 await helpFriends() await doTasks() + await getGrowthReward();//领取解锁的等级奖励 await getCoin() await getUserBean() - console.log(`当前信息:${$.bean} 京豆,${$.coin} 金币`) if ( applyJdBean!==0 && applyJdBean<=$.bean){ await $.wait(1000) console.log(`检测您打开了自动兑换开关,去兑换京豆`) await doApplyJdBean(applyJdBean) } + await showMsg(); } async function doTasks() { await getTaskInfo() for (let j = 0; j < $.taskList.length; ++j) { - let task = $.taskList[j] + let task = $.taskList[j]; + if (task['taskTypeId'] === 102) { + message += `${task.taskTitle}:${task['doneTimes']}/${task.ext.count}\n`; + } if (task.status === 0 && task.taskTypeId === 103) for (let i = task.doneTimes; i < task.ext.count; ++i) { await doTask(task.taskId) @@ -294,10 +301,12 @@ function doApplyJdBean(bean = 1000) { } else { if (safeGet(data)) { data = JSON.parse(data); - if (data.success) + if (data.success) { console.log(`兑换${bean}京豆成功`) - else + message += `兑换京豆:${bean}京豆成功\n`; + } else { console.log(`兑换${bean}京豆失败,错误信息:${data.resultTips||data.message}`) + } } } } catch (e) { @@ -323,6 +332,7 @@ function getUserInfo(code = "EdLPh8A6X5G1iWXu-uPYfA==") { console.log(`\n【京东账号${$.index}(${$.nickName || $.UserName})的${$.name}好友互助码】${data.data.userInviteCode}`) $.selfCodes.push(data.data.userInviteCode) $.nextCode = data.data.userInviteCode + message += `${data.data['nickName']}:${data.data['userTopLevelJoyId']}级JOY\n`; } else console.log(`用户信息获取失败`) @@ -359,7 +369,7 @@ function getTaskInfo() { if (safeGet(data)) { data = JSON.parse(data); if (data.success && data.data && data.data.length) { - $.taskList = data.data + $.taskList = data.data; } else { console.log(`任务信息获取失败`) } @@ -495,7 +505,13 @@ function helpFriend(code) { } else { if (safeGet(data)) { data = JSON.parse(data); - console.log(data.resultTips) + if (data['resultCode'] ==='0') { + console.log(`助力结果:${JSON.stringify(data)}`); + } else if (data['resultCode'] === '2000402') { + console.log(data.resultTips) + } else { + console.log(`助力异常:${JSON.stringify(data)}`); + } } } } catch (e) { @@ -542,8 +558,9 @@ function getCoin() { } else { if (safeGet(data)) { data = JSON.parse(data); - if (data.data && data.data.totalCoinAmount) - $.coin = data.data.totalCoinAmount + if (data.data && data.data.totalCoinAmount) { + $.coin = data.data.totalCoinAmount; + } } } } catch (e) { @@ -554,8 +571,71 @@ function getCoin() { }) }) } - - +//领取解锁等级奖励(京豆) +function getGrowthReward() { + return new Promise(async resolve => { + const body = { "paramData":{"eventType":"GROWTH_REWARD"} }; + $.get(taskUrl('crazyJoy_event_getGrowthAndSceneState', JSON.stringify(body)), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data['resultCode'] === '0') { + if (data.data) { + for (let item of data.data) { + if (item.status === 1) { + if (item.eventRecordId) await obtainAward(item.eventRecordId); + } + } + if ($.GROWTH_REWARD_BEAN > 0) { + message += `解锁等级奖励:获得${$.GROWTH_REWARD_BEAN}京豆\n`; + } + } + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} +function obtainAward(eventRecordId) { + return new Promise(async resolve => { + const body = {"eventType": "GROWTH_REWARD", eventRecordId}; + $.get(taskUrl('crazyJoy_event_obtainAward', JSON.stringify(body)), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data['resultCode'] === '0') { + $.GROWTH_REWARD_BEAN += data.data['beans']; + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} +function showMsg() { + return new Promise(async resolve => { + message += `当前信息:${$.bean}京豆,${$.coin}金币` + $.msg($.name, '', `京东账号${$.index} ${$.nickName}\n${message}`) + resolve() + }) +} function taskUrl(functionId, body = '') { let t = Date.now().toString().substr(0, 10) let e = body || "" @@ -719,5 +799,13 @@ function jsonParse(str) { } } } +/** + * 生成随机数字 + * @param {number} min 最小值(包含) + * @param {number} max 最大值(不包含) + */ +function randomNumber(min = 0, max = 100) { + return Math.min(Math.floor(min + Math.random() * (max - min)), max); +} // 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();s&&this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)}))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)})}}time(t){let e={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).length)));return t}msg(e=t,s="",i="",r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};if(this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r))),!this.isMuteLog){let t=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];t.push(e),s&&t.push(s),i&&t.push(i),console.log(t.join("\n")),this.logs=this.logs.concat(t)}}log(...t){t.length>0&&(this.logs=[...this.logs,...t]),console.log(t.join(this.logSeparator))}logErr(t,e){const s=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();s?this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)} diff --git a/jd_crazy_joy_coin.js b/jd_crazy_joy_coin.js index 00f394ba..669bf766 100644 --- a/jd_crazy_joy_coin.js +++ b/jd_crazy_joy_coin.js @@ -204,6 +204,12 @@ async function jdJxStory() { await $.wait(1000) await getJoyShop() await $.wait(1000) + if ($.joyIds && $.joyIds.length > 0) { + $.log('当前JOY分布情况') + $.log(`\n${$.joyIds[0]} ${$.joyIds[1]} ${$.joyIds[2]} ${$.joyIds[3]}`) + $.log(`${$.joyIds[4]} ${$.joyIds[5]} ${$.joyIds[6]} ${$.joyIds[7]}`) + $.log(`${$.joyIds[8]} ${$.joyIds[9]} ${$.joyIds[10]} ${$.joyIds[11]}\n`) + } for (let i = 0; i < $.joyIds.length; ++i) { if (!$.canBuy) { $.log(`金币不足,跳过购买`) @@ -280,8 +286,14 @@ function getJoyShop() { data = JSON.parse(data); if (data.success && data.data && data.data.shop) { const shop = data.data.shop.filter(vo => vo.status === 1) || [] - $.buyJoyLevel = shop.length ? shop[shop.length - 1]['joyId'] : 1 - $.cost = shop.length ? shop[shop.length - 1]['coins'] : Infinity + $.buyJoyLevel = shop.length ? shop[shop.length - 1]['joyId'] : 1;//可购买的最大等级 + if ($.isNode() && process.env.BUY_JPY_LEVEL) { + $.log(`当前可购买的最高JOY等级为${$.buyJoyLevel}级\n`) + $.buyJoyLevel = (process.env.BUY_JPY_LEVEL * 1) > $.buyJoyLevel ? $.buyJoyLevel : process.env.BUY_JPY_LEVEL * 1; + $.cost = shop[$.buyJoyLevel - 1]['coins'] + } else { + $.cost = shop.length ? shop[shop.length - 1]['coins'] : Infinity + } } } } catch (e) { @@ -412,12 +424,17 @@ function getCoin() { if (data.data && data.data.tryMoneyJoyBeans) { console.log(`分红狗生效中,预计获得 ${data.data.tryMoneyJoyBeans} 京豆奖励`) } - if (data.data && data.data.totalCoinAmount) - $.coin = data.data.totalCoinAmount + if (data.data && data.data.totalCoinAmount) { + $.coin = data.data.totalCoinAmount; + } else { + $.coin = `获取当前金币数量失败` + } if (data.data && data.data.luckyBoxRecordId) { await openBox('LUCKY_BOX_DROP',data.data.luckyBoxRecordId) - } else - $.log(`产出金币信息获取失败`) + } + if (data.data) { + $.log(`此次在线收益:获得 ${data.data['coins']} 金币`) + } } } } catch (e) { @@ -430,7 +447,6 @@ function getCoin() { } function openBox(eventType = 'LUCKY_BOX_DROP', boxId) { - console.log(`openBox:${eventType}`) let body = { eventType, "eventRecordId": boxId} return new Promise(async resolve => { $.get(taskUrl('crazyJoy_event_getVideoAdvert', JSON.stringify(body)), async (err, resp, data) => { diff --git a/jd_dreamFactory.js b/jd_dreamFactory.js index 4c0b8fc5..2333f2f8 100644 --- a/jd_dreamFactory.js +++ b/jd_dreamFactory.js @@ -1,6 +1,6 @@ /* 京东京喜工厂 -更新时间:2020-12-07 +更新时间:2020-12-27 活动入口 :京东APP->游戏与互动->查看更多->京喜工厂 或者: 京东APP首页搜索 "玩一玩" ,造物工厂即可 @@ -31,7 +31,7 @@ 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 = `6S9y4sJUfA2vPQP6TLdVIQ==`; +let tuanActiveId = `6S9y4sJUfA2vPQP6TLdVIQ==`; const jxOpenUrl = `openjd://virtual?params=%7B%20%22category%22:%20%22jump%22,%20%22des%22:%20%22m%22,%20%22url%22:%20%22https://wqsd.jd.com/pingou/dream_factory/index.html%22%20%7D`; let cookiesArr = [], cookie = '', message = ''; const inviteCodes = ['V5LkjP4WRyjeCKR9VRwcRX0bBuTz7MEK0-E99EJ7u0k=', 'PDPM257r_KuQhil2Y7koNw==', "gB99tYLjvPcEFloDgamoBw==", '-OvElMzqeyeGBWazWYjI1Q==', 'GFwo6PntxDHH95ZRzZ5uAg==']; @@ -566,10 +566,10 @@ function userInfo() { } else if (data.factoryList && !data.productionList) { console.log(`【提示】京东账号${$.index}[${$.nickName}]京喜工厂未选购商品\n请手动去京东APP->游戏与互动->查看更多->京喜工厂 选购\n`) let nowTimes = new Date(new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000); - if (nowTimes.getHours() % 6 === 0) { - //如按每小时运行一次,则此处将一天推送4次提醒 + if (nowTimes.getHours() % 12 === 0) { + //如按每小时运行一次,则此处将一天推送2次提醒 $.msg($.name, '提醒⏰', `京东账号${$.index}[${$.nickName}]京喜工厂未选择商品\n请手动去京东APP->游戏与互动->查看更多->京喜工厂 选择商品`); - await notify.sendNotify(`${$.name} - 京东账号${$.index} - ${$.nickName}`, `京东账号${$.index}[${$.nickName}]京喜工厂未选择商品\n请手动去京东APP->游戏与互动->查看更多->京喜工厂 选择商品`) + if ($.isNode()) await notify.sendNotify(`${$.name} - 京东账号${$.index} - ${$.nickName}`, `京东账号${$.index}[${$.nickName}]京喜工厂未选择商品\n请手动去京东APP->游戏与互动->查看更多->京喜工厂 选择商品`) } } } @@ -1018,17 +1018,19 @@ function CreateTuan() { }) } async function joinLeaderTuan() { - await updateTuanIds(); - if (!$.tuanIdS) await updateTuanIdsCDN('https://gitee.com/lxk0301/updateTeam/raw/master/jd_updateFactoryTuanId.json'); - if (!$.tuanIdS) await updateTuanIdsCDN('https://cdn.jsdelivr.net/gh/lxk0301/updateTeam@master/jd_updateFactoryTuanId.json'); - for (let tuanId of $.tuanIdS.tuanIds) { - if (!tuanId) continue - await JoinTuan(tuanId); + if ($.tuanIdS && $.tuanIdS.tuanIds) { + for (let tuanId of $.tuanIdS.tuanIds) { + if (!tuanId) continue + await JoinTuan(tuanId); + } } + $.tuanIdS = null; if (!$.tuanIdS) await updateTuanIdsCDN('https://gitee.com/shylocks/updateTeam/raw/main/jd_updateFactoryTuanId.json'); - for (let tuanId of $.tuanIdS.tuanIds) { - if (!tuanId) continue - await JoinTuan(tuanId); + if ($.tuanIdS && $.tuanIdS.tuanIds) { + for (let tuanId of $.tuanIdS.tuanIds) { + if (!tuanId) continue + await JoinTuan(tuanId); + } } } function JoinTuan(tuanId) { @@ -1253,17 +1255,17 @@ async function exchangeProNotify() { // 一:在兑换超时这一天(2020/12/8 09:20:04)的前2小时内通知 if ((exchangeEndTime - nowTimes) <= 3600000 * 2) { $.msg($.name, ``, `【京东账号${$.index}】${$.nickName}\n【生产商品】${$.productName}${(exchangeEndTime - nowTimes) / 60*60*1000}分钟后兑换超时\n【兑换截止时间】${$.exchangeEndTime}\n请速去京喜APP->首页->好物0元造进行兑换`, {'open-url': jxOpenUrl, 'media-url': $.picture}) - await notify.sendNotify(`${$.name} - 京东账号${$.index} - ${$.nickName}`, `【京东账号${$.index}】${$.nickName}\n【生产商品】${$.productName}${(exchangeEndTime - nowTimes) / 60*60*1000}分钟后兑换超时\n【兑换截止时间】${$.exchangeEndTime}\n请速去京喜APP->首页->好物0元造进行兑换`, { url: jxOpenUrl }) + if ($.isNode()) await notify.sendNotify(`${$.name} - 京东账号${$.index} - ${$.nickName}`, `【京东账号${$.index}】${$.nickName}\n【生产商品】${$.productName}${(exchangeEndTime - nowTimes) / 60*60*1000}分钟后兑换超时\n【兑换截止时间】${$.exchangeEndTime}\n请速去京喜APP->首页->好物0元造进行兑换`, { url: jxOpenUrl }) } //二:在兑换超时日期前的时间一天通知三次(2020/12/6 9,10,11点,以及在2020/12/7 9,10,11点各通知一次) if (nowHours === exchangeEndHours || nowHours === (exchangeEndHours + 1) || nowHours === (exchangeEndHours + 2)) { $.msg($.name, ``, `【京东账号${$.index}】${$.nickName}\n【生产商品】${$.productName}已可兑换\n【兑换截止时间】${$.exchangeEndTime}\n请速去京喜APP->首页->好物0元造进行兑换`, {'open-url': jxOpenUrl, 'media-url': $.picture}) - await notify.sendNotify(`${$.name} - 京东账号${$.index} - ${$.nickName}`, `【京东账号${$.index}】${$.nickName}\n【生产商品】${$.productName}已可兑换\n【兑换截止时间】${$.exchangeEndTime}\n请速去京喜APP->首页->好物0元造进行兑换`, { url: jxOpenUrl }) + if ($.isNode()) await notify.sendNotify(`${$.name} - 京东账号${$.index} - ${$.nickName}`, `【京东账号${$.index}】${$.nickName}\n【生产商品】${$.productName}已可兑换\n【兑换截止时间】${$.exchangeEndTime}\n请速去京喜APP->首页->好物0元造进行兑换`, { url: jxOpenUrl }) } } else { //兑换已超时 $.msg($.name, ``, `【京东账号${$.index}】${$.nickName}\n【生产商品】${$.productName}兑换已超时,请重新选择商品生产\n【兑换截止时间】${$.exchangeEndTime}`, {'open-url': jxOpenUrl}) - await notify.sendNotify(`${$.name} - 京东账号${$.index} - ${$.nickName}`, `【京东账号${$.index}】${$.nickName}\n【生产商品】${$.productName}兑换已超时,请重新选择商品生产\n【兑换截止时间】${$.exchangeEndTime}`, { url: jxOpenUrl }) + if ($.isNode()) await notify.sendNotify(`${$.name} - 京东账号${$.index} - ${$.nickName}`, `【京东账号${$.index}】${$.nickName}\n【生产商品】${$.productName}兑换已超时,请重新选择商品生产\n【兑换截止时间】${$.exchangeEndTime}`, { url: jxOpenUrl }) } } } @@ -1338,8 +1340,15 @@ function shareCodesFormat() { }) } function requireConfig() { - return new Promise(resolve => { + return new Promise(async resolve => { + await updateTuanIdsCDN('https://gitee.com/lxk0301/updateTeam/raw/master/jd_updateFactoryTuanId.json'); + if (!$.tuanIdS) await updateTuanIds(); + if (!$.tuanIdS) await updateTuanIdsCDN('https://cdn.jsdelivr.net/gh/lxk0301/updateTeam@master/jd_updateFactoryTuanId.json'); + if ($.tuanIdS && $.tuanIdS.tuanActiveId) { + tuanActiveId = $.tuanIdS.tuanActiveId; + } console.log(`开始获取${$.name}配置文件\n`); + console.log(`tuanActiveId: ${tuanActiveId}`) //Node.js用户请在jdCookie.js处填写京东ck; const shareCodes = $.isNode() ? require('./jdDreamFactoryShareCodes.js') : ''; console.log(`共${cookiesArr.length}个京东账号\n`); diff --git a/jd_ds.js b/jd_ds.js index aa5bac6c..46381bf9 100644 --- a/jd_ds.js +++ b/jd_ds.js @@ -87,8 +87,15 @@ const JD_API_HOST = 'https://api.m.jd.com/'; }) function showMsg() { - return new Promise(resolve => { - $.msg($.name, '', `【京东账号${$.index}】${$.nickName}\n${message}`); + return new Promise(async resolve => { + // $.msg($.name, '', `【京东账号${$.index}】${$.nickName}\n${message}`); + let nowTime = new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000; + if (nowTime > new Date('2020/12/31 23:59:59+08:00').getTime()) { + $.msg($.name, '活动已结束', `咱江湖再见\nhttps://github.com/lxk0301/jd_scripts`, {"open-url": "https://github.com/lxk0301/jd_scripts"}); + if ($.isNode()) await notify.sendNotify($.name + '活动已结束', `咱江湖再见\n https://github.com/lxk0301/jd_scripts`) + } else { + $.msg($.name, '', `京东账号${$.index} ${$.nickName}\n${message}`); + } resolve() }) } diff --git a/jd_jdfactory.js b/jd_jdfactory.js index b1d7a45f..b756da1d 100644 --- a/jd_jdfactory.js +++ b/jd_jdfactory.js @@ -2,7 +2,7 @@ * @Author: lxk0301 https://github.com/lxk0301 * @Date: 2020-12-06 18:19:21 * @Last Modified by: lxk0301 - * @Last Modified time: 2020-12-06 22:58:02 + * @Last Modified time: 2020-12-26 22:58:02 */ /* 东东工厂,不是京喜工厂 @@ -254,98 +254,100 @@ async function helpFriends() { } } async function doTask() { - for (let item of $.taskVos) { - if (item.taskType === 1) { - //关注店铺任务 - if (item.status === 1) { - console.log(`准备做此任务:${item.taskName}`); - for (let task of item.followShopVo) { - if (task.status === 1) { - await jdfactory_collectScore(task.taskToken); - } - } - } else { - console.log(`${item.taskName}已做完`) - } - } - if (item.taskType === 2) { - //看看商品任务 - if (item.status === 1) { - console.log(`准备做此任务:${item.taskName}`); - for (let task of item.productInfoVos) { - if (task.status === 1) { - await jdfactory_collectScore(task.taskToken); - } - } - } else { - console.log(`${item.taskName}已做完`) - } - } - if (item.taskType === 3) { - //逛会场任务 - if (item.status === 1) { - console.log(`准备做此任务:${item.taskName}`); - for (let task of item.shoppingActivityVos) { - if (task.status === 1) { - await jdfactory_collectScore(task.taskToken); - } - } - } else { - console.log(`${item.taskName}已做完`) - } - } - if (item.taskType === 10) { - if (item.status === 1) { - if (item.threeMealInfoVos[0].status === 1) { - //可以做此任务 + if ($.taskVos && $.taskVos.length > 0) { + for (let item of $.taskVos) { + if (item.taskType === 1) { + //关注店铺任务 + if (item.status === 1) { console.log(`准备做此任务:${item.taskName}`); - await jdfactory_collectScore(item.threeMealInfoVos[0].taskToken); - } else if (item.threeMealInfoVos[0].status === 0) { - console.log(`${item.taskName} 任务已错过时间`) + for (let task of item.followShopVo) { + if (task.status === 1) { + await jdfactory_collectScore(task.taskToken); + } + } + } else { + console.log(`${item.taskName}已做完`) } - } else if (item.status === 2){ - console.log(`${item.taskName}已完成`); } - } - if (item.taskType === 21) { - //开通会员任务 - if (item.status === 1) { - console.log(`此任务:${item.taskName},跳过`); - // for (let task of item.brandMemberVos) { - // if (task.status === 1) { - // await jdfactory_collectScore(task.taskToken); - // } - // } - } else { - console.log(`${item.taskName}已做完`) + if (item.taskType === 2) { + //看看商品任务 + if (item.status === 1) { + console.log(`准备做此任务:${item.taskName}`); + for (let task of item.productInfoVos) { + if (task.status === 1) { + await jdfactory_collectScore(task.taskToken); + } + } + } else { + console.log(`${item.taskName}已做完`) + } } - } - if (item.taskType === 13) { - //每日打卡 - if (item.status === 1) { - console.log(`准备做此任务:${item.taskName}`); - await jdfactory_collectScore(item.simpleRecordInfoVo.taskToken); - } else { - console.log(`${item.taskName}已完成`); + if (item.taskType === 3) { + //逛会场任务 + if (item.status === 1) { + console.log(`准备做此任务:${item.taskName}`); + for (let task of item.shoppingActivityVos) { + if (task.status === 1) { + await jdfactory_collectScore(task.taskToken); + } + } + } else { + console.log(`${item.taskName}已做完`) + } } - } - if (item.taskType === 14) { - //好友助力 - if (item.status === 1) { - console.log(`准备做此任务:${item.taskName}`); - // await jdfactory_collectScore(item.simpleRecordInfoVo.taskToken); - } else { - console.log(`${item.taskName}已完成`); + if (item.taskType === 10) { + if (item.status === 1) { + if (item.threeMealInfoVos[0].status === 1) { + //可以做此任务 + console.log(`准备做此任务:${item.taskName}`); + await jdfactory_collectScore(item.threeMealInfoVos[0].taskToken); + } else if (item.threeMealInfoVos[0].status === 0) { + console.log(`${item.taskName} 任务已错过时间`) + } + } else if (item.status === 2){ + console.log(`${item.taskName}已完成`); + } } - } - if (item.taskType === 23) { - //从数码电器首页进入 - if (item.status === 1) { - console.log(`准备做此任务:${item.taskName}`); - await queryVkComponent(); - await jdfactory_collectScore(item.simpleRecordInfoVo.taskToken); - } else { - console.log(`${item.taskName}已完成`); + if (item.taskType === 21) { + //开通会员任务 + if (item.status === 1) { + console.log(`此任务:${item.taskName},跳过`); + // for (let task of item.brandMemberVos) { + // if (task.status === 1) { + // await jdfactory_collectScore(task.taskToken); + // } + // } + } else { + console.log(`${item.taskName}已做完`) + } + } + if (item.taskType === 13) { + //每日打卡 + if (item.status === 1) { + console.log(`准备做此任务:${item.taskName}`); + await jdfactory_collectScore(item.simpleRecordInfoVo.taskToken); + } else { + console.log(`${item.taskName}已完成`); + } + } + if (item.taskType === 14) { + //好友助力 + if (item.status === 1) { + console.log(`准备做此任务:${item.taskName}`); + // await jdfactory_collectScore(item.simpleRecordInfoVo.taskToken); + } else { + console.log(`${item.taskName}已完成`); + } + } + if (item.taskType === 23) { + //从数码电器首页进入 + if (item.status === 1) { + console.log(`准备做此任务:${item.taskName}`); + await queryVkComponent(); + await jdfactory_collectScore(item.simpleRecordInfoVo.taskToken); + } else { + console.log(`${item.taskName}已完成`); + } } } } @@ -353,7 +355,8 @@ async function doTask() { //领取做完任务的奖励 function jdfactory_collectScore(taskToken) { - return new Promise(resolve => { + return new Promise(async resolve => { + await $.wait(1000); $.post(taskPostUrl("jdfactory_collectScore", { taskToken }, "jdfactory_collectScore"), async (err, resp, data) => { try { if (err) { diff --git a/jd_ms_redrain.js b/jd_ms_redrain.js index c0e82585..c2ea858e 100644 --- a/jd_ms_redrain.js +++ b/jd_ms_redrain.js @@ -83,8 +83,14 @@ const JD_API_HOST = 'https://api.m.jd.com/api'; }) function showMsg() { - return new Promise(resolve => { - $.msg($.name, '', `【京东账号${$.index}】${$.nickName}\n${message}`); + return new Promise(async resolve => { + let nowTime = new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000; + if (nowTime > new Date('2020/12/31 23:59:59+08:00').getTime()) { + $.msg($.name, '活动已结束', `咱江湖再见\nhttps://github.com/lxk0301/jd_scripts`, {"open-url": "https://github.com/lxk0301/jd_scripts"}); + if ($.isNode()) await notify.sendNotify($.name + '活动已结束', `咱江湖再见\n https://github.com/lxk0301/jd_scripts`) + } else { + $.msg($.name, '', `京东账号${$.index} ${$.nickName}\n${message}`); + } resolve() }) } diff --git a/jd_pet.js b/jd_pet.js index 1446989d..9b19c20f 100644 --- a/jd_pet.js +++ b/jd_pet.js @@ -1,6 +1,6 @@ /* 东东萌宠 更新地址: https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_pet.js -更新时间:2020-11-30 +更新时间:2020-12-26 已支持IOS双京东账号,Node.js支持N个京东账号 脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js @@ -90,7 +90,7 @@ async function jdPet() { } if (!$.petInfo.goodsInfo) { $.msg($.name, '', `【提示】京东账号${$.index}${$.nickName}\n暂未选购新的商品`, { "open-url": "openapp.jdmoble://" }); - await notify.sendNotify(`${$.name} - ${$.index} - ${$.nickName}`, `【提示】京东账号${$.index}${$.nickName}\n暂未选购新的商品`); + if ($.isNode()) await notify.sendNotify(`${$.name} - ${$.index} - ${$.nickName}`, `【提示】京东账号${$.index}${$.nickName}\n暂未选购新的商品`); return } goodsUrl = $.petInfo.goodsInfo && $.petInfo.goodsInfo.goodsUrl; diff --git a/jd_plantBean.js b/jd_plantBean.js index 9497a079..8fbe3d0f 100644 --- a/jd_plantBean.js +++ b/jd_plantBean.js @@ -1,6 +1,6 @@ /* 种豆得豆 脚本更新地址:https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_plantBean.js -更新时间:2020-11-04 +更新时间:2020-12-31 已支持IOS京东双账号,云端N个京东账号 脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js 注:会自动关注任务中的店铺跟商品,介意者勿使用。 @@ -161,14 +161,27 @@ async function stealFriendWater() { return } if ($.stealFriendList.data && $.stealFriendList.data.friendInfoList && $.stealFriendList.data.friendInfoList.length > 0) { + let nowTimes = new Date(new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000); for (let item of $.stealFriendList.data.friendInfoList) { - if (item.nutrCount >= 3) { - // console.log(`可以偷的好友的信息::${JSON.stringify(item)}`); - console.log(`可以偷的好友的信息paradiseUuid::${JSON.stringify(item.paradiseUuid)}`); - await collectUserNutr(item.paradiseUuid); - console.log(`偷取好友营养液情况:${JSON.stringify($.stealFriendRes)}`) - if ($.stealFriendRes.code === '0') { - console.log(`偷取好友营养液成功`) + if (new Date(nowTimes).getHours() === 20) { + if (item.nutrCount >= 2) { + // console.log(`可以偷的好友的信息::${JSON.stringify(item)}`); + console.log(`可以偷的好友的信息paradiseUuid::${JSON.stringify(item.paradiseUuid)}`); + await collectUserNutr(item.paradiseUuid); + console.log(`偷取好友营养液情况:${JSON.stringify($.stealFriendRes)}`) + if ($.stealFriendRes.code === '0') { + console.log(`偷取好友营养液成功`) + } + } + } else { + if (item.nutrCount >= 3) { + // console.log(`可以偷的好友的信息::${JSON.stringify(item)}`); + console.log(`可以偷的好友的信息paradiseUuid::${JSON.stringify(item.paradiseUuid)}`); + await collectUserNutr(item.paradiseUuid); + console.log(`偷取好友营养液情况:${JSON.stringify($.stealFriendRes)}`) + if ($.stealFriendRes.code === '0') { + console.log(`偷取好友营养液成功`) + } } } } diff --git a/jd_speed.js b/jd_speed.js index 305701ce..905cecc2 100644 --- a/jd_speed.js +++ b/jd_speed.js @@ -511,8 +511,8 @@ function getMemBerList() { await getReward(uuids['uuid']); } if ($.getRewardBeans > 0) { - $.msg(`${$.name}`, '', `${$.index} ${$.nickName}\n虫洞任务:获得${$.getRewardBeans}京豆`); - await notify.sendNotify(`${$.name} - ${$.index} - ${$.nickName}`, `${$.index} ${$.nickName}\n虫洞任务:获得${$.getRewardBeans}京豆`) + $.msg(`${$.name}`, '', `京东账号${$.index} ${$.nickName}\n虫洞任务:获得${$.getRewardBeans}京豆`); + if ($.isNode()) await notify.sendNotify(`${$.name} - 账号${$.index} - ${$.nickName}`, `京东账号${$.index} ${$.nickName}\n虫洞任务:获得${$.getRewardBeans}京豆`) } } else { console.log(`暂无可领取的虫洞京豆奖励`) diff --git a/jd_syj.js b/jd_syj.js index cd6dabfa..ea75fc27 100644 --- a/jd_syj.js +++ b/jd_syj.js @@ -2,7 +2,7 @@ * @Author: lxk0301 https://github.com/lxk0301 * @Date: 2020-11-27 09:19:21 * @Last Modified by: lxk0301 - * @Last Modified time: 2020-11-27 09:58:02 + * @Last Modified time: 2021-1-1 16:58:02 */ /* 十元街脚本,一周签到下来可获得30京豆,一天任意时刻运行一次即可 @@ -93,7 +93,7 @@ function showMsg() { let signFlag = 0; function userSignIn() { return new Promise(resolve => { - const body = {"activityId":"8d6845fe2e77425c82d5078d314d33c5","inviterId":"VMIQlLQqjQyjZokQmv5bIDgq011L0Ov8","channel":"MiniProgram"}; + const body = {"activityId":"ccd8067defcd4787871b7f0c96fcbf5c","inviterId":"","channel":"MiniProgram"}; $.get(taskUrl('userSignIn', body), async (err, resp, data) => { try { if (err) { @@ -122,6 +122,10 @@ function userSignIn() { signFlag ++; await userSignIn(); } + } else if (data.code === 66) { + //此处有时会遇到 服务器繁忙 导致签到失败,故重复三次签到 + $.log(`${$.name}签到失败:${data.msg}`); + message += `【签到】失败,${data.msg}`; } else { console.log(`异常:${JSON.stringify(data)}`) } diff --git a/jd_unbind.js b/jd_unbind.js index 0e618a02..65e5377f 100644 --- a/jd_unbind.js +++ b/jd_unbind.js @@ -36,9 +36,9 @@ if ($.isNode()) { cookiesArr.reverse(); cookiesArr = cookiesArr.filter(item => item !== "" && item !== null && item !== undefined); } -const jdNotify = $.getdata('jdUnsubscribeNotify');//是否关闭通知,false打开通知推送,true关闭通知推送 -let cardPageSize = $.getdata('jdUnsubscribePageSize') || 200;// 运行一次取消多少个会员卡。数字0表示不注销任何会员卡 -let stopCards = $.getdata('jdUnsubscribeStopCards') || ['京东PLUS会员'];//遇到此会员卡不再进行注销 +const jdNotify = $.getdata('jdUnbindCardNotify');//是否关闭通知,false打开通知推送,true关闭通知推送 +let cardPageSize = 200;// 运行一次取消多少个会员卡。数字0表示不注销任何会员卡 +let stopCards = `京东PLUS会员`;//遇到此会员卡跳过注销,多个使用&分开 const JD_API_HOST = 'https://api.m.jd.com/'; !(async () => { if (!cookiesArr[0]) { @@ -220,24 +220,23 @@ function TotalBean() { } function requireConfig() { return new Promise(resolve => { - if ($.isNode() && process.env.UN_BIND_CARD_NUM) { - $.UN_BIND_NUM = process.env.UN_BIND_CARD_NUM - } - if ($.isNode() && process.env.UN_BIND_STOP_CARD) { - if (process.env.UN_BIND_STOP_CARD.indexOf('&') > -1) { - $.UN_BIND_STOP_CARD = process.env.UN_BIND_STOP_CARD.split('&'); - } else if (process.env.UN_BIND_STOP_CARD.indexOf('@') > -1) { - $.UN_BIND_STOP_CARD = process.env.UN_BIND_STOP_CARD.split('@'); - } else if (process.env.UN_BIND_STOP_CARD.indexOf('\n') > -1) { - $.UN_BIND_STOP_CARD = process.env.UN_BIND_STOP_CARD.split('\n'); - } else if (process.env.UN_BIND_STOP_CARD.indexOf('\\n') > -1) { - $.UN_BIND_STOP_CARD = process.env.UN_BIND_STOP_CARD.split('\\n'); + $.UN_BIND_NUM = $.isNode() ? (process.env.UN_BIND_CARD_NUM ? process.env.UN_BIND_CARD_NUM : cardPageSize) : ($.getdata('UN_BIND_CARD_NUM') ? $.getdata('UN_BIND_CARD_NUM') : cardPageSize); + $.UN_BIND_STOP_CARD = $.isNode() ? (process.env.UN_BIND_STOP_CARD ? process.env.UN_BIND_STOP_CARD : stopCards) : ($.getdata('UN_BIND_STOP_CARD') ? $.getdata('UN_BIND_STOP_CARD') : stopCards); + if ($.UN_BIND_STOP_CARD) { + if ($.UN_BIND_STOP_CARD.indexOf('&') > -1) { + $.UN_BIND_STOP_CARD = $.UN_BIND_STOP_CARD.split('&'); + } else if ($.UN_BIND_STOP_CARD.indexOf('@') > -1) { + $.UN_BIND_STOP_CARD = $.UN_BIND_STOP_CARD.split('@'); + } else if ($.UN_BIND_STOP_CARD.indexOf('\n') > -1) { + $.UN_BIND_STOP_CARD = $.UN_BIND_STOP_CARD.split('\n'); + } else if ($.UN_BIND_STOP_CARD.indexOf('\\n') > -1) { + $.UN_BIND_STOP_CARD = $.UN_BIND_STOP_CARD.split('\\n'); } else { - $.UN_BIND_STOP_CARD = process.env.UN_BIND_STOP_CARD.split(); + $.UN_BIND_STOP_CARD = $.UN_BIND_STOP_CARD.split(); } } - cardPageSize = $.UN_BIND_NUM || cardPageSize - stopCards = $.UN_BIND_STOP_CARD || stopCards + cardPageSize = $.UN_BIND_NUM; + stopCards = $.UN_BIND_STOP_CARD; resolve() }) } diff --git a/jd_watch.js b/jd_watch.js index 499a2fe2..f1f9f25a 100644 --- a/jd_watch.js +++ b/jd_watch.js @@ -188,6 +188,7 @@ const JD_API_HOST = 'https://api.m.jd.com/client.action'; continue } await jdHealth() + await showMsg(); } } })() @@ -200,8 +201,8 @@ const JD_API_HOST = 'https://api.m.jd.com/client.action'; async function jdHealth() { $.bean = 0 await getTaskList() - console.log(`${$.name}浏览次数:${$.task.times}/${$.task.maxTimes}`) if($.task) { + console.log(`${$.name}浏览次数:${$.task.times}/${$.task.maxTimes}`) let i = 0, j = $.task.times while(j < $.task.maxTimes) { if (!acceptBody[i]) break @@ -220,8 +221,15 @@ async function jdHealth() { } function showMsg() { - return new Promise(resolve => { - $.msg($.name, '', `京东账号${$.index} ${$.nickName}\n${message}`); + return new Promise(async resolve => { + // $.msg($.name, '', `京东账号${$.index} ${$.nickName}\n${message}`); + let nowTime = new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000; + if (nowTime > new Date('2020/12/31 23:59:59+08:00').getTime()) { + $.msg($.name, '活动已结束', `咱江湖再见\nhttps://github.com/lxk0301/jd_scripts`, {"open-url": "https://github.com/lxk0301/jd_scripts"}); + if ($.isNode()) await notify.sendNotify($.name + '活动已结束', `咱江湖再见\n https://github.com/lxk0301/jd_scripts`) + } else { + $.msg($.name, '', `京东账号${$.index} ${$.nickName}\n${message}`); + } resolve() }) } @@ -237,7 +245,9 @@ function getTaskList() { } else { if (safeGet(data)) { data = JSON.parse(data); - $.task = data['data']['discTasks'][1] + if (data.busiCode === '0') { + $.task = data['data']['discTasks'][1] + } } } } catch (e) { diff --git a/jr_sign.js b/jr_sign.js index b7e6089a..40c9a018 100644 --- a/jr_sign.js +++ b/jr_sign.js @@ -78,8 +78,14 @@ const JD_API_HOST = 'https://api.m.jd.com/api'; }) function showMsg() { - return new Promise(resolve => { - $.msg($.name, '', `【京东账号${$.index}】${$.nickName}\n${message}`); + return new Promise(async resolve => { + let nowTime = new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000; + if (nowTime > new Date('2020/12/31 23:59:59+08:00').getTime()) { + $.msg($.name, '活动已结束', `咱江湖再见\nhttps://github.com/lxk0301/jd_scripts`, {"open-url": "https://github.com/lxk0301/jd_scripts"}); + if ($.isNode()) await notify.sendNotify($.name + '活动已结束', `咱江湖再见\n https://github.com/lxk0301/jd_scripts`) + } else { + $.msg($.name, '', `【京东账号${$.index}】${$.nickName}\n${message}`); + } resolve() }) } @@ -96,6 +102,7 @@ function sign() { if (safeGet(data)) { data = JSON.parse(data); console.log(data.resultData.message) + message += `${data.resultData.message}` } } } catch (e) { diff --git a/lxk0301.boxjs.json b/lxk0301.boxjs.json index 842a61dd..dc9e0e5a 100644 --- a/lxk0301.boxjs.json +++ b/lxk0301.boxjs.json @@ -664,6 +664,44 @@ "https://raw.githubusercontent.com/Orz-3/task/master/jd.png" ] }, + { + "id": "jd_unbind", + "name": "注销京东会员卡", + "keys": [ + "UN_BIND_CARD_NUM", + "UN_BIND_STOP_CARD" + ], + "settings": [ + { + "id": "jdUnbindCardNotify", + "name": "静默运行", + "val": false, + "type": "boolean", + "desc": "运行脚本时不发出系统弹窗通知" + }, + { + "id": "UN_BIND_CARD_NUM", + "name": "注销京东店铺会员卡的数量", + "val": 200, + "type": "number", + "desc": "运行一次脚本注销多少个店铺会员卡(默认200个,输入0表示不注销会员卡)" + }, + { + "id": "UN_BIND_STOP_CARD", + "name": "注销京东店铺会员卡(白名单)", + "val": "", + "type": "text", + "desc": "不想注销的店铺会员卡名称" + } + ], + "author": "@lxk0301", + "repo": "https://github.com/lxk0301/jd_scripts", + "script": "https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_unsubscribe.js", + "icons": [ + "https://raw.githubusercontent.com/58xinian/icon/master/jd_unbind_mini.png", + "https://raw.githubusercontent.com/58xinian/icon/master/jd_unbind.png" + ] + }, { "id": "jd_SuperMarket", "name": "京小超", diff --git a/sendNotify.js b/sendNotify.js index 6a205895..262e5e97 100644 --- a/sendNotify.js +++ b/sendNotify.js @@ -48,6 +48,11 @@ let DD_BOT_SECRET = ''; //注:此处设置github action用户填写到Settings-Secrets里面(Name输入QYWX_KEY) let QYWX_KEY = ''; +// =======================================企业微信应用消息通知设置区域=========================================== +//此处填你企业微信应用消息的 值(详见文档 https://work.weixin.qq.com/api/doc/90000/90135/90236),依次填上corpid的值,corpsecret的值,touser的值,agentid的值,素材库图片id(见https://work.weixin.qq.com/api/doc/90000/90135/90253) 注意用,号隔开,例如:wwcff56746d9adwers,B-791548lnzXBE6_BWfxdf3kSTMJr9vFEPKAbh6WERQ,mingcheng,1000001,2COXgjH2UIfERF2zxrtUOKgQ9XklUqMdGSWLBoW_lSDAdafat +//注:此处设置github action用户填写到Settings-Secrets里面(Name输入QYWX_AM) +let QYWX_AM = ''; + // =======================================iGot聚合推送通知设置区域=========================================== //此处填您iGot的信息(推送key,例如:https://push.hellyw.com/XXXXXXXX) //注:此处设置github action用户填写到Settings-Secrets里面(Name输入IGOT_PUSH_KEY) @@ -108,6 +113,10 @@ if (process.env.QYWX_KEY) { QYWX_KEY = process.env.QYWX_KEY; } +if (process.env.QYWX_AM) { + QYWX_AM = process.env.QYWX_AM; +} + if (process.env.IGOT_PUSH_KEY) { IGOT_PUSH_KEY = process.env.IGOT_PUSH_KEY } @@ -131,6 +140,7 @@ async function sendNotify(text, desp, params = {}) { await tgBotNotify(text, desp);//telegram 机器人 await ddBotNotify(text, desp);//钉钉机器人 await qywxBotNotify(text, desp); //企业微信机器人 + await qywxamNotify(text, desp); //企业微信应用消息推送 await iGotNotify(text, desp, params);//iGot await CoolPush(text, desp);//QQ酷推 } @@ -406,6 +416,74 @@ function qywxBotNotify(text, desp) { }); } +function qywxamNotify(text, desp) { + return new Promise(resolve => { + if (QYWX_AM) { + var QYWX_AM_AY = QYWX_AM.split(','); + const options_accesstoken = { + url: `https://qyapi.weixin.qq.com/cgi-bin/gettoken`, + json: { + corpid:`${QYWX_AM_AY[0]}`, + corpsecret:`${QYWX_AM_AY[1]}`, + }, + headers: { + 'Content-Type': 'application/json', + }, + }; + $.post(options_accesstoken, (err, resp, data) => { + var json = JSON.parse(data); + accesstoken = json.access_token; + const options = { + url: `https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=${accesstoken}`, + json: { + touser:`${QYWX_AM_AY[2]}`, + agentid:`${QYWX_AM_AY[3]}`, + msgtype: 'mpnews', + mpnews: { + articles: [ + { + title: `${text}`, + thumb_media_id: `${QYWX_AM_AY[4]}`, + author : `智能助手` , + content_source_url: ``, + content : `${desp}`, //暂时直接设置成了desp + digest: `${desp}` + } + ] + }, + safe:'0', + }, + headers: { + 'Content-Type': 'application/json', + }, + }; + $.post(options, (err, resp, data) => { + try { + if (err) { + console.log('企业微信应用消息发送通知消息失败!!\n'); + console.log(err); + } else { + data = JSON.parse(data); + if (data.errcode === 0) { + console.log('企业微信应用消息发送通知消息完成。\n'); + } else { + console.log(`${data.errmsg}\n`); + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(data); + } + }); + }); + } else { + console.log('您未提供企业微信应用消息推送所需的QYWX_AM,取消企业微信应用消息推送消息通知\n'); + resolve(); + } + }); +} + function iGotNotify(text, desp, params={}){ return new Promise(resolve => { if (IGOT_PUSH_KEY) { diff --git a/serverless.yml b/serverless.yml index 3a81ce08..d78fe00b 100644 --- a/serverless.yml +++ b/serverless.yml @@ -19,15 +19,15 @@ inputs: - timer: # 签到 parameters: name: jd_bean_sign - cronExpression: "0 0 0,7 * * * *" - enable: true - argument: jd_bean_sign - - timer: # 京小超兑换奖品# 摇京豆 - parameters: - name: jd_blueCoin_jd_club_lottery cronExpression: "0 0 0 * * * *" enable: true - argument: jd_blueCoin&jd_club_lottery + argument: jd_bean_sign + - timer: #京小超兑换奖品 #摇京豆 #京东汽车 + parameters: + name: jd_blueCoin_jd_club_lottery_car + cronExpression: "0 0 0 * * * *" + enable: true + argument: jd_blueCoin&jd_club_lottery&jd_car - timer: # 东东农场# 东东萌宠 parameters: name: jd_fruit_jd_pet @@ -46,12 +46,12 @@ inputs: cronExpression: "0 0 0-16/8,20 * * * *" enable: true argument: jd_joy_reward&jd_joy_steal&jd_necklace&jd_live - - timer: #京东全民开红包 #进店领豆 #取关京东店铺商品 #注销京东会员卡 #京东抽奖机 #东东小窝 #秒杀红包雨 #健康抽奖机 + - timer: #京东全民开红包 #进店领豆 #取关京东店铺商品 #注销京东会员卡 #京东抽奖机 #东东小窝 #健康抽奖机 parameters: - name: redPacket_shop_unsubscribe_unbind_lotteryMachine_small_home_ms_redrain_health + name: redPacket_shop_unsubscribe_unbind_lotteryMachine_small_home_health cronExpression: "0 10 0 * * * *" enable: true - argument: jd_redPacket&jd_shop&jd_unsubscribe&jd_unbind&jd_lotteryMachine&jd_small_home&jd_ms_redrain&jd_health + argument: jd_redPacket&jd_shop&jd_unsubscribe&jd_unbind&jd_lotteryMachine&jd_small_home&jd_health - timer: # 京东天天加速# 天天提鹅 parameters: name: jd_speed_jd_daily_egg @@ -64,18 +64,18 @@ inputs: cronExpression: "0 15 * * * * *" enable: true argument: jd_superMarket - - timer: #京豆变动通知 #疯狂的joy #京东排行榜 #领京豆额外奖励 #京东汽车 #京东健康APP + - timer: #京豆变动通知 #疯狂的joy #京东排行榜 #领京豆额外奖励 parameters: - name: bean_change_crazy_joy_rankingList_bean_home_car_jdh + name: bean_change_crazy_joy_rankingList_bean_home cronExpression: "0 30 7 * * * *" enable: true - argument: jd_bean_change&jd_crazy_joy&jd_rankingList&jd_bean_home&jd_car&jd_jdh - - timer: #金融养猪 #十元街 #京东快递 #发现-看一看 #京东赚赚 #金融打卡领年终奖 + argument: jd_bean_change&jd_crazy_joy&jd_rankingList&jd_bean_home&jd_car + - timer: #金融养猪 #十元街 #京东快递 #京东赚赚 parameters: - name: pigPet_syj_kd_watch_jdzz_jr_sign + name: pigPet_syj_kd_jdzz cronExpression: "0 3 1 * * * *" enable: true - argument: jd_pigPet&jd_syj&jd_kd&jd_watch&jd_jdzz&jr_sign + argument: jd_pigPet&jd_syj&jd_kd&jd_jdzz environment: # 环境变量 variables: # 环境变量对象 AAA: BBB # 不要删除,用来格式化对齐追加的变量的