├── CK_WxPusherUid.json ├── JDSignValidator.js ├── JS_USER_AGENTS.js ├── README.md ├── TS_JDHelloWorld.js ├── USER_AGENTS.js ├── cleancart_activity.js ├── depend.py ├── function ├── common.js ├── config.js ├── dylank.js ├── dylano.js ├── dylans.js ├── dylanv.js ├── dylanw.js ├── dylanx.js ├── dylany.js ├── dylanz.js ├── dylib.js ├── getH5st3_0.js ├── getToken.js ├── h5source │ └── 47.js ├── h5st41.js ├── jdCommon.js ├── jdCommon1.js ├── jdCrypto.js ├── jdcookie.js ├── proxy.js ├── ql.js ├── qlApi.js ├── savePrize.js ├── sendJDNotify.js └── sendNotify.js ├── h5sts.js ├── icon ├── DD_bot.png ├── Snipaste_2020-08-28_09-31-42.png ├── TG_PUSH1.png ├── TG_PUSH2.png ├── TG_PUSH3.png ├── action1.png ├── action2.png ├── action3.png ├── bark.jpg ├── bean_sign_simple.jpg ├── disable-action.jpg ├── fork.png ├── git1.jpg ├── git10.jpg ├── git11.jpg ├── git12.jpg ├── git13.jpg ├── git14.jpg ├── git2.jpg ├── git3.jpg ├── git4.jpg ├── git5.jpg ├── git6.jpg ├── git7.png ├── git8.jpg ├── git9.jpg ├── iCloud1.png ├── iCloud2.png ├── iCloud3.png ├── iCloud4.png ├── iCloud5.png ├── iCloud6.png ├── iCloud7.png ├── iCloud8.png ├── jd1.jpg ├── jd2.jpg ├── jd3.jpg ├── jd4.jpg ├── jd5.png ├── jd6.png ├── jd7.png ├── jd8.png ├── jd_moneyTree.png ├── jd_pet.png ├── qh1.png ├── qh2.png ├── qh3.png └── txy.png ├── jdCookie.js ├── jdEnv.py ├── jdMsLogs.js ├── jd_10dou.js ├── jd_3c_task.js ├── jd_Advent_exchange.js ├── jd_AutoEval.js ├── jd_CheckCK.js ├── jd_CkSeq.js ├── jd_OnceApply.js ├── jd_OpenCard.js ├── jd_OpenCard_Force.js ├── jd_Surprise_Red.js ├── jd_UpdateUIDtoRemark.js ├── jd_XinFarm_draw.js ├── jd_XinFarm_help.js ├── jd_XinFarm_helpnum.js ├── jd_XinFarm_task.js ├── jd_XinFarm_water.js ├── jd_XinFarm_wxhelp.js ├── jd_autock.js ├── jd_baglx.js ├── jd_baglx_sign.js ├── jd_beanSign.js ├── jd_bean_change.js ├── jd_bean_home.js ├── jd_bean_info.js ├── jd_beanday.js ├── jd_beangame_sign.js ├── jd_beans_7days.py ├── jd_book_draw.js ├── jd_by_sign.js ├── jd_cacheIsvToken.js ├── jd_car_draw.js ├── jd_car_sign.js ├── jd_cbdLottery.js ├── jd_channel_follow.js ├── jd_channel_venue_sign.js ├── jd_chb.js ├── jd_cjzzj.js ├── jd_clean_cart.js ├── jd_clean_coupon.js ├── jd_clothing_beauty_sign.js ├── jd_clothing_draw.js ├── jd_code2url.js ├── jd_completeInfoActivity.js ├── jd_cp_draw.js ├── jd_cxjhelp_draw.js ├── jd_czs_draw.js ├── jd_czs_help.js ├── jd_daily.js ├── jd_daily_bean.js ├── jd_daily_yjd.js ├── jd_day.js ├── jd_daycj.js ├── jd_dayf.js ├── jd_dayf2.js ├── jd_delLjq.js ├── jd_deliverySign_sign.js ├── jd_djggl_draw.js ├── jd_doudou.js ├── jd_dplh0415.js ├── jd_dplh0425.js ├── jd_dplh0505.js ├── jd_dplh0515.js ├── jd_dplh0524.js ├── jd_dplh052402.js ├── jd_dplh0525.js ├── jd_dplh_viewShop.js ├── jd_dpqd_main.js ├── jd_dpqd_monitor.js ├── jd_dpqd_record.js ├── jd_dpqd_sign.js ├── jd_dpqd_single.js ├── jd_drawCenter.js ├── jd_drawShopGift.js ├── jd_dwapp.js ├── jd_dyf_draw.js ├── jd_dygetbeans_.js ├── jd_fanfanka.js ├── jd_fanhaoli_draw.js ├── jd_fanhaoli_help.js ├── jd_fansDraw.js ├── jd_fans_videofangrowth.js ├── jd_fcwb_auto.js ├── jd_fcwb_help.js ├── jd_fen2bean.js ├── jd_fish_help.js ├── jd_fl_draw.js ├── jd_follow.js ├── jd_fruit_diyhelp.js ├── jd_fruit_friend.js ├── jd_fruit_help.js ├── jd_fruit_task.js ├── jd_fruit_watering.js ├── jd_fz_draw.js ├── jd_fzms_draw.js ├── jd_fzmz_draw.js ├── jd_gfjd_sign.js ├── jd_gitfix.sh ├── jd_global_task_.js ├── jd_gmart.js ├── jd_gua_MMdou_Mod.js ├── jd_gwfd.js ├── jd_gzsl_contact.js ├── jd_gzsl_contactWare.js ├── jd_gzsl_getLottery.js ├── jd_gzsl_lottery.js ├── jd_gzsl_shopGiftBag.js ├── jd_health.js ├── jd_healthCheck.js ├── jd_health_collect.js ├── jd_health_task.js ├── jd_healthy_task.js ├── jd_hlw_draw.js ├── jd_hssign.js ├── jd_huandou.js ├── jd_indeps.sh ├── jd_jdjh.js ├── jd_jdjoypark.js ├── jd_jdzz_dh.js ├── jd_jiaz_draw.js ├── jd_jinggeng_blindBox.js ├── jd_jinggeng_cart.js ├── jd_jinggeng_drawOne.js ├── jd_jinggeng_exchangeActDetail.js ├── jd_jinggeng_favoriteShop.js ├── jd_jinggeng_floor.js ├── jd_jinggeng_loadBlindBox.js ├── jd_jinggeng_perfectInformation.js ├── jd_jinggeng_showCart.js ├── jd_jinggeng_showDrawOne.js ├── jd_jinggeng_showFavoriteShop.js ├── jd_jinggeng_showInviteJoin.js ├── jd_jinggeng_showPartition.js ├── jd_jinggeng_showPerfectInformation.js ├── jd_jinggeng_showSign.js ├── jd_jinggeng_showTaskDraw.js ├── jd_jinggeng_sign.js ├── jd_jinggeng_taskDraw.js ├── jd_jipiao_draw.js ├── jd_jj_wwly.js ├── jd_jj_wwly_help.js ├── jd_joy_withdraw.js ├── jd_joypark_leave.js ├── jd_joypark_task.js ├── jd_joyrunred.js ├── jd_jpt_draw.js ├── jd_jr_fish_help.js ├── jd_jr_sign.js ├── jd_jrsign.js ├── jd_js_cash.js ├── jd_jzfl_draw.js ├── jd_kd_bean.js ├── jd_kd_dlcs.js ├── jd_kd_fruit.js ├── jd_kd_qd.js ├── jd_kd_task.js ├── jd_kill_ck.js ├── jd_kjsign.js ├── jd_ksjs.js ├── jd_kuaid.js ├── jd_kx_draw.js ├── jd_kx_help.js ├── jd_kx_jpdraw.js ├── jd_kxbbp.js ├── jd_live.js ├── jd_liveLottery.js ├── jd_lotterys.js ├── jd_luck_draw.js ├── jd_luckyDraw.js ├── jd_lxing_draw.js ├── jd_lzaddCart.js ├── jd_lzkj_loreal_cart.js ├── jd_lzkj_loreal_dailyGrabs.js ├── jd_lzkj_loreal_daySign.js ├── jd_lzkj_loreal_draw.js ├── jd_lzkj_loreal_followGoods.js ├── jd_lzkj_loreal_invite.js ├── jd_lzkj_loreal_inviteFollowShop.js ├── jd_lzkj_loreal_know.js ├── jd_lzkj_loreal_lkFollowShop.js ├── jd_lzkj_loreal_organizeTeam.js ├── jd_lzkj_loreal_perfectInfo.js ├── jd_lzkj_loreal_pointsExchange.js ├── jd_lzkj_loreal_share.js ├── jd_lzkj_loreal_shopGift.js ├── jd_lzkj_loreal_sign.js ├── jd_lzkj_organizeTeam.js ├── jd_lzkj_perfectInfo.js ├── jd_lzkj_pointsExchange.js ├── jd_lzkj_share.js ├── jd_lzkj_shopGift.js ├── jd_lzkj_v2_birthday.js ├── jd_lzkj_v2_cart.js ├── jd_lzkj_v2_draw.js ├── jd_lzkj_v2_perfectInfo.js ├── jd_lzkj_v2_sign.js ├── jd_lzkj_yili_medal.js ├── jd_market_answer.js ├── jd_market_draw.js ├── jd_market_exchange.js ├── jd_market_lottery.js ├── jd_market_new.js ├── jd_market_task.js ├── jd_mk_game.js ├── jd_mkt_answer.js ├── jd_mohe.js ├── jd_msSign.js ├── jd_ms_draw.js ├── jd_msdraw.js ├── jd_mybbphdyh.js ├── jd_mybbphdyh2.js ├── jd_mybbphdyh2_give.js ├── jd_mybbphdyh3.js ├── jd_mybbphdyh3_give.js ├── jd_mybbphdyh4.js ├── jd_mybbphdyh4_give.js ├── jd_mybbphdyh_give.js ├── jd_notify.js ├── jd_nzyq_draw.js ├── jd_nzyq_help.js ├── jd_opencard0521.js ├── jd_opencard05211.js ├── jd_opencard0527.js ├── jd_opencard05271.js ├── jd_opencard_0407.js ├── jd_opencard_04071.js ├── jd_opencard_0421.js ├── jd_opencard_0423.js ├── jd_opencard_0426.js ├── jd_opencard_0428.js ├── jd_opencard_gift.js ├── jd_opencard_shopleague.js ├── jd_ouguan.js ├── jd_pan_lottery.js ├── jd_pcSign.js ├── jd_pkabeans.js ├── jd_plantBean_friend.js ├── jd_plantBean_help.js ├── jd_plantBean_task.js ├── jd_plus2bean.js ├── jd_plus_blindbox.js ├── jd_pluscore.js ├── jd_pointExgBeans.js ├── jd_pointExgECard.js ├── jd_pointExgHb.js ├── jd_pointExgShiWu.js ├── jd_price.js ├── jd_pro_lottery.js ├── jd_pro_lottery_task.js ├── jd_pro_sign.js ├── jd_prodev.js ├── jd_pullfix.py ├── jd_qqxing.js ├── jd_querryBeans.js ├── jd_qy.js ├── jd_qyhb.js ├── jd_red618.js ├── jd_red618_task.js ├── jd_redRain.js ├── jd_redrain_supermarket.js ├── jd_rmvcart.js ├── jd_seckillViewTask.js ├── jd_seckill_viewTask.js ├── jd_sendbeans.js ├── jd_sevenDay.js ├── jd_share2.js ├── jd_shopDraw.js ├── jd_shopSign.js ├── jd_shop_lottery.js ├── jd_shopping_red.js ├── jd_sign.js ├── jd_sj38_draw.js ├── jd_sq_draw.js ├── jd_sqb_award.js ├── jd_star.js ├── jd_super_zzj.js ├── jd_super_zzj_exchange.js ├── jd_superbrandhall.js ├── jd_supermarket_draw.js ├── jd_supermh.js ├── jd_sx_draw.js ├── jd_sx_help.js ├── jd_taskop.py ├── jd_tj_nnly.js ├── jd_tj_qdtx.js ├── jd_tj_ttlhb.js ├── jd_tj_yqs.js ├── jd_tjfb.js ├── jd_tjfb_help.js ├── jd_tjqd_new.js ├── jd_tower_collect.js ├── jd_try.js ├── jd_try_notify.js ├── jd_ttDraw.js ├── jd_ttthb_help.js ├── jd_txtotal.js ├── jd_txzj_cart_item.js ├── jd_txzj_collect_item.js ├── jd_txzj_collect_shop.js ├── jd_txzj_lottery.js ├── jd_txzj_share_new.js ├── jd_txzj_shop_gift.js ├── jd_txzj_sign_in.js ├── jd_unFollow.js ├── jd_unsubscribe.js ├── jd_unsubscribeShop.js ├── jd_video_shua.js ├── jd_video_task.js ├── jd_video_view.js ├── jd_vu50.js ├── jd_washbeans.js ├── jd_wbDraw.js ├── jd_wdzfd.js ├── jd_wechat_openGroup.js ├── jd_wechat_qd.js ├── jd_wechat_signRedpacket.js ├── jd_wechat_ttlzq.js ├── jd_whx_drawShopGift.js ├── jd_wsck.py ├── jd_wskey.py ├── jd_wskey_logout.js ├── jd_wwmanor_merge.js ├── jd_wxBuildActivity.js ├── jd_wxCartKoi.js ├── jd_wxCollectCard.js ├── jd_wxCollectionActivity.js ├── jd_wxCollectionActivity2.js ├── jd_wxFansInterActionActivity.js ├── jd_wxGameActivity.js ├── jd_wxKnowledgeActivity.js ├── jd_wxMcLevelAndBirthGifts.js ├── jd_wxSecond.js ├── jd_wxShareActivity.js ├── jd_wxShopFollowActivity.js ├── jd_wxShopGift.js ├── jd_wxSign.js ├── jd_wxSignPoint.js ├── jd_wxSignRed.js ├── jd_wxTeam.js ├── jd_wxUnPackingActivity.js ├── jd_wx_completeInfoActivity.js ├── jd_wx_daily.js ├── jd_wx_draw.js ├── jd_wx_drawCenter.js ├── jd_wx_shopSign.js ├── jd_wx_zeroTrial.js ├── jd_wxgame.js ├── jd_wxtoken_m.js ├── jd_wxttzq.js ├── jd_xbzzj_draw.js ├── jd_xy_draw.js ├── jd_y1y.js ├── jd_yb_draw.js ├── jd_ybdraw.js ├── jd_yc_draw.js ├── jd_yiLi.js ├── jd_yili_medal.js ├── jd_yqs.js ├── jd_yssign.js ├── jd_yzj.js ├── jd_zqydj.js ├── jd_zwb.js ├── jd_zzhb_new_draw.js ├── jd_zzhb_new_help1.js ├── jd_zzhb_withdraw.js ├── jx_fcwb_auto.js ├── jx_fcwb_help.js ├── jx_joypark_task.js ├── jx_niuniu_merge.js ├── jx_ttlhb.js ├── main.py ├── mount.sh ├── package-lock.json ├── package.json ├── ql.js ├── ql_wsck.py ├── sendNotify.js ├── sendNotify.py ├── sign_graphics_validate.js ├── test.js ├── utils ├── Rebels │ ├── rebelsa.js │ ├── rebelsb.js │ ├── rebelsc.js │ ├── rebelsm.js │ ├── rebelsn.js │ ├── rebelsv.js │ ├── rebelsx.js │ └── rebelsz.js ├── Rebels_3_0.js ├── Rebels_H.js ├── Rebels_Token.js ├── Rebels_jdCommon.js ├── Rebels_proxy.js ├── Rebels_savePrize.js ├── Rebels_sendJDNotify.js ├── baseCookie.js ├── baseUtils.js ├── jsToken.js ├── rs_config.js └── smashUtils.js └── wskey.py /CK_WxPusherUid.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "pt_pin": "ptpin1", 4 | "Uid": "UID_AAAAAAAAAAAA" 5 | }, 6 | { 7 | "pt_pin": "ptpin2", 8 | "Uid": "UID_BBBBBBBBBB" 9 | }, 10 | { 11 | "pt_pin": "ptpin3", 12 | "Uid": "UID_CCCCCCCCC" 13 | } 14 | ] -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## 仓库说明 2 | ### 不破楼兰终不还 3 | 4 | Faker自用仓库。本地秘钥计算方法,保证账户信息安全。已适配Spy插件24小时全天监控。 5 | 6 | * 推荐配合无界使用 7 | * 自有拉库代理 8 | * 每日保持更新 9 | 10 | ### 注意 11 | 为了可以完美使用本库,请使用一键安装脚本安装青龙,请按照教程链接进行配置。 12 | 13 | 【一键脚本】 14 | https://thin-hill-428.notion.site/Faker-QL-pannel-Faker-Repository-environment-Setup-45edcbfe90d74d8abb2d71896eab3be7 15 | 16 | ## 内部助力版 17 | 18 | 无任何自带助力码。 19 | 20 | #### [点击直达频道获得更多使用教程](https://t.me/scriptalking) 21 | 22 | [![Anurag's GitHub stats](https://github-readme-stats.vercel.app/api?username=shufflewzc&bg_color=30,e96443,904e95&title_color=fff&text_color=fff)](https://github.com/anuraghazra/github-readme-stats) 23 | 24 | 25 | 26 | 【注意】拉库前请打开青龙面板-配置文件 第18行 GithubProxyUrl="" 双引号中的内容去掉。 27 | 28 | Faker3 内部助力版 29 | 30 | ql repo https://git.metauniverse-cn.com/https://github.com/shufflewzc/faker3.git "jd_|jx_|gua_|jddj_|jdCookie" "activity|backUp" "^jd[^_]|USER|function|utils|sendNotify|ZooFaker_Necklace.js|JDJRValidator_|sign_graphics_validate|ql|JDSignValidator|magic|depend|h5sts" "main" 31 | 32 | 【教程合集】 33 | [https://www.notion.so/Cent-OS-7-6-1c598629675145988b43a37998a1604a]() 34 | 35 | 36 | ## Special statement: 37 | 38 | * Any unlocking and decryption analysis scripts involved in the Script project released by this warehouse are only used for testing, learning and research, and are forbidden to be used for commercial purposes. Their legality, accuracy, completeness and effectiveness cannot be guaranteed. Please make your own judgment based on the situation. . 39 | 40 | * All resource files in this project are forbidden to be reproduced or published in any form by any official account or self-media. 41 | 42 | * This warehouse is not responsible for any script problems, including but not limited to any loss or damage caused by any script errors. 43 | 44 | * Any user who indirectly uses the script, including but not limited to establishing a VPS or disseminating it when certain actions violate national/regional laws or related regulations, this warehouse is not responsible for any privacy leakage or other consequences caused by this. 45 | 46 | * Do not use any content of the Script project for commercial or illegal purposes, otherwise you will be responsible for the consequences. 47 | 48 | * If any unit or individual believes that the script of the project may be suspected of infringing on their rights, they should promptly notify and provide proof of identity and ownership. We will delete the relevant script after receiving the certification document. 49 | 50 | * Anyone who views this item in any way or directly or indirectly uses any script of the Script item should read this statement carefully. This warehouse reserves the right to change or supplement this disclaimer at any time. Once you have used and copied any relevant scripts or rules of the Script project, you are deemed to have accepted this disclaimer. 51 | 52 | **You must completely delete the above content from your computer or mobile phone within 24 hours after downloading.**
53 | > ***You have used or copied any script made by yourself in this warehouse, it is deemed to have accepted this statement, please read it carefully*** 54 | 55 | 56 | ## Special thanks to: 57 | 58 | 59 | * [@NobyDa](https://github.com/NobyDa) 60 | * [@chavyleung](https://github.com/chavyleung) 61 | * [@liuxiaoyucc](https://github.com/liuxiaoyucc) 62 | * [@Zero-S1](https://github.com/Zero-S1) 63 | * [@uniqueque](https://github.com/uniqueque) 64 | * [@nzw9314](https://github.com/nzw9314) 65 | * [@Andy Woo](https://t.me/update_help_group)「青龙互助研究院支持」 66 | * [@Oreo](https://github.com/Oreomeow) 「青龙Faker仓库一键安装配置」 67 | 68 | # 欢迎Pull Request! 69 | -------------------------------------------------------------------------------- /USER_AGENTS.js: -------------------------------------------------------------------------------- 1 | const USER_AGENTS = [ 2 | "jdapp;android;11.2.8;;;Mozilla/5.0 (Linux; Android 10; ONEPLUS A5010 Build/QKQ1.191014.012; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/76.0.3809.89 MQQBrowser/6.2 TBS/045230 Mobile Safari/537.36", 3 | "jdapp;iPhone;11.2.6;;;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 4 | "jdapp;android;11.2.5;;;Mozilla/5.0 (Linux; Android 9; Mi Note 3 Build/PKQ1.181007.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/78.0.3904.108 MQQBrowser/6.2 TBS/045131 Mobile Safari/537.36", 5 | "jdapp;android;11.2.4;;;Mozilla/5.0 (Linux; Android 10; GM1910 Build/QKQ1.190716.003; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/76.0.3809.89 MQQBrowser/6.2 TBS/045230 Mobile Safari/537.36", 6 | "jdapp;android;11.2.2;;;Mozilla/5.0 (Linux; Android 9; 16T Build/PKQ1.190616.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/78.0.3904.108 MQQBrowser/6.2 TBS/044942 Mobile Safari/537.36", 7 | "jdapp;iPhone;11.2.0;;;Mozilla/5.0 (iPhone; CPU iPhone OS 13_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 8 | "jdapp;iPhone;11.1.4;;;Mozilla/5.0 (iPhone; CPU iPhone OS 13_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 9 | "jdapp;iPhone;11.1.2;;;Mozilla/5.0 (iPhone; CPU iPhone OS 13_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 10 | "jdapp;iPhone;11.1.0;;;Mozilla/5.0 (iPhone; CPU iPhone OS 14_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 11 | "jdapp;iPhone;11.0.4;;;Mozilla/5.0 (iPhone; CPU iPhone OS 13_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 12 | "jdapp;iPhone;11.0.2;;;Mozilla/5.0 (iPhone; CPU iPhone OS 13_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 13 | "jdapp;iPhone;11.0.0;;;Mozilla/5.0 (iPhone; CPU iPhone OS 14_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 14 | "jdapp;iPhone;10.5.4;;;Mozilla/5.0 (iPhone; CPU iPhone OS 13_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 15 | "jdapp;iPhone;10.5.2;;;Mozilla/5.0 (iPhone; CPU iPhone OS 13_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 16 | "jdapp;iPhone;10.5.0;;;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 17 | "jdapp;android;11.2.8;;;Mozilla/5.0 (Linux; Android 9; MI 6 Build/PKQ1.190118.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/78.0.3904.108 MQQBrowser/6.2 TBS/044942 Mobile Safari/537.36", 18 | "jdapp;android;11.2.6;;;Mozilla/5.0 (Linux; Android 11; Redmi K30 5G Build/RKQ1.200826.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/76.0.3809.89 MQQBrowser/6.2 TBS/045511 Mobile Safari/537.36", 19 | "jdapp;iPhone;11.2.5;;;Mozilla/5.0 (iPhone; CPU iPhone OS 11_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15F79", 20 | "jdapp;android;11.2.4;;;Mozilla/5.0 (Linux; Android 10; M2006J10C Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/76.0.3809.89 MQQBrowser/6.2 TBS/045230 Mobile Safari/537.36", 21 | "jdapp;android;11.2.2;;;Mozilla/5.0 (Linux; Android 10; M2006J10C Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/76.0.3809.89 MQQBrowser/6.2 TBS/045230 Mobile Safari/537.36", 22 | "jdapp;android;11.2.0;;;Mozilla/5.0 (Linux; Android 10; ONEPLUS A6000 Build/QKQ1.190716.003; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/76.0.3809.89 MQQBrowser/6.2 TBS/045224 Mobile Safari/537.36", 23 | "jdapp;android;11.1.4;;;Mozilla/5.0 (Linux; Android 9; MHA-AL00 Build/HUAWEIMHA-AL00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/78.0.3904.108 MQQBrowser/6.2 TBS/044942 Mobile Safari/537.36", 24 | "jdapp;android;11.1.2;;;Mozilla/5.0 (Linux; Android 8.1.0; 16 X Build/OPM1.171019.026; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/78.0.3904.108 MQQBrowser/6.2 TBS/044942 Mobile Safari/537.36", 25 | "jdapp;android;11.1.0;;;Mozilla/5.0 (Linux; Android 8.0.0; HTC U-3w Build/OPR6.170623.013; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/78.0.3904.108 MQQBrowser/6.2 TBS/044942 Mobile Safari/537.36", 26 | "jdapp;iPhone;11.0.4;;;Mozilla/5.0 (iPhone; CPU iPhone OS 14_0_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 27 | "jdapp;android;11.0.2;;;Mozilla/5.0 (Linux; Android 10; LYA-AL00 Build/HUAWEILYA-AL00L; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/76.0.3809.89 MQQBrowser/6.2 TBS/045230 Mobile Safari/537.36", 28 | "jdapp;iPhone;11.0.0;;;Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 29 | "jdapp;iPhone;10.5.4;;;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 30 | "jdapp;iPhone;10.5.2;;;Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 31 | "jdapp;android;10.5.0;;;Mozilla/5.0 (Linux; Android 8.1.0; MI 8 Build/OPM1.171019.026; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/78.0.3904.108 MQQBrowser/6.2 TBS/045131 Mobile Safari/537.36", 32 | "jdapp;android;11.2.8;;;Mozilla/5.0 (Linux; Android 10; Redmi K20 Pro Premium Edition Build/QKQ1.190825.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/76.0.3809.89 MQQBrowser/6.2 TBS/045227 Mobile Safari/537.36", 33 | "jdapp;iPhone;11.2.5;;;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 34 | "jdapp;iPhone;11.2.4;;;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 35 | "jdapp;android;11.2.2;;;Mozilla/5.0 (Linux; Android 11; Redmi K20 Pro Premium Edition Build/RKQ1.200826.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/76.0.3809.89 MQQBrowser/6.2 TBS/045513 Mobile Safari/537.36", 36 | "jdapp;android;11.2.0;;;Mozilla/5.0 (Linux; Android 10; MI 8 Build/QKQ1.190828.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/76.0.3809.89 MQQBrowser/6.2 TBS/045227 Mobile Safari/537.36", 37 | "jdapp;iPhone;11.1.4;;;Mozilla/5.0 (iPhone; CPU iPhone OS 14_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 38 | "jdapp;android;11.0.1;;;Mozilla/5.0 (Linux; Android 10; ONEPLUS A5010 Build/QKQ1.191014.012; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/76.0.3809.89 MQQBrowser/6.2 TBS/045230 Mobile Safari/537.36", 39 | "jdapp;iPhone;11.1.2;;;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 40 | "jdapp;android;11.1.0;;;Mozilla/5.0 (Linux; Android 10; Mi Note 5 Build/PKQ1.181007.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/78.0.3904.108 MQQBrowser/6.2 TBS/045131 Mobile Safari/537.36", 41 | "jdapp;android;11.0.4;;;Mozilla/5.0 (Linux; Android 11; LIO-AN00 Build/HUAWEILIO-AN00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/76.0.3809.89 MQQBrowser/6.2 TBS/045230 Mobile Safari/537.36", 42 | "jdapp;android;11.0.2;;;Mozilla/5.0 (Linux; Android 10; SKW-A0 Build/SKYW2001202CN00MQ0; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/78.0.3904.108 MQQBrowser/6.2 TBS/044942 Mobile Safari/537.36", 43 | "jdapp;iPhone;11.0.0;;;Mozilla/5.0 (iPhone; CPU iPhone OS 13_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 44 | "jdapp;iPhone;10.5.4;;;Mozilla/5.0 (iPhone; CPU iPhone OS 13_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 45 | "jdapp;iPhone;10.5.2;;;Mozilla/5.0 (iPhone; CPU iPhone OS 13_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 46 | "jdapp;iPhone;10.5.0;;;Mozilla/5.0 (iPhone; CPU iPhone OS 14_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 47 | "jdapp;iPhone;11.2.8;;;Mozilla/5.0 (iPhone; CPU iPhone OS 13_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 48 | "jdapp;iPhone;11.2.5;;;Mozilla/5.0 (iPhone; CPU iPhone OS 13_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 49 | "jdapp;iPhone;11.2.4;;;Mozilla/5.0 (iPhone; CPU iPhone OS 14_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 50 | "jdapp;iPhone;11.2.2;;;Mozilla/5.0 (iPhone; CPU iPhone OS 13_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 51 | "jdapp;iPhone;11.2.0;;;Mozilla/5.0 (iPhone; CPU iPhone OS 13_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 52 | "jdapp;iPhone;11.1.4;;;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 53 | "jdapp;android;11.1.2;;;Mozilla/5.0 (Linux; Android 9; MI 6 Build/PKQ1.190118.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/78.0.3904.108 MQQBrowser/6.2 TBS/044942 Mobile Safari/537.36", 54 | "jdapp;android;11.1.0;;;Mozilla/5.0 (Linux; Android 12; Redmi K30 5G Build/RKQ1.200826.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/76.0.3809.89 MQQBrowser/6.2 TBS/045511 Mobile Safari/537.36", 55 | "jdapp;iPhone;11.0.4;;;Mozilla/5.0 (iPhone; CPU iPhone OS 11_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15F79", 56 | "jdapp;android;11.0.2;;;Mozilla/5.0 (Linux; Android 10; M2006J10C Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/76.0.3809.89 MQQBrowser/6.2 TBS/045230 Mobile Safari/537.36", 57 | "jdapp;android;11.0.0;;;Mozilla/5.0 (Linux; Android 12; HWI-AL00 Build/HUAWEIHWI-AL00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/76.0.3809.89 MQQBrowser/6.2 TBS/045230 Mobile Safari/537.36", 58 | "jdapp;android;10.5.4;;;Mozilla/5.0 (Linux; Android 10; ANE-AL00 Build/HUAWEIANE-AL00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/76.0.3809.89 MQQBrowser/6.2 TBS/045224 Mobile Safari/537.36", 59 | "jdapp;android;10.5.2;;;Mozilla/5.0 (Linux; Android 9; ELE-AL00 Build/HUAWEIELE-AL00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/78.0.3904.108 MQQBrowser/6.2 TBS/044942 Mobile Safari/537.36", 60 | "jdapp;android;10.5.0;;;Mozilla/5.0 (Linux; Android 10; LIO-AL00 Build/HUAWEILIO-AL00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/78.0.3904.108 MQQBrowser/6.2 TBS/044942 Mobile Safari/537.36", 61 | "jdapp;android;11.2.8;;;Mozilla/5.0 (Linux; Android 10; SM-G9750 Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/78.0.3904.108 MQQBrowser/6.2 TBS/044942 Mobile Safari/537.36", 62 | "jdapp;iPhone;11.2.5;;;Mozilla/5.0 (iPhone; CPU iPhone OS 14_0_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 63 | "jdapp;android;11.2.4;;;Mozilla/5.0 (Linux; Android 12; EVR-AL00 Build/HUAWEIEVR-AL00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/76.0.3809.89 MQQBrowser/6.2 TBS/045230 Mobile Safari/537.36", 64 | "jdapp;iPhone;11.2.2;;;Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 65 | "jdapp;iPhone;11.2.0;;;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 66 | "jdapp;iPhone;11.1.4;;;Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 67 | "jdapp;android;11.1.2;;;Mozilla/5.0 (Linux; Android 8.1.0; MI 8 Build/OPM1.171019.026; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/78.0.3904.108 MQQBrowser/6.2 TBS/045131 Mobile Safari/537.36", 68 | "jdapp;android;11.1.0;;;Mozilla/5.0 (Linux; Android 9; HLK-AL00 Build/HONORHLK-AL00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/76.0.3809.89 MQQBrowser/6.2 TBS/045227 Mobile Safari/537.36", 69 | "jdapp;iPhone;11.0.4;;;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 70 | "jdapp;iPhone;11.0.2;;;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 71 | "jdapp;android;11.0.0;;;Mozilla/5.0 (Linux; Android 10; LYA-AL10 Build/HUAWEILYA-AL10; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/76.0.3809.89 MQQBrowser/6.2 TBS/045513 Mobile Safari/537.36", 72 | "jdapp;android;10.5.4;;;Mozilla/5.0 (Linux; Android 10; MI 9 Build/QKQ1.190825.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/76.0.3809.89 MQQBrowser/6.2 TBS/045227 Mobile Safari/537.36", 73 | "jdapp;iPhone;10.5.2;;;Mozilla/5.0 (iPhone; CPU iPhone OS 14_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 74 | ] 75 | /** 76 | * 生成随机数字 77 | * @param {number} min 最小值(包含) 78 | * @param {number} max 最大值(不包含) 79 | */ 80 | function randomNumber(min = 0, max = 80) { 81 | return Math.min(Math.floor(min + Math.random() * (max - min)), max); 82 | } 83 | const USER_AGENT = USER_AGENTS[randomNumber(0, USER_AGENTS.length)]; 84 | 85 | function UARAM (){ 86 | return USER_AGENTS[randomNumber(0, USER_AGENTS.length)]; 87 | } 88 | 89 | module.exports = { 90 | USER_AGENT, 91 | UARAM 92 | } 93 | -------------------------------------------------------------------------------- /cleancart_activity.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | */ 4 | let jdSignUrl = '' // 算法url 5 | let Authorization = '' // 算法url token 有则填 6 | let got = ''; 7 | try{ 8 | got = require('got'); 9 | }catch(e){ 10 | console.log('请添加依赖模块"got"') 11 | } 12 | 13 | 14 | jdSignUrl = process.env.gua_cleancart_SignUrl ? process.env.gua_cleancart_SignUrl : `${jdSignUrl}` 15 | Authorization = process.env.gua_cleancart_Authorization ? process.env.gua_cleancart_Authorization : `${Authorization}` 16 | if(Authorization && Authorization.indexOf("Bearer ") === -1) Authorization = `Bearer ${Authorization}` 17 | let cookie = '' 18 | let out = false 19 | 20 | async function clean(ck,url,goodsArr){ 21 | if(!got) return false 22 | return new Promise(async resolve => { 23 | let msg = false 24 | try{ 25 | if(!ck) return '' 26 | if(!jdSignUrl) jdSignUrl = url 27 | cookie = ck 28 | // if(jdSignUrl.indexOf("://jd.smiek.tk/") > -1) { 29 | // resolve(msg) 30 | // return false 31 | // } 32 | let signBody = `{"homeWishListUserFlag":"1","userType":"0","updateTag":true,"showPlusEntry":"2","hitNewUIStatus":"1","cvhv":"049591","cartuuid":"hjudwgohxzVu96krv/T6Hg==","adid":""}` 33 | let body = await jdSign('cartClearQuery', signBody) 34 | if(out) return 35 | if(!body){ 36 | console.log('获取不到算法') 37 | return 38 | } 39 | let data = await jdApi('cartClearQuery',body) 40 | let res = jsonParse(data) 41 | if(typeof res == 'object' && res){ 42 | if(res.resultCode == 0){ 43 | if(res.mainTitle.indexOf('购物车是空的') > -1){ 44 | msg = [] 45 | }else if(!res.clearCartInfo || !res.subTitle){ 46 | console.log(res.mainTitle) 47 | }else{ 48 | let num = 0 49 | if(res.subTitle){ 50 | num = res.subTitle.match(/共(\d+)件商品/).length > 0 && res.subTitle.match(/共(\d+)件商品/)[1] || 0 51 | console.log(res.subTitle) 52 | } 53 | // console.log(`共${num}件商品`) 54 | if(num != 0){ 55 | let operations = [] 56 | let operNum = 0 57 | let goodsArrs = [] 58 | let goodsArrsFlag = false 59 | for(let a of res.clearCartInfo || {}){ 60 | // console.log(a.groupName) 61 | // if(a.groupName.indexOf('7天内加入购物车') > -1){ 62 | if(typeof goodsArr !== 'object'){ 63 | goodsArrs = [...goodsArrs,...a.groupDetails] 64 | goodsArrsFlag = true 65 | }else{ 66 | for(let s of a.groupDetails || []){ 67 | if(typeof goodsArr === 'object'){ 68 | let XBDetail = goodsArr.filter((x) => x.skuId === s.skuId) 69 | if(XBDetail.length == 0){ 70 | // console.log(s.unusable,s.skuUuid,s.name) 71 | operNum += s.clearSkus && s.clearSkus.length || 1; 72 | operations.push({ 73 | "itemType": s.itemType+"", 74 | "suitType": s.suitType, 75 | "skuUuid": s.skuUuid+"", 76 | "itemId": s.itemId || s.skuId, 77 | "useUuid": typeof s.useUuid !== 'undefined' && s.useUuid || false 78 | }) 79 | } 80 | } 81 | } 82 | } 83 | // } 84 | } 85 | if(goodsArrsFlag){ 86 | msg = goodsArrs || [] 87 | return 88 | } 89 | console.log(`准备清空${operNum}件商品`) 90 | if(operations.length == 0){ 91 | console.log(`清空${operNum}件商品|没有找到要清空的商品`) 92 | }else{ 93 | let clearBody = `{"homeWishListUserFlag":"1","userType":"0","updateTag":false,"showPlusEntry":"2","hitNewUIStatus":"1","cvhv":"049591","cartuuid":"hjudwgohxzVu96krv/T6Hg==","operations":${jsonStringify(operations)},"adid":"","coord_type":"0"}` 94 | clearBody = await jdSign('cartClearRemove', clearBody) 95 | if(out) return 96 | if(!clearBody){ 97 | console.log('获取不到算法') 98 | }else{ 99 | let clearData = await jdApi('cartClearRemove',clearBody) 100 | let clearRes = jsonParse(clearData) 101 | if(typeof clearRes == 'object'){ 102 | if(clearRes.resultCode == 0) { 103 | console.log(`清空${operNum}件商品|✅\n`) 104 | }else if(clearRes.mainTitle){ 105 | console.log(`清空${operNum}件商品|${clearRes.mainTitle}\n`) 106 | }else{ 107 | console.log(`清空${operNum}件商品|❌\n`) 108 | console.log(clearData) 109 | } 110 | }else{ 111 | console.log(`清空${operNum}件商品|❌\n`) 112 | console.log(clearData) 113 | } 114 | } 115 | } 116 | }else if(res.mainTitle){ 117 | if(res.mainTitle.indexOf('购物车是空的') > -1){ 118 | msg = [] 119 | } 120 | console.log(res.mainTitle) 121 | }else{ 122 | console.log(data) 123 | } 124 | } 125 | }else{ 126 | console.log(data) 127 | } 128 | }else{ 129 | console.log(data) 130 | } 131 | }catch(e){ 132 | console.log(e) 133 | } finally { 134 | resolve(msg); 135 | } 136 | }) 137 | } 138 | 139 | function jdApi(functionId,body) { 140 | if(!functionId || !body) return 141 | return new Promise(resolve => { 142 | let opts = taskPostUrl(`/client.action?functionId=${functionId}`, body) 143 | got.post(opts).then( 144 | (resp) => { 145 | const {body:data } = resp 146 | try { 147 | let res = jsonParse(data); 148 | if(typeof res == 'object'){ 149 | if(res.mainTitle) console.log(res.mainTitle) 150 | if(res.resultCode == 0){ 151 | resolve(res); 152 | }else if (res.tips && res.tips.includes("正在努力加载")){ 153 | console.log("请求太快,ip被限制了") 154 | out = true 155 | } 156 | } 157 | } catch (e) { 158 | console.log(e) 159 | } finally { 160 | resolve(''); 161 | } 162 | }, 163 | (err) => { 164 | try { 165 | const { message: error, response: resp } = err 166 | console.log(`${jsonStringify(error)}`) 167 | console.log(`${functionId} API请求失败,请检查网路重试`) 168 | } catch (e) { 169 | console.log(e) 170 | } finally { 171 | resolve('') 172 | } 173 | } 174 | ) 175 | }) 176 | } 177 | 178 | function jdSign(fn,body) { 179 | let sign = '' 180 | let flag = false 181 | try{ 182 | const fs = require('fs'); 183 | if (fs.existsSync('./gua_encryption_sign.js')) { 184 | const encryptionSign = require('./gua_encryption_sign'); 185 | sign = encryptionSign.getSign(fn, body) 186 | }else{ 187 | flag = true 188 | } 189 | sign = sign.data && sign.data.sign && sign.data.sign || '' 190 | }catch(e){ 191 | flag = true 192 | } 193 | if(!flag) return sign 194 | if(!jdSignUrl.match(/^https?:\/\//)){ 195 | console.log('请填写算法url') 196 | out = true 197 | return '' 198 | } 199 | return new Promise((resolve) => { 200 | let options = { 201 | url: jdSignUrl, 202 | body:`{"fn":"${fn}","body":${body}}`, 203 | headers: { 204 | 'Accept':'*/*', 205 | "accept-encoding": "gzip, deflate, br", 206 | 'Content-Type': 'application/json', 207 | }, 208 | timeout:30000 209 | } 210 | if(Authorization) options["headers"]["Authorization"] = Authorization 211 | got.post(options).then( 212 | (resp) => { 213 | const {body:data } = resp 214 | try { 215 | let res = jsonParse(data) 216 | if(typeof res === 'object' && res){ 217 | if(res.code && res.code == 200 && res.data){ 218 | if(res.data.sign) sign = res.data.sign || '' 219 | if(sign != '') resolve(sign) 220 | }else{ 221 | console.log(data) 222 | } 223 | }else{ 224 | console.log(data) 225 | } 226 | } catch (e) { 227 | console.log(e) 228 | } finally { 229 | resolve('') 230 | } 231 | }, 232 | (err) => { 233 | try { 234 | const { message: error, response: resp } = err 235 | console.log(`${jsonStringify(error)}`) 236 | console.log(`算法url API请求失败,请检查网路重试`) 237 | } catch (e) { 238 | console.log(e) 239 | } finally { 240 | resolve('') 241 | } 242 | } 243 | 244 | ) 245 | }) 246 | } 247 | 248 | function jsonParse(str) { 249 | try { 250 | return JSON.parse(str); 251 | } catch (e) { 252 | return str; 253 | } 254 | } 255 | 256 | function jsonStringify(arr) { 257 | try { 258 | return JSON.stringify(arr); 259 | } catch (e) { 260 | return arr; 261 | } 262 | } 263 | 264 | function taskPostUrl(url, body) { 265 | return { 266 | url: `https://api.m.jd.com${url}`, 267 | body: body, 268 | headers: { 269 | "Accept": "*/*", 270 | "Accept-Language": "zh-cn", 271 | "Accept-Encoding": "gzip, deflate, br", 272 | "Connection": "keep-alive", 273 | "Content-Type": "application/x-www-form-urlencoded", 274 | 'Cookie': `${cookie}`, 275 | "User-Agent": "JD4iPhone/167853 (iPhone; iOS; Scale/2.00)" , 276 | } 277 | } 278 | } 279 | 280 | module.exports = { 281 | clean 282 | } -------------------------------------------------------------------------------- /depend.py: -------------------------------------------------------------------------------- 1 | import json 2 | import re 3 | import sys 4 | import os 5 | 6 | 7 | class Depend: 8 | @staticmethod 9 | def get_ql_path(): 10 | if re.search('/ql/data/', sys.path[0]): 11 | return '/ql/data/' 12 | else: 13 | return '/ql/' 14 | 15 | @staticmethod 16 | def get_env(env, default=None): 17 | """ 18 | 青龙环境变量读取,支持将整数,bool类型变量转化为正常的值 19 | Args: 20 | env: 字符串,被读取的青龙环境变量 21 | default: 字符串,如果找不到这个环境变量,返回的默认变量 22 | Returns: 23 | result 被格式化的变量 24 | """ 25 | if env in os.environ and os.environ[env]: 26 | if os.environ[env] in ["True", "False"]: 27 | return False if os.environ[env] == "False" else True 28 | elif os.environ[env].isdigit(): 29 | return int(os.environ[env]) 30 | else: 31 | return os.environ[env] 32 | else: 33 | if default: 34 | if default in ["True", "False"]: 35 | return False if default == "False" else True 36 | elif default.isdigit(): 37 | return int(default) 38 | else: 39 | return default 40 | else: 41 | return None 42 | 43 | @staticmethod 44 | def str2list(string): 45 | if string and string != "": 46 | if re.search(",", string): 47 | return string.split(",") 48 | else: 49 | return [string] 50 | else: 51 | return [] 52 | 53 | @staticmethod 54 | def not2append(addlist, appended): 55 | for i in addlist: 56 | if i not in appended: 57 | appended.append(i) 58 | return appended 59 | 60 | @staticmethod 61 | def re_filter_list(string, filter_list): 62 | for i in filter_list: 63 | if re.search(i, string): 64 | return True 65 | return False 66 | 67 | def only_check(self, pyname, pyabspath,osenv=None): 68 | only_path = self.get_ql_path() + pyname + '_by_keven1024' 69 | result = "☺当前脚本目录为: " + str(pyabspath) + "\n" 70 | j_data = { 71 | "py_path": None 72 | } 73 | if osenv and self.get_env(osenv): 74 | result += "😏检测到环境变量:" + str(osenv) + " = " + self.get_env(osenv) + " 将按照该路径为准\n" 75 | pyabspath = self.get_env(osenv) 76 | if os.path.exists(only_path): 77 | with open(only_path, 'r+') as f: 78 | py_data = f.read(2097152) 79 | if py_data == pyabspath: 80 | # 对旧版转换为json格式 81 | j_data["py_path"] = pyabspath 82 | f.seek(0, os.SEEK_SET) 83 | result += "😏检测到旧版检测文件,自动转换新版\n" 84 | f.writelines(json.dumps(j_data)) 85 | try: 86 | j_data = json.loads(py_data) 87 | except: 88 | pass 89 | if j_data["py_path"] and j_data["py_path"] == pyabspath: 90 | result += "😁脚本唯一性检测通过,继续运行!\n" 91 | else: 92 | result += "🙄检测到其他同类型的青龙日志分析脚本存在,拒绝运行!\n" 93 | load_send() 94 | send(pyname, result) 95 | exit(0) 96 | else: 97 | with open(only_path, "w") as f: 98 | j_data["py_path"] = pyabspath 99 | f.writelines(json.dumps(j_data)) 100 | result += "🙄检测到第一次运行,已写入唯一性检测文件,如无特殊情况请勿删除\n" 101 | return result 102 | 103 | 104 | def load_send(): 105 | global send 106 | cur_path = os.path.abspath(os.path.dirname(__file__)) 107 | sys.path.append(cur_path) 108 | if os.path.exists(cur_path + "/notify.py"): 109 | try: 110 | from notify import send 111 | except: 112 | send = False 113 | print("加载通知服务失败~") 114 | else: 115 | send = False 116 | print("加载通知服务失败~") 117 | -------------------------------------------------------------------------------- /function/common.js: -------------------------------------------------------------------------------- 1 | let request = require('request'); 2 | let CryptoJS = require('crypto-js'); 3 | let qs = require('querystring'); 4 | let urls = require('url'); 5 | let path = require('path'); 6 | let notify = require('./sendNotify'); 7 | let mainEval = require("./eval"); 8 | let assert = require('assert'); 9 | let jxAlgo = require("./jxAlgo"); 10 | let config = require("./config"); 11 | let user = {} 12 | try { 13 | user = require("./user") 14 | } catch (e) {} 15 | class env { 16 | constructor(name) { 17 | this.config = { ...config, 18 | ...process.env, 19 | ...user, 20 | }; 21 | this.name = name; 22 | this.message = []; 23 | this.sharecode = []; 24 | this.code = []; 25 | this.timestamp = new Date().getTime(); 26 | this.time = this.start = parseInt(this.timestamp / 1000); 27 | this.options = { 28 | 'headers': {} 29 | }; 30 | console.log(`\n🔔${this.name}, 开始!\n`) 31 | console.log(`=========== 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000).toLocaleString()} ===========\n`) 32 | } 33 | done() { 34 | let timestamp = new Date().getTime(); 35 | let work = ((timestamp - this.timestamp) / 1000).toFixed(2) 36 | console.log(`=========================脚本执行完成,耗时${work}s============================\n`) 37 | console.log(`🔔${this.name}, 结束!\n`) 38 | } 39 | notify(array) { 40 | let text = ''; 41 | for (let i of array) { 42 | text += `${i.user} -- ${i.msg}\n` 43 | } 44 | console.log(`\n=============================开始发送提醒消息=============================`) 45 | notify.sendNotify(this.name + "消息提醒", text) 46 | } 47 | wait(t) { 48 | return new Promise(e => setTimeout(e, t)) 49 | } 50 | setOptions(params) { 51 | this.options = params; 52 | } 53 | setCookie(cookie) { 54 | this.options.headers.cookie = cookie 55 | } 56 | jsonParse(str) { 57 | try { 58 | return JSON.parse(str); 59 | } catch (e) { 60 | try { 61 | let data = this.match([/try\s*\{\w+\s*\(([^\)]+)/, /\w+\s*\(([^\)]+)/], str) 62 | return JSON.parse(data); 63 | } catch (ee) { 64 | try { 65 | let cb = this.match(/try\s*\{\s*(\w+)/, str) 66 | if (cb) { 67 | let func = ""; 68 | let data = str.replace(cb, `func=`) 69 | eval(data); 70 | return func 71 | } 72 | } catch (eee) { 73 | return str 74 | } 75 | } 76 | } 77 | } 78 | curl(params, extra = '') { 79 | if (typeof(params) != 'object') { 80 | params = { 81 | 'url': params 82 | } 83 | } 84 | params = Object.assign({ ...this.options 85 | }, params); 86 | params.method = params.body ? 'POST' : 'GET'; 87 | if (params.hasOwnProperty('cookie')) { 88 | params.headers.cookie = params.cookie 89 | } 90 | if (params.hasOwnProperty('ua') || params.hasOwnProperty('useragent')) { 91 | params.headers['user-agent'] = params.ua 92 | } 93 | if (params.hasOwnProperty('referer')) { 94 | params.headers.referer = params.referer 95 | } 96 | if (params.hasOwnProperty('params')) { 97 | params.url += '?' + qs.stringify(params.params) 98 | } 99 | if (params.hasOwnProperty('form')) { 100 | params.method = 'POST' 101 | } 102 | return new Promise(resolve => { 103 | request(params, async (err, resp, data) => { 104 | try { 105 | if (params.console) { 106 | console.log(data) 107 | } 108 | this.source = this.jsonParse(data); 109 | if (extra) { 110 | this[extra] = this.source 111 | } 112 | } catch (e) { 113 | console.log(e, resp) 114 | } finally { 115 | resolve(data); 116 | } 117 | }) 118 | }) 119 | } 120 | dumps(dict) { 121 | return JSON.stringify(dict) 122 | } 123 | loads(str) { 124 | return JSON.parse(str) 125 | } 126 | notice(msg) { 127 | this.message.push({ 128 | 'index': this.index, 129 | 'user': this.user, 130 | 'msg': msg 131 | }) 132 | } 133 | notices(msg, user, index = '') { 134 | this.message.push({ 135 | 'user': user, 136 | 'msg': msg, 137 | 'index': index 138 | }) 139 | } 140 | urlparse(url) { 141 | return urls.parse(url, true, true) 142 | } 143 | md5(encryptString) { 144 | return CryptoJS.MD5(encryptString).toString() 145 | } 146 | haskey(data, key, value) { 147 | value = typeof value !== 'undefined' ? value : ''; 148 | var spl = key.split('.'); 149 | for (var i of spl) { 150 | i = !isNaN(i) ? parseInt(i) : i; 151 | try { 152 | data = data[i]; 153 | } catch (error) { 154 | return ''; 155 | } 156 | } 157 | if (data == undefined) { 158 | return '' 159 | } 160 | if (value !== '') { 161 | return data === value ? true : false; 162 | } else { 163 | return data 164 | } 165 | } 166 | match(pattern, string) { 167 | pattern = (pattern instanceof Array) ? pattern : [pattern]; 168 | for (let pat of pattern) { 169 | // var match = string.match(pat); 170 | var match = pat.exec(string) 171 | if (match) { 172 | var len = match.length; 173 | if (len == 1) { 174 | return match; 175 | } else if (len == 2) { 176 | return match[1]; 177 | } else { 178 | var r = []; 179 | for (let i = 1; i < len; i++) { 180 | r.push(match[i]) 181 | } 182 | return r; 183 | } 184 | break; 185 | } 186 | // console.log(pat.exec(string)) 187 | } 188 | return ''; 189 | } 190 | matchall(pattern, string) { 191 | pattern = (pattern instanceof Array) ? pattern : [pattern]; 192 | var match; 193 | var result = []; 194 | for (var pat of pattern) { 195 | while ((match = pat.exec(string)) != null) { 196 | var len = match.length; 197 | if (len == 1) { 198 | result.push(match); 199 | } else if (len == 2) { 200 | result.push(match[1]); 201 | } else { 202 | var r = []; 203 | for (let i = 1; i < len; i++) { 204 | r.push(match[i]) 205 | } 206 | result.push(r); 207 | } 208 | } 209 | } 210 | return result; 211 | } 212 | compare(property) { 213 | return function(a, b) { 214 | var value1 = a[property]; 215 | var value2 = b[property]; 216 | return value1 - value2; 217 | } 218 | } 219 | filename(file, rename = '') { 220 | if (!this.runfile) { 221 | this.runfile = path.basename(file).replace(".js", '').replace(/-/g, '_') 222 | } 223 | if (rename) { 224 | rename = `_${rename}`; 225 | } 226 | return path.basename(file).replace(".js", rename).replace(/-/g, '_'); 227 | } 228 | rand(n, m) { 229 | var random = Math.floor(Math.random() * (m - n + 1) + n); 230 | return random; 231 | } 232 | random(arr, num) { 233 | var temp_array = new Array(); 234 | for (var index in arr) { 235 | temp_array.push(arr[index]); 236 | } 237 | var return_array = new Array(); 238 | for (var i = 0; i < num; i++) { 239 | if (temp_array.length > 0) { 240 | var arrIndex = Math.floor(Math.random() * temp_array.length); 241 | return_array[i] = temp_array[arrIndex]; 242 | temp_array.splice(arrIndex, 1); 243 | } else { 244 | break; 245 | } 246 | } 247 | return return_array; 248 | } 249 | compact(lists, keys) { 250 | let array = {}; 251 | for (let i of keys) { 252 | if (lists[i]) { 253 | array[i] = lists[i]; 254 | } 255 | } 256 | return array; 257 | } 258 | unique(arr) { 259 | return Array.from(new Set(arr)); 260 | } 261 | end(args) { 262 | return args[args.length - 1] 263 | } 264 | } 265 | module.exports = { 266 | env, 267 | eval: mainEval, 268 | assert, 269 | jxAlgo, 270 | } 271 | -------------------------------------------------------------------------------- /function/config.js: -------------------------------------------------------------------------------- 1 | module.exports = {"ThreadJs":[],"invokeKey":"RtKLB8euDo7KwsO0"} -------------------------------------------------------------------------------- /function/getH5st3_0.js: -------------------------------------------------------------------------------- 1 | function qvOoC_(){}var bqv9RD=Object['defineProperty'],BahnH7w,nk_U0E,jad0dpX,Lwi9dV,wopLnSr,MjNBoca,_EBMaR,qbvHvuG,BVDpnIh,CJHx15,d3J8_T,w8BPtN,LnkAPIo,AeK_tkO,c09sHmx,T3eOMJk,DimuA5j,uGw2fr,KS8mHlo,dhf2NH,i36nOsn;function Ok7H2Bu(qvOoC_){return BahnH7w[qvOoC_>0x3e?qvOoC_+0x3b:qvOoC_-0x2d]}BahnH7w=oqEjZ55();var YjlprKs=[],wbfE0H=['06JVI','`A','Kt.o8^A','bnu)C(j+X','UnlV/7geK','DOJVI','5#r)/9y','b8SxRa#tiUVLny,cj*3@hq*5/6**2^=W,g~RK3+s','Ztg"7{A','}XvBY(ESw5Dv~i/ZUaRW%9ZrS*evxCDF1|fWw}3S','n_MVI6>(m@u]0.HeV1lk?dse.B)*6CVe{&^uirms','d&wGW!#`ZCO9nCS7)6g','PkkH,+VUKMP#161y,X,G/{Ycg>xtYFm%9|=G|@Ms','@fPaX`ed&J@:{c7c8|Y(X@*dL6ixintF','AtZ"y#0[oOxU3m6T@1cah.)I8l','({?uTuDt3nU"dd0FRO3F1[9Xz|o"M8`_(|H(D','Z(xHz{Z(}BZLJy@.eOFI/G*Gk','tG}Pu*#U,Yvqkn7p}8EbAOqh|Opufy@hw6]aFaJ@~&2,!OY','bOKph##c_|NlLeC','sqS"Nm4teTlg:1_R>GpW^v:c}YZFH"wN;]g','B({]r!=I95+Js','<80X[(|hm{bgAnPym_}on+nj|aA#Yg+F[TF)ha_um@L9A','@#@KVykL*{|]<^,r,%g','LZpWb#x0T*l0US','sk2)g@`Yj>sSid_Re|zRbqrraMP#tL7c7Gqo$:OUX','B(6Pbd2M2Otq96"j:X2Ie}Qc+*h.UH~yiO,H','oasXy!H[$UFXPF#Uv|/"&OSrLT=)9cBU[.LTF*T&uc:cpx6{:0C,RX.lRp!2fEMr','raKbH+Etp68Z"&;=TU*YD)k!E8ZCvkrWc3aC&8}xjSlS','S5$ku<,Lt@l:2nc.YYbF@L5xHMV#c8pr5&kvz#A','hYNom8eK&UAp/CQ.','CBZ"^N!sjY0+/w+<85>]136Ija02s','!6~(46ztgaps5V|ide.l#%)j','$&0qMvs*NOPLU+S7_fAb&L/dY&f:1CITRaCK2+/s','S*eX=:*5D5FN&M"jxGjVL@1x*@u','I|u(#Odd|Yt:LCC8TjC@WNOg','tZPb>"i^0@5','Yo!14$WpSOt,Hr1jT/dkH0sM%J3T?y6%=DtukNA','X1XKL"Rj^>4EvyxjH#!RL@WU$*3J7k:jiO*Wh.h./TL','OB;3]:tYNY)nogRTyGNo{L3pxDWDP1$Z0&`uFapug','q/B$rmbjeTYDiFb%3Rg)A82Izl]t8duNcGBFR]ls','$DiXn(EujjO)d^7R7#vaw$[IDM_C9.t_zXBFU','$]^We_&t/T5:{"P','q/8]Fafd/Ps#_k{NglnB|">LGOh9G}Sc9~XK','#8eol[:t]LL,Mi|RwRaku{Et{L,PnCSf>aOvU','~D,P[(RK|nZLX+&TyGyq,Nb."TwsyeYZon=XsOx5k','h&oB/xD`iUz8,7#$P399ghyz_&U?2Bixex|7K}yEr8n','_#23K+F+oYm)gwWr#GqazmTd+YF"ck:yCUBXi5@I2jqWig','a~7Wi}>tIC','Bfg"<#A^8U','2aYK}3M@jYSmFw+F/GnXv^z_5|5.~i5.TOTxr.g@K','yB,o9&G.>Oog"1(ev_vu*)|M!jR[=Oy7lt7k','t&XK~wH@=DUG_g#TG1i$::YL,BG[^^4i6#2(6NBKbaVNFSX','O#{qcu%_~@?OgwaWg/(oA<]#6/ylOj)xv6.%T;2wq&Tt|{qW.f[X','K.eFx&VP2O4ed^uF[#sx13uLPDu[*Lb0m[EN>6)Z4$Hj9U}(i6*T&T_JIV5k%!aBxAiiF^|bFT','yB:Ii:vs','?g_qC(YckM#,}SCW','?]Tao15sVv%CxZM','8|2I~#T@xCO6"1#U=8iB;6rUi,jxs','m8uI}yA','Qg6)Q!BsJCBLs8aWQ~)1V&A','#GrRZ$)5(T(tLMgREGHKx3tuUnFN_dO.9&|GW_>t:6cV[k','JfhaIdCcil66?ylhO&23[vzp.jgGQqP','3~#v1r!I0O|e"6W.nB[ReuDc=|FVs',';W>Xq*S%z{x9.y|r*WPp036M;ae&TiS7=WZF&07M)6fDs','=J&u^NpUs5i"{8~<|76@91oU0PtR8tpRnIKu6iF@A','?%$:bazcFCk"Vm1e','m1sXl_wY6T[nAF_e','NBCR&LAriO)qfZQWhYHK)(6fwasd.SMF','7OaW^r00:P/v=kg','E|mvD[K@2BoRAFgUXk4an1m[T5i0ogV'];nk_U0E=(qvOoC_,bqv9RD,BahnH7w,jad0dpX,Lwi9dV)=>{if(typeof jad0dpX==='undefined'){jad0dpX=PNlJ1ya}if(typeof Lwi9dV===Ok7H2Bu(0x32)){Lwi9dV=YjlprKs}if(jad0dpX===nk_U0E){PNlJ1ya=bqv9RD;return PNlJ1ya(BahnH7w)}if(qvOoC_!==bqv9RD){return Lwi9dV[qvOoC_]||(Lwi9dV[qvOoC_]=jad0dpX(wbfE0H[qvOoC_]))}if(BahnH7w==qvOoC_){return bqv9RD[YjlprKs[BahnH7w]]=nk_U0E(qvOoC_,bqv9RD)}if(jad0dpX===void 0x0){nk_U0E=Lwi9dV}};function M2U4gn(){return globalThis}function iBp9kA(){return global}function pcHoTl(){return window}function wYgD7cp(){return new Function('return this')()}function kd3GSj(bqv9RD=[M2U4gn,iBp9kA,pcHoTl,wYgD7cp],nk_U0E,jad0dpX=[],Lwi9dV=0x0,wopLnSr){nk_U0E=nk_U0E;try{var MjNBoca=U3xctEZ(bqv9RD=>{return BahnH7w[bqv9RD<0x12?bqv9RD+0x57:bqv9RD-0x13]},0x1);qvOoC_(nk_U0E=Object,jad0dpX[MjNBoca(0x17)](''.__proto__.constructor.name))}catch(e){}yub6d_v:for(Lwi9dV=Lwi9dV;Lwi9dV{return BahnH7w[bqv9RD>0x1b?bqv9RD+0x3c:bqv9RD-0xa]},0x1);nk_U0E=bqv9RD[Lwi9dV]();for(wopLnSr=0x0;wopLnSr{var bqv9RD=new qbvHvuG(0x80),nk_U0E,jad0dpX;qvOoC_(nk_U0E=_EBMaR[Ok7H2Bu(0x30)]||_EBMaR.fromCharCode,jad0dpX=[]);return U3xctEZ(Lwi9dV=>{var wopLnSr,MjNBoca,qbvHvuG,BVDpnIh;qvOoC_(qbvHvuG=Lwi9dV[Ok7H2Bu(0x2d)],jad0dpX[Ok7H2Bu(0x2d)]=0x0);for(BVDpnIh=Ok7H2Bu(0x36);BVDpnIh{return BahnH7w[Lwi9dV>0x61?Lwi9dV-0x62:Lwi9dV+0x25]},0x1);MjNBoca=Lwi9dV[BVDpnIh++];if(MjNBoca<=0x7f){wopLnSr=MjNBoca}else{if(MjNBoca<=0xdf){wopLnSr=(MjNBoca&0x1f)<{return BahnH7w[Lwi9dV>-0x36?Lwi9dV<-0x36?Lwi9dV+0x23:Lwi9dV+0x35:Lwi9dV+0x1d]},0x1);wopLnSr=(MjNBoca&0xf)<<0xc|(Lwi9dV[BVDpnIh++]&Ok7H2Bu(0x2f))<{return BahnH7w[Lwi9dV<0x47?Lwi9dV+0x5d:Lwi9dV>0x47?Lwi9dV<0x59?Lwi9dV-0x48:Lwi9dV+0x4c:Lwi9dV+0xb]},0x1);wopLnSr=(MjNBoca&Ok7H2Bu(0x33))<<0x12|(Lwi9dV[BVDpnIh++]&Ok7H2Bu(0x2f))<<0xc|(Lwi9dV[BVDpnIh++]&Ok7H2Bu(0x2f))<{return BahnH7w[Lwi9dV>-0x6?Lwi9dV+0x5:Lwi9dV-0x28]},0x1);qvOoC_(wopLnSr=LnkAPIo(-0x3),BVDpnIh+=0x3)}}}}jad0dpX[CJHx15(0x66)](bqv9RD[wopLnSr]||(bqv9RD[wopLnSr]=nk_U0E(wopLnSr)))}return jad0dpX.join('')},0x1)})());function m925zts(qvOoC_){var bqv9RD=U3xctEZ(qvOoC_=>{return BahnH7w[qvOoC_>-0x3d?qvOoC_+0x22:qvOoC_<-0x4f?qvOoC_-0x25:qvOoC_>-0x3d?qvOoC_+0x2e:qvOoC_+0x4e]},0x1);return typeof Lwi9dV!==bqv9RD(-0x49)&&Lwi9dV?new Lwi9dV().decode(new wopLnSr(qvOoC_)):typeof MjNBoca!==Ok7H2Bu(0x32)&&MjNBoca?MjNBoca.from(qvOoC_).toString('utf-8'):BVDpnIh(qvOoC_)}qvOoC_(CJHx15=nk_U0E(0x88),d3J8_T=nk_U0E(0x6a),w8BPtN=nk_U0E(0x43),LnkAPIo=nk_U0E(0x3b),AeK_tkO=nk_U0E(0x36),c09sHmx=nk_U0E(0x34),T3eOMJk=nk_U0E(0x30),DimuA5j=nk_U0E.apply(void 0x0,[0x29]),uGw2fr=nk_U0E(0x23),KS8mHlo=nk_U0E.apply(void 0x0,[0x18]),dhf2NH={m1F3rLA:nk_U0E(0x9),AXzRjj:nk_U0E.call(void 0x0,Ok7H2Bu(0x3a)),b65Bk0O:nk_U0E(0x1b),mlZBGIj:nk_U0E(0x1c),lYjnRl:nk_U0E(0x2c),Ct84AJG:nk_U0E(0x2f),YM068V:nk_U0E(0x49),IiUBBJ:nk_U0E(0x4d),wxKrOZ:nk_U0E(0x6c),LfyG7V:nk_U0E(0x6d),cOdNUcQ:nk_U0E(0x6e)},i36nOsn=[nk_U0E(Ok7H2Bu(0x33)),nk_U0E.apply(void 0x0,[0x8]),nk_U0E(Ok7H2Bu(0x39)),nk_U0E(0xf),nk_U0E(0x10),nk_U0E(0x17),nk_U0E(0x2b),nk_U0E(0x2e),nk_U0E[Ok7H2Bu(0x34)](Ok7H2Bu(0x35),[0x39]),nk_U0E[Ok7H2Bu(0x34)](void 0x0,[0x3d]),nk_U0E.apply(Ok7H2Bu(0x35),[Ok7H2Bu(0x38)]),nk_U0E.call(Ok7H2Bu(0x35),0x5e),nk_U0E(0x7f)]);const {[nk_U0E(Ok7H2Bu(0x36))]:qIqMvD}=require('./jdCrypto');async function BxOmCLE(bqv9RD,jad0dpX,Lwi9dV=nk_U0E(Ok7H2Bu(0x37))){var wopLnSr=(bqv9RD,jad0dpX,Lwi9dV,MjNBoca,_EBMaR)=>{if(typeof MjNBoca===Ok7H2Bu(0x32)){MjNBoca=CJHx15}if(typeof _EBMaR==='undefined'){_EBMaR=YjlprKs}if(bqv9RD!==jad0dpX){return _EBMaR[bqv9RD]||(_EBMaR[bqv9RD]=MjNBoca(wbfE0H[bqv9RD]))}if(jad0dpX){[_EBMaR,jad0dpX]=[MjNBoca(_EBMaR),bqv9RD||Lwi9dV];return wopLnSr(bqv9RD,_EBMaR,Lwi9dV)}if(Lwi9dV==MjNBoca){return jad0dpX?bqv9RD[_EBMaR[jad0dpX]]:YjlprKs[bqv9RD]||(Lwi9dV=_EBMaR[bqv9RD]||MjNBoca,YjlprKs[bqv9RD]=Lwi9dV(wbfE0H[bqv9RD]))}if(Lwi9dV&&MjNBoca!==CJHx15){wopLnSr=CJHx15;return wopLnSr(bqv9RD,-0x1,Lwi9dV,MjNBoca,_EBMaR)}},MjNBoca,_EBMaR;qvOoC_(MjNBoca=[nk_U0E(0x6)],_EBMaR=nk_U0E(0x4));const qbvHvuG=Object[wopLnSr(0x2)]({[nk_U0E(0x3)]:bqv9RD,[_EBMaR]:Lwi9dV},jad0dpX),BVDpnIh=await qIqMvD[nk_U0E(0x5)](qbvHvuG);return BVDpnIh?.[MjNBoca[Ok7H2Bu(0x36)]];function CJHx15(bqv9RD,jad0dpX='iRAWQSVftYBTjCqlohLXeOsDcnJaNU@Eb0rxIF>M4=[w#)d1+%G]u$k!~Zg*HP8`"pm{y2(_;7./5?,:6vz3&}9<^K|',Lwi9dV,wopLnSr,MjNBoca=[],_EBMaR=0x0,qbvHvuG,BVDpnIh,CJHx15,nk_U0E){qvOoC_(Lwi9dV=''+(bqv9RD||''),wopLnSr=Lwi9dV.length,qbvHvuG=Ok7H2Bu(0x36),BVDpnIh=-Ok7H2Bu(0x37));for(CJHx15=Ok7H2Bu(0x36);CJHx15{return BahnH7w[bqv9RD<-0x3?bqv9RD-0x3a:bqv9RD+0x2]},0x1);nk_U0E=jad0dpX.indexOf(Lwi9dV[CJHx15]);if(nk_U0E===-d3J8_T(0x8)){continue}if(BVDpnIh{return BahnH7w[bqv9RD<0x4c?bqv9RD-0x36:bqv9RD<0x4c?bqv9RD-0x13:bqv9RD<0x4c?bqv9RD-0x50:bqv9RD>0x4c?bqv9RD-0x4d:bqv9RD+0x21]},0x1);qvOoC_(BVDpnIh+=nk_U0E*w8BPtN(0x5c),_EBMaR|=BVDpnIh<w8BPtN(0x58)?Ok7H2Bu(0x39):w8BPtN(0x5a));do{qvOoC_(MjNBoca.push(_EBMaR&0xff),_EBMaR>>=Ok7H2Bu(0x3b),qbvHvuG-=w8BPtN(0x5b))}while(qbvHvuG>0x7);BVDpnIh=-Ok7H2Bu(0x37)}}if(BVDpnIh>-0x1){MjNBoca.push((_EBMaR|BVDpnIh<{return BahnH7w[bqv9RD>-0xe?bqv9RD-0x60:bqv9RD+0x1f]},0x1);qvOoC_(jad0dpX=''+(bqv9RD||''),Lwi9dV=jad0dpX.length,_EBMaR=d3J8_T(-0x16),qbvHvuG=-Ok7H2Bu(0x37));for(BVDpnIh=Ok7H2Bu(0x36);BVDpnIh{return BahnH7w[bqv9RD>-0x52?bqv9RD-0x2:bqv9RD>-0x64?bqv9RD>-0x64?bqv9RD<-0x52?bqv9RD+0x63:bqv9RD+0x2a:bqv9RD+0x4:bqv9RD-0x4c]},0x1);CJHx15=nk_U0E.indexOf(jad0dpX[BVDpnIh]);if(CJHx15===-w8BPtN(-0x59)){continue}if(qbvHvuG<0x0){qbvHvuG=CJHx15}else{var LnkAPIo=U3xctEZ(bqv9RD=>{return BahnH7w[bqv9RD>0x20?bqv9RD-0xe:bqv9RD>0xe?bqv9RD<0xe?bqv9RD+0x3b:bqv9RD>0x20?bqv9RD-0x21:bqv9RD-0xf:bqv9RD+0xe]},0x1);qvOoC_(qbvHvuG+=CJHx15*Ok7H2Bu(0x3c),MjNBoca|=qbvHvuG<<_EBMaR,_EBMaR+=(qbvHvuG&d3J8_T(-0xf))>LnkAPIo(0x1a)?w8BPtN(-0x57):0xe);do{qvOoC_(wopLnSr.push(MjNBoca&0xff),MjNBoca>>=d3J8_T(-0x11),_EBMaR-=LnkAPIo(0x1d))}while(_EBMaR>LnkAPIo(0x15));qbvHvuG=-w8BPtN(-0x59)}}if(qbvHvuG>-0x1){wopLnSr.push((MjNBoca|qbvHvuG<<_EBMaR)&0xff)}return m925zts(wopLnSr)}function oqEjZ55(){return['length',0x6,0x3f,'fromCodePoint','push','undefined',0x7,'apply',void 0x0,0x0,0x1,0x58,0xd,0xe,0x8,0x5b,0x1fff]}function U3xctEZ(qvOoC_,BahnH7w=0x0){var nk_U0E=function(){return qvOoC_(...arguments)};return bqv9RD(nk_U0E,'length',{'value':BahnH7w,'configurable':true})} -------------------------------------------------------------------------------- /function/jdcookie.js: -------------------------------------------------------------------------------- 1 | /* 2 | 此文件为Node.js专用。其他用户请忽略 3 | */ 4 | //此处填写京东账号cookie。 5 | let CookieJDs = [ 6 | '',//账号一ck,例:pt_key=XXX;pt_pin=XXX; 7 | '',//账号二ck,例:pt_key=XXX;pt_pin=XXX;如有更多,依次类推 8 | ] 9 | // 判断环境变量里面是否有京东ck 10 | if (process.env.JD_COOKIE) { 11 | if (process.env.JD_COOKIE.indexOf('&') > -1) { 12 | CookieJDs = process.env.JD_COOKIE.split('&'); 13 | } else if (process.env.JD_COOKIE.indexOf('\n') > -1) { 14 | CookieJDs = process.env.JD_COOKIE.split('\n'); 15 | } else { 16 | CookieJDs = [process.env.JD_COOKIE]; 17 | } 18 | } 19 | if (JSON.stringify(process.env).indexOf('GITHUB')>-1) { 20 | console.log(`请勿使用github action运行此脚本,无论你是从你自己的私库还是其他哪里拉取的源代码,都会导致我被封号\n`); 21 | !(async () => { 22 | await require('./sendNotify').sendNotify('提醒', `请勿使用github action、滥用github资源会封我仓库以及账号`) 23 | await process.exit(0); 24 | })() 25 | } 26 | CookieJDs = [...new Set(CookieJDs.filter(item => !!item))] 27 | console.log(`\n====================共${CookieJDs.length}个京东账号Cookie=================\n`); 28 | console.log(`============脚本执行时间:${new Date(new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000).toLocaleString('chinese',{hour12:false})}=============\n`) 29 | if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {}; 30 | for (let i = 0; i < CookieJDs.length; i++) { 31 | if (!CookieJDs[i].match(/pt_pin=(.+?);/) || !CookieJDs[i].match(/pt_key=(.+?);/)) console.log(`\n提示:京东cookie 【${CookieJDs[i]}】填写不规范,可能会影响部分脚本正常使用。正确格式为: pt_key=xxx;pt_pin=xxx;(分号;不可少)\n`); 32 | const index = (i + 1 === 1) ? '' : (i + 1); 33 | exports['CookieJD' + index] = CookieJDs[i].trim(); 34 | } 35 | console.log('>>>>>>>>>>>>>>Faker 提示:任务正常运行中>>>>>>>>>>>>>>>\n') -------------------------------------------------------------------------------- /function/ql.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const got = require('got'); 4 | require('dotenv').config(); 5 | const { readFile } = require('fs/promises'); 6 | const path = require('path'); 7 | const fs = require('fs'); 8 | const tokenFileList = ['/ql/data/db/keyv.sqlite', '/ql/data/config/auth.json', '/ql/config/auth.json']; 9 | let authFile = getLatestFile(tokenFileList); 10 | const api = got.extend({ 11 | prefixUrl: 'http://127.0.0.1:5600', 12 | retry: { limit: 0 }, 13 | }); 14 | function getLatestFile(files) { 15 | let latestFile = null; 16 | let latestMtime = 0; 17 | for (const file of files) { 18 | try { 19 | const stats = fs.statSync(file); 20 | const mtime = stats.mtimeMs; 21 | if (mtime > latestMtime) { 22 | latestMtime = mtime; 23 | latestFile = file; 24 | } 25 | } catch (e) { 26 | } 27 | } 28 | return latestFile; 29 | } 30 | async function getToken() { 31 | const authConfig = await readFile(authFile); 32 | // console.log(authConfig.toString().match(/"token":"(.*?)",/)[1]) 33 | return authConfig.toString().match(/"token":"([^"]*)"(?!.*"token":)/)[1]; 34 | } 35 | // getToken() 36 | module.exports.getEnvs = async () => { 37 | const token = await getToken(); 38 | const body = await api({ 39 | url: 'api/envs', 40 | searchParams: { 41 | searchValue: 'JD_COOKIE', 42 | t: Date.now(), 43 | }, 44 | headers: { 45 | Accept: 'application/json', 46 | authorization: `Bearer ${token}`, 47 | }, 48 | }).json(); 49 | return body.data; 50 | }; 51 | 52 | module.exports.getEnvsCount = async () => { 53 | const data = await this.getEnvs(); 54 | return data.length; 55 | }; 56 | 57 | module.exports.addEnv = async (cookie, remarks) => { 58 | const token = await getToken(); 59 | const body = await api({ 60 | method: 'post', 61 | url: 'api/envs', 62 | params: { t: Date.now() }, 63 | json: [{ 64 | name: 'JD_COOKIE', 65 | value: cookie, 66 | remarks, 67 | }], 68 | headers: { 69 | Accept: 'application/json', 70 | authorization: `Bearer ${token}`, 71 | 'Content-Type': 'application/json;charset=UTF-8', 72 | }, 73 | }).json(); 74 | return body; 75 | }; 76 | 77 | module.exports.updateEnv = async (cookie, eid, remarks) => { 78 | const token = await getToken(); 79 | const body = await api({ 80 | method: 'put', 81 | url: 'api/envs', 82 | params: { t: Date.now() }, 83 | json: { 84 | name: 'JD_COOKIE', 85 | value: cookie, 86 | _id: eid, 87 | remarks, 88 | }, 89 | headers: { 90 | Accept: 'application/json', 91 | authorization: `Bearer ${token}`, 92 | 'Content-Type': 'application/json;charset=UTF-8', 93 | }, 94 | }).json(); 95 | return body; 96 | }; 97 | 98 | module.exports.updateEnv11 = async (cookie, eid, remarks) => { 99 | const token = await getToken(); 100 | const body = await api({ 101 | method: 'put', 102 | url: 'api/envs', 103 | params: { t: Date.now() }, 104 | json: { 105 | name: 'JD_COOKIE', 106 | value: cookie, 107 | id: eid, 108 | remarks, 109 | }, 110 | headers: { 111 | Accept: 'application/json', 112 | authorization: `Bearer ${token}`, 113 | 'Content-Type': 'application/json;charset=UTF-8', 114 | }, 115 | }).json(); 116 | return body; 117 | }; 118 | 119 | module.exports.DisableCk = async (eid) => { 120 | const token = await getToken(); 121 | const body = await api({ 122 | method: 'put', 123 | url: 'api/envs/disable', 124 | params: { t: Date.now() }, 125 | body: JSON.stringify([eid]), 126 | headers: { 127 | Accept: 'application/json', 128 | authorization: `Bearer ${token}`, 129 | 'Content-Type': 'application/json;charset=UTF-8', 130 | }, 131 | }).json(); 132 | return body; 133 | }; 134 | 135 | module.exports.EnableCk = async (eid) => { 136 | const token = await getToken(); 137 | const body = await api({ 138 | method: 'put', 139 | url: 'api/envs/enable', 140 | params: { t: Date.now() }, 141 | body: JSON.stringify([eid]), 142 | headers: { 143 | Accept: 'application/json', 144 | authorization: `Bearer ${token}`, 145 | 'Content-Type': 'application/json;charset=UTF-8', 146 | }, 147 | }).json(); 148 | return body; 149 | }; 150 | 151 | module.exports.getstatus = async (eid) => { 152 | const envs = await this.getEnvs(); 153 | var tempid = 0; 154 | for (let i = 0; i < envs.length; i++) { 155 | tempid = 0; 156 | if (envs[i]._id) { 157 | tempid = envs[i]._id; 158 | } 159 | if (envs[i].id) { 160 | tempid = envs[i].id; 161 | } 162 | if (tempid == eid) { 163 | return envs[i].status; 164 | } 165 | } 166 | return 99; 167 | }; 168 | 169 | module.exports.getEnvById = async (eid) => { 170 | const envs = await this.getEnvs(); 171 | var tempid = 0; 172 | for (let i = 0; i < envs.length; i++) { 173 | tempid = 0; 174 | if (envs[i]._id) { 175 | tempid = envs[i]._id; 176 | } 177 | if (envs[i].id) { 178 | tempid = envs[i].id; 179 | } 180 | if (tempid == eid) { 181 | return envs[i].value; 182 | } 183 | } 184 | return ""; 185 | }; 186 | 187 | module.exports.getEnvByPtPin = async (Ptpin) => { 188 | const envs = await this.getEnvs(); 189 | for (let i = 0; i < envs.length; i++) { 190 | var tempptpin = decodeURIComponent(envs[i].value.match(/pt_pin=([^; ]+)(?=;?)/) && envs[i].value.match(/pt_pin=([^; ]+)(?=;?)/)[1]); 191 | if (tempptpin == Ptpin) { 192 | return envs[i]; 193 | } 194 | } 195 | return ""; 196 | }; 197 | 198 | module.exports.delEnv = async (eid) => { 199 | const token = await getToken(); 200 | const body = await api({ 201 | method: 'delete', 202 | url: 'api/envs', 203 | params: { t: Date.now() }, 204 | body: JSON.stringify([eid]), 205 | headers: { 206 | Accept: 'application/json', 207 | authorization: `Bearer ${token}`, 208 | 'Content-Type': 'application/json;charset=UTF-8', 209 | }, 210 | }).json(); 211 | return body; 212 | }; -------------------------------------------------------------------------------- /function/qlApi.js: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: chenghao 3 | * @Date: 2022-02-14 10:19:21 4 | * @Last Modified by: chenghao 5 | * @Last Modified time: 2022-03-20 13:57:10 6 | * @Desc: 青龙依赖 7 | * @From: https://github.com/whyour/qinglong/issues/1369 8 | */ 9 | const axios = require('axios') 10 | const QL_URL = 'http://127.0.0.1:5700' 11 | const CLIENT_ID = process.env.CLIENT_ID 12 | const CLIENT_SECRET = process.env.CLIENT_SECRET 13 | 14 | /** 15 | *获取青龙token 16 | */ 17 | function getQLToken() { 18 | return new Promise((resolve, reject) => { 19 | axios 20 | .get( 21 | QL_URL + 22 | `/open/auth/token?client_id=${CLIENT_ID}&client_secret=${CLIENT_SECRET}` 23 | ) 24 | .then(res => { 25 | if (res.data.code === 200) { 26 | resolve(res.data.data.token) 27 | } else { 28 | reject(res.data.message) 29 | } 30 | }) 31 | }) 32 | } 33 | 34 | /** 35 | *构造请求头 36 | * @returns headers 37 | */ 38 | async function generateRequestHeader() { 39 | return new Promise(async resolve => { 40 | const token = await getQLToken() 41 | resolve({ 42 | Authorization: 'Bearer ' + token, 43 | 'User-Agent': 44 | 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4577.63 Safari/537.36', 45 | 'Content-Type': 'application/json;charset=UTF-8', 46 | 'Accept-Encoding': 'gzip, deflate', 47 | 'Accept-Language': 'zh-CN,zh;q=0.9' 48 | }) 49 | }) 50 | } 51 | 52 | /** 53 | *初始化请求实例 54 | * @returns axios instance 55 | */ 56 | async function init() { 57 | if (!CLIENT_ID || !CLIENT_SECRET) 58 | return Promise.reject('未获取到 CLIENT_ID 或 CLIENT_SECRET') 59 | const headers = await generateRequestHeader() 60 | return new Promise(resolve => { 61 | resolve( 62 | axios.create({ 63 | baseURL: QL_URL, 64 | timeout: 10000, 65 | headers 66 | }) 67 | ) 68 | }) 69 | } 70 | 71 | /** 72 | * 73 | *获取青龙环境变量 74 | * @param {*} instance 75 | * @returns [] envlist 76 | */ 77 | function getQLEnvs(instance, searchValue = 'JD_COOKIE') { 78 | return new Promise(resolve => { 79 | instance 80 | .get('/open/envs', { 81 | params: { 82 | searchValue, 83 | t: +new Date() 84 | } 85 | }) 86 | .then(res => { 87 | resolve(res.data.data.filter(v => v.status === 0)) 88 | }) 89 | }) 90 | } 91 | 92 | /** 93 | *创建ck环境变量 94 | * @param {*} instance 95 | * @param {*} [ck=[]] 96 | * @returns 97 | */ 98 | function createCkEnv(instance, ck = []) { 99 | return new Promise(resolve => { 100 | instance 101 | .post(`/open/envs?t=${+new Date()}`, ck) 102 | .then(res => { 103 | resolve(res.data) 104 | }) 105 | .catch(error => { 106 | console.log(error.response.data) 107 | }) 108 | }) 109 | } 110 | 111 | /** 112 | * 更新环境变量 113 | * @param {*} instance 114 | * @param {*} ck 115 | * @returns 116 | */ 117 | function updateCkEnv(instance, ck = {}) { 118 | return new Promise(resolve => { 119 | instance 120 | .put(`/open/envs?t=${+new Date()}`, ck) 121 | .then(res => { 122 | resolve(res.data) 123 | }) 124 | .catch(error => { 125 | console.log(error.response.data) 126 | }) 127 | }) 128 | } 129 | 130 | /** 131 | * 删除环境变量 132 | * @param {*} instance 133 | * @param {*} ckIds 134 | * @returns 135 | */ 136 | function deleteCkEnv(instance, ckIds = []) { 137 | return new Promise(resolve => { 138 | instance({ 139 | method: 'delete', 140 | url: `/open/envs?t=${+new Date()}`, 141 | data: ckIds 142 | }).then(resolve) 143 | }) 144 | } 145 | 146 | /** 147 | *切换ck状态 148 | * @param {*} instance 149 | * @param {*} path 150 | * @param {*} id 151 | * @returns 152 | */ 153 | function toggleCKEnv(instance, id, path = 'enable') { 154 | return new Promise(resolve => { 155 | instance.put(`/open/envs/${path}?t=${+new Date()}`, [id]).then(res => { 156 | resolve(res.data) 157 | }) 158 | }) 159 | } 160 | 161 | exports.createEnv = createCkEnv 162 | exports.deleteEnv = deleteCkEnv 163 | exports.getEnv = getQLEnvs 164 | exports.initInstance = init 165 | exports.updateCkEnv = updateCkEnv 166 | exports.toggleCKEnv = toggleCKEnv 167 | -------------------------------------------------------------------------------- /icon/DD_bot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shufflewzc/faker3/5d27c5474e0bdebfc566d589ad6db3b1a071b3f0/icon/DD_bot.png -------------------------------------------------------------------------------- /icon/Snipaste_2020-08-28_09-31-42.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shufflewzc/faker3/5d27c5474e0bdebfc566d589ad6db3b1a071b3f0/icon/Snipaste_2020-08-28_09-31-42.png -------------------------------------------------------------------------------- /icon/TG_PUSH1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shufflewzc/faker3/5d27c5474e0bdebfc566d589ad6db3b1a071b3f0/icon/TG_PUSH1.png -------------------------------------------------------------------------------- /icon/TG_PUSH2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shufflewzc/faker3/5d27c5474e0bdebfc566d589ad6db3b1a071b3f0/icon/TG_PUSH2.png -------------------------------------------------------------------------------- /icon/TG_PUSH3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shufflewzc/faker3/5d27c5474e0bdebfc566d589ad6db3b1a071b3f0/icon/TG_PUSH3.png -------------------------------------------------------------------------------- /icon/action1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shufflewzc/faker3/5d27c5474e0bdebfc566d589ad6db3b1a071b3f0/icon/action1.png -------------------------------------------------------------------------------- /icon/action2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shufflewzc/faker3/5d27c5474e0bdebfc566d589ad6db3b1a071b3f0/icon/action2.png -------------------------------------------------------------------------------- /icon/action3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shufflewzc/faker3/5d27c5474e0bdebfc566d589ad6db3b1a071b3f0/icon/action3.png -------------------------------------------------------------------------------- /icon/bark.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shufflewzc/faker3/5d27c5474e0bdebfc566d589ad6db3b1a071b3f0/icon/bark.jpg -------------------------------------------------------------------------------- /icon/bean_sign_simple.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shufflewzc/faker3/5d27c5474e0bdebfc566d589ad6db3b1a071b3f0/icon/bean_sign_simple.jpg -------------------------------------------------------------------------------- /icon/disable-action.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shufflewzc/faker3/5d27c5474e0bdebfc566d589ad6db3b1a071b3f0/icon/disable-action.jpg -------------------------------------------------------------------------------- /icon/fork.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shufflewzc/faker3/5d27c5474e0bdebfc566d589ad6db3b1a071b3f0/icon/fork.png -------------------------------------------------------------------------------- /icon/git1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shufflewzc/faker3/5d27c5474e0bdebfc566d589ad6db3b1a071b3f0/icon/git1.jpg -------------------------------------------------------------------------------- /icon/git10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shufflewzc/faker3/5d27c5474e0bdebfc566d589ad6db3b1a071b3f0/icon/git10.jpg -------------------------------------------------------------------------------- /icon/git11.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shufflewzc/faker3/5d27c5474e0bdebfc566d589ad6db3b1a071b3f0/icon/git11.jpg -------------------------------------------------------------------------------- /icon/git12.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shufflewzc/faker3/5d27c5474e0bdebfc566d589ad6db3b1a071b3f0/icon/git12.jpg -------------------------------------------------------------------------------- /icon/git13.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shufflewzc/faker3/5d27c5474e0bdebfc566d589ad6db3b1a071b3f0/icon/git13.jpg -------------------------------------------------------------------------------- /icon/git14.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shufflewzc/faker3/5d27c5474e0bdebfc566d589ad6db3b1a071b3f0/icon/git14.jpg -------------------------------------------------------------------------------- /icon/git2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shufflewzc/faker3/5d27c5474e0bdebfc566d589ad6db3b1a071b3f0/icon/git2.jpg -------------------------------------------------------------------------------- /icon/git3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shufflewzc/faker3/5d27c5474e0bdebfc566d589ad6db3b1a071b3f0/icon/git3.jpg -------------------------------------------------------------------------------- /icon/git4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shufflewzc/faker3/5d27c5474e0bdebfc566d589ad6db3b1a071b3f0/icon/git4.jpg -------------------------------------------------------------------------------- /icon/git5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shufflewzc/faker3/5d27c5474e0bdebfc566d589ad6db3b1a071b3f0/icon/git5.jpg -------------------------------------------------------------------------------- /icon/git6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shufflewzc/faker3/5d27c5474e0bdebfc566d589ad6db3b1a071b3f0/icon/git6.jpg -------------------------------------------------------------------------------- /icon/git7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shufflewzc/faker3/5d27c5474e0bdebfc566d589ad6db3b1a071b3f0/icon/git7.png -------------------------------------------------------------------------------- /icon/git8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shufflewzc/faker3/5d27c5474e0bdebfc566d589ad6db3b1a071b3f0/icon/git8.jpg -------------------------------------------------------------------------------- /icon/git9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shufflewzc/faker3/5d27c5474e0bdebfc566d589ad6db3b1a071b3f0/icon/git9.jpg -------------------------------------------------------------------------------- /icon/iCloud1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shufflewzc/faker3/5d27c5474e0bdebfc566d589ad6db3b1a071b3f0/icon/iCloud1.png -------------------------------------------------------------------------------- /icon/iCloud2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shufflewzc/faker3/5d27c5474e0bdebfc566d589ad6db3b1a071b3f0/icon/iCloud2.png -------------------------------------------------------------------------------- /icon/iCloud3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shufflewzc/faker3/5d27c5474e0bdebfc566d589ad6db3b1a071b3f0/icon/iCloud3.png -------------------------------------------------------------------------------- /icon/iCloud4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shufflewzc/faker3/5d27c5474e0bdebfc566d589ad6db3b1a071b3f0/icon/iCloud4.png -------------------------------------------------------------------------------- /icon/iCloud5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shufflewzc/faker3/5d27c5474e0bdebfc566d589ad6db3b1a071b3f0/icon/iCloud5.png -------------------------------------------------------------------------------- /icon/iCloud6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shufflewzc/faker3/5d27c5474e0bdebfc566d589ad6db3b1a071b3f0/icon/iCloud6.png -------------------------------------------------------------------------------- /icon/iCloud7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shufflewzc/faker3/5d27c5474e0bdebfc566d589ad6db3b1a071b3f0/icon/iCloud7.png -------------------------------------------------------------------------------- /icon/iCloud8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shufflewzc/faker3/5d27c5474e0bdebfc566d589ad6db3b1a071b3f0/icon/iCloud8.png -------------------------------------------------------------------------------- /icon/jd1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shufflewzc/faker3/5d27c5474e0bdebfc566d589ad6db3b1a071b3f0/icon/jd1.jpg -------------------------------------------------------------------------------- /icon/jd2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shufflewzc/faker3/5d27c5474e0bdebfc566d589ad6db3b1a071b3f0/icon/jd2.jpg -------------------------------------------------------------------------------- /icon/jd3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shufflewzc/faker3/5d27c5474e0bdebfc566d589ad6db3b1a071b3f0/icon/jd3.jpg -------------------------------------------------------------------------------- /icon/jd4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shufflewzc/faker3/5d27c5474e0bdebfc566d589ad6db3b1a071b3f0/icon/jd4.jpg -------------------------------------------------------------------------------- /icon/jd5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shufflewzc/faker3/5d27c5474e0bdebfc566d589ad6db3b1a071b3f0/icon/jd5.png -------------------------------------------------------------------------------- /icon/jd6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shufflewzc/faker3/5d27c5474e0bdebfc566d589ad6db3b1a071b3f0/icon/jd6.png -------------------------------------------------------------------------------- /icon/jd7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shufflewzc/faker3/5d27c5474e0bdebfc566d589ad6db3b1a071b3f0/icon/jd7.png -------------------------------------------------------------------------------- /icon/jd8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shufflewzc/faker3/5d27c5474e0bdebfc566d589ad6db3b1a071b3f0/icon/jd8.png -------------------------------------------------------------------------------- /icon/jd_moneyTree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shufflewzc/faker3/5d27c5474e0bdebfc566d589ad6db3b1a071b3f0/icon/jd_moneyTree.png -------------------------------------------------------------------------------- /icon/jd_pet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shufflewzc/faker3/5d27c5474e0bdebfc566d589ad6db3b1a071b3f0/icon/jd_pet.png -------------------------------------------------------------------------------- /icon/qh1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shufflewzc/faker3/5d27c5474e0bdebfc566d589ad6db3b1a071b3f0/icon/qh1.png -------------------------------------------------------------------------------- /icon/qh2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shufflewzc/faker3/5d27c5474e0bdebfc566d589ad6db3b1a071b3f0/icon/qh2.png -------------------------------------------------------------------------------- /icon/qh3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shufflewzc/faker3/5d27c5474e0bdebfc566d589ad6db3b1a071b3f0/icon/qh3.png -------------------------------------------------------------------------------- /icon/txy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shufflewzc/faker3/5d27c5474e0bdebfc566d589ad6db3b1a071b3f0/icon/txy.png -------------------------------------------------------------------------------- /jdCookie.js: -------------------------------------------------------------------------------- 1 | /* 2 | 此文件为Node.js专用。其他用户请忽略 3 | */ 4 | //此处填写京东账号cookie。 5 | let CookieJDs = [ 6 | '',//账号一ck,例:pt_key=XXX;pt_pin=XXX; 7 | '',//账号二ck,例:pt_key=XXX;pt_pin=XXX;如有更多,依次类推 8 | ] 9 | let IP = ''; 10 | // 判断环境变量里面是否有京东ck 11 | if (process.env.JD_COOKIE) { 12 | if (process.env.JD_COOKIE.indexOf('&') > -1) { 13 | CookieJDs = process.env.JD_COOKIE.split('&'); 14 | } else if (process.env.JD_COOKIE.indexOf('\n') > -1) { 15 | CookieJDs = process.env.JD_COOKIE.split('\n'); 16 | } else { 17 | CookieJDs = [process.env.JD_COOKIE]; 18 | } 19 | } 20 | if (JSON.stringify(process.env).indexOf('GITHUB') > -1) { 21 | console.log(`请勿使用github action运行此脚本,无论你是从你自己的私库还是其他哪里拉取的源代码,都会导致我被封号\n`); 22 | !(async () => { 23 | await require('./sendNotify').sendNotify('提醒', `请勿使用github action、滥用github资源会封我仓库以及账号`) 24 | await process.exit(0); 25 | })() 26 | } 27 | //!(async () => { 28 | // IP = await getIP(); 29 | // try { 30 | // IP = IP.match(/((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})(\.((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})){3}/)[0]; 31 | // console.log(`\n当前公网IP: ${IP}`); 32 | // } catch (e) { } 33 | //})() 34 | CookieJDs = [...new Set(CookieJDs.filter(item => !!item))] 35 | if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => { }; 36 | console.log(`\n====================共${CookieJDs.length}个京东账号Cookie=================\n`); 37 | console.log(`============脚本执行时间:${formatdate(new Date(new Date().getTime() + new Date().getTimezoneOffset() * 60 * 1000 + 8 * 60 * 60 * 1000))}=============\n`) 38 | console.log('>>>>>>>>>>>>>>Faker提醒您:有问题先更新 关注频道https://t.me/scriptalking>>>>>>>>>>>>>>>\n') 39 | for (let i = 0; i < CookieJDs.length; i++) { 40 | if (!CookieJDs[i].match(/pt_pin=(.+?);/) || !CookieJDs[i].match(/pt_key=(.+?);/)) console.log(`\n提示:京东cookie 【${CookieJDs[i]}】填写不规范,可能会影响部分脚本正常使用。正确格式为: pt_key=xxx;pt_pin=xxx;(分号;不可少)\n`); 41 | CookieJDs[i] = CookieJDs[i].replace(/[\u4e00-\u9fa5]/g, (str) => encodeURI(str)); 42 | const index = (i + 1 === 1) ? '' : (i + 1); 43 | exports['CookieJD' + index] = CookieJDs[i].trim(); 44 | } 45 | let permit = process.env.PERMIT_JS ? process.env.PERMIT_JS.split('&') : ''; 46 | 47 | if (process.env.DP_POOL) { 48 | if (permit && permit.filter(x => process.mainModule.filename.includes(x)).length != 0) { 49 | try { 50 | require("global-agent/bootstrap"); 51 | global.GLOBAL_AGENT.HTTP_PROXY = process.env.DP_POOL; 52 | console.log(`\n---------------使用代理池模式---------------\n`); 53 | } catch { 54 | throw new Error(`请安装global-agent依赖,才能启用代理!`); 55 | 56 | } 57 | } else { 58 | 59 | } 60 | } 61 | function getIP() { 62 | const https = require('https'); 63 | return new Promise((resolve, reject) => { 64 | let opt = { 65 | hostname: "www.cip.cc", 66 | port: 443, 67 | path: "/", 68 | method: "GET", 69 | headers: { 70 | "User-Agent": 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36', 71 | }, 72 | timeout: 5000 73 | } 74 | const req = https.request(opt, (res) => { 75 | res.setEncoding('utf-8'); 76 | let tmp = ''; 77 | res.on('error', reject); 78 | res.on('data', d => tmp += d); 79 | res.on('end', () => resolve(tmp)); 80 | }); 81 | 82 | req.on('error', reject); 83 | req.end(); 84 | }); 85 | } 86 | // 以下为注入互助码环境变量(仅nodejs内起效)的代码 87 | function SetShareCodesEnv(nameChinese = "", nameConfig = "", envName = "") { 88 | let rawCodeConfig = {} 89 | let fs = require('fs') 90 | // 读取互助码 91 | let shareCodeLogPath = fs.existsSync(`${process.env.QL_DIR}/data`) ? `${process.env.QL_DIR}/data/log/.ShareCode/${nameConfig}.log` : `${process.env.QL_DIR}/log/.ShareCode/${nameConfig}.log`; 92 | if (fs.existsSync(shareCodeLogPath)) { 93 | // 因为faker2目前没有自带ini,改用已有的dotenv来解析 94 | // // 利用ini模块读取原始互助码和互助组信息 95 | // let ini = require('ini') 96 | // rawCodeConfig = ini.parse(fs.readFileSync(shareCodeLogPath, 'utf-8')) 97 | 98 | // 使用env模块 99 | require('dotenv').config({ path: shareCodeLogPath }) 100 | rawCodeConfig = process.env 101 | } 102 | 103 | // 解析每个用户的互助码 104 | let codes = {} 105 | Object.keys(rawCodeConfig).forEach(function (key) { 106 | if (key.startsWith(`My${nameConfig}`)) { 107 | codes[key] = rawCodeConfig[key] 108 | } 109 | }); 110 | 111 | // 解析每个用户要帮助的互助码组,将用户实际的互助码填充进去 112 | let helpOtherCodes = {} 113 | Object.keys(rawCodeConfig).forEach(function (key) { 114 | if (key.startsWith(`ForOther${nameConfig}`)) { 115 | let helpCode = rawCodeConfig[key] 116 | for (const [codeEnv, codeVal] of Object.entries(codes)) { 117 | helpCode = helpCode.replace("${" + codeEnv + "}", codeVal) 118 | } 119 | 120 | helpOtherCodes[key] = helpCode 121 | } 122 | }); 123 | 124 | // 按顺序用&拼凑到一起,并放入环境变量,供目标脚本使用 125 | let shareCodes = [] 126 | let leftIndex = 1, rightIndex = Object.keys(helpOtherCodes).length 127 | 128 | // 判断是否是ptask并行触发,若是,则修改实际需要设置的互助码范围 129 | let ptaskLeft = process.env.PTASK_LEFT 130 | let ptaskRight = process.env.PTASK_RIGHT 131 | if (ptaskLeft && ptaskRight) { 132 | leftIndex = Number(ptaskLeft) 133 | rightIndex = Number(ptaskRight) 134 | } 135 | 136 | for (let idx = leftIndex; idx <= rightIndex; idx++) { 137 | shareCodes.push(helpOtherCodes[`ForOther${nameConfig}${idx}`]) 138 | } 139 | let shareCodesStr = shareCodes.join('&') 140 | process.env[envName] = shareCodesStr 141 | 142 | let totalCodeCount = rightIndex - leftIndex + 1 143 | //console.info(`${nameChinese}的 互助码环境变量 ${envName},共计 ${totalCodeCount} 组互助码,总大小为 ${shareCodesStr.length} 字节`) 144 | } 145 | 146 | // 判断当前活动脚本是否在互助脚本列表中 147 | function IsShareJsFile() { 148 | // 尝试获取在task_before.sh中设置的 互助活动的脚本文件名的关键部分 列表 149 | let rawJsNameList = process.env.ShareCodeJSNameList 150 | if (!rawJsNameList) { 151 | return false 152 | } 153 | 154 | // 转换为list 155 | let jsNameList = process.env.ShareCodeJSNameList.split(" ") 156 | 157 | // 判断当前 158 | let currentActivityScriptFileName = GetCurrentActivityScriptFileName() 159 | 160 | let isShareJsFile = false 161 | for (let idx = 0; idx < jsNameList.length; idx++) { 162 | if (currentActivityScriptFileName.includes(jsNameList[idx])) { 163 | isShareJsFile = true 164 | break 165 | } 166 | } 167 | 168 | return isShareJsFile 169 | } 170 | 171 | // 获取当前活动脚本的文件名 172 | function GetCurrentActivityScriptFileName() { 173 | const path = require('path') 174 | return path.basename(process.argv[1]) 175 | } 176 | 177 | // 若在task_before.sh 中设置了要设置互助码环境变量的活动名称和环境变量名称信息,则在nodejs中处理,供活动使用 178 | let nameChinese = process.env.ShareCodeConfigChineseName 179 | let nameConfig = process.env.ShareCodeConfigName 180 | let envName = process.env.ShareCodeEnvName 181 | if (nameChinese && nameConfig && envName) { 182 | SetShareCodesEnv(nameChinese, nameConfig, envName) 183 | } 184 | function formatdate(date) { 185 | const year = date.getFullYear(); 186 | const month = ('0' + (date.getMonth() + 1)).slice(-2); 187 | const day = ('0' + date.getDate()).slice(-2); 188 | const hours = ('0' + date.getHours()).slice(-2); 189 | const minutes = ('0' + date.getMinutes()).slice(-2); 190 | const seconds = ('0' + date.getSeconds()).slice(-2); 191 | return `${year}/${month}/${day} ${hours}:${minutes}:${seconds}`; 192 | } 193 | -------------------------------------------------------------------------------- /jdEnv.py: -------------------------------------------------------------------------------- 1 | import os 2 | import random 3 | import re 4 | 5 | 6 | def env(key): 7 | return os.environ.get(key) 8 | 9 | 10 | # 宠汪汪 11 | JD_JOY_REWARD_NAME = 500 # 默认500 12 | if env("JD_JOY_REWARD_NAME"): 13 | JD_JOY_REWARD_NAME = int(env("JD_JOY_REWARD_NAME")) 14 | 15 | # Cookie 16 | cookies = [] 17 | if env("JD_COOKIE"): 18 | cookies.extend(env("JD_COOKIE").split('&')) 19 | 20 | # UA 21 | USER_AGENTS = [ 22 | "jdapp;android;10.0.2;10;network/wifi;Mozilla/5.0 (Linux; Android 10; ONEPLUS A5010 Build/QKQ1.191014.012; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045230 Mobile Safari/537.36", 23 | "jdapp;iPhone;10.0.2;14.3;network/4g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 24 | "jdapp;android;10.0.2;9;network/4g;Mozilla/5.0 (Linux; Android 9; Mi Note 3 Build/PKQ1.181007.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/045131 Mobile Safari/537.36", 25 | "jdapp;android;10.0.2;10;network/wifi;Mozilla/5.0 (Linux; Android 10; GM1910 Build/QKQ1.190716.003; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045230 Mobile Safari/537.36", 26 | "jdapp;android;10.0.2;9;network/wifi;Mozilla/5.0 (Linux; Android 9; 16T Build/PKQ1.190616.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/044942 Mobile Safari/537.36", 27 | "jdapp;iPhone;10.0.2;13.6;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 13_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 28 | "jdapp;iPhone;10.0.2;13.6;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 13_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 29 | "jdapp;iPhone;10.0.2;13.5;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 13_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 30 | "jdapp;iPhone;10.0.2;14.1;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 14_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 31 | "jdapp;iPhone;10.0.2;13.3;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 13_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 32 | "jdapp;iPhone;10.0.2;13.7;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 13_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 33 | "jdapp;iPhone;10.0.2;14.1;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 14_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 34 | "jdapp;iPhone;10.0.2;13.3;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 13_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 35 | "jdapp;iPhone;10.0.2;13.4;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 13_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 36 | "jdapp;iPhone;10.0.2;14.3;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 37 | "jdapp;android;10.0.2;9;network/wifi;Mozilla/5.0 (Linux; Android 9; MI 6 Build/PKQ1.190118.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/044942 Mobile Safari/537.36", 38 | "jdapp;android;10.0.2;11;network/wifi;Mozilla/5.0 (Linux; Android 11; Redmi K30 5G Build/RKQ1.200826.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045511 Mobile Safari/537.36", 39 | "jdapp;iPhone;10.0.2;11.4;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 11_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15F79", 40 | "jdapp;android;10.0.2;10;;network/wifi;Mozilla/5.0 (Linux; Android 10; M2006J10C Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045230 Mobile Safari/537.36", 41 | "jdapp;android;10.0.2;10;network/wifi;Mozilla/5.0 (Linux; Android 10; M2006J10C Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045230 Mobile Safari/537.36", 42 | "jdapp;android;10.0.2;10;network/wifi;Mozilla/5.0 (Linux; Android 10; ONEPLUS A6000 Build/QKQ1.190716.003; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045224 Mobile Safari/537.36", 43 | "jdapp;android;10.0.2;9;network/wifi;Mozilla/5.0 (Linux; Android 9; MHA-AL00 Build/HUAWEIMHA-AL00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/044942 Mobile Safari/537.36", 44 | "jdapp;android;10.0.2;8.1.0;network/wifi;Mozilla/5.0 (Linux; Android 8.1.0; 16 X Build/OPM1.171019.026; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/044942 Mobile Safari/537.36", 45 | "jdapp;android;10.0.2;8.0.0;network/wifi;Mozilla/5.0 (Linux; Android 8.0.0; HTC U-3w Build/OPR6.170623.013; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/044942 Mobile Safari/537.36", 46 | "jdapp;iPhone;10.0.2;14.0.1;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 14_0_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 47 | "jdapp;android;10.0.2;10;network/wifi;Mozilla/5.0 (Linux; Android 10; LYA-AL00 Build/HUAWEILYA-AL00L; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045230 Mobile Safari/537.36", 48 | "jdapp;iPhone;10.0.2;14.2;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 49 | "jdapp;iPhone;10.0.2;14.3;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 50 | "jdapp;iPhone;10.0.2;14.2;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 51 | "jdapp;android;10.0.2;8.1.0;network/wifi;Mozilla/5.0 (Linux; Android 8.1.0; MI 8 Build/OPM1.171019.026; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/045131 Mobile Safari/537.36", 52 | "jdapp;android;10.0.2;10;network/wifi;Mozilla/5.0 (Linux; Android 10; Redmi K20 Pro Premium Edition Build/QKQ1.190825.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045227 Mobile Safari/537.36", 53 | "jdapp;iPhone;10.0.2;14.3;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 54 | "jdapp;iPhone;10.0.2;14.3;network/4g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 55 | "jdapp;android;10.0.2;11;network/wifi;Mozilla/5.0 (Linux; Android 11; Redmi K20 Pro Premium Edition Build/RKQ1.200826.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045513 Mobile Safari/537.36", 56 | "jdapp;android;10.0.2;10;network/wifi;Mozilla/5.0 (Linux; Android 10; MI 8 Build/QKQ1.190828.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045227 Mobile Safari/537.36", 57 | "jdapp;iPhone;10.0.2;14.1;network/wifi;Mozilla/5.0 (iPhone; CPU iPhone OS 14_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 58 | ] 59 | USER_AGENTS = USER_AGENTS[random.randint(0, len(USER_AGENTS) - 1)] 60 | 61 | 62 | def root(): 63 | if 'Options:' in os.popen('sudo -h').read() or re.match(r'[C-Z]:.*', os.getcwd()): 64 | return True 65 | else: 66 | print('珍爱ck,远离docker') 67 | return False 68 | -------------------------------------------------------------------------------- /jd_beans_7days.py: -------------------------------------------------------------------------------- 1 | # !/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # Modify : 2024/4/21 4 | # 京豆近7天输出表格统计 5 | # 用不着每天跑,定时自行设置吧,配合desi可指定账号 6 | # https://raw.githubusercontent.com/6dylan6/jdpro/main/jd_beans_7days.py 7 | ''' 8 | new Env('豆子7天统计'); 9 | 8 8 29 2 * jd_beans_7days.py 10 | ''' 11 | 12 | import requests 13 | import datetime 14 | import random 15 | import os,re,sys,json,time 16 | from urllib.parse import unquote,quote 17 | from datetime import timedelta 18 | from datetime import timezone 19 | 20 | try: 21 | from prettytable import PrettyTable 22 | except: 23 | os.system('pip3 install prettytable &> /dev/null') 24 | from prettytable import PrettyTable 25 | 26 | SHA_TZ = timezone( 27 | timedelta(hours=8), 28 | name='Asia/Shanghai', 29 | ) 30 | requests.adapters.DEFAULT_RETRIES = 5 31 | session = requests.session() 32 | session.keep_alive = False 33 | 34 | url = "https://api.m.jd.com/api" 35 | def getua(): 36 | global uuid,addressid,iosVer,iosV,clientVersion,iPhone,area,ADID,lng,lat 37 | uuid=''.join(random.sample(['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9','a','b','c','z'], 40)) 38 | addressid = ''.join(random.sample('1234567898647', 10)) 39 | iosVer = ''.join(random.sample(["15.1.1","14.5.1", "14.4", "14.3", "14.2", "14.1", "14.0.1"], 1)) 40 | iosV = iosVer.replace('.', '_') 41 | clientVersion=''.join(random.sample(["10.3.0", "10.2.7", "10.2.4"], 1)) 42 | iPhone = ''.join(random.sample(["8", "9", "10", "11", "12", "13"], 1)) 43 | area=''.join(random.sample('0123456789', 2)) + '_' + ''.join(random.sample('0123456789', 4)) + '_' + ''.join(random.sample('0123456789', 5)) + '_' + ''.join(random.sample('0123456789', 4)) 44 | ADID = ''.join(random.sample('0987654321ABCDEF', 8)) + '-' + ''.join(random.sample('0987654321ABCDEF', 4)) + '-' + ''.join(random.sample('0987654321ABCDEF', 4)) + '-' + ''.join(random.sample('0987654321ABCDEF', 4)) + '-' + ''.join(random.sample('0987654321ABCDEF', 12)) 45 | lng='119.31991256596'+str(random.randint(100,999)) 46 | lat='26.1187118976'+str(random.randint(100,999)) 47 | UserAgent='' 48 | if not UserAgent: 49 | return f'jdapp;iPhone;10.0.4;{iosVer};{uuid};network/wifi;ADID/{ADID};model/iPhone{iPhone},1;addressid/{addressid};appBuild/167707;jdSupportDarkMode/0;Mozilla/5.0 (iPhone; CPU iPhone OS {iosV} like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/null;supportJDSHWK/1' 50 | else: 51 | return UserAgent 52 | def gen_body(page): 53 | body = { 54 | "beginDate": datetime.datetime.utcnow().replace(tzinfo=timezone.utc).astimezone(SHA_TZ).strftime("%Y-%m-%d %H:%M:%S"), 55 | "endDate": datetime.datetime.utcnow().replace(tzinfo=timezone.utc).astimezone(SHA_TZ).strftime("%Y-%m-%d %H:%M:%S"), 56 | "pageNo": page, 57 | "pageSize": 20, 58 | } 59 | return body 60 | 61 | def printf(text): 62 | print(text) 63 | sys.stdout.flush() 64 | 65 | def column_pad(*columns): 66 | max_len = max([len(x) for x in columns]) 67 | for y in columns: 68 | y.extend(['NaN']*(max_len-len(y))) 69 | 70 | class getJDCookie(object): 71 | 72 | # 获取cookie 73 | def getCookie(self): 74 | global cookies 75 | cookies = [] 76 | try: 77 | if "JD_COOKIE" in os.environ: 78 | if len(os.environ["JD_COOKIE"]) > 10: 79 | cookies = os.environ["JD_COOKIE"] 80 | printf("\n当前从环境变量获取CK\n") 81 | return 82 | except Exception as e: 83 | printf(f"【getCookie Error】{e}") 84 | 85 | # 检测cookie格式是否正确 86 | 87 | def getUserInfo(self, ck, pinName, userNum): 88 | url = 'https://me-api.jd.com/user_new/info/GetJDUserInfoUnion?orgFlag=JD_PinGou_New&callSource=mainorder&channel=4&isHomewhite=0&sceneval=2&sceneval=2&callback=' 89 | headers = { 90 | 'Cookie': ck, 91 | 'Accept': '*/*', 92 | 'Connection': 'close', 93 | 'Referer': 'https://home.m.jd.com/myJd/home.action', 94 | 'Accept-Encoding': 'gzip, deflate, br', 95 | 'Host': 'me-api.jd.com', 96 | 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.2 Mobile/15E148 Safari/604.1', 97 | 'Accept-Language': 'zh-cn' 98 | } 99 | try: 100 | if sys.platform == 'ios': 101 | resp = requests.get(url=url, verify=False, headers=headers, timeout=60).json() 102 | else: 103 | resp = requests.get(url=url, headers=headers, timeout=60).json() 104 | if resp['retcode'] == "0": 105 | nickname = resp['data']['userInfo']['baseInfo']['nickname'] 106 | if not nickname: 107 | nickname = resp['data']['userInfo']['baseInfo']['curPin'] 108 | return ck, nickname 109 | else: 110 | context = f"账号{userNum}【{pinName}】Cookie 已失效!请重新获取\n。" 111 | printf(context) 112 | return ck, False 113 | except Exception: 114 | context = f"账号{userNum}【{pinName}】Cookie 已失效!请重新获取\n。" 115 | printf(context) 116 | return ck, False 117 | 118 | def iscookie(self): 119 | """ 120 | :return: cookiesList,userNameList,pinNameList 121 | """ 122 | cookiesList = [] 123 | userNameList = [] 124 | pinNameList = [] 125 | if 'pt_key=' in cookies and 'pt_pin=' in cookies: 126 | r = re.compile(r"pt_key=.*?pt_pin=.*?;", re.M | re.S | re.I) 127 | result = r.findall(cookies) 128 | if len(result) >= 1: 129 | printf("您有{}个账号".format(len(result))) 130 | u = 1 131 | for i in result: 132 | r = re.compile(r"pt_pin=(.*?);") 133 | pinName = r.findall(i) 134 | pinName = unquote(pinName[0]) 135 | # 获取账号名 136 | ck, nickname = self.getUserInfo(i, pinName, u) 137 | if nickname: 138 | cookiesList.append(ck) 139 | userNameList.append(nickname) 140 | pinNameList.append(pinName) 141 | else: 142 | u += 1 143 | continue 144 | u += 1 145 | if len(cookiesList) > 0 and len(userNameList) > 0: 146 | return cookiesList, userNameList, pinNameList 147 | else: 148 | printf("没有可用CK,已退出\n") 149 | exit(3) 150 | else: 151 | printf("CK格式错误!...本次运行退出\n") 152 | exit(4) 153 | else: 154 | printf("CK格式错误或无CK!...请检查\n") 155 | exit(4) 156 | 157 | 158 | getCk = getJDCookie() 159 | getCk.getCookie() 160 | 161 | 162 | def gen_params(page): 163 | body = gen_body(page) 164 | params = { 165 | "functionId": "jposTradeQuery", 166 | "appid": "swat_miniprogram", 167 | "client": "tjj_m", 168 | "sdkName": "orderDetail", 169 | "sdkVersion": "1.0.0", 170 | "clientVersion": "3.1.3", 171 | "timestamp": int(round(time.time() * 1000)), 172 | "body": json.dumps(body) 173 | } 174 | return params 175 | 176 | def creat_bean_count(date, beansin, beansout, beanstotal): 177 | tb = PrettyTable() 178 | tb.add_column('DATE', date) 179 | tb.add_column('BEANSIN', beansin) 180 | tb.add_column('BEANSOUT', beansout) 181 | tb.add_column('TOTAL', beanstotal) 182 | printf(tb) 183 | 184 | 185 | def get_beans_7days(ck): 186 | try: 187 | day_7 = True 188 | page = 0 189 | headers = { 190 | "Host": "bean.m.jd.com", 191 | "User-Agent": getua(), 192 | "Content-Type": "application/x-www-form-urlencoded;", 193 | "Cookie": ck, 194 | } 195 | days = [] 196 | for i in range(0, 7): 197 | days.append((datetime.date.today() - datetime.timedelta(days=i)).strftime("%Y-%m-%d")) 198 | beans_in = {key: 0 for key in days} 199 | beans_out = {key: 0 for key in days} 200 | while day_7: 201 | page = page + 1 202 | url="https://bean.m.jd.com/beanDetail/detail.json?page="+str(page) 203 | data='body='+quote(str({"pageSize":"20","page":str(page)}))+'&appid=ld' 204 | resp = session.post(url, headers=headers, data=data ,timeout=1000).text 205 | 206 | res = json.loads(resp) 207 | if res['code'] == '0' : 208 | for i in res['jingDetailList']: 209 | for date in days: 210 | if str(date) in i['date'] and int(i['amount']) > 0: 211 | beans_in[str(date)] = beans_in[str(date)] + int(i['amount']) 212 | break 213 | elif str(date) in i['date'] and int(i['amount']) < 0: 214 | beans_out[str(date)] = beans_out[str(date)] + int(i['amount']) 215 | break 216 | if i['date'].split(' ')[0] not in str(days): 217 | day_7 = False 218 | else: 219 | print("未获取到数据,原因未知!!\n") 220 | return {'code': 400, 'data': res} 221 | #print(beans_in, beans_out, days) 222 | return {'code': 200, 'data': [beans_in, beans_out, days]} 223 | except Exception as e: 224 | print(str(e)) 225 | return {'code': 400, 'data': str(e)} 226 | 227 | 228 | def get_total_beans(ck): 229 | try: 230 | headers = { 231 | "Host": "me-api.jd.com", 232 | "User-Agent": getua(), 233 | "Content-Type": "application/x-www-form-urlencoded;", 234 | "Cookie": ck, 235 | #"Referer": 'https://wqs.jd.com/my/jingdou/my.shtml?sceneval=2' 236 | } 237 | jurl = "https://me-api.jd.com/user_new/info/GetJDUserInfoUnion" 238 | resp = requests.get(jurl, headers=headers).text 239 | res = json.loads(resp) 240 | #print(res) 241 | return res['data']['assetInfo']['beanNum'] 242 | except Exception as e: 243 | printf(str(e)) 244 | 245 | 246 | def get_bean_data(i,ck): 247 | try: 248 | if ck: 249 | #ck = cookies[i-1] 250 | beans_res = get_beans_7days(ck) 251 | beantotal = get_total_beans(ck) 252 | if beans_res['code'] != 200: 253 | return beans_res 254 | else: 255 | beans_in, beans_out = [], [] 256 | beanstotal = [int(beantotal), ] 257 | for i in beans_res['data'][0]: 258 | beantotal = int(beantotal) - int(beans_res['data'][0][i]) - int(beans_res['data'][1][i]) 259 | beans_in.append(int(beans_res['data'][0][i])) 260 | beans_out.append(int(str(beans_res['data'][1][i]).replace('-', ''))) 261 | beanstotal.append(beantotal) 262 | return {'code': 200, 'data': [beans_in[::-1], beans_out[::-1], beanstotal[::-1], beans_res['data'][2][::-1]]} 263 | except Exception as e: 264 | print(str(e)) 265 | 266 | def query(): 267 | try: 268 | global cookiesList, userNameList, pinNameList, ckNum, beanCount, userCount 269 | cookiesList, userNameList, pinNameList = getCk.iscookie() 270 | for i,ck,user,pin in zip(range(1,len(cookiesList)+1),cookiesList,userNameList,pinNameList): 271 | printf(f"\n****** [账号{i}]-{user} ******") 272 | res=get_bean_data(i,ck) 273 | if res['code'] != 200: 274 | printf(res['data']) 275 | continue 276 | if res['data'][2][1:] != []: 277 | creat_bean_count(res['data'][3], res['data'][0], res['data'][1], res['data'][2][1:]) 278 | time.sleep(2) 279 | except Exception as e: 280 | printf(str(e)) 281 | 282 | 283 | if __name__ == "__main__": 284 | query() 285 | -------------------------------------------------------------------------------- /jd_gitfix.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #依赖安装,运行一次就好 3 | #0 2 * * * jd_gitfix.sh 4 | #new Env('github拉库修复') 5 | # 6 | 7 | # 设置 http.postBuffer 8 | echo "设置 github缓存配置.....\n" 9 | git config --global http.postBuffer 524288000 10 | 11 | # 查看 http.postBuffer 配置 12 | echo "查看缓存配置 配置为:524288000 则成功\n" 13 | POST_BUFFER_VALUE=$(git config --global http.postBuffer) 14 | echo "http.postBuffer 的值是: $POST_BUFFER_VALUE" 15 | 16 | # 设置 http.sslVerify 17 | echo "设置 github拉库SSL检验配置....\n" 18 | git config --global http.sslVerify "false" 19 | 20 | # 查看 http.sslVerify 配置 21 | echo "查看 github拉库SSL检验配置 配置为false则成功\n" 22 | SSL_VERIFY_VALUE=$(git config --global http.sslVerify) 23 | echo "http.sslVerify 的值是: $SSL_VERIFY_VALUE" -------------------------------------------------------------------------------- /jd_indeps.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 依赖安装脚本 3 | # 0 8 5 5 * jd_indeps.sh 4 | # new Env('依赖安装'); 5 | # updatedate:20240903 6 | 7 | set -euo pipefail # 启用严格错误检查 8 | 9 | # 动态获取青龙根目录 10 | if [ -d "/ql/data" ]; then 11 | dir_root="/ql/data" 12 | else 13 | dir_root="/ql" 14 | fi 15 | 16 | dir_repo="$dir_root/repo" 17 | dir_deps="$dir_root/deps" 18 | dir_log="$dir_root/log" 19 | 20 | # 自动配置 sendNotify.js 21 | if [[ "${AUTOCFG:-}" == 'true' ]]; then 22 | if [[ -z "$(pwd | grep 'main')" ]]; then 23 | dir_code="$dir_log/shufflewzc_faker3_jd_sharecode" 24 | repo='shufflewzc_faker3' 25 | else 26 | dir_code="$dir_log/shufflewzc_faker3_main_jd_sharecode" 27 | repo='shufflewzc_faker3_main' 28 | fi 29 | 30 | [[ -d "$dir_root/data" ]] && dir_data="$dir_root/data" 31 | [[ -d "$dir_data/repo" ]] && dir_repo="$dir_data/repo" 32 | [[ -d "$dir_data/deps" ]] && dir_deps="$dir_data/deps" 33 | 34 | if [ -f "$dir_repo/${repo}/sendNotify.js" ]; then 35 | cp "$dir_repo/${repo}/sendNotify.js" "$dir_deps/" 36 | echo -e "\n已配置 sendNotify.js 到 deps 目录\n" 37 | else 38 | echo -e "\n错误:未找到 sendNotify.js 文件!\n" 39 | exit 1 40 | fi 41 | else 42 | echo -e "\n提示:如需自动配置 sendNotify.js,请设置变量 AUTOCFG='true'\n" 43 | fi 44 | 45 | # 检查权限 46 | if [ "$EUID" -ne 0 ]; then 47 | SUDO="sudo" 48 | else 49 | SUDO="" 50 | fi 51 | 52 | # 配置 pnpm 镜像 53 | pnpm config set registry https://registry.npmmirror.com 54 | 55 | # 处理 pnpm v7+ 环境变量 56 | npm_ver=$(pnpm -v | awk -F. '{print $1}') 57 | if [[ $npm_ver -ge 7 ]]; then 58 | export PNPM_HOME="/root/.local/share/pnpm" 59 | export PATH="$PNPM_HOME:$PATH" 60 | fi 61 | 62 | echo -e "\n开始检查依赖列表并安装依赖...\n" 63 | 64 | # 目标依赖列表 65 | declare -A target_deps=( 66 | ["tough-cookie"]="4.1.4" 67 | ["ds"]="2.0.2" 68 | ["png-js"]="1.0.0" 69 | ["date-fns"]="3.6.0" 70 | ["axios"]="1.7.4" 71 | ["crypto-js"]="4.2.0" 72 | ["request"]="2.88.2" 73 | ["jsdom"]="24.1.1" 74 | ["moment"]="2.30.1" 75 | ["cheerio"]="1.0.0" 76 | ["tunnel"]="latest" 77 | ["https-proxy-agent"]="7.0.5" 78 | ["sharp"]="0.32.0" 79 | ["qs"]="6.11.0" 80 | ) 81 | 82 | # 获取已安装的全局依赖 83 | installed_deps=$(pnpm list -g --depth=0 --parseable 2>/dev/null | awk -F@ '{print $1, $2}') 84 | 85 | # 安装或更新依赖 86 | for dep in "${!target_deps[@]}"; do 87 | target_version="${target_deps[$dep]}" 88 | installed_version=$(echo "$installed_deps" | awk -v dep="$dep" '$1 == dep {print $2}') 89 | 90 | if [[ -z "$installed_version" ]]; then 91 | echo "正在安装 $dep@$target_version ..." 92 | pnpm i -g "$dep@$target_version" || { echo "安装 $dep@$target_version 失败!"; exit 1; } 93 | elif [[ "$installed_version" != "$target_version" ]]; then 94 | echo "正在更新 $dep ($installed_version -> $target_version) ..." 95 | pnpm i -g "$dep@$target_version" || { echo "更新 $dep@$target_version 失败!"; exit 1; } 96 | else 97 | echo "$dep@$installed_version 已是最新版本,跳过安装。" 98 | fi 99 | done 100 | 101 | # 安装 Python 依赖 102 | pip3 install -i https://pypi.doubanio.com/simple/ --upgrade jieba requests 103 | 104 | # 清理 canvas 冲突文件 105 | canvas_paths=( 106 | "/usr/local/pnpm-global/5/node_modules/.pnpm/canvas*" 107 | "/root/.local/share/pnpm/global/5/.pnpm/canvas*" 108 | ) 109 | 110 | for path in "${canvas_paths[@]}"; do 111 | if [ -d "$path" ]; then 112 | rm -rf "$path" 113 | fi 114 | done 115 | 116 | echo -e "\n依赖检查与安装完成!请检查是否有报错。\n" -------------------------------------------------------------------------------- /jd_kuaid.js: -------------------------------------------------------------------------------- 1 | /* 2 | 京东快递 3 | @Leaf 4 | 5 | 12 17 * * * jd_kuaid.js 6 | 7 | */ 8 | const $ = new Env('京东快递'); 9 | const got = require('got'); 10 | 11 | const envSplitor = ['&','\n','@'] 12 | const ckNames = ['JD_COOKIE'] 13 | 14 | const MAX_THREAD = parseInt(process.env['jd_jdkd_thread']) || 5 15 | const DEFAULT_TIMEOUT=8000, DEFAULT_RETRY=3; 16 | 17 | const default_UA = 'Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.31(0x18001f2f) NetType/WIFI Language/zh_CN miniProgram/wx73247c7819d61796' 18 | const Referer = 'https://jingcai-h5.jd.com/' 19 | const Origin = 'https://jingcai-h5.jd.com' 20 | 21 | const client = got.extend({ 22 | headers:{ 23 | Connection:'keep-alive', 24 | 'User-Agent': default_UA, 25 | Referer, 26 | Origin, 27 | AppParams: JSON.stringify({"appid":158,"ticket_type":"m"}), 28 | ClientInfo: JSON.stringify({"appName":"jingcai","client":"m"}), 29 | 'LOP-DN': 'jingcai.jd.com', 30 | 'X-Requested-With': 'XMLHttpRequest', 31 | }, 32 | retry: {limit:0}, 33 | timeout: DEFAULT_TIMEOUT, 34 | followRedirect: false, 35 | }) 36 | 37 | class BasicClass{constructor(){this.index=$.userIdx++;this.name='';} log(msg,opt={}){var m='',n=$.userCount.toString().length;;if(this.index)m+=`账号[${$.padStr(this.index,n)}]`;if(this.name)m+=`[${this.name}]`;$.log(m+msg,opt);} async request(opt){var resp=null,count=0;var fn=opt.fn||opt.url;opt.method=opt?.method?.toUpperCase()||'GET';while(count++{resp=t},e=>{resp=e.response});if(((resp?.statusCode/100)|0)<=4)break;}catch(e){if(e.name=='TimeoutError'){this.log(`[${fn}]请求超时,重试第${count}次`);}else{this.log(`[${fn}]请求错误(${e.message}),重试第${count}次`);}};} if(resp==null)return Promise.resolve({statusCode:-1,headers:null,result:null});let{statusCode,headers,body}=resp;if(body)try{body=JSON.parse(body);}catch{};return Promise.resolve({statusCode,headers,result:body})}} 38 | let http = new BasicClass(); 39 | 40 | class UserClass extends BasicClass { 41 | constructor(ck) { 42 | super() 43 | this.cookie = ck 44 | this.pt_pin = ck.match(/pin=([\w\-\%]+)/) ? ck.match(/pin=([\w\-\%]+)/)[1] : '' 45 | this.name = decodeURIComponent(this.pt_pin) 46 | } 47 | 48 | async queryTaskList() { 49 | try { 50 | let options = { 51 | fn: 'queryTaskList', 52 | method: 'post', 53 | url: 'https://lop-proxy.jd.com/ESGApi/queryTaskList', 54 | headers: {Cookie:this.cookie,'event-id':$.randomPattern('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx')}, 55 | json: [{"pin":"$cooMrdGatewayUid$"}], 56 | } 57 | let {result} = await this.request(options) 58 | let code = result?.code 59 | if(code == 1) { 60 | //console.log(JSON.stringify(result?.content?.taskInfoList)) 61 | for(let task of (result?.content?.taskInfoList||[]).filter(x => x.taskReachNum < x.taskNeedReachNum && x.triggerType==1 && !x.taskTitle.includes('加购'))) { 62 | await this.reachTaskInfo(task); 63 | await $.wait(1000); 64 | break; 65 | } 66 | } else { 67 | let errCode = code || result?.error_response?.code 68 | let errMsg = result?.msg || result?.error_response?.zh_desc 69 | this.log(`查询任务列表出错[${errCode}]: ${errMsg}`) 70 | } 71 | } catch (e) { 72 | $.log(e) 73 | } finally { 74 | return Promise.resolve() 75 | } 76 | } 77 | 78 | async reachTaskInfo(task) { 79 | try { 80 | let options = { 81 | fn: 'reachTaskInfo', 82 | method: 'post', 83 | url: 'https://lop-proxy.jd.com/ESGApi/reachTaskInfo', 84 | headers: {Cookie:this.cookie,'event-id':$.randomPattern('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx')}, 85 | json: [{ 86 | taskNo: task.taskNo, 87 | childTaskId: task.childTaskId, 88 | pin: "$cooMrdGatewayUid$", 89 | }], 90 | } 91 | let {result} = await this.request(options) 92 | let code = result?.code 93 | if(code == 1) { 94 | this.log(`完成任务[${task.taskTitle}]成功`); 95 | await $.wait(1000); 96 | await this.queryTaskList(); 97 | } else { 98 | let errCode = code || result?.error_response?.code 99 | let errMsg = result?.msg || result?.error_response?.zh_desc 100 | this.log(`完成任务[${task.taskTitle}]失败[${errCode}]: ${errMsg}`) 101 | } 102 | } catch (e) { 103 | $.log(e) 104 | } finally { 105 | return Promise.resolve() 106 | } 107 | } 108 | 109 | async queryCanGetRewardTaskList() { 110 | try { 111 | let options = { 112 | fn: 'queryCanGetRewardTaskList', 113 | method: 'post', 114 | url: 'https://lop-proxy.jd.com/ESGApi/queryCanGetRewardTaskList', 115 | headers: {Cookie:this.cookie,'event-id':$.randomPattern('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx')}, 116 | json: [{"pin":"$cooMrdGatewayUid$"}], 117 | } 118 | let {result} = await this.request(options) 119 | let code = result?.code 120 | if(code == 1) { 121 | for(let item of (result?.content?.personalCarbonRewardRespDtoList||[])) { 122 | await this.operationPersonalCarbonIntegral(item) 123 | } 124 | } else { 125 | let errCode = code || result?.error_response?.code 126 | let errMsg = result?.msg || result?.error_response?.zh_desc 127 | this.log(`查询可领取奖励出错[${errCode}]: ${errMsg}`) 128 | } 129 | } catch (e) { 130 | $.log(e) 131 | } finally { 132 | return Promise.resolve() 133 | } 134 | } 135 | 136 | async operationPersonalCarbonIntegral(item) { 137 | try { 138 | let options = { 139 | fn: 'operationPersonalCarbonIntegral', 140 | method: 'post', 141 | url: 'https://lop-proxy.jd.com/ESGApi/operationPersonalCarbonIntegral', 142 | headers: {Cookie:this.cookie,'event-id':$.randomPattern('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx')}, 143 | json: [{ 144 | type: 2, 145 | operationType: 1, 146 | rewardNo: item.rewardNo, 147 | taskNo: item.taskNo, 148 | pin: "$cooMrdGatewayUid$", 149 | }], 150 | } 151 | let {result} = await this.request(options) 152 | let code = result?.code 153 | if(code == 1) { 154 | this.log(`收取[${item.taskTitle}]奖励成功, 现在有${result?.content?.carbonIntegral}g能量`) 155 | } else { 156 | let errCode = code || result?.error_response?.code 157 | let errMsg = result?.msg || result?.error_response?.zh_desc 158 | this.log(`收取[${item.taskTitle}]奖励失败[${errCode}]: ${errMsg}`) 159 | } 160 | } catch (e) { 161 | $.log(e) 162 | } finally { 163 | return Promise.resolve() 164 | } 165 | } 166 | 167 | async userTask() { 168 | await this.queryTaskList(); 169 | await this.queryCanGetRewardTaskList(); 170 | } 171 | } 172 | 173 | !(async () => { 174 | $.read_env(UserClass); 175 | 176 | await $.threadTask('userTask',MAX_THREAD) 177 | })() 178 | .catch((e) => $.log(e)) 179 | .finally(() => $.exitNow()) 180 | 181 | function Env(name){return new class{constructor(name){this.name=name;this.startTime=Date.now();this.log(`[${this.name}]开始运行\n`,{time:true});this.notifyStr=[];this.notifyFlag=true;this.userIdx=0;this.userList=[];this.userCount=0;} log(msg,options={}){let opt={console:true};Object.assign(opt,options);if(opt.time){let fmt=opt.fmt||'hh:mm:ss';msg=`[${this.time(fmt)}]`+msg;} if(opt.notify)this.notifyStr.push(msg);if(opt.console)console.log(msg);} read_env(Class){let envStrList=ckNames.map(x=>process.env[x]);for(let env_str of envStrList.filter(x=>!!x)){let sp=envSplitor.filter(x=>env_str.includes(x));let splitor=sp.length>0?sp[0]:envSplitor[0];for(let ck of env_str.split(splitor).filter(x=>!!x)){this.userList.push(new Class(ck));}} this.userCount=this.userList.length;if(!this.userCount){this.log(`未找到变量,请检查变量${ckNames.map(x => '['+x+']').join('或')}`,{notify:true});return false;} this.log(`共找到${this.userCount}个账号`);return true;} async threads(taskName,conf,opt={}){while(conf.idx<$.userList.length){let user=$.userList[conf.idx++];await user[taskName](opt);}} async threadTask(taskName,thread){let taskAll=[];let taskConf={idx:0};while(thread--)taskAll.push(this.threads(taskName,taskConf));await Promise.all(taskAll);} time(t,x=null){let xt=x?new Date(x):new Date;let e={"M+":xt.getMonth()+1,"d+":xt.getDate(),"h+":xt.getHours(),"m+":xt.getMinutes(),"s+":xt.getSeconds(),"q+":Math.floor((xt.getMonth()+3)/3),S:this.padStr(xt.getMilliseconds(),3)};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(xt.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;} async showmsg(){if(!this.notifyFlag)return;if(!this.notifyStr.length)return;var notify=require('./sendNotify');this.log('\n============== 推送 ==============');await notify.sendNotify(this.name,this.notifyStr.join('\n'));} padStr(num,length,opt={}){let padding=opt.padding||'0';let mode=opt.mode||'l';let numStr=String(num);let numPad=(length>numStr.length)?(length-numStr.length):0;let pads='';for(let i=0;isetTimeout(e,t));} async exitNow(){await this.showmsg();let e=Date.now();let s=(e-this.startTime)/1000;this.log('');this.log(`[${this.name}]运行结束,共运行了${s}秒`,{time:true});process.exit(0);}} (name)} -------------------------------------------------------------------------------- /jd_plus2bean.js: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | 9 8 * * * jd_plus2bean.js 4 | */ 5 | 6 | const $ = new Env('plus专属礼'); 7 | const notify = $.isNode() ? require('./sendNotify') : ''; 8 | const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; 9 | let jdNotify = true; 10 | //IOS等用户直接用NobyDa的jd cookie 11 | let cookiesArr = [], cookie = '', message = ''; 12 | if ($.isNode()) { 13 | Object.keys(jdCookieNode).forEach((item) => { 14 | cookiesArr.push(jdCookieNode[item]) 15 | }) 16 | if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => { }; 17 | } else { 18 | cookiesArr = [$.getdata('CookieJD'), $.getdata('CookieJD2'), ...jsonParse($.getdata('CookiesJD') || "[]").map(item => item.cookie)].filter(item => !!item); 19 | } 20 | !(async () => { 21 | if (!cookiesArr[0]) { 22 | $.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', { "open-url": "https://bean.m.jd.com/bean/signIndex.action" }); 23 | return; 24 | } 25 | for (let i = 0; i < cookiesArr.length; i++) { 26 | if (cookiesArr[i]) { 27 | cookie = cookiesArr[i]; 28 | $.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1]) 29 | $.index = i + 1; 30 | $.isLogin = true; 31 | $.nickName = ''; 32 | //await TotalBean(); 33 | console.log(`\n******开始【京东账号${$.index}】${$.nickName || $.UserName}*********\n`); 34 | if (!$.isLogin) { 35 | $.msg($.name, `【提示】cookie已失效`, `京东账号${$.index} ${$.nickName || $.UserName}\n请重新登录获取\nhttps://bean.m.jd.com/bean/signIndex.action`, { "open-url": "https://bean.m.jd.com/bean/signIndex.action" }); 36 | if ($.isNode()) { 37 | await notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`); 38 | } 39 | continue 40 | } 41 | await jingBeanReceive(); 42 | await $.wait(2000) 43 | } 44 | } 45 | })() 46 | .catch((e) => { 47 | $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '') 48 | }) 49 | .finally(() => { 50 | $.done(); 51 | }) 52 | 53 | 54 | 55 | function jingBeanReceive() { 56 | let opt = { 57 | url: `https://api.m.jd.com/client.action?functionId=jingBeanReceive&body={"encryptAssignmentId":"6bzcu8ZNPHFhuWZC55MhLgJCPiW","firstType":-100,"plugin_version":90556}&clientVersion=11.0.2&client=android&ef=1&ep=%7B%22ts%22%3A1658155958775%2C%22ridx%22%3A-1%2C%22cipher%22%3A%7B%22uuid%22%3A%22EJc4ENY0CJLrYzLwDQZsZq%3D%3D%22%2C%22aid%22%3A%22EJc4ENY0CJLrYzLwDQZsZq%3D%3D%22%7D%2C%22ciphertype%22%3A5%2C%22version%22%3A%221.2.0%22%7D&st=1658155977625&sign=354bbcb59bdc53276a62fb21c9d1f3df&sv=110`, 58 | headers: { 59 | 'Host': 'api.m.jd.com', 60 | 'accept-encoding': 'gzip,deflate', 61 | 'content-type': 'application/x-www-form-urlencoded; charset=UTF-8', 62 | 'User-Agent': 'okhttp/3.12.1;jdmall;android;version/11.0.2;build/97565;', 63 | 'Cookie': cookie 64 | } 65 | } 66 | return new Promise(async (resolve) => { 67 | $.post(opt, async (err, resp, data) => { 68 | try { 69 | if (err) { 70 | console.log(`${JSON.stringify(err)}`) 71 | console.log(`jingBeanReceive请求失败,请检查网路重试`) 72 | } else { 73 | data = JSON.parse(data) 74 | if (data.isSuccess) { 75 | console.log(data.data.windowsContent) 76 | } else { 77 | console.log('已领取过!') 78 | } 79 | } 80 | } catch (e) { 81 | $.logErr(e, resp) 82 | } finally { 83 | resolve(data) 84 | } 85 | }) 86 | }) 87 | } 88 | 89 | 90 | function TotalBean() { 91 | return new Promise(async resolve => { 92 | const options = { 93 | url: "https://wq.jd.com/user_new/info/GetJDUserInfoUnion?sceneval=2", 94 | headers: { 95 | Host: "wq.jd.com", 96 | Accept: "*/*", 97 | Connection: "keep-alive", 98 | Cookie: cookie, 99 | "User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.4.4;14.3;network/4g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1"), 100 | "Accept-Language": "zh-cn", 101 | "Referer": "https://home.m.jd.com/myJd/newhome.action?sceneval=2&ufc=&", 102 | "Accept-Encoding": "gzip, deflate, br" 103 | } 104 | } 105 | $.get(options, (err, resp, data) => { 106 | try { 107 | if (err) { 108 | $.logErr(err) 109 | } else { 110 | if (data) { 111 | data = JSON.parse(data); 112 | if (data['retcode'] === 1001) { 113 | $.isLogin = false; 114 | return; 115 | } 116 | if (data['retcode'] === 0 && data.data && data.data.hasOwnProperty("userInfo")) { 117 | $.nickName = data.data.userInfo.baseInfo.nickname; 118 | } 119 | } else { 120 | console.log('京东服务器返回空数据'); 121 | } 122 | } 123 | } catch (e) { 124 | $.logErr(e) 125 | } finally { 126 | resolve(); 127 | } 128 | }) 129 | }) 130 | } 131 | function showMsg() { 132 | return new Promise(resolve => { 133 | if (!jdNotify) { 134 | $.msg($.name, '', `${message}`); 135 | } else { 136 | $.log(`京东账号${$.index}${$.nickName}\n${message}`); 137 | } 138 | resolve() 139 | }) 140 | } 141 | function safeGet(data) { 142 | try { 143 | if (typeof JSON.parse(data) == "object") { 144 | return true; 145 | } 146 | } catch (e) { 147 | console.log(e); 148 | console.log(`京东服务器访问数据为空,请检查自身设备网络情况`); 149 | return false; 150 | } 151 | } 152 | function jsonParse(str) { 153 | if (typeof str == "string") { 154 | try { 155 | return JSON.parse(str); 156 | } catch (e) { 157 | console.log(e); 158 | $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') 159 | return []; 160 | } 161 | } 162 | } 163 | // prettier-ignore 164 | function Env(t, e) { "undefined" != typeof process && JSON.stringify(process.env).indexOf("GITHUB") > -1 && process.exit(0); 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("", `🔔${this.name}, 开始!`) } 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("@"), n = { url: `http://${h}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": o, Accept: "*/*" } }; this.post(n, (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, e = null) { const s = e ? new Date(e) : new Date; let i = { "M+": s.getMonth() + 1, "d+": s.getDate(), "H+": s.getHours(), "m+": s.getMinutes(), "s+": s.getSeconds(), "q+": Math.floor((s.getMonth() + 3) / 3), S: s.getMilliseconds() }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, (s.getFullYear() + "").substr(4 - RegExp.$1.length))); for (let e in i) new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? i[e] : ("00" + i[e]).substr(("" + i[e]).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 = ["", "==============📣系统通知📣=============="]; 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("", `❗️${this.name}, 错误!`, t.stack) : this.log("", `❗️${this.name}, 错误!`, t) } wait(t) { return new Promise(e => setTimeout(e, t)) } done(t = {}) { const e = (new Date).getTime(), s = (e - this.startTime) / 1e3; this.log("", `🔔${this.name}, 结束! 🕛 ${s} 秒`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) } }(t, e) } -------------------------------------------------------------------------------- /jd_pluscore.js: -------------------------------------------------------------------------------- 1 | /** 2 | 11 11 11 11 * jd_pluscore.js 3 | */ 4 | const $ = new Env('plus分查询'); 5 | const notify = $.isNode() ? require('./sendNotify') : ''; 6 | const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; 7 | 8 | 9 | let cookiesArr = [], cookie = '', message; 10 | if ($.isNode()) { 11 | Object.keys(jdCookieNode).forEach((item) => { 12 | cookiesArr.push(jdCookieNode[item]) 13 | }) 14 | if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {}; 15 | } else { 16 | cookiesArr = [$.getdata('CookieJD'), $.getdata('CookieJD2'), ...jsonParse($.getdata('CookiesJD') || "[]").map(item => item.cookie)].filter(item => !!item); 17 | } 18 | 19 | !(async () => { 20 | if (!cookiesArr[0]) { 21 | $.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', {"open-url": "https://bean.m.jd.com/bean/signIndex.action"}); 22 | return; 23 | } 24 | for (let i = 0; i < cookiesArr.length; i++) { 25 | getUA(); 26 | cookie = cookiesArr[i]; 27 | $.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1]); 28 | $.index = i + 1; 29 | $.nickName = ''; 30 | $.isLogin = true; 31 | 32 | console.log(`******开始【京东账号${$.index}】${$.nickName || $.UserName}*********`); 33 | 34 | await isWhite(); 35 | await $.wait(parseInt(Math.random() * 1500 + 500, 10)); 36 | } 37 | 38 | })() 39 | .catch((e) => { 40 | $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '') 41 | }) 42 | .finally(() => { 43 | $.done(); 44 | }) 45 | 46 | 47 | function safeGet(data) { 48 | try { 49 | if (typeof JSON.parse(data) == "object") { 50 | return true; 51 | } 52 | } catch (e) { 53 | return false; 54 | } 55 | } 56 | 57 | function isWhite() { 58 | return new Promise(resolve => { 59 | let get = { 60 | url: `https://rsp.jd.com/windControl/queryScore/v1?lt=m&an=plus.mobile&stamp=${Date.now()}`, 61 | headers: { 62 | "User-Agent": $.UA, 63 | "X-Requested-With": "com.jingdong.app.mall", 64 | 'Referer': 'https://plus.m.jd.com/rights/windControl', 65 | "Cookie": cookie, 66 | }, 67 | timeout: 30000 68 | } 69 | $.get(get, async (err, resp, data) => { 70 | try { 71 | if (err) { 72 | console.log(`${$.toStr(err)}`) 73 | console.log(`API请求失败,请检查网路重试`) 74 | } else { 75 | if (typeof data == 'string') { 76 | data = JSON.parse(data); 77 | if (data.code == 1000) { 78 | $.totalScore = data.rs.userSynthesizeScore.totalScore; 79 | console.log(`PLUS分: ${$.totalScore}\n`); 80 | } else { 81 | console.log(JSON.stringify(data)); 82 | } 83 | } 84 | } 85 | } catch (e) { 86 | $.logErr(e, resp) 87 | } finally { 88 | resolve(); 89 | } 90 | }) 91 | }) 92 | 93 | } 94 | 95 | function jsonParse(str) { 96 | if (typeof str == "string") { 97 | try { 98 | return JSON.parse(str); 99 | } catch (e) { 100 | console.log(e); 101 | $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') 102 | return []; 103 | } 104 | } 105 | } 106 | 107 | async function getUA() { 108 | $.UA = `jdapp;iPhone;10.4.6;13.1.2;${randomString(40)};network/wifi;model/iPhone8,1;addressid/2308460611;appBuild/167814;jdSupportDarkMode/0;Mozilla/5.0 (iPhone; CPU iPhone OS 13_1_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1` 109 | return $.UA; 110 | } 111 | 112 | function randomString(e) { 113 | e = e || 32; 114 | let t = "abcdef0123456789", a = t.length, n = ""; 115 | for (i = 0; i < e; i++) 116 | n += t.charAt(Math.floor(Math.random() * a)); 117 | return n 118 | } 119 | 120 | function random(min, max) { 121 | return Math.floor(Math.random() * (max - min)) + min; 122 | } 123 | 124 | 125 | function Env(t,e){"undefined"!=typeof process&&JSON.stringify(process.env).indexOf("GITHUB")>-1&&process.exit(0);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("",`🔔${this.name}, 开始!`)}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("@"),n={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(n,(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,e=null){const s=e?new Date(e):new Date;let i={"M+":s.getMonth()+1,"d+":s.getDate(),"H+":s.getHours(),"m+":s.getMinutes(),"s+":s.getSeconds(),"q+":Math.floor((s.getMonth()+3)/3),S:s.getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(s.getFullYear()+"").substr(4-RegExp.$1.length)));for(let e in i)new RegExp("("+e+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?i[e]:("00"+i[e]).substr((""+i[e]).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=["","==============📣系统通知📣=============="];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("",`❗️${this.name}, 错误!`,t.stack):this.log("",`❗️${this.name}, 错误!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`🔔${this.name}, 结束! 🕛 ${s} 秒`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)} -------------------------------------------------------------------------------- /jd_pullfix.py: -------------------------------------------------------------------------------- 1 | 2 | """ 3 | 15 2 * * * jd_pullfix.py 4 | new Env('拉库修复'); 5 | """ 6 | #!/usr/bin/env python3 7 | # coding: utf-8 8 | 9 | import os 10 | 11 | def pullfix(): 12 | print('\n对拉库失败、拉库成功但更新不出任务等问题修复\n') 13 | print('\n开始执行。。。\n') 14 | dir_path = os.path.dirname(os.path.abspath(__file__)) 15 | if 'main' not in dir_path: 16 | if os.path.isdir('/ql/repo/shufflewzc_faker3'): 17 | os.system('rm -rf /ql/repo/shufflewzc_faker3') 18 | elif os.path.isdir('/ql/data/repo/shufflewzc_faker3'): 19 | os.system('rm -rf /ql/data/repo/shufflewzc_faker3') 20 | else: 21 | print('无需修复,拉不动可能是代理问题') 22 | # os.system('find /ql -maxdepth 2 -type d') 23 | return False 24 | else: 25 | if os.path.isdir('/ql/repo/shufflewzc_faker3_main'): 26 | os.system('rm -rf /ql/repo/shufflewzc_faker3_main') 27 | elif os.path.isdir('/ql/data/repo/shufflewzc_faker3_main'): 28 | os.system('rm -rf /ql/data/repo/shufflewzc_faker3_main') 29 | else: 30 | print('无需修复,拉不动可能是代理问题\n') 31 | # os.system('find /ql -maxdepth 2 -type d') 32 | return False 33 | return True 34 | 35 | if pullfix(): 36 | print('修复完成,请重试拉库,如果还是拉库失败请在群内反馈!') -------------------------------------------------------------------------------- /jd_taskop.py: -------------------------------------------------------------------------------- 1 | # -*- coding:utf-8 -*- 2 | """ 3 | cron: 15 2 * * * 4 | new Env('重复任务优化'); 5 | """ 6 | 7 | import json 8 | import logging 9 | import os 10 | import sys,re 11 | import time 12 | import traceback 13 | 14 | import requests 15 | 16 | logger = logging.getLogger(name=None) # 创建一个日志对象 17 | logging.Formatter("%(message)s") # 日志内容格式化 18 | logger.setLevel(logging.INFO) # 设置日志等级 19 | logger.addHandler(logging.StreamHandler()) # 添加控制台日志 20 | # logger.addHandler(logging.FileHandler(filename="text.log", mode="w")) # 添加文件日志 21 | 22 | 23 | ipport = os.getenv("IPPORT") 24 | if not ipport: 25 | logger.info( 26 | "如果报错请在环境变量中添加你的真实 IP:端口\n名称:IPPORT\t值:127.0.0.1:5700\n或在 config.sh 中添加 export IPPORT='127.0.0.1:5700'" 27 | ) 28 | ipport = "localhost:5700" 29 | else: 30 | ipport = ipport.lstrip("http://").rstrip("/") 31 | sub_str = os.getenv("RES_SUB", "shufflewzc_faker3") 32 | sub_list = sub_str.split("&") 33 | res_only = os.getenv("RES_ONLY", True) 34 | headers = { 35 | "Accept": "application/json", 36 | "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36", 37 | } 38 | 39 | 40 | def load_send() -> None: 41 | logger.info("加载推送功能中...") 42 | global send 43 | send = None 44 | cur_path = os.path.abspath(os.path.dirname(__file__)) 45 | sys.path.append(cur_path) 46 | if os.path.exists(cur_path + "/notify.py"): 47 | try: 48 | from notify import send 49 | except Exception: 50 | send = None 51 | logger.info(f"❌加载通知服务失败!!!\n{traceback.format_exc()}") 52 | 53 | 54 | def get_tasklist() -> list: 55 | tasklist = [] 56 | t = round(time.time() * 1000) 57 | url = f"http://{ipport}/api/crons?searchValue=&t={t}" 58 | response = requests.get(url=url, headers=headers) 59 | datas = json.loads(response.content.decode("utf-8")) 60 | if datas.get("code") == 200: 61 | try: 62 | tasklist = datas.get("data").get("data") 63 | except Exception: 64 | tasklist = datas.get("data") 65 | return tasklist 66 | 67 | 68 | def filter_res_sub(tasklist: list) -> tuple: 69 | filter_list = [] 70 | res_list = [] 71 | for task in tasklist: 72 | for sub in sub_list: 73 | if task.get("command").find(sub) == -1: 74 | flag = False 75 | else: 76 | flag = True 77 | break 78 | if flag: 79 | res_list.append(task) 80 | else: 81 | filter_list.append(task) 82 | return filter_list, res_list 83 | 84 | 85 | def get_index(lst: list, item: str) -> list: 86 | return [index for (index, value) in enumerate(lst) if value == item] 87 | 88 | 89 | def get_duplicate_list(tasklist: list) -> tuple: 90 | logger.info("\n=== 第一轮初筛开始 ===") 91 | 92 | ids = [] 93 | names = [] 94 | cmds = [] 95 | for task in tasklist: 96 | ids.append(task.get("_id",task.get("id"))) 97 | names.append(task.get("name")) 98 | cmds.append(task.get("command")) 99 | 100 | name_list = [] 101 | for i, name in enumerate(names): 102 | if name not in name_list: 103 | name_list.append(name) 104 | 105 | tem_tasks = [] 106 | tem_ids = [] 107 | dup_ids = [] 108 | for name2 in name_list: 109 | name_index = get_index(names, name2) 110 | for i in range(len(name_index)): 111 | if i == 0: 112 | logger.info(f"【✅保留】{cmds[name_index[0]]}") 113 | tem_tasks.append(tasklist[name_index[0]]) 114 | tem_ids.append(ids[name_index[0]]) 115 | else: 116 | logger.info(f"【🚫禁用】{cmds[name_index[i]]}") 117 | dup_ids.append(ids[name_index[i]]) 118 | logger.info("") 119 | 120 | logger.info("=== 第一轮初筛结束 ===") 121 | 122 | return tem_ids, tem_tasks, dup_ids 123 | 124 | 125 | def reserve_task_only( 126 | tem_ids: list, tem_tasks: list, dup_ids: list, res_list: list 127 | ) -> list: 128 | if len(tem_ids) == 0: 129 | return tem_ids 130 | 131 | logger.info("\n=== 最终筛选开始 ===") 132 | task3 = None 133 | for task1 in tem_tasks: 134 | for task2 in res_list: 135 | if task1.get("name") == task2.get("name"): 136 | dup_ids.append(task1.get("_id",task1.get("id"))) 137 | logger.info(f"【✅保留】{task2.get('command')}") 138 | task3 = task1 139 | if task3: 140 | logger.info(f"【🚫禁用】{task3.get('command')}\n") 141 | task3 = None 142 | logger.info("=== 最终筛选结束 ===") 143 | return dup_ids 144 | 145 | 146 | def disable_duplicate_tasks(ids: list) -> None: 147 | t = round(time.time() * 1000) 148 | url = f"http://{ipport}/api/crons/disable?t={t}" 149 | data = json.dumps(ids) 150 | headers["Content-Type"] = "application/json;charset=UTF-8" 151 | response = requests.put(url=url, headers=headers, data=data) 152 | datas = json.loads(response.content.decode("utf-8")) 153 | if datas.get("code") != 200: 154 | logger.info(f"❌出错!!!错误信息为:{datas}") 155 | else: 156 | logger.info("🎉成功禁用重复任务~") 157 | 158 | 159 | def get_token() -> str or None: 160 | if os.path.exists("/ql/data/db/keyv.sqlite"): 161 | path="/ql/data/db/keyv.sqlite" 162 | elif os.path.exists("/ql/config/auth.json"): 163 | path="/ql/config/auth.json" 164 | elif os.path.exists("/ql/data/config/auth.json"): 165 | path="/ql/data/config/auth.json" 166 | 167 | try: 168 | if 'keyv' in path: 169 | with open(path, "r", encoding="latin1") as file: 170 | auth = file.read() 171 | matches = re.search(r'token":"([^"]+)"', auth) 172 | token = matches.group(1) 173 | else: 174 | with open(path, "r") as file: 175 | auth = file.read() 176 | auth = json.loads(auth) 177 | token = auth["token"] 178 | except Exception: 179 | logger.info(f"❌无法获取 token!!!\n{traceback.format_exc()}") 180 | send("禁用重复任务失败", "无法获取 token!!!") 181 | exit(1) 182 | return token 183 | 184 | 185 | if __name__ == "__main__": 186 | logger.info("===> 禁用重复任务开始 <===") 187 | load_send() 188 | token = get_token() 189 | headers["Authorization"] = f"Bearer {token}" 190 | 191 | # 获取过滤后的任务列表 192 | sub_str = "\n".join(sub_list) 193 | logger.info(f"\n=== 你选择过滤的任务前缀为 ===\n{sub_str}") 194 | tasklist = get_tasklist() 195 | if len(tasklist) == 0: 196 | logger.info("❌无法获取 tasklist!!!") 197 | exit(1) 198 | filter_list, res_list = filter_res_sub(tasklist) 199 | 200 | tem_ids, tem_tasks, dup_ids = get_duplicate_list(filter_list) 201 | # 是否在重复任务中只保留设置的前缀 202 | if res_only: 203 | ids = reserve_task_only(tem_ids, tem_tasks, dup_ids, res_list) 204 | else: 205 | ids = dup_ids 206 | logger.info("你选择保留除了设置的前缀以外的其他任务") 207 | 208 | sum = f"所有任务数量为:{len(tasklist)}" 209 | filter = f"过滤的任务数量为:{len(res_list)}" 210 | disable = f"禁用的任务数量为:{len(ids)}" 211 | logging.info("\n=== 禁用数量统计 ===\n" + sum + "\n" + filter + "\n" + disable) 212 | 213 | if len(ids) == 0: 214 | logger.info("😁没有重复任务~") 215 | else: 216 | disable_duplicate_tasks(ids) 217 | #if send: 218 | #send("💖禁用重复任务成功", f"\n{sum}\n{filter}\n{disable}") 219 | -------------------------------------------------------------------------------- /jd_wskey_logout.js: -------------------------------------------------------------------------------- 1 | /* 2 | * 注销所有 WSKEY 3 | * 默认不开启,如需启用请添加变量: 4 | * JD_WSCK_LOGOUT=pin 退出指定账户 5 | * JD_WSCK_LOGOUT=ALL 退出所有 CK 有效的账户(必须大写) 6 | */ 7 | 8 | const $ = new Env("注销所有 WSKEY") 9 | const WSKEY_LOGOUT = class { 10 | ck = null 11 | key = null 12 | constructor(ck) { 13 | this.ck = ck 14 | const matches = ck.match(/pt_key=([^;]+)/) 15 | if (matches) { 16 | this.key = matches[1] 17 | } 18 | } 19 | getDevices() { 20 | return new Promise((resolve) => { 21 | const opts = { 22 | url: `https://plogin.m.jd.com/cgi-bin/login/devicemanagement_getdevices?appid=100&_=${(new Date()).getTime()}`, 23 | headers: { 24 | "Host": "plogin.m.jd.com", 25 | "Accept": "*/*", 26 | "Accept-Encoding": "gzip, deflate, br", 27 | "User-Agent": 'jdapp', 28 | "Accept-Language": "zh-CN,zh-Hans;q=0.9", 29 | "Cookie": this.ck 30 | } 31 | } 32 | $.get(opts, (error, response, data) => { 33 | try { 34 | if (error) { 35 | console.log(`${JSON.stringify(error)}`) 36 | console.log(`${$.name} getdevices API请求失败`) 37 | resolve('failed') 38 | } else { 39 | const devices = [] 40 | let guid = undefined 41 | let matches = data.match(/]+>[\s\S]+?<\/li>/g) 42 | if (matches) { 43 | if (response.headers['set-cookie']) { 44 | response.headers['set-cookie'].forEach((item) => { 45 | let matches2 = item.match(/guid=([^;]+)/) 46 | if (matches2) { 47 | guid = matches2[1] 48 | } 49 | }) 50 | } 51 | matches.forEach((item) => { 52 | let matches2, uuid, ticket, deviceName, id, loginTime 53 | matches2 = item.match(/data-uid=['"]([^'"]+)['"]/) 54 | if (matches2) { 55 | uuid = matches2[1] 56 | } 57 | matches2 = item.match(/data-tiket=['"]([^'"]+)['"]/) 58 | if (matches2) { 59 | ticket = matches2[1] 60 | } 61 | matches2 = item.match(/data-name=['"]([^'"]+)['"]/) 62 | if (matches2) { 63 | deviceName = matches2[1] 64 | } 65 | matches2 = item.match(/data-index=['"]([^'"]+)['"]/) 66 | if (matches2) { 67 | id = matches2[1] 68 | } 69 | matches2 = item.match(/

([\s\S]+?)<\/p>/) 70 | if (matches2) { 71 | loginTime = this.htmlDecode(matches2[1]) 72 | } 73 | devices.push({ 74 | deviceName, 75 | loginTime, 76 | config: { 77 | uuid, 78 | ticket, 79 | deviceName: this.htmlEncode(deviceName), 80 | id, 81 | appid: '100', 82 | pt_key: this.key, 83 | guid, 84 | } 85 | }) 86 | }) 87 | } 88 | resolve(devices) 89 | } 90 | } catch (e) { 91 | $.logErr(e, response); 92 | resolve('failed') 93 | } 94 | }) 95 | }) 96 | } 97 | deleteDevice(config) { 98 | return new Promise((resolve) => { 99 | const body = Object.keys(config).map((key) => { 100 | return `${encodeURIComponent(key)}=${encodeURIComponent(config[key])}` 101 | }).join('&') 102 | const opts = { 103 | url: `https://plogin.m.jd.com/cgi-bin/login/devicemanagement_deletedevice`, 104 | headers: { 105 | "Host": "plogin.m.jd.com", 106 | "Accept": "*/*", 107 | "Accept-Encoding": "gzip, deflate, br", 108 | "User-Agent": 'jdapp', 109 | "Accept-Language": "zh-CN,zh-Hans;q=0.9", 110 | "Cookie": `guid=${config.guid}; ${this.ck}`, 111 | "Content-Type": "application/x-www-form-urlencoded", 112 | "Content-Length": body.length, 113 | "Origin": "https://plogin.m.jd.com", 114 | "Referer": "https://plogin.m.jd.com/cgi-bin/login/devicemanagement_getdevices?appid=100" 115 | }, 116 | body 117 | } 118 | $.post(opts, (error, response, data) => { 119 | try { 120 | if (error) { 121 | console.log(`${JSON.stringify(error)}`) 122 | console.log(`${$.name} deletedevice API请求失败`) 123 | resolve('failed') 124 | } else { 125 | resolve(JSON.parse(data)) 126 | } 127 | } catch (e) { 128 | $.logErr(e, response); 129 | resolve('failed') 130 | } 131 | }) 132 | }) 133 | } 134 | htmlEncode(str) { 135 | str = str.replaceAll('&', '&') 136 | str = str.replaceAll('<', '<') 137 | str = str.replaceAll('>', '>') 138 | str = str.replaceAll('"', '"') 139 | str = str.replaceAll("'", ''') 140 | str = str.replaceAll(" ", ' ') 141 | return str 142 | } 143 | htmlDecode(str) { 144 | str = str.replaceAll(' ', " ") 145 | str = str.replaceAll(''', "'") 146 | str = str.replaceAll('"', '"') 147 | str = str.replaceAll('>', '>') 148 | str = str.replaceAll('<', '<') 149 | str = str.replaceAll('&', '&') 150 | return str 151 | } 152 | } 153 | 154 | !(async () => { 155 | if (!process.env) { 156 | process.env = {} 157 | } 158 | if (!process.env['JD_WSCK_LOGOUT']) { 159 | process.env['JD_WSCK_LOGOUT'] = '' 160 | } 161 | if (process.env['JD_WSCK_LOGOUT'] !== 'ALL') { 162 | if (process.env['JD_WSCK_LOGOUT'].indexOf('&') !== -1) { 163 | process.env['JD_WSCK_LOGOUT'] = process.env['JD_WSCK_LOGOUT'].split('&') 164 | } else if (process.env['JD_WSCK_LOGOUT'].indexOf("\n") !== -1) { 165 | process.env['JD_WSCK_LOGOUT'] = process.env['JD_WSCK_LOGOUT'].split("\n") 166 | } else if (process.env['JD_WSCK_LOGOUT']) { 167 | process.env['JD_WSCK_LOGOUT'] = [process.env['JD_WSCK_LOGOUT']] 168 | } else { 169 | process.env['JD_WSCK_LOGOUT'] = [] 170 | } 171 | } 172 | if (!process.env['JD_WSCK_LOGOUT'] || !process.env['JD_WSCK_LOGOUT'].length) { 173 | console.log(`当前不开启,如需启用请添加变量:\nJD_WSCK_LOGOUT=pin 退出指定账户\nJD_WSCK_LOGOUT=ALL 退出所有 CK 有效的账户(必须大写)`) 174 | return 175 | } 176 | 177 | let cookies = [] 178 | if (process.env['JD_COOKIE']) { 179 | if (process.env['JD_COOKIE'].indexOf('&') !== -1) { 180 | cookies = process.env['JD_COOKIE'].split('&') 181 | } else if (process.env['JD_COOKIE'].indexOf("\n") !== -1) { 182 | cookies = process.env['JD_COOKIE'].split("\n") 183 | } else { 184 | cookies = [process.env['JD_COOKIE']] 185 | } 186 | } 187 | if (typeof cookies[0] === "undefined") { 188 | console.log(`未添加任何京东账户`) 189 | return 190 | } 191 | console.log(`=========== 共 ${cookies.length} 个京东账号 Cookie ===========\n`) 192 | for (let i = 0; i < cookies.length; i++) { 193 | let matches = cookies[i].match(/pt_pin=([^;\s]+)/) 194 | if (!matches) { 195 | console.log(`*********【京东账户${i + 1}】*********\nCookie 格式错误,请检查\n${cookies[i]}\n`) 196 | continue 197 | } 198 | let pin = matches[1] 199 | console.log(`*********【京东账户${i + 1}】${decodeURIComponent(pin)}*********\n`) 200 | if (process.env['JD_WSCK_LOGOUT'] !== 'ALL' && process.env['JD_WSCK_LOGOUT'].indexOf(pin) === -1) { 201 | console.log(`不注销该账户任何 WSKEY\n`) 202 | continue 203 | } 204 | let logout = new WSKEY_LOGOUT(cookies[i]) 205 | let devices = await logout.getDevices() 206 | if (devices === 'failed') { 207 | console.log(`获取设备列表失败,可能为 Cookie 或脚本失效\n`) 208 | continue 209 | } 210 | if (!devices.length) { 211 | console.log(`获取设备列表失败,可能为脚本失效\n`) 212 | continue 213 | } 214 | for (let j = 0; j < devices.length; j++) { 215 | console.log(`${devices[j].deviceName} (${devices[j].loginTime})`) 216 | const result = await logout.deleteDevice(devices[j].config) 217 | if (result.errcode === 0) { 218 | console.log(`0 => 已注销\n`) 219 | } else { 220 | console.log(`${result.errcode} => ${result.message}\n`) 221 | } 222 | await $.wait(1000) 223 | } 224 | await $.wait(3000) 225 | } 226 | })() 227 | .catch((e) => $.logErr(e)) 228 | .finally(() => $.done()); 229 | 230 | function Env(t,e){"undefined"!=typeof process&&JSON.stringify(process.env).indexOf("GITHUB")>-1&&process.exit(0);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("",`🔔${this.name}, 开始!`)}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("@"),n={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(n,(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,e=null){const s=e?new Date(e):new Date;let i={"M+":s.getMonth()+1,"d+":s.getDate(),"H+":s.getHours(),"m+":s.getMinutes(),"s+":s.getSeconds(),"q+":Math.floor((s.getMonth()+3)/3),S:s.getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(s.getFullYear()+"").substr(4-RegExp.$1.length)));for(let e in i)new RegExp("("+e+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?i[e]:("00"+i[e]).substr((""+i[e]).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=["","==============📣系统通知📣=============="];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("",`❗️${this.name}, 错误!`,t.stack):this.log("",`❗️${this.name}, 错误!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`🔔${this.name}, 结束! 🕛 ${s} 秒`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)} 231 | -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | # This is a sample Python script. 2 | 3 | # Press ⌃R to execute it or replace it with your code. 4 | # Press Double ⇧ to search everywhere for classes, files, tool windows, actions, and settings. 5 | 6 | 7 | def print_hi(name): 8 | # Use a breakpoint in the code line below to debug your script. 9 | print(f'Hi, {name}') # Press ⌘F8 to toggle the breakpoint. 10 | 11 | 12 | # Press the green button in the gutter to run the script. 13 | if __name__ == '__main__': 14 | print_hi('PyCharm') 15 | 16 | # See PyCharm help at https://www.jetbrains.com/help/pycharm/ 17 | -------------------------------------------------------------------------------- /mount.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ln -s /ql/data/config /ql/config 4 | ln -s /ql/data/db /ql/db 5 | ln -s /ql/data/jbot /ql/jbot 6 | ln -s /ql/data/log /ql/log 7 | ln -s /ql/data/scripts /ql/scripts 8 | echo "# 旧版青龙目录挂载完成。" -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jd", 3 | "version": "1.0.0", 4 | "description": "{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**}", 5 | "main": "AlipayManor.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "" 12 | }, 13 | "keywords": [ 14 | "JD" 15 | ], 16 | "author": "", 17 | "license": "ISC", 18 | "dependencies": { 19 | "axios": "^0.27.2", 20 | "commander": "^9.2.0", 21 | "console-grid": "^1.0.17", 22 | "crypto-js": "^4.1.1", 23 | "date-fns": "^2.28.0", 24 | "dotenv": "^16.0.0", 25 | "download": "^8.0.0", 26 | "form-data": "^4.0.0", 27 | "got": "^11.8.3", 28 | "http-server": "^14.1.0", 29 | "jsdom": "^19.0.0", 30 | "md5": "^2.3.0", 31 | "png-js": "^1.0.0", 32 | "prettytable": "^0.3.1", 33 | "qrcode-terminal": "^0.12.0", 34 | "request": "^2.88.2", 35 | "tough-cookie": "^4.0.0", 36 | "ts-md5": "^1.2.11", 37 | "tslib": "^2.4.0", 38 | "tunnel": "0.0.6", 39 | "ws": "^8.5.0" 40 | }, 41 | "devDependencies": { 42 | "@types/node": "^17.0.30", 43 | "gulp": "^4.0.2", 44 | "gulp-typescript": "^6.0.0-alpha.1", 45 | "ts-node": "^10.7.0", 46 | "typescript": "^4.6.4" 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /ql.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const got = require('got') 4 | require('dotenv').config() 5 | const { readFile } = require('fs/promises') 6 | const path = require('path') 7 | 8 | const qlDir = '/ql' 9 | const fs = require('fs') 10 | const tokenFileList = ['/ql/data/db/keyv.sqlite', '/ql/data/config/auth.json', '/ql/config/auth.json'] 11 | 12 | //const authFile = path.join(qlDir, 'config/auth.json'); 13 | let authFile = getLatestFile(tokenFileList) 14 | const api = got.extend({ 15 | prefixUrl: 'http://127.0.0.1:5600', 16 | retry: { limit: 0 }, 17 | }) 18 | function getLatestFile(files) { 19 | let latestFile = null 20 | let latestMtime = 0 21 | for (const file of files) { 22 | try { 23 | const stats = fs.statSync(file) 24 | const mtime = stats.mtimeMs 25 | if (mtime > latestMtime) { 26 | latestMtime = mtime 27 | latestFile = file 28 | } 29 | } catch (e) {} 30 | } 31 | return latestFile 32 | } 33 | async function getToken() { 34 | const authConfig = await readFile(authFile) 35 | // console.log(authConfig.toString().match(/"token":"(.*?)",/)[1]) 36 | return authConfig.toString().match(/"token":"([^"]*)"(?!.*"token":)/)[1] 37 | } 38 | 39 | module.exports.getEnvs = async () => { 40 | const token = await getToken() 41 | const body = await api({ 42 | url: 'api/envs', 43 | searchParams: { 44 | searchValue: 'JD_COOKIE', 45 | t: Date.now(), 46 | }, 47 | headers: { 48 | Accept: 'application/json', 49 | authorization: `Bearer ${token}`, 50 | }, 51 | }).json() 52 | return body.data 53 | } 54 | 55 | module.exports.getEnvsCount = async () => { 56 | const data = await this.getEnvs() 57 | return data.length 58 | } 59 | 60 | module.exports.addEnv = async (cookie, remarks) => { 61 | const token = await getToken() 62 | const body = await api({ 63 | method: 'post', 64 | url: 'api/envs', 65 | params: { t: Date.now() }, 66 | json: [ 67 | { 68 | name: 'JD_COOKIE', 69 | value: cookie, 70 | remarks, 71 | }, 72 | ], 73 | headers: { 74 | Accept: 'application/json', 75 | authorization: `Bearer ${token}`, 76 | 'Content-Type': 'application/json;charset=UTF-8', 77 | }, 78 | }).json() 79 | return body 80 | } 81 | 82 | module.exports.updateEnv = async (cookie, eid, remarks) => { 83 | const token = await getToken() 84 | const body = await api({ 85 | method: 'put', 86 | url: 'api/envs', 87 | params: { t: Date.now() }, 88 | json: { 89 | name: 'JD_COOKIE', 90 | value: cookie, 91 | _id: eid, 92 | remarks, 93 | }, 94 | headers: { 95 | Accept: 'application/json', 96 | authorization: `Bearer ${token}`, 97 | 'Content-Type': 'application/json;charset=UTF-8', 98 | }, 99 | }).json() 100 | return body 101 | } 102 | 103 | module.exports.updateEnv11 = async (cookie, eid, remarks) => { 104 | const token = await getToken() 105 | const body = await api({ 106 | method: 'put', 107 | url: 'api/envs', 108 | params: { t: Date.now() }, 109 | json: { 110 | name: 'JD_COOKIE', 111 | value: cookie, 112 | id: eid, 113 | remarks, 114 | }, 115 | headers: { 116 | Accept: 'application/json', 117 | authorization: `Bearer ${token}`, 118 | 'Content-Type': 'application/json;charset=UTF-8', 119 | }, 120 | }).json() 121 | return body 122 | } 123 | 124 | module.exports.DisableCk = async (eid) => { 125 | const token = await getToken() 126 | const body = await api({ 127 | method: 'put', 128 | url: 'api/envs/disable', 129 | params: { t: Date.now() }, 130 | body: JSON.stringify([eid]), 131 | headers: { 132 | Accept: 'application/json', 133 | authorization: `Bearer ${token}`, 134 | 'Content-Type': 'application/json;charset=UTF-8', 135 | }, 136 | }).json() 137 | return body 138 | } 139 | 140 | module.exports.EnableCk = async (eid) => { 141 | const token = await getToken() 142 | const body = await api({ 143 | method: 'put', 144 | url: 'api/envs/enable', 145 | params: { t: Date.now() }, 146 | body: JSON.stringify([eid]), 147 | headers: { 148 | Accept: 'application/json', 149 | authorization: `Bearer ${token}`, 150 | 'Content-Type': 'application/json;charset=UTF-8', 151 | }, 152 | }).json() 153 | return body 154 | } 155 | 156 | module.exports.getstatus = async (eid) => { 157 | const envs = await this.getEnvs() 158 | var tempid = 0 159 | for (let i = 0; i < envs.length; i++) { 160 | tempid = 0 161 | if (envs[i]._id) { 162 | tempid = envs[i]._id 163 | } 164 | if (envs[i].id) { 165 | tempid = envs[i].id 166 | } 167 | if (tempid == eid) { 168 | return envs[i].status 169 | } 170 | } 171 | return 99 172 | } 173 | 174 | module.exports.getEnvById = async (eid) => { 175 | const envs = await this.getEnvs() 176 | var tempid = 0 177 | for (let i = 0; i < envs.length; i++) { 178 | tempid = 0 179 | if (envs[i]._id) { 180 | tempid = envs[i]._id 181 | } 182 | if (envs[i].id) { 183 | tempid = envs[i].id 184 | } 185 | if (tempid == eid) { 186 | return envs[i].value 187 | } 188 | } 189 | return '' 190 | } 191 | 192 | module.exports.getEnvByPtPin = async (Ptpin) => { 193 | const envs = await this.getEnvs() 194 | for (let i = 0; i < envs.length; i++) { 195 | var tempptpin = decodeURIComponent(envs[i].value.match(/pt_pin=([^; ]+)(?=;?)/) && envs[i].value.match(/pt_pin=([^; ]+)(?=;?)/)[1]) 196 | if (tempptpin == Ptpin) { 197 | return envs[i] 198 | } 199 | } 200 | return '' 201 | } 202 | 203 | module.exports.delEnv = async (eid) => { 204 | const token = await getToken() 205 | const body = await api({ 206 | method: 'delete', 207 | url: 'api/envs', 208 | params: { t: Date.now() }, 209 | body: JSON.stringify([eid]), 210 | headers: { 211 | Accept: 'application/json', 212 | authorization: `Bearer ${token}`, 213 | 'Content-Type': 'application/json;charset=UTF-8', 214 | }, 215 | }).json() 216 | return body 217 | } 218 | -------------------------------------------------------------------------------- /sendNotify.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # _*_ coding:utf-8 _*_ 3 | 4 | #Modify: Kirin 5 | 6 | import sys 7 | import os, re 8 | import requests 9 | import json 10 | import time 11 | import hmac 12 | import hashlib 13 | import base64 14 | import urllib.parse 15 | from requests.adapters import HTTPAdapter 16 | from urllib3.util import Retry 17 | 18 | cur_path = os.path.abspath(os.path.dirname(__file__)) 19 | root_path = os.path.split(cur_path)[0] 20 | sys.path.append(root_path) 21 | 22 | # 通知服务 23 | BARK = '' # bark服务,自行搜索; secrets可填; 24 | BARK_PUSH='' # bark自建服务器,要填完整链接,结尾的/不要 25 | SCKEY = '' # Server酱的SCKEY; secrets可填 26 | TG_BOT_TOKEN = '' # tg机器人的TG_BOT_TOKEN; secrets可填1407203283:AAG9rt-6RDaaX0HBLZQq0laNOh898iFYaRQ 27 | TG_USER_ID = '' # tg机器人的TG_USER_ID; secrets可填 1434078534 28 | TG_API_HOST='' # tg 代理api 29 | TG_PROXY_IP = '' # tg机器人的TG_PROXY_IP; secrets可填 30 | TG_PROXY_PORT = '' # tg机器人的TG_PROXY_PORT; secrets可填 31 | DD_BOT_ACCESS_TOKEN = '' # 钉钉机器人的DD_BOT_ACCESS_TOKEN; secrets可填 32 | DD_BOT_SECRET = '' # 钉钉机器人的DD_BOT_SECRET; secrets可填 33 | QQ_SKEY = '' # qq机器人的QQ_SKEY; secrets可填 34 | QQ_MODE = '' # qq机器人的QQ_MODE; secrets可填 35 | QYWX_AM = '' # 企业微信 36 | QYWX_KEY = '' # 企业微信BOT 37 | PUSH_PLUS_TOKEN = '' # 微信推送Plus+ 38 | 39 | notify_mode = [] 40 | 41 | message_info = '''''' 42 | 43 | # GitHub action运行需要填写对应的secrets 44 | if "BARK" in os.environ and os.environ["BARK"]: 45 | BARK = os.environ["BARK"] 46 | if "BARK_PUSH" in os.environ and os.environ["BARK_PUSH"]: 47 | BARK_PUSH = os.environ["BARK_PUSH"] 48 | if "SCKEY" in os.environ and os.environ["SCKEY"]: 49 | SCKEY = os.environ["SCKEY"] 50 | if "TG_BOT_TOKEN" in os.environ and os.environ["TG_BOT_TOKEN"] and "TG_USER_ID" in os.environ and os.environ["TG_USER_ID"]: 51 | TG_BOT_TOKEN = os.environ["TG_BOT_TOKEN"] 52 | TG_USER_ID = os.environ["TG_USER_ID"] 53 | if "TG_API_HOST" in os.environ and os.environ["TG_API_HOST"]: 54 | TG_API_HOST = os.environ["TG_API_HOST"] 55 | if "DD_BOT_ACCESS_TOKEN" in os.environ and os.environ["DD_BOT_ACCESS_TOKEN"] and "DD_BOT_SECRET" in os.environ and os.environ["DD_BOT_SECRET"]: 56 | DD_BOT_ACCESS_TOKEN = os.environ["DD_BOT_ACCESS_TOKEN"] 57 | DD_BOT_SECRET = os.environ["DD_BOT_SECRET"] 58 | if "QQ_SKEY" in os.environ and os.environ["QQ_SKEY"] and "QQ_MODE" in os.environ and os.environ["QQ_MODE"]: 59 | QQ_SKEY = os.environ["QQ_SKEY"] 60 | QQ_MODE = os.environ["QQ_MODE"] 61 | # 获取pushplus+ PUSH_PLUS_TOKEN 62 | if "PUSH_PLUS_TOKEN" in os.environ: 63 | if len(os.environ["PUSH_PLUS_TOKEN"]) > 1: 64 | PUSH_PLUS_TOKEN = os.environ["PUSH_PLUS_TOKEN"] 65 | # print("已获取并使用Env环境 PUSH_PLUS_TOKEN") 66 | # 获取企业微信应用推送 QYWX_AM 67 | if "QYWX_AM" in os.environ: 68 | if len(os.environ["QYWX_AM"]) > 1: 69 | QYWX_AM = os.environ["QYWX_AM"] 70 | 71 | 72 | if "QYWX_KEY" in os.environ: 73 | if len(os.environ["QYWX_KEY"]) > 1: 74 | QYWX_KEY = os.environ["QYWX_KEY"] 75 | # print("已获取并使用Env环境 QYWX_AM") 76 | 77 | if BARK: 78 | notify_mode.append('bark') 79 | # print("BARK 推送打开") 80 | if BARK_PUSH: 81 | notify_mode.append('bark') 82 | # print("BARK 推送打开") 83 | if SCKEY: 84 | notify_mode.append('sc_key') 85 | # print("Server酱 推送打开") 86 | if TG_BOT_TOKEN and TG_USER_ID: 87 | notify_mode.append('telegram_bot') 88 | # print("Telegram 推送打开") 89 | if DD_BOT_ACCESS_TOKEN and DD_BOT_SECRET: 90 | notify_mode.append('dingding_bot') 91 | # print("钉钉机器人 推送打开") 92 | if QQ_SKEY and QQ_MODE: 93 | notify_mode.append('coolpush_bot') 94 | # print("QQ机器人 推送打开") 95 | 96 | if PUSH_PLUS_TOKEN: 97 | notify_mode.append('pushplus_bot') 98 | # print("微信推送Plus机器人 推送打开") 99 | if QYWX_AM: 100 | notify_mode.append('wecom_app') 101 | # print("企业微信机器人 推送打开") 102 | 103 | if QYWX_KEY: 104 | notify_mode.append('wecom_key') 105 | # print("企业微信机器人 推送打开") 106 | 107 | 108 | def message(str_msg): 109 | global message_info 110 | print(str_msg) 111 | message_info = "{}\n{}".format(message_info, str_msg) 112 | sys.stdout.flush() 113 | 114 | def bark(title, content): 115 | print("\n") 116 | if BARK: 117 | try: 118 | response = requests.get( 119 | f"""https://api.day.app/{BARK}/{title}/{urllib.parse.quote_plus(content)}""").json() 120 | if response['code'] == 200: 121 | print('推送成功!') 122 | else: 123 | print('推送失败!') 124 | except: 125 | print('推送失败!') 126 | if BARK_PUSH: 127 | try: 128 | response = requests.get( 129 | f"""{BARK_PUSH}/{title}/{urllib.parse.quote_plus(content)}""").json() 130 | if response['code'] == 200: 131 | print('推送成功!') 132 | else: 133 | print('推送失败!') 134 | except: 135 | print('推送失败!') 136 | print("bark服务启动") 137 | if BARK=='' and BARK_PUSH=='': 138 | print("bark服务的bark_token未设置!!\n取消推送") 139 | return 140 | 141 | def serverJ(title, content): 142 | print("\n") 143 | if not SCKEY: 144 | print("server酱服务的SCKEY未设置!!\n取消推送") 145 | return 146 | print("serverJ服务启动") 147 | data = { 148 | "text": title, 149 | "desp": content.replace("\n", "\n\n") 150 | } 151 | response = requests.post(f"https://sc.ftqq.com/{SCKEY}.send", data=data).json() 152 | if response['errno'] == 0: 153 | print('推送成功!') 154 | else: 155 | print('推送失败!') 156 | 157 | # tg通知 158 | def telegram_bot(title, content): 159 | try: 160 | print("\n") 161 | bot_token = TG_BOT_TOKEN 162 | user_id = TG_USER_ID 163 | if not bot_token or not user_id: 164 | print("tg服务的bot_token或者user_id未设置!!\n取消推送") 165 | return 166 | print("tg服务启动") 167 | if TG_API_HOST: 168 | if 'http' in TG_API_HOST: 169 | url = f"{TG_API_HOST}/bot{TG_BOT_TOKEN}/sendMessage" 170 | else: 171 | url = f"https://{TG_API_HOST}/bot{TG_BOT_TOKEN}/sendMessage" 172 | else: 173 | url = f"https://api.telegram.org/bot{TG_BOT_TOKEN}/sendMessage" 174 | 175 | headers = {'Content-Type': 'application/x-www-form-urlencoded'} 176 | payload = {'chat_id': str(TG_USER_ID), 'text': f'{title}\n\n{content}', 'disable_web_page_preview': 'true'} 177 | proxies = None 178 | if TG_PROXY_IP and TG_PROXY_PORT: 179 | proxyStr = "http://{}:{}".format(TG_PROXY_IP, TG_PROXY_PORT) 180 | proxies = {"http": proxyStr, "https": proxyStr} 181 | try: 182 | response = requests.post(url=url, headers=headers, params=payload, proxies=proxies).json() 183 | except: 184 | print('推送失败!') 185 | if response['ok']: 186 | print('推送成功!') 187 | else: 188 | print('推送失败!') 189 | except Exception as e: 190 | print(e) 191 | 192 | def dingding_bot(title, content): 193 | timestamp = str(round(time.time() * 1000)) # 时间戳 194 | secret_enc = DD_BOT_SECRET.encode('utf-8') 195 | string_to_sign = '{}\n{}'.format(timestamp, DD_BOT_SECRET) 196 | string_to_sign_enc = string_to_sign.encode('utf-8') 197 | hmac_code = hmac.new(secret_enc, string_to_sign_enc, digestmod=hashlib.sha256).digest() 198 | sign = urllib.parse.quote_plus(base64.b64encode(hmac_code)) # 签名 199 | print('开始使用 钉钉机器人 推送消息...', end='') 200 | url = f'https://oapi.dingtalk.com/robot/send?access_token={DD_BOT_ACCESS_TOKEN}×tamp={timestamp}&sign={sign}' 201 | headers = {'Content-Type': 'application/json;charset=utf-8'} 202 | data = { 203 | 'msgtype': 'text', 204 | 'text': {'content': f'{title}\n\n{content}'} 205 | } 206 | response = requests.post(url=url, data=json.dumps(data), headers=headers, timeout=15).json() 207 | if not response['errcode']: 208 | print('推送成功!') 209 | else: 210 | print('推送失败!') 211 | 212 | def coolpush_bot(title, content): 213 | print("\n") 214 | if not QQ_SKEY or not QQ_MODE: 215 | print("qq服务的QQ_SKEY或者QQ_MODE未设置!!\n取消推送") 216 | return 217 | print("qq服务启动") 218 | url=f"https://qmsg.zendee.cn/{QQ_MODE}/{QQ_SKEY}" 219 | payload = {'msg': f"{title}\n\n{content}".encode('utf-8')} 220 | response = requests.post(url=url, params=payload).json() 221 | if response['code'] == 0: 222 | print('推送成功!') 223 | else: 224 | print('推送失败!') 225 | # push推送 226 | def pushplus_bot(title, content): 227 | try: 228 | print("\n") 229 | if not PUSH_PLUS_TOKEN: 230 | print("PUSHPLUS服务的token未设置!!\n取消推送") 231 | return 232 | print("PUSHPLUS服务启动") 233 | url = 'http://www.pushplus.plus/send' 234 | data = { 235 | "token": PUSH_PLUS_TOKEN, 236 | "title": title, 237 | "content": content 238 | } 239 | body = json.dumps(data).encode(encoding='utf-8') 240 | headers = {'Content-Type': 'application/json'} 241 | response = requests.post(url=url, data=body, headers=headers).json() 242 | if response['code'] == 200: 243 | print('推送成功!') 244 | else: 245 | print('推送失败!') 246 | except Exception as e: 247 | print(e) 248 | 249 | 250 | 251 | print("xxxxxxxxxxxx") 252 | def wecom_key(title, content): 253 | print("\n") 254 | if not QYWX_KEY: 255 | print("QYWX_KEY未设置!!\n取消推送") 256 | return 257 | print("QYWX_KEY服务启动") 258 | print("content"+content) 259 | headers = {'Content-Type': 'application/json'} 260 | data = { 261 | "msgtype":"text", 262 | "text":{ 263 | "content":title+"\n"+content.replace("\n", "\n\n") 264 | } 265 | } 266 | 267 | print(f"https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key={QYWX_KEY}") 268 | response = requests.post(f"https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key={QYWX_KEY}", json=data,headers=headers).json() 269 | print(response) 270 | 271 | 272 | # 企业微信 APP 推送 273 | def wecom_app(title, content): 274 | try: 275 | if not QYWX_AM: 276 | print("QYWX_AM 并未设置!!\n取消推送") 277 | return 278 | QYWX_AM_AY = re.split(',', QYWX_AM) 279 | if 4 < len(QYWX_AM_AY) > 5: 280 | print("QYWX_AM 设置错误!!\n取消推送") 281 | return 282 | corpid = QYWX_AM_AY[0] 283 | corpsecret = QYWX_AM_AY[1] 284 | touser = QYWX_AM_AY[2] 285 | agentid = QYWX_AM_AY[3] 286 | try: 287 | media_id = QYWX_AM_AY[4] 288 | except: 289 | media_id = '' 290 | wx = WeCom(corpid, corpsecret, agentid) 291 | # 如果没有配置 media_id 默认就以 text 方式发送 292 | if not media_id: 293 | message = title + '\n\n' + content 294 | response = wx.send_text(message, touser) 295 | else: 296 | response = wx.send_mpnews(title, content, media_id, touser) 297 | if response == 'ok': 298 | print('推送成功!') 299 | else: 300 | print('推送失败!错误信息如下:\n', response) 301 | except Exception as e: 302 | print(e) 303 | 304 | class WeCom: 305 | def __init__(self, corpid, corpsecret, agentid): 306 | self.CORPID = corpid 307 | self.CORPSECRET = corpsecret 308 | self.AGENTID = agentid 309 | 310 | def get_access_token(self): 311 | url = 'https://qyapi.weixin.qq.com/cgi-bin/gettoken' 312 | values = {'corpid': self.CORPID, 313 | 'corpsecret': self.CORPSECRET, 314 | } 315 | req = requests.post(url, params=values) 316 | data = json.loads(req.text) 317 | return data["access_token"] 318 | 319 | def send_text(self, message, touser="@all"): 320 | send_url = 'https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=' + self.get_access_token() 321 | send_values = { 322 | "touser": touser, 323 | "msgtype": "text", 324 | "agentid": self.AGENTID, 325 | "text": { 326 | "content": message 327 | }, 328 | "safe": "0" 329 | } 330 | send_msges = (bytes(json.dumps(send_values), 'utf-8')) 331 | respone = requests.post(send_url, send_msges) 332 | respone = respone.json() 333 | return respone["errmsg"] 334 | 335 | def send_mpnews(self, title, message, media_id, touser="@all"): 336 | send_url = 'https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=' + self.get_access_token() 337 | send_values = { 338 | "touser": touser, 339 | "msgtype": "mpnews", 340 | "agentid": self.AGENTID, 341 | "mpnews": { 342 | "articles": [ 343 | { 344 | "title": title, 345 | "thumb_media_id": media_id, 346 | "author": "Author", 347 | "content_source_url": "", 348 | "content": message.replace('\n', '
'), 349 | "digest": message 350 | } 351 | ] 352 | } 353 | } 354 | send_msges = (bytes(json.dumps(send_values), 'utf-8')) 355 | respone = requests.post(send_url, send_msges) 356 | respone = respone.json() 357 | return respone["errmsg"] 358 | 359 | def send(title, content): 360 | """ 361 | 使用 bark, telegram bot, dingding bot, serverJ 发送手机推送 362 | :param title: 363 | :param content: 364 | :return: 365 | """ 366 | 367 | for i in notify_mode: 368 | if i == 'bark': 369 | if BARK or BARK_PUSH: 370 | bark(title=title, content=content) 371 | else: 372 | print('未启用 bark') 373 | continue 374 | if i == 'sc_key': 375 | if SCKEY: 376 | serverJ(title=title, content=content) 377 | else: 378 | print('未启用 Server酱') 379 | continue 380 | elif i == 'dingding_bot': 381 | if DD_BOT_ACCESS_TOKEN and DD_BOT_SECRET: 382 | dingding_bot(title=title, content=content) 383 | else: 384 | print('未启用 钉钉机器人') 385 | continue 386 | elif i == 'telegram_bot': 387 | if TG_BOT_TOKEN and TG_USER_ID: 388 | telegram_bot(title=title, content=content) 389 | else: 390 | print('未启用 telegram机器人') 391 | continue 392 | elif i == 'coolpush_bot': 393 | if QQ_SKEY and QQ_MODE: 394 | coolpush_bot(title=title, content=content) 395 | else: 396 | print('未启用 QQ机器人') 397 | continue 398 | elif i == 'pushplus_bot': 399 | if PUSH_PLUS_TOKEN: 400 | pushplus_bot(title=title, content=content) 401 | else: 402 | print('未启用 PUSHPLUS机器人') 403 | continue 404 | elif i == 'wecom_app': 405 | if QYWX_AM: 406 | wecom_app(title=title, content=content) 407 | else: 408 | print('未启用企业微信应用消息推送') 409 | continue 410 | elif i == 'wecom_key': 411 | if QYWX_KEY: 412 | 413 | for i in range(int(len(content)/2000)+1): 414 | wecom_key(title=title, content=content[i*2000:(i+1)*2000]) 415 | 416 | 417 | else: 418 | print('未启用企业微信应用消息推送') 419 | continue 420 | else: 421 | print('此类推送方式不存在') 422 | 423 | 424 | def main(): 425 | send('title', 'content') 426 | 427 | 428 | if __name__ == '__main__': 429 | main() -------------------------------------------------------------------------------- /test.js: -------------------------------------------------------------------------------- 1 | const {Env} = require('./magic'); 2 | const $ = new Env('MTest'); 3 | 4 | $.logic = async function () { 5 | let activityContent = { 6 | "result": true, 7 | "data": { 8 | "id": "173f89d8cc6d413e81a357b07137d56d", 9 | "userId": 197936, 10 | "venderType": 0, 11 | "endTime": 1649381820000, 12 | "list": [{ 13 | "type": "dq", 14 | "takeNum": null, 15 | "discount": "20", 16 | "quota": "499" 17 | }], 18 | "hasFollow": false, 19 | "openCard": false, 20 | "shopMember": false, 21 | "shopgiftActivity": null 22 | }, 23 | "count": 0, 24 | "errorMessage": "" 25 | } 26 | $.content = activityContent.data.list 27 | let ts = $.content.filter(o => ['jd', 'jf'].includes(o.type)); 28 | if (ts.length === 0) { 29 | $.putMsg(`不是豆子或积分不跑`); 30 | } 31 | 32 | }; 33 | $.run({whitelist: [1]}) 34 | .catch(reason => $.log(reason)); 35 | -------------------------------------------------------------------------------- /utils/Rebels_3_0.js: -------------------------------------------------------------------------------- 1 | /* 2 | new Env('Rebels_3_0'); 3 | */ 4 | var iil='jsjiami.com.v7';const ilI1lI=iii1II;(function(IiiIl1,lIIil1,IIli1,II1liI,IlI1i1,l1lIl1,IiiIlI){return IiiIl1=IiiIl1>>0x4,l1lIl1='hs',IiiIlI='hs',function(Iilli1,I1l1Il,llIll1,Illl1l,Illl1i){const llIlii=iii1II;Illl1l='tfi',l1lIl1=Illl1l+l1lIl1,Illl1i='up',IiiIlI+=Illl1i,l1lIl1=llIll1(l1lIl1),IiiIlI=llIll1(IiiIlI),llIll1=0x0;const lIIiil=Iilli1();while(!![]&&--II1liI+I1l1Il){try{Illl1l=-parseInt(llIlii(0x8f,'@isu'))/0x1*(parseInt(llIlii(0xa3,'oIbJ'))/0x2)+-parseInt(llIlii(0xa1,'guTq'))/0x3+parseInt(llIlii(0xa4,'AeS('))/0x4+parseInt(llIlii(0x92,'r5XH'))/0x5*(-parseInt(llIlii(0x87,'JVa9'))/0x6)+-parseInt(llIlii(0x9d,'$zW!'))/0x7*(parseInt(llIlii(0x8b,'3o@]'))/0x8)+-parseInt(llIlii(0x8d,'WQ]H'))/0x9+-parseInt(llIlii(0x96,'$zW!'))/0xa*(-parseInt(llIlii(0xaf,'EQjZ'))/0xb);}catch(l1lIii){Illl1l=llIll1;}finally{Illl1i=lIIiil[l1lIl1]();if(IiiIl1<=II1liI)llIll1?IlI1i1?Illl1l=Illl1i:IlI1i1=Illl1i:llIll1=Illl1i;else{if(llIll1==IlI1i1['replace'](/[dKGtDJRXeYUyHMwbCQB=]/g,'')){if(Illl1l===I1l1Il){lIIiil['un'+l1lIl1](Illl1i);break;}lIIiil[IiiIlI](Illl1i);}}}}}(IIli1,lIIil1,function(I11iI1,l1lIil,IiiIli,iillli,I1l1Ii,I1i11i,I1i11l){return l1lIil='\x73\x70\x6c\x69\x74',I11iI1=arguments[0x0],I11iI1=I11iI1[l1lIil](''),IiiIli=`\x72\x65\x76\x65\x72\x73\x65`,I11iI1=I11iI1[IiiIli]('\x76'),iillli=`\x6a\x6f\x69\x6e`,(0x14f566,I11iI1[iillli](''));});}(0xbc0,0xbb097,Iii11l,0xbe),Iii11l)&&(iil=Iii11l);const i1l1ll=require('jsdom');let I1iIiI=null,li1I1=null;async function i1ilil(iIIl1l){const llIli1={'cjJmi':function(iliIII,iIIl1i){return iliIII(iIIl1i);},'ISZTM':function(I1lllI,ill111,Iliil1){return I1lllI(ill111,Iliil1);}};return new Promise((i1III,Ii1iIi)=>{llIli1['ISZTM'](setTimeout,()=>{const llIlil=iii1II;llIli1[llIlil(0x9e,'y&Np')](i1III,iIIl1l);},iIIl1l);});}async function lilIii(iliIIl){const IIlil=iii1II,Ii1iIl={'FFCoM':IIlil(0x94,'oIbJ'),'vjWLO':'Mozilla/5.0\x20(Macintosh;\x20Intel\x20Mac\x20OS\x20X\x2010.15;\x20rv:91.0)\x20Gecko/20100101\x20Firefox/91.0','FHRri':IIlil(0xb0,'f[zq'),'FDIoN':IIlil(0xb3,'T(5r'),'fbfMW':IIlil(0x86,'T(5r'),'RIKxB':function(Iliiii,i1illI){return Iliiii(i1illI);}},{JSDOM:iliIIi}=i1l1ll;let ill11I=new i1l1ll[(IIlil(0x9c,'#4@$'))]({'userAgent':'Mozilla/5.0\x20(Macintosh;\x20Intel\x20Mac\x20OS\x20X\x2010.15;\x20rv:91.0)\x20Gecko/20100101\x20Firefox/91.0','referrer':'https://msitepp-fm.jd.com/rest/priceprophone/priceProPhoneMenu'}),Iliiil=new i1l1ll[(IIlil(0x8e,'&As9'))](),li1Il={'url':Ii1iIl[IIlil(0xa2,'T5ky')],'referrer':Ii1iIl[IIlil(0xab,'3o@]')],'userAgent':Ii1iIl[IIlil(0xa8,'W4[]')],'runScripts':Ii1iIl['FHRri'],'resources':ill11I,'includeNodeLocations':!![],'storageQuota':0x989680,'pretendToBeVisual':!![],'virtualConsole':Iliiil};const li1Ii=new iliIIi('\x0a\x20\x20\x20\x20\x0a\x20\x20\x20\x20>(-0x2*_0xce138f&0x6)):0x0){_0x3e9ef4=_0x7f7e4b['indexOf'](_0x3e9ef4);}for(let _0x492d9f=0x0,_0x2ee623=_0xabd09['length'];_0x492d9f<_0x2ee623;_0x492d9f++){_0x2906b5+='%'+('00'+_0xabd09['charCodeAt'](_0x492d9f)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x2906b5);};const _0x5cccb4=function(_0x4927f1,_0x2645db){let _0x4d2871=[],_0x203a97=0x0,_0x44018c,_0x3fa1df='';_0x4927f1=_0x44e1b1(_0x4927f1);let _0x519f62;for(_0x519f62=0x0;_0x519f62<0x100;_0x519f62++){_0x4d2871[_0x519f62]=_0x519f62;}for(_0x519f62=0x0;_0x519f62<0x100;_0x519f62++){_0x203a97=(_0x203a97+_0x4d2871[_0x519f62]+_0x2645db['charCodeAt'](_0x519f62%_0x2645db['length']))%0x100,_0x44018c=_0x4d2871[_0x519f62],_0x4d2871[_0x519f62]=_0x4d2871[_0x203a97],_0x4d2871[_0x203a97]=_0x44018c;}_0x519f62=0x0,_0x203a97=0x0;for(let _0x2e5e72=0x0;_0x2e5e72<_0x4927f1['length'];_0x2e5e72++){_0x519f62=(_0x519f62+0x1)%0x100,_0x203a97=(_0x203a97+_0x4d2871[_0x519f62])%0x100,_0x44018c=_0x4d2871[_0x519f62],_0x4d2871[_0x519f62]=_0x4d2871[_0x203a97],_0x4d2871[_0x203a97]=_0x44018c,_0x3fa1df+=String['fromCharCode'](_0x4927f1['charCodeAt'](_0x2e5e72)^_0x4d2871[(_0x4d2871[_0x519f62]+_0x4d2871[_0x203a97])%0x100]);}return _0x3fa1df;};iii1II['MLJCYC']=_0x5cccb4,_0x2cf802=arguments,iii1II['ShUtdE']=!![];}const _0xf3c2c4=_0x1edb9e[0x0],_0x38e182=_0x2865b8+_0xf3c2c4,_0x2e1843=_0x2cf802[_0x38e182];return!_0x2e1843?(iii1II['XbqsKb']===undefined&&(iii1II['XbqsKb']=!![]),_0x1d161b=iii1II['MLJCYC'](_0x1d161b,_0x283592),_0x2cf802[_0x38e182]=_0x1d161b):_0x1d161b=_0x2e1843,_0x1d161b;},iii1II(_0x2cf802,_0x379743);}async function i1ill1(i1IIl,I1lll1,i1IIi=ilI1lI(0x84,'*wPq')){const IiiIll=ilI1lI,IIII1I={'ZUIDH':'function','FSjMj':function(Iii111,l1l1II){return Iii111(l1l1II);},'cMNDA':function(Iil1I1,Ii1iII){return Iil1I1===Ii1iII;},'eqOnp':function(l1i11I,II11II,Ii1iI1){return l1i11I(II11II,Ii1iI1);},'NjTAw':function(lilIli,Iliili){return lilIli===Iliili;},'qTJaP':function(Iliill,IIII11,i1illi){return Iliill(IIII11,i1illi);},'WPcSj':'4.1'};i1IIi!=='3.1'&&(i1IIi=IIII1I[IiiIll(0xb2,'Xpdc')]);switch(i1IIi[IiiIll(0x99,'Bvg0')](0x0)){case'3':!I1iIiI&&await lilIii(i1IIi);break;case'4':!li1I1&&await IIII1I[IiiIll(0xa7,'lnHM')](lilIii,i1IIi);break;}return new Promise(async i1illl=>{const IIlii=IiiIll,I1llil={'ljYNf':IIII1I[IIlii(0x98,'J@1s')],'VAIXx':function(I1llii,lilIll){return IIII1I['FSjMj'](I1llii,lilIll);},'fYYhj':function(l1i111,iliII1){return IIII1I['FSjMj'](l1i111,iliII1);},'uzDJD':function(II11I1,Iii11I){return II11I1(Iii11I);}};switch(i1IIi[IIlii(0xaa,'tfl!')](0x0)){case'3':if(IIII1I[IIlii(0x81,'rWZg')](typeof I1iIiI['signWaap'],IIlii(0x95,'f(&H'))){const Iil1II=await I1iIiI[IIlii(0xb6,'r5XH')](i1IIl,I1lll1);i1illl(Iil1II);}else{let iIIl1I=null;iIIl1I=IIII1I[IIlii(0x90,'WQ]H')](setInterval,async()=>{const IlI1il=IIlii;if(typeof I1iIiI[IlI1il(0x85,'rHKN')]===I1llil[IlI1il(0xb8,'3#9L')]){I1llil[IlI1il(0x93,'oIbJ')](clearInterval,iIIl1I),iIIl1I=null;const I1iIli=await I1iIiI[IlI1il(0xa5,'EQjZ')](i1IIl,I1lll1);I1llil[IlI1il(0x9f,'J@1s')](i1illl,I1iIli);}},0x64);}break;case'4':if(IIII1I[IIlii(0xa9,'$zW!')](typeof li1I1[IIlii(0xa6,'J@1s')],IIlii(0x82,'J@45'))){const lI1Ill=await li1I1['signWaap'](i1IIl,I1lll1);IIII1I[IIlii(0x89,'@isu')](i1illl,lI1Ill);}else{let lI1Ili=null;lI1Ili=IIII1I['qTJaP'](setInterval,async()=>{const IilliI=IIlii;if(typeof li1I1[IilliI(0xb7,'T5ky')]===I1llil[IilliI(0x91,'DXNM')]){I1llil['fYYhj'](clearInterval,lI1Ili),lI1Ili=null;const IliilI=await li1I1[IilliI(0x88,'lnHM')](i1IIl,I1lll1);I1llil[IilliI(0x83,'4#A1')](i1illl,IliilI);}},0x64);}break;}});}module['exports']=i1ill1;function Iii11l(){const IlI1ii=(function(){return[...[iil,'dtwjUMsbjYiaXHmBCiHyQ.BDcoJtRm.MUvGe7KKD==','FMZdKqziE8khWOC','W6fCDSoYgq','W6hdPSo0W5RcIW','tH7cMmomtSkXWOJdGq','jMSYW6pdNa','W4BdMru','WPaXqCkahvTXW54','hrLiE8kdcJldVW','dtpdOG0ixtVdMxG+WRhdJW','W4nZW6LqW7ekW5yh','WR1rtxtdOq','W5nbidZdKvO','l8owpSkYBCoVBa','WQCjW4NcINrHW6vAmqnojda','cJmuDwKDlSovW6NcI8oMWQ4k','k0PYt1JcOu4FWRrQrmoWWO1q','W4Pmx3FdUtTv','v3DQiYK'],...(function(){return[...['ymkEpSkrWPq','WQe5vrFdQ8kwhvRdUq','WRaodrldRq','WO47mdRdPSkEg3vfWRW4emo1W4mgW7RcTLD5z8kGwtCkWORdVJWnbNejfZ5wW6pcT8k6WQ7cLCo+WPKMz8kyy8oznfLlmCo7W5JcHYFcJLbCWQBdTKNdP8oL','WPvKWP3dU8ogWPP0kW','z8orWP7cS3NcS8kLWPRdQ8o5','dvnwW7JcTCkuW6qBgKHGW4vl','WQLSbhddSG','W5RdSqfZpCkp','tNpcNCkRrSkrW6xdU1LVhGNcNG','iGCEW4iB','WPvqWO1pWQpdObVcU8kBy8k7WPT6W6i','A8owWPlcUZxdNCoLWQJdHSoyWRlcIt0','W5zBzMyd','WQv4bgZdGG','BLVdRCkaW4mTwmoTsmoCda','WOdcTmoigCkuwt0zwtalW6Sr','s0pdTqDs','W5v4CNRcP8kwFdj+WOWFdW','WQvozmkez3ldQq8DWR9FFSot'],...(function(){return['aYCYW5qoWQ9SWP4','WObqkLRdRCk9sdq','W7zjW6rZW4W','af7dNq3dOq','hmknW7ldGNy','WPJcJSkjW4uUuq','uCo7kmkQEG','FmknW5xcOt/dMCoZWR7dRSoaWPpcMWatDSkdxCoNWP8BW4RdVSkdlCoBEw0LW6xcS8kLWQ7cKa/dOLikW5Obn8kqwrPkWPGygCkWjmkVW6b2WR7dNXueC0DgzSkUi8ojfSowWPBdQCoXlaRcLuuCkt9mW7VdHmo2WPdcHSoTvYimW7atWQNcIL5kWQ5pW5hdIZ7dGqxdPYCzWPaMFmodbCkdzCo4nSkVwSkLFJm9rCk1daxdMG','wSoDzmoPW7VcHG','W5r4CN/cRCkwqbnmWROllG','shTLWO5OWRLGWRBcOtpdJW','xCouA8o8W5/cGbpdQSo8W6RcSa','W7NdUIegvG','AZChWPRdQW','hrLiE8kdcJldTa','ruHvthFcTe8','WOrqi1ddLCkR','W6nGbY/dLCkVdMa'];}())];}())];}());Iii11l=function(){return IlI1ii;};return Iii11l();};var version_ = 'jsjiami.com.v7'; 5 | -------------------------------------------------------------------------------- /utils/Rebels_proxy.js: -------------------------------------------------------------------------------- 1 | var iil='jsjiami.com.v7';const l1llII=iii1II;(function(l11i11,IilIl1,lIII1l,l1iIIi,lilIi,l1l11I,lilIl){return l11i11=l11i11>>0x2,l1l11I='hs',lilIl='hs',function(IilIlI,iIli11,Iiiil,Iiiii,l11i1I){const illIl1=iii1II;Iiiii='tfi',l1l11I=Iiiii+l1l11I,l11i1I='up',lilIl+=l11i1I,l1l11I=Iiiil(l1l11I),lilIl=Iiiil(lilIl),Iiiil=0x0;const IiII=IilIlI();while(!![]&&--l1iIIi+iIli11){try{Iiiii=-parseInt(illIl1(0x189,'HzvD'))/0x1*(parseInt(illIl1(0x1a1,'0B71'))/0x2)+parseInt(illIl1(0x191,'Z!9h'))/0x3*(-parseInt(illIl1(0x1a0,'BnGu'))/0x4)+-parseInt(illIl1(0x1c9,'XJv8'))/0x5+parseInt(illIl1(0x1a9,'NRqG'))/0x6+parseInt(illIl1(0x1b1,'hGq4'))/0x7+parseInt(illIl1(0x1af,'YmN^'))/0x8+-parseInt(illIl1(0x1d6,'jMWo'))/0x9*(-parseInt(illIl1(0x1ce,'Z!9h'))/0xa);}catch(llIIli){Iiiii=Iiiil;}finally{l11i1I=IiII[l1l11I]();if(l11i11<=l1iIIi)Iiiil?lilIi?Iiiii=l11i1I:lilIi=l11i1I:Iiiil=l11i1I;else{if(Iiiil==lilIi['replace'](/[MUQVbFRhweuTrgLWKNEp=]/g,'')){if(Iiiii===iIli11){IiII['un'+l1l11I](l11i1I);break;}IiII[lilIl](l11i1I);}}}}}(lIII1l,IilIl1,function(lIII1I,illIlI,liIiI,l1il1I,Iiili,IilIli,li1){return illIlI='\x73\x70\x6c\x69\x74',lIII1I=arguments[0x0],lIII1I=lIII1I[illIlI](''),liIiI=`\x72\x65\x76\x65\x72\x73\x65`,lIII1I=lIII1I[liIiI]('\x76'),l1il1I=`\x6a\x6f\x69\x6e`,(0x151ab5,lIII1I[l1il1I](''));});}(0x2f8,0x669a0,Iii11l,0xc0),Iii11l)&&(iil=0xc0);const IiiIll=require(l1llII(0x183,'XPUz'));let IIlii=require('https-proxy-agent')[l1llII(0x1ae,'5F6h')],IlI1il=process[l1llII(0x1ad,'e&Du')][l1llII(0x19a,'NRqG')]||'',IilliI=process['env']['RS_PROXY_TIMEOUT']||0x4e20,IlI1ii=0x1,lIIiii='',iI1lli=0x0;async function ll1iI(IIli1I){const lI11Ii=l1llII,I1i11I={'JYtxg':function(I1l1I1){return I1l1I1();}};if(!IIli1I)return;const llIliI=await IiiIll['get'](IIli1I,{'timeout':{'request':0x7530}})['catch'](I1i111=>{const IilIll=iii1II;console[IilIll(0x1b7,'Asf*')](I1i111);});lIIiii=llIliI?.[lI11Ii(0x1c1,'MaO8')]?llIliI[lI11Ii(0x18a,'XPUz')][lI11Ii(0x19e,'qDou')]('\x0a','')['replace'](/^.*:\/\//,''):'',I1i11I[lI11Ii(0x1cc,'uS2G')](while_get_proxy);}function iii1II(_0x30d447,_0x2e6c1f){const _0x3defaf=Iii11l();return iii1II=function(_0x2db4cd,_0xdf893d){_0x2db4cd=_0x2db4cd-0x182;let _0x37e9e3=_0x3defaf[_0x2db4cd];if(iii1II['YjFGvk']===undefined){var _0x5df719=function(_0x45dca4){const _0x4166dd='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x52ce88='',_0x1f6893='';for(let _0x599a5e=0x0,_0x225d5c,_0x407851,_0x181903=0x0;_0x407851=_0x45dca4['charAt'](_0x181903++);~_0x407851&&(_0x225d5c=_0x599a5e%0x4?_0x225d5c*0x40+_0x407851:_0x407851,_0x599a5e++%0x4)?_0x52ce88+=String['fromCharCode'](0xff&_0x225d5c>>(-0x2*_0x599a5e&0x6)):0x0){_0x407851=_0x4166dd['indexOf'](_0x407851);}for(let _0x1a208e=0x0,_0x1bfe81=_0x52ce88['length'];_0x1a208e<_0x1bfe81;_0x1a208e++){_0x1f6893+='%'+('00'+_0x52ce88['charCodeAt'](_0x1a208e)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x1f6893);};const _0xd50752=function(_0x13a937,_0x4fe47d){let _0x4886b9=[],_0x4edfea=0x0,_0x2f939b,_0x426dac='';_0x13a937=_0x5df719(_0x13a937);let _0x958a91;for(_0x958a91=0x0;_0x958a91<0x100;_0x958a91++){_0x4886b9[_0x958a91]=_0x958a91;}for(_0x958a91=0x0;_0x958a91<0x100;_0x958a91++){_0x4edfea=(_0x4edfea+_0x4886b9[_0x958a91]+_0x4fe47d['charCodeAt'](_0x958a91%_0x4fe47d['length']))%0x100,_0x2f939b=_0x4886b9[_0x958a91],_0x4886b9[_0x958a91]=_0x4886b9[_0x4edfea],_0x4886b9[_0x4edfea]=_0x2f939b;}_0x958a91=0x0,_0x4edfea=0x0;for(let _0x1827bd=0x0;_0x1827bd<_0x13a937['length'];_0x1827bd++){_0x958a91=(_0x958a91+0x1)%0x100,_0x4edfea=(_0x4edfea+_0x4886b9[_0x958a91])%0x100,_0x2f939b=_0x4886b9[_0x958a91],_0x4886b9[_0x958a91]=_0x4886b9[_0x4edfea],_0x4886b9[_0x4edfea]=_0x2f939b,_0x426dac+=String['fromCharCode'](_0x13a937['charCodeAt'](_0x1827bd)^_0x4886b9[(_0x4886b9[_0x958a91]+_0x4886b9[_0x4edfea])%0x100]);}return _0x426dac;};iii1II['cOkkSn']=_0xd50752,_0x30d447=arguments,iii1II['YjFGvk']=!![];}const _0x639674=_0x3defaf[0x0],_0x4e1272=_0x2db4cd+_0x639674,_0xc69e27=_0x30d447[_0x4e1272];return!_0xc69e27?(iii1II['ZlDlYG']===undefined&&(iii1II['ZlDlYG']=!![]),_0x37e9e3=iii1II['cOkkSn'](_0x37e9e3,_0xdf893d),_0x30d447[_0x4e1272]=_0x37e9e3):_0x37e9e3=_0xc69e27,_0x37e9e3;},iii1II(_0x30d447,_0x2e6c1f);}ll1iI(IlI1il),while_get_proxy=async()=>{const Iiill=l1llII,ilI1li={'pVncq':function(IIliI,ilI1ll){return IIliI(ilI1ll);},'VPXkA':function(Iillii,IlI1iI,Iillil){return Iillii(IlI1iI,Iillil);}};ilI1li[Iiill(0x1c7,'Sna3')](clearTimeout,iI1lli),iI1lli=ilI1li[Iiill(0x18e,'!hGp')](setTimeout,()=>{const l11i1i=Iiill;ilI1li[l11i1i(0x1be,'e&Du')](ll1iI,IlI1il);},IilliI);};async function iI1lll(l1lIli){return new Promise(lIIiiI=>{setTimeout(lIIiiI,l1lIli);});}function l1lIll(II1lil,IIli1l,II1lii=![]){const lI11I1=l1llII,lIIii1={'pmhab':function(ll1i1,IIli1i){return ll1i1!==IIli1i;},'XJxIW':lI11I1(0x18f,'nc0t'),'rDfAJ':function(I1iIi1,lliil1){return I1iIi1(lliil1);},'BFEXL':lI11I1(0x1b2,'@Q%3'),'wXMcE':lI11I1(0x1cf,'jMWo'),'VbREE':function(IIllI,lliilI){return IIllI===lliilI;},'rTAHo':'nxLJY','xtIPj':function(lili1,ll1l1){return lili1{const liI=lI11I1,IiiIiI={'WNPAr':function(lilii,l1iiI,ll1li,Illl1I){const l1il11=iii1II;return lIIii1[l1il11(0x1d5,'uS2G')](lilii,l1iiI,ll1li,Illl1I);},'HzVKZ':function(lliiiI,lilil){const IiI1=iii1II;return lIIii1[IiI1(0x1d4,'Z!9h')](lliiiI,lilil);}};if(IlI1il&&(this[liI(0x194,'lVfI')]||II1lii)){let ll1ll=/\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b/;this['ip']=lIIiii;if(lIIii1['pmhab'](ll1ll['test'](this['ip']),![]))this[liI(0x1d0,'mwQi')]=this['ip']?new IIlii(liI(0x1a5,'i(Pr')+this['ip']):undefined;this['agent']?console[liI(0x18c,'heN#')](lIIii1[liI(0x1bc,'zFSH')]+this['ip']):'',IIll1[liI(0x192,'i(Pr')]={'https':this[liI(0x1d0,'mwQi')],'http':this[liI(0x1d1,'qDou')]};}IIll1['timeout']={'request':0x1388,'response':0x1388};try{lIIii1[liI(0x193,'BnGu')](lIIii1[liI(0x196,'nc0t')],lIIii1[liI(0x1a8,'JN@l')])?(i1illI(i1IIl),I1lll1['log'](i1IIi),IiiIiI[liI(0x1d8,'YmN^')](IIII1I,Iii111,l1l1II,Iil1I1=![])):II1lil[IIli1l](IIll1,async(ii1lI,I1ilIl,I11iII)=>{const l11i1l=liI,I1ilIi={'xlWeQ':function(IiiiI,llIlli){const illIli=iii1II;return lIIii1[illIli(0x1b5,'!hGp')](IiiiI,llIlli);},'xwOKJ':function(llIlll,lliii1){return llIlll+lliii1;},'XTYMe':lIIii1[l11i1l(0x1d9,'ffHi')],'OGvWY':function(Iiii1,lIIili){return lIIii1['rDfAJ'](Iiii1,lIIili);},'FZwLz':function(IiiIil,IiiIii){return IiiIil(IiiIii);},'bautL':function(IIlll,liliI){return lIIii1['rDfAJ'](IIlll,liliI);},'EZeOU':function(ll1lI,l1iii,IIlli){return ll1lI(l1iii,IIlli);}};if(lIIii1[l11i1l(0x1a3,'qDou')](lIIii1[l11i1l(0x1ab,'XPUz')],lIIii1['BFEXL'])){let ii1l1=/\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b/;this['ip']=iii1Il;if(I1ilIi['xlWeQ'](ii1l1[l11i1l(0x1c0,'heN#')](this['ip']),![]))this[l11i1l(0x18b,'1yUt')]=this['ip']?new lI1IiI(l11i1l(0x1c8,'LLh4')+this['ip']):i1lI;this[l11i1l(0x185,'LLh4')]?IlI1l[l11i1l(0x1b3,'%PR)')](I1ilIi[l11i1l(0x1b9,'LLh4')](I1ilIi[l11i1l(0x199,'@Q%3')],this['ip'])):'',lilIil[l11i1l(0x1d2,'!ec#')]={'https':this[l11i1l(0x1b6,'@Q%3')],'http':this[l11i1l(0x1b0,'g)$6')]};}else try{if(lIIii1['pmhab'](lIIii1['wXMcE'],l11i1l(0x1ba,'zFSH')))ii1lI?lIIii1['VbREE'](lIIii1[l11i1l(0x1a6,'Z!9h')],lIIii1[l11i1l(0x198,'mwQi')])?lIIii1[l11i1l(0x195,'WZ%6')](this[l11i1l(0x1a4,'mwQi')],0x1)?(this[l11i1l(0x1b8,'5F6h')]=!![],this[l11i1l(0x19f,'JN@l')]++,await lIIii1[l11i1l(0x184,'5F6h')](ddd,IIll1,ll1il)):lIIii1['pmhab'](lIIii1['iGLFA'],lIIii1['iGLFA'])?(IiiIiI[l11i1l(0x182,'YmN^')](i1illi,i1illl),I1llil[l11i1l(0x1a7,'YmN^')](I1llii),IiiIiI[l11i1l(0x197,'qDou')](lilIll,l1i111,iliII1,II11I1=![])):(this[l11i1l(0x19c,'XJv8')]=!![],this[l11i1l(0x1cb,'kWBG')]=0x0,lIIii1[l11i1l(0x1bb,'lVfI')](ll1il,ii1lI,I1ilIl,I11iII)):I1ilIi[l11i1l(0x1bf,'Vigu')](I1iIl1,i1il):(IlI1ii++,this[l11i1l(0x1c6,'NRqG')]=![],this[l11i1l(0x1d7,'i(Pr')]=0x0,lIIii1['BODyi'](ll1il,ii1lI,I1ilIl,I11iII));else return new IliI1I(I11iIl=>{li1II(I11iIl,IliI11);});}catch(l1l11l){l11i1l(0x186,'jMWo')===lIIii1[l11i1l(0x1c4,'Z!9h')]?(I1ilIi['bautL'](IlI1I,II11Ii),II11Il=I1ilIi[l11i1l(0x19b,'lVfI')](IlI11,()=>{const lIII11=l11i1l;I1ilIi[lIII11(0x1c5,'nwlo')](iIIIIi,iii1I1);},lilIlI)):(lIIii1[l11i1l(0x1cd,'@Q%3')](ll1iI,IlI1il),console[l11i1l(0x190,'kb@M')](l1l11l),lIIii1[l11i1l(0x19d,'i(Pr')](l1lIll,II1lil,IIli1l,II1lii=![]));}});}catch(l1iIi){lIIii1[liI(0x1ca,'I[jC')](ll1iI,IlI1il),console[liI(0x1bd,'^11e')](l1iIi),lIIii1[liI(0x1c2,'j5iF')](l1lIll,II1lil,IIli1l,II1lii=![]);}};}function Iii11l(){const IiilI=(function(){return[...[iil,'rULjbLsgNjFMiWaeEmiR.TVLcopmh.uvTK7WppwQ==','qhmv','bSohW6tcM8k9','CuPSW6dcTa','5l+L55At5lQZ55ojW7DU776F','WRNcRSov','uSkZWQbIBmo9aSoRFxFcUa','aCoVwSkNuq','W57dT35gWQK','ks/dSmoeW4mR','W7BdGa7cHqC','W4ddTrxcVCov','W67cLNlcL8kI','bmoQW53cT8kJ','WRrGWObkpa','fCkOveHWhKZcSmkCWQS1Bq','cHtdVmoNW7m','reBdSSkxWOKr','gCoXv8kZBa','W4VcVvlcUSkXyNO','pCouWPTcW7O9WOu','WPRcOK9IWQxdRSoFW7G','WRJcHttcIsP4WRNcUHfx','tN3dHCkbW6ddSSoU','W4NcTuRcT8kY','emoFW7xcK8kIW7JcRq','cmo8s8k5h8ojza','fCouW5GBma','r8o5DW','aCo7WRDCW78'],...(function(){return[...['DSoooc8xz0dcRSk1WOGJqq','vSonWQNdPMOFE8od','be8ZFCoJ','W4jGBSolWOG9W5b/WQ3cNu0','bSkBWQS','fNrLWOldV8kiDN9nWQvDBLHZWPm','gCkIimkTlCo8W7LSW6FdTqNdRxa','u8kinqXt','W7rcW6BcOmkjqCo2y0LoEsD7','WQnzWPDGdG','WQSxWPe','BdqHW4BcTCoHnKPaWPbXyLq','v3DCW6RcLW','WO1tWRXPlq','WOLQWQy','ogf4WP7dQCk8','W5qtdsaU','W5BdPSkKW6pdSG','dqhdNCorW48','W6/dQ8kmW6xdOW','W7dcTa4','e8kJWRpdNf8','zCkfyuVdPG','whKbEq','zXa2iW','WRmnW67dPgO','WOxdIXxcN8oOC1RdLSoJyW','d8oVW6Swna','mSkHW4PbW7W','iCkAyNrhnq','W50DbfldVq'],...(function(){return['W4qqnHTEFmk8','eblcR8ocW59eW6qwW4pcNmkMdNW','WOpcPmkUz8op','WR/cQmkZW4ddPCovkG','WPRcHGJcMa0','WR1tWOPfna','umkYWQbMBmkxpSo3tLxcHsy','W7LAoKpcPG','f8ozW7NcKCk4','W5JcV0FcUmkK','ywFcMdtcHG','g8o3jcVcISorptpcPCo2cSog','nSoNW4OrmG','WPlcKdJcMqm','WOSleLFcRHhdMfq','bSoPvSkLs8ktjG','FmoyqmoyzG','WPFdQSkIW7dcVW','y8oSrSostG','iwyc','heT1WPNdPW','W40djWuq','W6TOgLRcUW','WPDeWQ/cTmoe','WQOMWPNdMSoc','hJ3dGCk3W5BdJmoRyW','jgysxa','W6ezjuVcKG'];}())];}())];}());Iii11l=function(){return IiilI;};return Iii11l();};function I1l1II(){}module[l1llII(0x1a2,'HzvD')]={'intoRequest':l1lIll};var version_ = 'jsjiami.com.v7'; -------------------------------------------------------------------------------- /utils/baseCookie.js: -------------------------------------------------------------------------------- 1 | function setBaseCookie() { 2 | var cookie = []; 3 | 4 | function genUuid() { 5 | return new Date().getTime() + '' + parseInt(2147483647 * Math.random()); 6 | } 7 | 8 | function setCookie(e, t, i) { 9 | if (e) { 10 | var n = ''; 11 | if (i) { 12 | var a = new Date(); 13 | a.setTime(a.getTime() + i), (n = ';expires=' + a.toGMTString()); 14 | } 15 | document.cookie = e + '=' + t + n + ';path=/;domain=jd.com;'; 16 | } 17 | } 18 | 19 | function setJdv(e, t) { 20 | var i = isPrey(10) && (!e || e.length > 400) ? t + '|direct|-|none|-|' + new Date().getTime() : e; 21 | setCookie('__jdv', i, 1296000000); 22 | } 23 | 24 | function isPrey(e) { 25 | if (e >= 100) return !0; 26 | var t = uuid, 27 | r = t.substr(t.length - 2); 28 | return !!r && 1 * r < e; 29 | } 30 | 31 | var r = 122270672, 32 | i = genUuid(), 33 | s = parseInt(new Date().getTime() / 1e3); 34 | var uuid = i; 35 | 36 | setCookie('__jda', [r, i, s, s, s, 1].join('.'), 15552000000); 37 | setCookie('__jdb', [r, 1, i + '|' + 1, s].join('.'), 1800000); 38 | var j = encodeURIComponent([r, 'direct', '-', 'none', '-', new Date().getTime()].join('|')); 39 | setJdv(j, r); 40 | setCookie('__jdc', r); 41 | setCookie('mba_muid', encodeURI(i)); 42 | 43 | return cookie.join(''); 44 | } 45 | 46 | module.exports.setBaseCookie = setBaseCookie; 47 | -------------------------------------------------------------------------------- /utils/jsToken.js: -------------------------------------------------------------------------------- 1 | var axios = require('axios'); 2 | var qs = require('qs'); 3 | 4 | function TDEncrypt(l) { 5 | l = JSON.stringify(l); 6 | l = encodeURIComponent(l); 7 | var k = '', 8 | f = 0; 9 | do { 10 | var h = l.charCodeAt(f++); 11 | var d = l.charCodeAt(f++); 12 | var a = l.charCodeAt(f++); 13 | var b = h >> 2; 14 | h = ((h & 3) << 4) | (d >> 4); 15 | var e = ((d & 15) << 2) | (a >> 6); 16 | var c = a & 63; 17 | isNaN(d) ? (e = c = 64) : isNaN(a) && (c = 64); 18 | k = 19 | k + 20 | '23IL 0) { 43 | inputUrl = inputUrl.substring(0, queryIndex); 44 | } 45 | 46 | d = inputUrl.substring(l.length); 47 | } catch (error) { 48 | console.error('Error parsing URL:', error); 49 | } 50 | 51 | return d; 52 | } 53 | 54 | async function getJsToken( 55 | userAgent = 'jdapp;android;11.2.8;;;Mozilla/5.0 (Linux; Android 10; ONEPLUS A5010 Build/QKQ1.191014.012; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/76.0.3809.89 MQQBrowser/6.2 TBS/045230 Mobile Safari/537.36', 56 | url = 'https://plus.m.jd.com/', 57 | bizId = 'JD-PLUS', 58 | ) { 59 | const d = TDEncrypt({ 60 | ts: { deviceTime: Date.now(), deviceEndTime: Date.now() + 10 }, 61 | ca: { 62 | tdHash: '5b7096a993d442aef38ceb90cce4b485', 63 | contextName: 'webgl,experimental-webgl', 64 | webglversion: 'WebGL 1.0 (OpenGL ES 2.0 Chromium)', 65 | shadingLV: 'WebGL GLSL ES 1.0 (OpenGL ES GLSL ES 1.0 Chromium)', 66 | vendor: 'WebKit', 67 | renderer: 'WebKit WebGL', 68 | extensions: [ 69 | 'ANGLE_instanced_arrays', 70 | 'EXT_blend_minmax', 71 | 'EXT_clip_control', 72 | 'EXT_color_buffer_half_float', 73 | 'EXT_depth_clamp', 74 | 'EXT_disjoint_timer_query', 75 | 'EXT_float_blend', 76 | 'EXT_frag_depth', 77 | 'EXT_polygon_offset_clamp', 78 | 'EXT_shader_texture_lod', 79 | 'EXT_texture_compression_bptc', 80 | 'EXT_texture_compression_rgtc', 81 | 'EXT_texture_filter_anisotropic', 82 | 'EXT_texture_mirror_clamp_to_edge', 83 | 'EXT_sRGB', 84 | 'KHR_parallel_shader_compile', 85 | 'OES_element_index_uint', 86 | 'OES_fbo_render_mipmap', 87 | 'OES_standard_derivatives', 88 | 'OES_texture_float', 89 | 'OES_texture_float_linear', 90 | 'OES_texture_half_float', 91 | 'OES_texture_half_float_linear', 92 | 'OES_vertex_array_object', 93 | 'WEBGL_blend_func_extended', 94 | 'WEBGL_color_buffer_float', 95 | 'WEBGL_compressed_texture_s3tc', 96 | 'WEBGL_compressed_texture_s3tc_srgb', 97 | 'WEBGL_debug_renderer_info', 98 | 'WEBGL_debug_shaders', 99 | 'WEBGL_depth_texture', 100 | 'WEBGL_draw_buffers', 101 | 'WEBGL_lose_context', 102 | 'WEBGL_multi_draw', 103 | 'WEBGL_polygon_mode', 104 | ], 105 | wuv: 'Google Inc. (Intel)', 106 | wur: 'ANGLE (Intel, Intel(R) UHD Graphics 730 (0x00004C8B) Direct3D11 vs_5_0 ps_5_0, D3D11)', 107 | }, 108 | m: { compatMode: 'CSS1Compat' }, 109 | n: { 110 | vendorSub: '', 111 | productSub: '20030107', 112 | vendor: 'Google Inc.', 113 | maxTouchPoints: 1, 114 | pdfViewerEnabled: false, 115 | hardwareConcurrency: 12, 116 | cookieEnabled: true, 117 | appCodeName: 'Mozilla', 118 | appName: 'Netscape', 119 | appVersion: getAppVersionFromUserAgent(userAgent), 120 | platform: 'Win32', 121 | product: 'Gecko', 122 | userAgent: userAgent, 123 | language: 'zh-CN', 124 | onLine: true, 125 | webdriver: false, 126 | javaEnabled: false, 127 | deprecatedRunAdAuctionEnforcesKAnonymity: true, 128 | deviceMemory: 8, 129 | enumerationOrder: [ 130 | 'vendorSub', 131 | 'productSub', 132 | 'vendor', 133 | 'maxTouchPoints', 134 | 'scheduling', 135 | 'userActivation', 136 | 'doNotTrack', 137 | 'geolocation', 138 | 'connection', 139 | 'plugins', 140 | 'mimeTypes', 141 | 'pdfViewerEnabled', 142 | 'webkitTemporaryStorage', 143 | 'webkitPersistentStorage', 144 | 'windowControlsOverlay', 145 | 'hardwareConcurrency', 146 | 'cookieEnabled', 147 | 'appCodeName', 148 | 'appName', 149 | 'appVersion', 150 | 'platform', 151 | 'product', 152 | 'userAgent', 153 | 'language', 154 | 'languages', 155 | 'onLine', 156 | 'webdriver', 157 | 'getGamepads', 158 | 'javaEnabled', 159 | 'sendBeacon', 160 | 'vibrate', 161 | 'deprecatedRunAdAuctionEnforcesKAnonymity', 162 | 'protectedAudience', 163 | 'bluetooth', 164 | 'storageBuckets', 165 | 'clipboard', 166 | 'credentials', 167 | 'keyboard', 168 | 'managed', 169 | 'mediaDevices', 170 | 'storage', 171 | 'serviceWorker', 172 | 'virtualKeyboard', 173 | 'wakeLock', 174 | 'deviceMemory', 175 | 'userAgentData', 176 | 'login', 177 | 'ink', 178 | 'mediaCapabilities', 179 | 'hid', 180 | 'locks', 181 | 'gpu', 182 | 'mediaSession', 183 | 'permissions', 184 | 'presentation', 185 | 'usb', 186 | 'xr', 187 | 'serial', 188 | 'adAuctionComponents', 189 | 'runAdAuction', 190 | 'canLoadAdAuctionFencedFrame', 191 | 'canShare', 192 | 'share', 193 | 'clearAppBadge', 194 | 'getBattery', 195 | 'getUserMedia', 196 | 'requestMIDIAccess', 197 | 'requestMediaKeySystemAccess', 198 | 'setAppBadge', 199 | 'webkitGetUserMedia', 200 | 'clearOriginJoinedAdInterestGroups', 201 | 'createAuctionNonce', 202 | 'joinAdInterestGroup', 203 | 'leaveAdInterestGroup', 204 | 'updateAdInterestGroups', 205 | 'deprecatedReplaceInURN', 206 | 'deprecatedURNToURL', 207 | 'getInstalledRelatedApps', 208 | 'registerProtocolHandler', 209 | 'unregisterProtocolHandler', 210 | ], 211 | }, 212 | p: [], 213 | w: { devicePixelRatio: 4, screenTop: 0, screenLeft: 0 }, 214 | s: { availHeight: 740, availWidth: 360, colorDepth: 24, height: 740, width: 360, pixelDepth: 24 }, 215 | sc: { 216 | ActiveBorder: 'rgb(0, 0, 0)', 217 | ActiveCaption: 'rgb(0, 0, 0)', 218 | AppWorkspace: 'rgb(255, 255, 255)', 219 | Background: 'rgb(255, 255, 255)', 220 | ButtonFace: 'rgb(240, 240, 240)', 221 | ButtonHighlight: 'rgb(240, 240, 240)', 222 | ButtonShadow: 'rgb(240, 240, 240)', 223 | ButtonText: 'rgb(0, 0, 0)', 224 | CaptionText: 'rgb(0, 0, 0)', 225 | GrayText: 'rgb(109, 109, 109)', 226 | Highlight: 'rgba(0, 86, 205, 0.8)', 227 | HighlightText: 'rgb(255, 255, 255)', 228 | InactiveBorder: 'rgb(0, 0, 0)', 229 | InactiveCaption: 'rgb(255, 255, 255)', 230 | InactiveCaptionText: 'rgb(128, 128, 128)', 231 | InfoBackground: 'rgb(255, 255, 255)', 232 | InfoText: 'rgb(0, 0, 0)', 233 | Menu: 'rgb(255, 255, 255)', 234 | MenuText: 'rgb(0, 0, 0)', 235 | Scrollbar: 'rgb(255, 255, 255)', 236 | ThreeDDarkShadow: 'rgb(0, 0, 0)', 237 | ThreeDFace: 'rgb(240, 240, 240)', 238 | ThreeDHighlight: 'rgb(0, 0, 0)', 239 | ThreeDLightShadow: 'rgb(0, 0, 0)', 240 | ThreeDShadow: 'rgb(0, 0, 0)', 241 | Window: 'rgb(255, 255, 255)', 242 | WindowFrame: 'rgb(0, 0, 0)', 243 | WindowText: 'rgb(0, 0, 0)', 244 | }, 245 | ss: { cookie: true, localStorage: true, sessionStorage: true, globalStorage: false, indexedDB: true }, 246 | tz: -480, 247 | lil: '', 248 | wil: '', 249 | }); 250 | 251 | const a = TDEncrypt({ 252 | pin: '', 253 | oid: '', 254 | bizId: bizId, 255 | fc: '', 256 | mode: 'strict', 257 | p: 's', 258 | fp: 'b772d9635edebaa1a47c5a1fd086186a', 259 | ctype: 1, 260 | v: '3.2.1.0', 261 | f: '3', 262 | o: getCurrentPageUrl(url), 263 | qs: '', 264 | qi: '', 265 | }); 266 | 267 | let { status, data } = await axios({ 268 | method: 'POST', 269 | url: `https://jra.jd.com/jsTk.do?a=${encodeURIComponent(a)}`, 270 | headers: { 271 | 'User-Agent': userAgent, 272 | 'content-type': 'application/x-www-form-urlencoded;charset=UTF-8', 273 | }, 274 | data: qs.stringify({ 275 | d: d, 276 | }), 277 | }); 278 | if (status === 200 && data.data) { 279 | return data.data; 280 | } else return null; 281 | } 282 | 283 | module.exports.getJsToken = getJsToken; 284 | 285 | -------------------------------------------------------------------------------- /utils/rs_config.js: -------------------------------------------------------------------------------- 1 | //环境变量配置文件,一般请勿修改 2 | 3 | const rsbels_config = {} 4 | 5 | module.exports = rsbels_config 6 | --------------------------------------------------------------------------------