├── CK_WxPusherUid.json ├── JDJRSignValidator.js ├── JDJRValidator_Pure.js ├── JDSignValidator.js ├── JD_DailyBonus.js ├── JD_extra_cookie.js ├── JS_USER_AGENTS.js ├── TS_JDHelloWorld.d.ts ├── TS_JDHelloWorld.js ├── TS_USER_AGENTS.ts ├── USER_AGENTS.js ├── ZooFaker_Necklace.js ├── backUp ├── AlipayManor.js ├── GetJdCookie.md ├── GetJdCookie2.md ├── TG_PUSH.md ├── ZooFaker_Necklace.js ├── getJDCookie.js ├── gitSync.md ├── gua_1111RedEnvelope.js ├── gua_MMdou.js ├── gua_RedEnvelope.js ├── gua_UnknownTask1.js ├── gua_UnknownTask3.js ├── gua_UnknownTask4.js ├── gua_UnknownTask5.js ├── gua_carnivalcity.js ├── gua_cleancart.js ├── gua_ddgame.js ├── gua_doge.js ├── gua_olympic_opencard.js ├── gua_opencard9.js ├── gua_wealth_island.js ├── gua_xiaolong.js ├── iCloud.md ├── iOS_Weather_AQI_Standard.js ├── jd_15.py ├── jd_HongBao.js ├── jd_OpenCard.py ├── jd_aid_ftzy.js ├── jd_all_bean_change.js ├── jd_angryBean.js ├── jd_angryCash.js ├── jd_angryKoi.js ├── jd_anjia.js ├── jd_appliances.js ├── jd_bean_change.js ├── jd_bean_change_xh.js ├── jd_beauty_twelfth.js ├── jd_big_winner.js ├── jd_big_winner_Mod.js ├── jd_blueCoin.py ├── jd_bs.py ├── jd_car.js ├── jd_car_exchange_xh.js ├── jd_carnivalcity.js ├── jd_carnivalcity_help.js ├── jd_cart_remove.js ├── jd_cashHelp.py ├── jd_cfd.js ├── jd_cfd_fresh_exchange.js ├── jd_cfd_loop.js ├── jd_cfd_mooncake.js ├── jd_cfdtx.js ├── jd_cleancart.js ├── jd_ddwj.js ├── jd_decompression.js ├── jd_delete.py ├── jd_deletenotify.py ├── jd_djyyj.js ├── jd_dpqd.js ├── jd_dyj_help.js ├── jd_esManager.js ├── jd_fan.js ├── jd_fansa.js ├── jd_fc.js ├── jd_fcdyj.js ├── jd_fcffl.js ├── jd_film_museum.js ├── jd_flpa.js ├── jd_foodRunning.js ├── jd_goddess.js ├── jd_golden_machine.js ├── jd_gq.js ├── jd_hyj.js ├── jd_hyj_help.py ├── jd_industrial_task.js ├── jd_industryLottery.js ├── jd_iqoo_run.js ├── jd_jinggengjcq_dapainew.js ├── jd_jinggengjcq_dapainew3.js ├── jd_jinggengjcq_dapainew4.js ├── jd_jinggengjcq_yingle.js ├── jd_joy_new.js ├── jd_joy_reward_Mod.js ├── jd_joy_score.js ├── jd_jx_sign.js ├── jd_jxgc.js ├── jd_jxgc_tuan.py ├── jd_jxlhb.js ├── jd_jxnc.js ├── jd_kanjia.js ├── jd_kanjia2.js ├── jd_kanjia3.js ├── jd_kxcdz.js ├── jd_kyd.js ├── jd_ldhwj.js ├── jd_live_redrain.js ├── jd_lol.js ├── jd_lotteryMachine.js ├── jd_lsj.js ├── jd_lzdz1_bw.js ├── jd_lzdz1_dapai.js ├── jd_lzdz1_go2.js ├── jd_lzdz1_go3.js ├── jd_lzdz1_huiju.js ├── jd_lzdz1_huiju11.js ├── jd_lzdz1_huiju2.js ├── jd_lzdz1_women.js ├── jd_lzdz2_fashion.js ├── jd_lzdz2_fashion1.js ├── jd_mb.js ├── jd_mid.js ├── jd_mid2.js ├── jd_mofang.js ├── jd_necklace.js ├── jd_necklace_new.js ├── jd_olympicgames.js ├── jd_opencard2.js ├── jd_opencard_Daddy.js ├── jd_opencard_all_people_FYF_enc.js ├── jd_ppdz.js ├── jd_price.js ├── jd_priceProtect_Mod.js ├── jd_productZ4Brand.js ├── jd_qcshj.js ├── jd_qixi.js ├── jd_qjd.py ├── jd_qqxing.js ├── jd_red.js ├── jd_redPacket.js ├── jd_redPacket_help.js ├── jd_ryhxj.js ├── jd_small_home.js ├── jd_speed_signfaker.js ├── jd_star_shop.js ├── jd_summer_movement.js ├── jd_summer_movement_bet.js ├── jd_summer_movement_card.js ├── jd_summer_movement_help.js ├── jd_summer_movement_map.js ├── jd_superBrand.js ├── jd_superMarket_xh.js ├── jd_super_redrain.js ├── jd_try.js ├── jd_twlove.js ├── jd_vivo.js ├── jd_vivo_add.js ├── jd_wxFans.js ├── jd_xiaomi.js ├── jd_xtg.js ├── jd_young.js ├── jd_yqyl.js ├── jd_zjd.py ├── jd_zy_ddwj_help.js ├── jddj_fruit.js ├── tencentscf.md ├── webhook.js └── xmSports.js ├── cleancart_activity.js ├── depend.py ├── docker ├── Dockerfile ├── Readme.md ├── auto_help.sh ├── bot │ ├── jd.png │ ├── jd_bot │ ├── requirements.txt │ └── setup.py ├── crontab_list.sh ├── default_task.sh ├── docker_entrypoint.sh ├── example │ ├── custom-append.yml │ ├── custom-overwrite.yml │ ├── default.yml │ ├── docker多账户使用独立容器使用说明.md │ ├── jd_scripts.custom-append.syno.json │ ├── jd_scripts.custom-overwrite.syno.json │ ├── jd_scripts.syno.json │ └── multi.yml ├── notify_docker_user.js └── proc_file.sh ├── function ├── TS_USER_AGENTS.ts ├── common.js ├── config.js ├── eval.js ├── h5st.ts ├── jdCookie.js ├── jdValidate.js ├── jdcookie.js ├── jinli_log.ts ├── jxAlgo.js ├── ql.js ├── sendNotify.js └── zjdtool.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 ├── index.js ├── jdCookie.js ├── jdCookie.py ├── jdDreamFactoryShareCodes.js ├── jdEnv.py ├── jdFactoryShareCodes.js ├── jdFruitShareCodes.js ├── jdJxncShareCodes.js ├── jdMsLogs.js ├── jdPetShareCodes.js ├── jdPlantBeanShareCodes.js ├── jd_1464.js ├── jd_58.js ├── jd_AJYX.js ├── jd_CheckCK.js ├── jd_CkSeq.js ├── jd_DailyBonus_Mod.js ├── jd_EsportsManager.js ├── jd_OpenCard_Force.js ├── jd_TreasureRank.js ├── jd_UpdateUIDtoRemark.js ├── jd_YSLD.js ├── jd_bean_change.js ├── jd_bean_change_pro.js ├── jd_bean_home.js ├── jd_bean_info.js ├── jd_bean_sign.js ├── jd_beans_7days.py ├── jd_beauty.js ├── jd_beauty_ex.js ├── jd_beauty_plant.py ├── jd_big_winner_Mod.js ├── jd_bigwinner.py ├── jd_blackHome.js ├── jd_blueCoin.js ├── jd_btdraw.py ├── jd_btfree.py ├── jd_captian.js ├── jd_car.js ├── jd_car_play.js ├── jd_car_play_exchange.js ├── jd_card.js ├── jd_card_force.js ├── jd_cash.js ├── jd_cash_freesoul.js ├── jd_cash_nolan.js ├── jd_cash_wx.js ├── jd_categoryUnion.js ├── jd_categoryUnion_draw.js ├── jd_ccSign.js ├── jd_cfd.js ├── jd_cfd_loop.js ├── jd_check_dependent.py ├── jd_cjdaily.js ├── jd_cjhy_completeInfoActivity.js ├── jd_cjhy_daily.js ├── jd_cjhy_sevenDay.js ├── jd_cjhy_signActivity.js ├── jd_cjhy_wxCollectionActivity.js ├── jd_cjhy_wxDrawActivity.js ├── jd_cjhy_wxGameActivity.js ├── jd_cjhy_wxKnowledgeActivity.js ├── jd_cjhy_wxMcLevelAndBirthGifts.js ├── jd_cjhy_wxShopFollowActivity.js ├── jd_cjhy_wxShopGift.js ├── jd_cjhz.js ├── jd_cjzdgf.js ├── jd_cleancart.js ├── jd_cleancart_nolan.js ├── jd_club_lottery.js ├── jd_comment.js ├── jd_comment_wzb.js ├── jd_completeInfoActivity.js ├── jd_computer.js ├── jd_connoisseur.js ├── jd_couponspace.js ├── jd_cxxb_award.js ├── jd_dadoudou.js ├── jd_daily.js ├── jd_dd_follow_cc.js ├── jd_ddly.js ├── jd_ddnc_farmpark.js ├── jd_delCoupon.js ├── jd_desire.js ├── jd_disable.py ├── jd_disable_force.py ├── jd_doTreasureRank.py ├── jd_dpcj.py ├── jd_dpqd.js ├── jd_dpqd_dsb.js ├── jd_drawCenter.js ├── jd_dreamFactory.js ├── jd_dreamFactory_help.js ├── jd_dreamFactory_tuan.js ├── jd_dwapp.js ├── jd_dyson.js ├── jd_dyson_s.js ├── jd_exchange.js ├── jd_fan.js ├── jd_fans.js ├── jd_fans_fansactiveall.js ├── jd_fanshb.js ├── jd_farautomation.js ├── jd_farm_automation.js ├── jd_fc_winner.js ├── jd_fcwb.py ├── jd_fcwb_mfhelp.js ├── jd_fcwb_nolan.js ├── jd_follow.js ├── jd_follow_shop.js ├── jd_fruit.js ├── jd_fruit_friend.js ├── jd_fruit_help.js ├── jd_fruit_task.js ├── jd_fruit_watering.js ├── jd_fuck_sentry.py ├── jd_gehugame.js ├── jd_get_share_code.js ├── jd_gjlh.js ├── jd_gold_creation.js ├── jd_gold_creator.js ├── jd_gold_sign.js ├── jd_goodMorning.js ├── jd_gwxj_v.js ├── jd_half_redrain.js ├── jd_harmony_auto.js ├── jd_health.js ├── jd_health_collect.js ├── jd_health_help.js ├── jd_health_plant.py ├── jd_hlred.js ├── jd_identical.py ├── jd_identical211.py ├── jd_identicaln214.py ├── jd_identicalnew.py ├── jd_indeps.sh ├── jd_insight.js ├── jd_insight_Mod.js ├── jd_inviteFriendsGift.py ├── jd_jdfactory.js ├── jd_jdfactory_help.js ├── jd_jdjoypark.js ├── jd_jdkd1.js ├── jd_jdsupermarket_sign.js ├── jd_jdzz.js ├── jd_jfcz.js ├── jd_jin_tie.js ├── jd_jingBeanReceive.js ├── jd_jingBeanReceive.py ├── jd_jinggengInvite.py ├── jd_jinggeng_showInviteJoin.js ├── jd_jinggengjcq_dapainew.js ├── jd_jinggengjcq_dapainew_task.js ├── jd_jmf.js ├── jd_joy_energy.js ├── jd_joy_feedPets.js ├── jd_joy_joy_reward.ts ├── jd_joy_park.js ├── jd_joy_park_Mod.js ├── jd_joy_park_run.js ├── jd_joy_park_run.ts ├── jd_joy_park_task.js ├── jd_joy_park_task_Mod.js ├── jd_joy_run.js ├── jd_joy_run_reward.ts ├── jd_joy_withdraw.js ├── jd_joyjd_open.js ├── jd_joymanor_task.js ├── jd_joyopen.js ├── jd_joypark_synthesis.js ├── jd_joypark_task.js ├── jd_jr_draw.js ├── jd_jr_draws.js ├── jd_js_cash.js ├── jd_jx_sign.js ├── jd_jxgckc.js ├── jd_jxhb.js ├── jd_jxlhb.js ├── jd_jxmc.js ├── jd_jxmc_hb.js ├── jd_jxzl.js ├── jd_kanjia.js ├── jd_kd.js ├── jd_kuaidi.js ├── jd_live.js ├── jd_live_redrain.js ├── jd_ljd_xh.js ├── jd_lottery.js ├── jd_lottery_eight.js ├── jd_lottery_newyear.js ├── jd_lotterys.js ├── jd_lotty2.js ├── jd_luck_draw.js ├── jd_lzaddCart.js ├── jd_lzdz_categoryUnion.js ├── jd_lzkjInteract.py ├── jd_lzkj_daily.js ├── jd_lzkj_interact_yqrhyl.js ├── jd_lzkj_interactsaas_gzspyl.js ├── jd_lzkj_interactsaas_gzyl.js ├── jd_lzkj_interactsaas_jgyl.js ├── jd_lzkj_loreal_cart.js ├── jd_lzkj_loreal_draw.js ├── jd_lzkj_loreal_followShop.js ├── jd_lzkj_loreal_invite.js ├── jd_lzkj_sevenDay.js ├── jd_lzkj_signActivity2.js ├── jd_lzkj_wxBuildActivity.js ├── jd_lzkj_wxCollectionActivity.js ├── jd_lzkj_wxDrawActivity.js ├── jd_lzkj_wxGameActivity.js ├── jd_lzkj_wxKnowledgeActivity.js ├── jd_lzkj_wxShopFollowActivity.js ├── jd_lzkj_wxShopGift.js ├── jd_lzkjdz.js ├── jd_m_sign.js ├── jd_makemoneyshop.js ├── jd_makemoneyshop_award.js ├── jd_makemoneyshop_reward.js ├── jd_malls.js ├── jd_marketmh.js ├── jd_mf_new.js ├── jd_mfredrain.js ├── jd_mhtask.js ├── jd_mnyyn.js ├── jd_mofang_ex.js ├── jd_mofangj.js ├── jd_morningSc.js ├── jd_moxigame.js ├── jd_mpdz_car.js ├── jd_mpdz_car_help.js ├── jd_ms.js ├── jd_necklace_6dy.js ├── jd_nhjred.js ├── jd_nhjs.js ├── jd_nnfls.js ├── jd_notify.js ├── jd_nzmh.js ├── jd_parallel.js ├── jd_pay_contract.js ├── jd_petred.js ├── jd_phoneDiscount.py ├── jd_pigPet.js ├── jd_plantBean.js ├── jd_plantBean_help.js ├── jd_plus2bean.js ├── jd_pluscore.js ├── jd_price.js ├── jd_prices.js ├── jd_prodev.js ├── jd_prodev.py ├── jd_productZ4Brand.js ├── jd_pzhb_notify.py ├── jd_qbyql.js ├── jd_ql_log_scan.py ├── jd_qqxing.js ├── jd_redhelp.js ├── jd_redhl.js ├── jd_rednhj.js ├── jd_redpacketinfo.py ├── jd_redrain.js ├── jd_redrain_half.js ├── jd_ry.js ├── jd_scripts_check_dependence.py ├── jd_sevenDay.js ├── jd_sgmh.js ├── jd_shangou.js ├── jd_share.js ├── jd_share2.js ├── jd_shop.js ├── jd_shopCollectGift.py ├── jd_shopDraw.js ├── jd_shopGifts.js ├── jd_shop_draw.js ├── jd_shop_sign.js ├── jd_sign.js ├── jd_signFree.js ├── jd_sign_graphics.js ├── jd_sign_graphics1.js ├── jd_sk2.js ├── jd_speed_redpocke.js ├── jd_speed_sign.js ├── jd_speed_signfree.js ├── jd_splitHongbao.js ├── jd_superBrandJKK.js ├── jd_superBrandJK_1.js ├── jd_superBrandJXZ.js ├── jd_superBrandSign.js ├── jd_superBrandStar.js ├── jd_superBrandXZ.js ├── jd_supergz.js ├── jd_supermarket.js ├── jd_supermarket1.js ├── jd_supermarket_dh.js ├── jd_supermarket_ex.js ├── jd_supermarket_exchange.js ├── jd_supermh.js ├── jd_supermohe.js ├── jd_sxLottery.js ├── jd_tanwei.js ├── jd_team60.js ├── jd_teamAJ.js ├── jd_teamFLP.js ├── jd_team_exchange.js ├── jd_tenbean.js ├── jd_tewu.ts ├── jd_tj.py ├── jd_tj_sign.js ├── jd_track.ts ├── jd_try.js ├── jd_try_notify.js ├── jd_try_notify.py ├── jd_twCard.js ├── jd_twjk.js ├── jd_twjk_new.js ├── jd_txgzyl.js ├── jd_txgzyl1.js ├── jd_txstockex.js ├── jd_txzj_cart_item.js ├── jd_txzj_collect_item.js ├── jd_txzj_collect_shop.js ├── jd_txzj_lottery.js ├── jd_txzj_sign_in.js ├── jd_tyt.js ├── jd_tyt_ks.js ├── jd_unbind.js ├── jd_unsubscriLive.js ├── jd_unsubscribe.js ├── jd_unsubscribeShop.js ├── jd_unsubscribe_xh.js ├── jd_vipgrowth.js ├── jd_washbeans.js ├── jd_wdz.js ├── jd_wdz.py ├── jd_wdz_openLuckBag.js ├── jd_wdzfd.js ├── jd_wechat_zz.ts ├── jd_whx_drawShopGift.js ├── jd_wish.js ├── jd_work_price.js ├── jd_wq_wxsign.js ├── jd_wrtred.js ├── jd_wsdlb.js ├── jd_wskey.py ├── jd_wskey_logout.js ├── jd_wxBirthGifts.py ├── jd_wxBuildActivity.js ├── jd_wxBulidActivity.py ├── jd_wxCartKoi.js ├── jd_wxCollectCard.js ├── jd_wxCollectionActivity.js ├── jd_wxCollectionActivity.py ├── jd_wxCollectionActivity2.js ├── jd_wxCompleteInfo.py ├── jd_wxFansInterActionActivity.js ├── jd_wxFansinter.js ├── jd_wxKnowledgeActivity.js ├── jd_wxMcLevelAndBirthGifts.js ├── jd_wxSecond.js ├── jd_wxShareActivity.js ├── jd_wxShopFollowActivity.js ├── jd_wxShopGift.js ├── jd_wxShopGift.py ├── jd_wxSignRed.js ├── jd_wxUnPackingActivity.js ├── jd_wx_addCart.js ├── jd_wx_centerDraw.js ├── jd_wx_collectCard.js ├── jd_wx_luckDraw.js ├── jd_wxgame.js ├── jd_wxttzq.js ├── jd_wyw.js ├── jd_wzqddnh.js ├── jd_xbhdl.js ├── jd_xgyl_wx.js ├── jd_xinruimz.js ├── jd_xkmh.js ├── jd_xmf.js ├── jd_xs_zzl.js ├── jd_xtclh.js ├── jd_yhzd.js ├── jd_yqyl.js ├── jd_yyn.js ├── jd_zdjr.js ├── jd_zjb.js ├── jd_zjd_new.js ├── jd_zns_award.js ├── jd_zns_draw.js ├── jd_zns_game1.js ├── jd_zns_game2.js ├── jx_aid_cashback.js ├── jx_factory_automation.js ├── jx_factory_commodity.js ├── jx_one2shopping.js ├── jx_sign.js ├── jx_sign_help.js ├── jx_sign_xd.js ├── magic.js ├── magic.json ├── magic.py ├── main.py ├── mount.sh ├── package-lock.json ├── package.json ├── ql.js ├── scan.json ├── sendNotify.js ├── sendNotify.py ├── serverless.yml ├── sign_graphics_validate.js ├── telecom.py ├── test.js ├── utils ├── JDJRValidator.js ├── JDJRValidator_Pure.js ├── JDSignValidator.js ├── JD_DailyBonus.js ├── MoveMentFaker.js ├── TS_USER_AGENTS.ts ├── USER_AGENTS.js ├── V3.ts ├── ZooFaker_Necklace.js ├── common.js ├── config.js ├── eval.js ├── h5st.ts ├── jdCookie.js ├── jdShareCodes.js ├── jdValidate.js ├── jd_joy_getInvokeKey.ts ├── jd_jxmcToken.js ├── jinli_log.ts ├── jxAlgo.js ├── magic.js ├── pushplus.ts ├── ql.js ├── sendNotify.js ├── shareCodesTool.ts └── share_code.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 | ] -------------------------------------------------------------------------------- /TS_JDHelloWorld.d.ts: -------------------------------------------------------------------------------- 1 | interface User { 2 | index: number; 3 | UserName: string; 4 | cookie: string; 5 | UserAgent: string; 6 | end?: boolean; 7 | } 8 | declare class JDHelloWorld { 9 | scriptName: string; 10 | cookiesArr: string[]; 11 | users: User[]; 12 | constructor(scriptName?: string); 13 | getCookie(): Promise; 14 | exceptCookie(filename?: string): string[]; 15 | get(url: string, headers?: any): Promise; 16 | post(url: string, data: any, headers?: any, params?: object): Promise; 17 | wait(ms?: number): Promise; 18 | o2s(obj: object, title?: string): void; 19 | getShareCodePool(key: string, num: number): Promise; 20 | getshareCodeHW(key: string): Promise; 21 | getRandomNumberByRange(start: number, end: number): number; 22 | getRandomNumString(e: number): string; 23 | getEncStr(fn: string, body: { 24 | id?: number; 25 | taskType?: number; 26 | }): object; 27 | getSign(fn: string, body: object): Promise; 28 | cashDoSign(): Promise; 29 | run(son: { 30 | main: any; 31 | help?: any; 32 | tips?: any; 33 | }, help?: Function, tips?: Function): Promise; 34 | } 35 | export { User, JDHelloWorld }; 36 | -------------------------------------------------------------------------------- /backUp/AlipayManor.js: -------------------------------------------------------------------------------- 1 | // qx 及 loon 可用。 2 | // 半自动提醒支付宝蚂蚁庄园喂食。 3 | // 15 */4 * * * AlipayManor.js 4 | // 自用 Modified from zZPiglet 5 | 6 | const $ = new Env('蚂蚁庄园'); 7 | const manor = "alipays://platformapi/startapp?appId=66666674"; 8 | 9 | $.msg("支付宝", "蚂蚁庄园喂食啦", "alipays://platformapi/startapp?appId=66666674", manor); 10 | 11 | $.done() 12 | 13 | // prettier-ignore 14 | function Env(t,s){return new class{constructor(t,s){this.name=t,this.data=null,this.dataFile="box.dat",this.logs=[],this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,s),this.log("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}getScript(t){return new Promise(s=>{$.get({url:t},(t,e,i)=>s(i))})}runScript(t,s){return new Promise(e=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let o=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");o=o?1*o:20,o=s&&s.timeout?s.timeout:o;const[h,a]=i.split("@"),r={url:`http://${a}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:o},headers:{"X-Key":h,Accept:"*/*"}};$.post(r,(t,s,i)=>e(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),s=this.path.resolve(process.cwd(),this.dataFile),e=this.fs.existsSync(t),i=!e&&this.fs.existsSync(s);if(!e&&!i)return{};{const i=e?t:s;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),s=this.path.resolve(process.cwd(),this.dataFile),e=this.fs.existsSync(t),i=!e&&this.fs.existsSync(s),o=JSON.stringify(this.data);e?this.fs.writeFileSync(t,o):i?this.fs.writeFileSync(s,o):this.fs.writeFileSync(t,o)}}lodash_get(t,s,e){const i=s.replace(/\[(\d+)\]/g,".$1").split(".");let o=t;for(const t of i)if(o=Object(o)[t],void 0===o)return e;return o}lodash_set(t,s,e){return Object(t)!==t?t:(Array.isArray(s)||(s=s.toString().match(/[^.[\]]+/g)||[]),s.slice(0,-1).reduce((t,e,i)=>Object(t[e])===t[e]?t[e]:t[e]=Math.abs(s[i+1])>>0==+s[i+1]?[]:{},t)[s[s.length-1]]=e,t)}getdata(t){let s=this.getval(t);if(/^@/.test(t)){const[,e,i]=/^@(.*?)\.(.*?)$/.exec(t),o=e?this.getval(e):"";if(o)try{const t=JSON.parse(o);s=t?this.lodash_get(t,i,""):s}catch(t){s=""}}return s}setdata(t,s){let e=!1;if(/^@/.test(s)){const[,i,o]=/^@(.*?)\.(.*?)$/.exec(s),h=this.getval(i),a=i?"null"===h?null:h||"{}":"{}";try{const s=JSON.parse(a);this.lodash_set(s,o,t),e=this.setval(JSON.stringify(s),i)}catch(s){const h={};this.lodash_set(h,o,t),e=this.setval(JSON.stringify(h),i)}}else e=$.setval(t,s);return e}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,s){return this.isSurge()||this.isLoon()?$persistentStore.write(t,s):this.isQuanX()?$prefs.setValueForKey(t,s):this.isNode()?(this.data=this.loaddata(),this.data[s]=t,this.writedata(),!0):this.data&&this.data[s]||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,s=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?$httpClient.get(t,(t,e,i)=>{!t&&e&&(e.body=i,e.statusCode=e.status),s(t,e,i)}):this.isQuanX()?$task.fetch(t).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t)):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,s)=>{try{const e=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();this.ckjar.setCookieSync(e,null),s.cookieJar=this.ckjar}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t)))}post(t,s=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),delete t.headers["Content-Length"],this.isSurge()||this.isLoon())$httpClient.post(t,(t,e,i)=>{!t&&e&&(e.body=i,e.statusCode=e.status),s(t,e,i)});else if(this.isQuanX())t.method="POST",$task.fetch(t).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t));else if(this.isNode()){this.initGotEnv(t);const{url:e,...i}=t;this.got.post(e,i).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t))}}time(t){let s={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let e in s)new RegExp("("+e+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?s[e]:("00"+s[e]).substr((""+s[e]).length)));return t}msg(s=t,e="",i="",o){const h=t=>!t||!this.isLoon()&&this.isSurge()?t:"string"==typeof t?this.isLoon()?t:this.isQuanX()?{"open-url":t}:void 0:"object"==typeof t&&(t["open-url"]||t["media-url"])?this.isLoon()?t["open-url"]:this.isQuanX()?t:void 0:void 0;this.isSurge()||this.isLoon()?$notification.post(s,e,i,h(o)):this.isQuanX()&&$notify(s,e,i,h(o)),this.logs.push("","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="),this.logs.push(s),e&&this.logs.push(e),i&&this.logs.push(i)}log(...t){t.length>0?this.logs=[...this.logs,...t]:console.log(this.logs.join(this.logSeparator))}logErr(t,s){const e=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();e?$.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):$.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(s=>setTimeout(s,t))}done(t={}){const s=(new Date).getTime(),e=(s-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${e} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,s)} -------------------------------------------------------------------------------- /backUp/GetJdCookie.md: -------------------------------------------------------------------------------- 1 | ## 浏览器获取京东cookie教程 2 | 3 | **以下浏览器都行** 4 | 5 | - Chrome浏览器 6 | - 新版Edge浏览器 7 | - 国产360,QQ浏览器切换到极速模式 8 | 9 | ### 操作步骤 10 | 11 | 1. 电脑浏览器打开京东网址 [https://m.jd.com/](https://m.jd.com/) 12 | 2. 按键盘F12键打开开发者工具,然后点下图中的图标 13 | ![切换到手机模式](../icon/jd1.jpg) 14 | 3. 此时是未登录状态(使用手机短信验证码登录),如已登录请忽略此步骤 15 | - 使用手机短信验证码登录(此方式cookie有效时长大概31天,其他登录方式比较短) 16 | 4. 登录后,选择Network,有很多链接的话点箭头这里清空下 17 | ![清空](../icon/jd2.jpg) 18 | 5. 然后再点我的,链接就变少了 19 | ![再次点击我的](../icon/jd3.jpg) 20 | 6. 点第一个链接(log.gif)进去,找到cookie,复制出来,新建一个TXT文本临时保存一下,下面需要用到 21 | ![寻找log.gi](../icon/jd4.jpg) 22 | 7. 第六步复制出来的cookie比较长,我们只需要`pt_pin=xxxx;`和 `pt_key=xxxx;`部分的内容即可(注:英文引号`;`是必要的)。可以用下面的脚本,在Chrome浏览器按F12,console里面输入下面脚本按enter回车键 23 | ``` 24 | var CV = '单引号里面放第六步拿到的cookie'; 25 | var CookieValue = CV.match(/pt_pin=.+?;/) + CV.match(/pt_key=.+?;/); 26 | copy(CookieValue); 27 | ``` 28 | 8. 这样子整理出关键的的cookie已经在你的剪贴板上, 可直接粘贴 29 | 30 | 9. 如果需获取第二个京东账号的cookie,不要在刚才的浏览器上面退出登录账号一(否则刚才获取的cookie会失效),需另外换一个浏览器(Chrome浏览器 `ctr+shift+n` 打开无痕模式也行),然后继续按上面步骤操作即可 31 | 32 | 33 | -------------------------------------------------------------------------------- /backUp/GetJdCookie2.md: -------------------------------------------------------------------------------- 1 | ## 浏览器插件获取京东cookie教程 2 | > 此教程内容由tg用户@wukongdada提供,特此感谢 3 | 4 | **以下浏览器都行** 5 | 6 | - Chrome浏览器 7 | - 新版Edge浏览器(chrome内核) 8 | 9 | ### 操作步骤 10 | 11 | 1. 电脑浏览器打开京东网址 [https://m.jd.com/](https://m.jd.com/) 12 | 2. Chrome类浏览器安装EditThisCookie插件 13 | - Chrome插件商店搜EditThisCookie, 或者[打开此网站](https://chrome.google.com/webstore/detail/editthiscookie/fngmhnnpilhplaeedifhccceomclgfbg?utm_source=chrome-ntp-icon) 进行安装 14 | - 仅使用百分浏览器,谷歌浏览器测试过,其他谷歌类浏览器请自行测试。 15 | - 无法登录Chrome插件商店或者打不开网址建议使用edge chrome版。 16 | 3. edge chrome浏览器安装Cookie Editor插件 17 | - [edge插件商店](edge://extensions/)搜Cookie Editor,或[打开以下网址](https://microsoftedge.microsoft.com/addons/detail/cookie-editor/ajfboaconbpkglpfanbmlfgojgndmhmc?hl=zh-CN) 完成插件安装 18 | 4. 以下是chrome和edge的相关设置截图,输入的网址是 ``jd.com`` 19 | 20 | ![Chrome浏览器相关设置](../icon/jd5.png) 21 | 22 | ![Edge浏览器相关设置](../icon/jd6.png) 23 | 24 | 5. 现在点击回到京东触屏版,再点击EditThisCookie/Cookie Editor,再点击搜索,输入key或pin,如下图所示的pt_key,复制pt_key的value值。此插件可以看到cookie的有效期。 25 | 26 | ![插件显示](../icon/jd7.png) 27 | 28 | 6. 按照以下格式形成自己的jd_cookie 29 | - `pt_key=复制插件搜索出来的key值;pt_pin=复制插件搜索出来的pin值;` ,后面的英文引号`;`是必须要的 30 | - 给一个京东cookie具体示例 `pt_key=jdDC2F833333EFDGTCE5BD4AD1A952D4F4DF84A46052;pt_pin=jd_123456;` 31 | 32 | 7. 如果需获取第二个京东账号的cookie,不要在刚才的浏览器上面退出登录账号一(否则刚才获取的cookie会失效),需另外换一个浏览器(Chrome浏览器 `ctr+shift+n` 打开无痕模式也行),然后继续按上面步骤操作即可 33 | 34 | 35 | -------------------------------------------------------------------------------- /backUp/TG_PUSH.md: -------------------------------------------------------------------------------- 1 | **TG_PUSH教程** 2 | 3 | 利用Telegram机器人推送通知,需要在环境变量填入正确的```TG_BOT_TOKEN```以及```TG_USER_ID```,以下教程简明阐述如何获取token以及UserID 4 | 5 | Ⅰ.首先在Telegram上搜索[BotFather](https://t.me/BotFather)机器人
6 | 7 | ![TG_PUSH1](../icon/TG_PUSH1.png) 8 | 9 | Ⅱ.利用[BotFather](https://t.me/BotFather)创建一个属于自己的通知机器人,按照下图中的1、2、3步骤拿到token,格式形如```10xxx4:AAFcqxxxxgER5uw```。填入```TG_BOT_TOKEN```
10 | 11 | ![TG_PUSH2](../icon/TG_PUSH2.png)
12 | 13 | **新创建的机器人需要跟它发一条消息来开启对话,否则可能会遇到secret填对了但是收不到消息的情况**
14 | 15 | Ⅲ.再次在Telegram上搜索[getuserIDbot](https://t.me/getuserIDbot)机器人,获取UserID。填入```TG_USER_ID```
16 | 17 | ![TG_PUSH3](../icon/TG_PUSH3.png) 18 | 19 | 至此,获取**TG_BOT_TOKEN**以及**TG_USER_ID**的教程结束 20 | -------------------------------------------------------------------------------- /backUp/gitSync.md: -------------------------------------------------------------------------------- 1 | ## 保持自己github的forks自动和上游仓库同步的教程 2 | - 信息来源于 [https://github.com/wei/pull](https://github.com/wei/pull) 3 | - 以下教程仅是出于个人爱好,不保证本教程的完全正确性,最终请以作者 [https://github.com/wei/pull](https://github.com/wei/pull) 的描述为准。 4 | - 注:此教程由telegram用户@wukongdada提供 5 | ### 1、只同步默认分支的教程 6 | 7 | > 当上游的仓库仅有一个默认分支。或者上游仓库有两个分支,我们仅需要同步他的默认分支,其他分支对内容对我们来说无关紧要。 8 | 9 | 10 | 11 | ![git1.jpg](../icon/git1.jpg) 12 | 13 | 14 | 15 | a) 登录自己的github账号,另开网页打开 [https://github.com/wei/pull](https://github.com/wei/pull) 16 | 17 | 18 | 19 | b) 点击Pull app进行安装。 20 | 21 | ![../icon/git2.jpg](../icon/git2.jpg) 22 | 23 | 24 | 25 | c) 安装过程中会让你选择要选择那一种方式,All repositories(就是同步已经frok的仓库以及未来fork的仓库),Only select repositories(仅选择要自己需要同步的仓库,其他fork的仓库不会被同步),根据自己需求选择,实在不知道怎么选择,就选All repositories;点击install,完成安装。 26 | 27 | ![../icon/git3.jpg](../icon/git3.jpg) 28 | 29 | 30 | 31 | d) 后续,如果要调整1.c中的选项,打开 [https://github.com/apps/pull](https://github.com/apps/pull) ,点击Configure,输入github密码进入pull的相关设置。 32 | 33 | ![../icon/git4.jpg](../icon/git4.jpg) 34 | 35 | 36 | 37 | e) 进入后,找到Repository access,根据自己的需求,重新选择:All repositories(就是同步已经frok的仓库以及未来fork的仓库),Only select repositories(仅选择要自己需要同步的仓库,其他fork的仓库不会被同步),Save后保存生效。 38 | 39 | ![../icon/git5.jpg](../icon/git5.jpg) 40 | 41 | 42 | 43 | f) Pull app作者虽然在项目中写道keeps your forks up-to-date with upstream via automated pull requests,但当上游仓库有更改时,自己的仓库会在3个小时内完成与上游的同步,3个小时是Pull app作者说的最长时间。当然也可以通过手动触发同步上游仓库,手动触发方式:`https://pull.git.ci/process/你的GitHub名字/你的仓库名字` (例如:`https://pull.git.ci/process/xxxxx/test` ),手动触发可能会进行人机验证,验证通过后会显示Success。 44 | 45 | ![../icon/git12.jpg](../icon/git6.jpg) 46 | 47 | ![../icon/git13.jpg](../icon/git7.png) 48 | 49 | ### 2、同步其他分支的教程 50 | 51 | ![../icon/git8.jpg](../icon/git8.jpg) 52 | 53 | 54 | 55 | a) 假设你fork了上游仓库后,你fork后的地址为 `https://github.com/你的仓库名字/test` ,首先设置完成第1部分内容,注意在1.c步骤没有设置全部同步的,要回到1.e步,确认是否设置同步了 `你的仓库名字/test`,如果没有,请添加上。 56 | 57 | ![../icon/git9.jpg](../icon/git9.jpg) 58 | 59 | 60 | 61 | b) 在默认分支下添加一个文件。 62 | 63 | ![../icon/git10.jpg](../icon/git10.jpg) 64 | 65 | 66 | 67 | c) 复制 ``.github/pull.yml`` 粘贴后看到以下页面,注意github前面的那个.别漏掉了。 68 | 69 | ![../icon/git11.jpg](../icon/git11.jpg) 70 | 71 | 72 | 73 | d) 请在https://github.com/wei/pull\#advanced-setup-with-config 页复制代码, 74 | 75 | 注意:upstream处要修改为上游仓库作者名字。 76 | 77 | ![../icon/git12.jpg](../icon/git12.jpg) 78 | 79 | ![../icon/git13.jpg](../icon/git13.jpg) 80 | 81 | 82 | 83 | e) 最终的示例如下,假设上游作者是zhangsan,所有的注意点都用红线圈出来了,保存后生效。 84 | 85 | ![../icon/git14.jpg](../icon/git14.jpg) 86 | 87 | 88 | 89 | f) Pull app作者虽然在项目中写道keeps your forks up-to-date with upstream via automated pull requests,但当上游仓库有更改时,自己的仓库会在3个小时内完成与上游的同步,3个小时是Pull app作者说的最长时间。当然也可以通过手动触发同步上游仓库,手动触发方式:`https://pull.git.ci/process/你的GitHub名字/你的仓库名字` (例如:`https://pull.git.ci/process/xxxxx/test`),手动触发可能会进行人机验证,验证通过后会显示Success。具体见1.f提供的图片。 90 | 91 | 92 | 93 | g) 本人仅测试过forks一个仓库只有2个分支的项目,如果有多个分支,不能保证是否可行,请自行测试,或者是使用本教程第3部分高级玩法。 94 | 95 | ### 高级玩法 96 | 97 | >当然,作者还有其他更好的项目用于同步所有分支,例如使用 GitHub actions 进行同步。请参考原作者的项目 98 | 99 | - [https://github.com/wei/git-sync](https://github.com/wei/git-sync) 100 | - [https://github.com/repo-sync/github-sync](https://github.com/repo-sync/github-sync) 101 | -------------------------------------------------------------------------------- /backUp/jd_aid_ftzy.js: -------------------------------------------------------------------------------- 1 | /** 2 | cron=15 3,9 * * * jd_aid_ftzy.js 3 | new Env('京东沸腾之夜助力'); 4 | */ 5 | let common = require("./function/common"); 6 | let $ = new common.env('京东沸腾之夜助力'); 7 | let min = 3, 8 | help = $.config[$.filename(__filename)] || Math.min(min, $.config.JdMain) || min 9 | $.setOptions({ 10 | headers: { 11 | 'content-type': 'application/json', 12 | 'user-agent': 'jdapp;iPhone;9.4.6;14.2;965af808880443e4c1306a54afdd5d5ae771de46;network/wifi;supportApplePay/0;hasUPPay/0;hasOCPay/0;model/iPhone8,4;addressid/;supportBestPay/0;appBuild/167618;jdSupportDarkMode/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', 13 | 'referer': 'https://happy.m.jd.com/babelDiy/Zeus/3ugedFa7yA6NhxLN5gw2L3PF9sQC/index.html', 14 | } 15 | }); 16 | $.readme = ` 17 | 0 0 * * * task ${$.runfile} 18 | exprot ${$.runfile}=2 # 如需修改被助力账号个数,请自行修改环境变量 19 | ` 20 | eval(common.eval.mainEval($)); 21 | async function prepare() { 22 | for (let i of cookies['help']) { 23 | let s = await $.curl({ 24 | 'url': `https://api.m.jd.com/client.action?advId=party1031_init`, 25 | 'form': `functionId=party1031_init&body={}&client=wh5&clientVersion=1.0.0&appid=o2_act&uuid=cf7d66dca8a794007c133227f504a8e2aff131e7`, 26 | cookie: i 27 | },'s') 28 | try { 29 | $.sharecode.push($.compact($.s.data.result, ['inviteCode'])) 30 | } catch (e) {} 31 | } 32 | } 33 | async function main(p) { 34 | let cookie = p.cookie 35 | await $.curl({ 36 | 'url': `https://api.m.jd.com/client.action?advId=party1031_assist`, 37 | 'form': `functionId=party1031_assist&client=wh5&clientVersion=1.0.0&appid=o2_act&_stk=appid,body,client,clientVersion,functionId&_ste=1&h5st=&body={"inviteCode":"${p.inviteCode}"}&uuid=cf7d66dca8a794007c133227f504a8e2aff131e7`, 38 | cookie 39 | },'s') 40 | console.log($.s.data); 41 | } 42 | -------------------------------------------------------------------------------- /backUp/jd_bs.py: -------------------------------------------------------------------------------- 1 | #/* 2 | # 小米运动更新步数 3 | #[task_local] 4 | # 小米运动更新步数 5 | #0 15 15 * * 6 | #*/ 7 | 8 | import requests 9 | 10 | import random 11 | 12 | number2 = random.randint(50001,65000) 13 | 14 | dict = { 15 | # '小米运行账号':'密码' 16 | '':'' 17 | } 18 | 19 | header={ 20 | 21 | 'User_Agent':'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0; .NET CLR 2.0.50727; SLCC2; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.3; .NET4.0C; Tablet PC 2.0; .NET4.0E)', 22 | 23 | } 24 | 25 | for key in dict: 26 | 27 | number,password = (key,dict[key]) 28 | 29 | lj = f"http://42.193.130.93:8080/mi?phoneNumber={number}&password={password}&steps={number2}" 30 | 31 | r = requests.get(url = lj,headers=header) 32 | 33 | r.encoding = r.apparent_encoding 34 | 35 | t = r.text.encode('gbk', 'ignore').decode('gbk') 36 | 37 | print(t) 38 | 39 | print("您今日运动步数结果为{}".format(number2)) 40 | -------------------------------------------------------------------------------- /backUp/jd_delete.py: -------------------------------------------------------------------------------- 1 | # -*- coding:utf-8 -*- 2 | ''' 3 | cron: 0 0 0 6 * 4 | new Env('禁用重复任务'); 5 | ''' 6 | 7 | import json 8 | import os, sys 9 | import requests 10 | import time 11 | 12 | ip="localhost" 13 | 14 | def loadSend(): 15 | print("加载推送功能") 16 | global send 17 | cur_path = os.path.abspath(os.path.dirname(__file__)) 18 | sys.path.append(cur_path) 19 | if os.path.exists(cur_path + "/deleteDuplicateTasksNotify.py"): 20 | try: 21 | from deleteDuplicateTasksNotify import send 22 | except: 23 | print("加载通知服务失败~") 24 | 25 | headers={ 26 | "Accept": "application/json", 27 | "Authorization": "Basic YWRtaW46YWRtaW4=", 28 | "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", 29 | } 30 | 31 | def getTaskList(): 32 | t = round(time.time() * 1000) 33 | url = "http://%s:5700/api/crons?searchValue=&t=%d" % (ip, t) 34 | response = requests.get(url=url, headers=headers) 35 | responseContent=json.loads(response.content.decode('utf-8')) 36 | if responseContent['code']==200: 37 | taskList= responseContent['data'] 38 | return taskList 39 | else: 40 | # 没有获取到taskList,返回空 41 | return [] 42 | 43 | 44 | def getDuplicate(taskList): 45 | wholeNames={} 46 | duplicateID=[] 47 | for task in taskList: 48 | if task['name'] in wholeNames.keys(): 49 | duplicateID.append(task['_id']) 50 | else: 51 | wholeNames[task['name']] = 1 52 | return duplicateID 53 | 54 | 55 | def getData(duplicateID): 56 | rawData = "[" 57 | count=0 58 | for id in duplicateID: 59 | rawData += "\"%s\""%id 60 | if count 4 | > - 本地安装依赖使用serverless部署,[点这里](tencentscf.md#1-安装-nodejs-环境) 5 | > - Github Action 部署[点这里](tencentscf.md#github-action-部署) 6 | 7 | ## 1. 安装 Node.js 环境 8 | 9 | Node.js 环境 [下载地址](https://nodejs.org/zh-tw/download/) ,根据自己的操作系统下载和安装。 10 | 11 | ## 2. 下载代码 12 | 13 | 点击红框处下载压缩包 14 | ![下载代码](https://imgbed-bucket-1251971143.cos.ap-guangzhou.myqcloud.com/1605497672397-zip.png) 15 | 16 | ## 3. 安装依赖,配置 cookie 17 | 18 | ### 3.1 安装依赖 19 | 20 | 压缩包解压后进入项目文件夹 21 | 22 | - Windows 用户按住 **shift** 点击右键,点击 **在此处打开命令窗口** 23 | - Mac 用户通过终端,自行进入该文件夹 24 | 25 | 在命令行内输入 `npm i `,等待运行完成。 26 | 27 | 此时,项目文件夹内会多出一个 `node_modules`文件夹 28 | 29 | ### 3.2 配置 cookie 30 | 31 | 打开项目文件内的 `jdCookie.js` 32 | 33 | 在最上面的 `CookieJDs`里写入 cookie ,多个账号以逗号分隔 34 | 35 | 例如 36 | 37 | ```javascript 38 | let CookieJDs = [ 39 | 'pt_key=xxx;pt_pin=xxx;', 40 | 'pt_key=zzz;pt_pin=zzz;', 41 | 'pt_key=aaa;pt_pin=xxxaaa' 42 | ] 43 | ``` 44 | 45 | > 注:获取京东 cookie 教程参考 [浏览器获取京东cookie教程](https://github.com/LXK9301/jd_scripts/blob/master/backUp/GetJdCookie.md) , [插件获取京东cookie教程](https://github.com/LXK9301/jd_scripts/blob/master/backUp/GetJdCookie2.md) 46 | 47 | 48 | ## 4. 部署到云函数 49 | 50 | ### 4.1 开通服务 51 | 52 | 依次登录 [SCF 云函数控制台](https://console.cloud.tencent.com/scf) 和 [SLS 控制台](https://console.cloud.tencent.com/sls) 开通相关服务,确保账户下已开通服务并创建相应[服务角色](https://console.cloud.tencent.com/cam/role) **SCF_QcsRole、SLS_QcsRole** 53 | 54 | > 注意!为了确保权限足够,获取这两个参数时不要使用子账户!此外,腾讯云账户需要[实名认证](https://console.cloud.tencent.com/developer/auth)。 55 | 56 | ### 4.2 工具部署 57 | 58 | 下载 Serverless 工具,快速部署函数 59 | ``` 60 | npm install -g serverless 61 | ``` 62 | 63 | 执行部署命令 64 | ``` 65 | serverless deploy 66 | ``` 67 | 68 | 如果已经配置了永久秘钥,则可以直接部署,如果没有,可以直接**微信扫码**登录腾讯云,并且授权部署。 69 | 70 | 过几秒后,查看输出,可以看到函数和定时触发器都已经配置完成。 71 | ``` 72 | serverless ⚡framework 73 | Action: "deploy" - Stage: "dev" - App: "jdscript" - Instance: "jdscript" 74 | 75 | functionName: scf-jdscript 76 | description: This is a function in jdscript application. 77 | namespace: default 78 | runtime: Nodejs12.16 79 | handler: index.main_handler 80 | memorySize: 64 81 | lastVersion: $LATEST 82 | traffic: 1 83 | triggers: 84 | timer: 85 | - timer-jdscript-dev 86 | 87 | 36s › jdscript › Success 88 | ``` 89 | 90 | ## 5. 查看和测试 91 | 92 | 登录后,在 [腾讯云函数地址](https://console.cloud.tencent.com/scf/index) 点击管理控制台,查看最新部署的函数。 93 | 94 | 在左侧栏的日志查询中,可以查看到触发的日志,包括是否打卡成功等。 95 | 96 | ![测试函数](https://user-images.githubusercontent.com/6993269/99628053-5a9eea80-2a70-11eb-906f-f1d5ea2bfa3a.png) 97 | 98 | > 如果需要配置永久秘钥,则可以在[访问秘钥页面](https://console.cloud.tencent.com/cam/capi)获取账号的 TENCENT_SECRET_ID,TENCENT_SECRET_KEY,并配置在代码根目录 .env 文件中。 99 | 100 | 101 | # Github Action 部署 102 | ## 1. 开通服务 103 | 104 | 依次登录 [SCF 云函数控制台](https://console.cloud.tencent.com/scf) 和 [SLS 控制台](https://console.cloud.tencent.com/sls) 开通相关服务,确保账户下已开通服务并创建相应[服务角色](https://console.cloud.tencent.com/cam/role) **SCF_QcsRole、SLS_QcsRole** 105 | 106 | > 注意!为了确保权限足够,获取这两个参数时不要使用子账户!此外,腾讯云账户需要[实名认证](https://console.cloud.tencent.com/developer/auth)。 107 | 108 | ## 2. 在这里新建一个访问密钥[新建密钥](https://console.cloud.tencent.com/cam/capi) 109 | > 将SecretId和SecretKey分别配置在仓库的secrets变量里面, TENCENT_SECRET_ID对应你的SecretId的值,TENCENT_SECRET_KEY对应你的SecretKey的值 110 | 111 | ## 3. 配置自己需要secrets变量[参考这里](githubAction.md#下方提供使用到的-secrets全集合) 112 | 113 | 目前因为云函数改版升级,原GitHub Action部署云函数方案需要作出相应调整,secret变量新增`SCF_REGION`和`TENCENT_FUNCTION_NAME`。`SCF_REGION`用于控制部署区域的选择,具体参数代码填写可以自行查找官方说明 [地域和可用区](https://cloud.tencent.com/document/product/213/6091) `TENCENT_FUNCTION_NAME`用于控制部署到云函数后函数名的命名。
114 | 115 | ## 4. 配置index.js中secrets变量说明 116 | 现在可以通过secret设置自定义index.js中的执行方式,环境变量分别为`TENCENTSCF_SOURCE_TYPE`和`TENCENTSCF_SOURCE_URL`,其中`TENCENTSCF_SOURCE_TYPE`值可以选取`local`、`git`、`custom`具体含义[参考这里](githubAction.md#下方提供使用到的-secrets全集合)。`TENCENTSCF_SOURCE_URL`格式为包含raw的URL,例如:`https://raw.githubusercontent.com/LXK9301/jd_scripts/master/`或`https://gitee.com/lxk0301/jd_scripts/raw/master/`
117 | 118 | 119 | ### __重要的说三遍__ 120 | ### 如果涉及一个变量配置多个值,如多个cookie,多个取消订阅关键字,去掉里面的 *__[空格]()__* 和 __*[换行]()*__ 使用 `&` 连接 121 | ### 如果涉及一个变量配置多个值,如多个cookie,多个取消订阅关键字,去掉里面的 *__[空格]()__* 和 __*[换行]()*__ 使用 `&` 连接 122 | ### 如果涉及一个变量配置多个值,如多个cookie,多个取消订阅关键字,去掉里面的 *__[空格]()__* 和 __*[换行]()*__ 使用 `&` 连接 123 | > 排查问题第一步先看自己[腾讯云函数](https://console.cloud.tencent.com/scf/list-detail?rid=5&ns=default&id=scf-jdscript)那边的环境变量跟自己在仓库配置的 `secrets` 是否一致 124 | ![image](https://user-images.githubusercontent.com/6993269/99937191-06617680-2da0-11eb-99ea-033f2c655683.png) 125 | 126 | 127 | ## 4.执行action workflow进行部署,workflow未报错即部署成功 128 | 129 | **在执行action workflow进行部署前,先在需要部署的区域下新建一个空函数,名称可以任意,比如:`jd`,此时secret中`TENCENT_FUNCTION_NAME`值也必须是`jd`,保持与云函数的函数名一致,目前部署云函数的策略是覆盖的方式,故而此步骤至关重要。**
130 | 131 | ![image](https://user-images.githubusercontent.com/6993269/99513289-6a152980-29c5-11eb-9266-3f56ba13d3b2.png) 132 | ## 5. 查看和测试 133 | 登录后,在 [腾讯云函数地址](https://console.cloud.tencent.com/scf/index) 点击管理控制台,查看最新部署的函数。 134 | 135 | 在左侧栏的日志查询中,可以查看到触发的日志,包括是否打卡成功等。 136 | 137 | ![测试函数](https://user-images.githubusercontent.com/6993269/99628053-5a9eea80-2a70-11eb-906f-f1d5ea2bfa3a.png) 138 | ## 6. 设置触发器[看这里](iCloud.md#5设置触发器) 或者看这里的[注释说明](https://github.com/iouAkira/jd_scripts/blob/patch-1/index.js#L4) 139 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:lts-alpine3.12 2 | 3 | LABEL AUTHOR="none" \ 4 | VERSION=0.1.4 5 | 6 | ARG KEY="-----BEGIN OPENSSH PRIVATE KEY-----\nb3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABFwAAAAdzc2gtcn\nNhAAAAAwEAAQAAAQEAvRQk2oQqLB01iVnJKrnI3tTfJyEHzc2ULVor4vBrKKWOum4dbTeT\ndNWL5aS+CJso7scJT3BRq5fYVZcz5ra0MLMdQyFL1DdwurmzkhPYbwcNrJrB8abEPJ8ltS\nMoa0X9ecmSepaQFedZOZ2YeT/6AAXY+cc6xcwyuRVQ2ZJ3YIMBrRuVkF6nYwLyBLFegzhu\nJJeU5o53kfpbTCirwK0h9ZsYwbNbXYbWuJHmtl5tEBf2Hz+5eCkigXRq8EhRZlSnXfhPr2\n32VCb1A/gav2/YEaMPSibuBCzqVMVruP5D625XkxMdBdLqLBGWt7bCas7/zH2bf+q3zac4\nLcIFhkC6XwAAA9BjE3IGYxNyBgAAAAdzc2gtcnNhAAABAQC9FCTahCosHTWJWckqucje1N\n8nIQfNzZQtWivi8GsopY66bh1tN5N01YvlpL4ImyjuxwlPcFGrl9hVlzPmtrQwsx1DIUvU\nN3C6ubOSE9hvBw2smsHxpsQ8nyW1IyhrRf15yZJ6lpAV51k5nZh5P/oABdj5xzrFzDK5FV\nDZkndggwGtG5WQXqdjAvIEsV6DOG4kl5TmjneR+ltMKKvArSH1mxjBs1tdhta4kea2Xm0Q\nF/YfP7l4KSKBdGrwSFFmVKdd+E+vbfZUJvUD+Bq/b9gRow9KJu4ELOpUxWu4/kPrbleTEx\n0F0uosEZa3tsJqzv/MfZt/6rfNpzgtwgWGQLpfAAAAAwEAAQAAAQEAnMKZt22CBWcGHuUI\nytqTNmPoy2kwLim2I0+yOQm43k88oUZwMT+1ilUOEoveXgY+DpGIH4twusI+wt+EUVDC3e\nlyZlixpLV+SeFyhrbbZ1nCtYrtJutroRMVUTNf7GhvucwsHGS9+tr+96y4YDZxkBlJBfVu\nvdUJbLfGe0xamvE114QaZdbmKmtkHaMQJOUC6EFJI4JmSNLJTxNAXKIi3TUrS7HnsO3Xfv\nhDHElzSEewIC1smwLahS6zi2uwP1ih4fGpJJbU6FF/jMvHf/yByHDtdcuacuTcU798qT0q\nAaYlgMd9zrLC1OHMgSDcoz9/NQTi2AXGAdo4N+mnxPTHcQAAAIB5XCz1vYVwJ8bKqBelf1\nw7OlN0QDM4AUdHdzTB/mVrpMmAnCKV20fyA441NzQZe/52fMASUgNT1dQbIWCtDU2v1cP6\ncG8uyhJOK+AaFeDJ6NIk//d7o73HNxR+gCCGacleuZSEU6075Or2HVGHWweRYF9hbmDzZb\nCLw6NsYaP2uAAAAIEA3t1BpGHHek4rXNjl6d2pI9Pyp/PCYM43344J+f6Ndg3kX+y03Mgu\n06o33etzyNuDTslyZzcYUQqPMBuycsEb+o5CZPtNh+1klAVE3aDeHZE5N5HrJW3fkD4EZw\nmOUWnRj1RT2TsLwixB21EHVm7fh8Kys1d2ULw54LVmtv4+O3cAAACBANkw7XZaZ/xObHC9\n1PlT6vyWg9qHAmnjixDhqmXnS5Iu8TaKXhbXZFg8gvLgduGxH/sGwSEB5D6sImyY+DW/OF\nbmIVC4hwDUbCsTMsmTTTgyESwmuQ++JCh6f2Ams1vDKbi+nOVyqRvCrAHtlpaqSfv8hkjK\npBBqa/rO5yyYmeJZAAAAFHJvb3RAbmFzLmV2aW5lLnByZXNzAQIDBAUG\n-----END OPENSSH PRIVATE KEY-----" 7 | 8 | ENV DEFAULT_LIST_FILE=crontab_list.sh \ 9 | CUSTOM_LIST_MERGE_TYPE=append \ 10 | COOKIES_LIST=/scripts/logs/cookies.list \ 11 | REPO_URL=git@gitee.com:lxk0301/jd_scripts.git \ 12 | REPO_BRANCH=master 13 | 14 | RUN set -ex \ 15 | && apk update \ 16 | && apk upgrade \ 17 | && apk add --no-cache bash tzdata git moreutils curl jq openssh-client \ 18 | && rm -rf /var/cache/apk/* \ 19 | && ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \ 20 | && echo "Asia/Shanghai" > /etc/timezone \ 21 | && mkdir -p /root/.ssh \ 22 | && echo -e $KEY > /root/.ssh/id_rsa \ 23 | && chmod 600 /root/.ssh/id_rsa \ 24 | && ssh-keyscan gitee.com > /root/.ssh/known_hosts \ 25 | && git clone -b $REPO_BRANCH $REPO_URL /scripts \ 26 | && cd /scripts \ 27 | && mkdir logs \ 28 | && npm config set registry https://registry.npm.taobao.org \ 29 | && npm install \ 30 | && cp /scripts/docker/docker_entrypoint.sh /usr/local/bin \ 31 | && chmod +x /usr/local/bin/docker_entrypoint.sh 32 | 33 | WORKDIR /scripts 34 | 35 | ENTRYPOINT ["docker_entrypoint.sh"] 36 | 37 | CMD [ "crond" ] -------------------------------------------------------------------------------- /docker/auto_help.sh: -------------------------------------------------------------------------------- 1 | #set -e 2 | 3 | #日志路径 4 | logDir="/scripts/logs" 5 | 6 | # 处理后的log文件 7 | logFile=${logDir}/sharecodeCollection.log 8 | if [ -n "$1" ]; then 9 | parameter=${1} 10 | else 11 | echo "没有参数" 12 | fi 13 | 14 | # 收集助力码 15 | collectSharecode() { 16 | if [ -f ${2} ]; then 17 | echo "${1}:清理 ${preLogFile} 中的旧助力码,收集新助力码" 18 | 19 | #删除预处理旧助力码 20 | if [ -f "${logFile}" ]; then 21 | sed -i '/'"${1}"'/d' ${logFile} 22 | fi 23 | 24 | #收集日志中的互助码 25 | codes="$(sed -n '/'${1}'.*/'p ${2} | sed 's/京东账号/京东账号 /g' | sed 's/(/ (/g' | sed 's/】/】 /g' | awk '{print $4,$5,$6,$7}' | sort -gk2 | awk '!a[$2" "$3]++{print}')" 26 | 27 | #获取ck文件夹中的pin值集合 28 | if [ -f "/usr/local/bin/spnode" ]; then 29 | ptpins="$(awk -F "=" '{print $3}' $COOKIES_LIST | awk -F ";" '{print $1}')" 30 | else 31 | ptpins="$(echo $JD_COOKIE | sed "s/[ &]/\\n/g" | sed "/^$/d" | awk -F "=" '{print $3}' | awk -F ";" '{print $1}')" 32 | fi 33 | 34 | 35 | #遍历pt_pin值 36 | for item in $ptpins; do 37 | #中文pin解码 38 | if [ ${#item} > 20 ]; then 39 | item="$(printf $(echo -n "$item" | sed 's/\\/\\\\/g;s/\(%\)\([0-9a-fA-F][0-9a-fA-F]\)/\\x\2/g')"\n")" 40 | fi 41 | #根据pin值匹配第一个code结果输出到文件中 42 | echo "$codes" | grep -m1 $item >> $logFile 43 | done 44 | else 45 | echo "${1}:${2} 文件不存在,不清理 ${logFile} 中的旧助力码" 46 | fi 47 | 48 | } 49 | 50 | # 导出助力码 51 | exportSharecode() { 52 | if [ -f ${logFile} ]; then 53 | #账号数 54 | cookiecount=$(echo ${JD_COOKIE} | grep -o pt_key | grep -c pt_key) 55 | if [ -f /usr/local/bin/spnode ]; then 56 | cookiecount=$(cat "$COOKIES_LIST" | grep -o pt_key | grep -c pt_key) 57 | fi 58 | echo "cookie个数:${cookiecount}" 59 | 60 | # 单个账号助力码 61 | singleSharecode=$(sed -n '/'${1}'.*/'p ${logFile} | awk '{print $4}' | awk '{T=T"@"$1} END {print T}' | awk '{print substr($1,2)}') 62 | # | awk '{print $2,$4}' | sort -g | uniq 63 | # echo "singleSharecode:${singleSharecode}" 64 | 65 | # 拼接多个账号助力码 66 | num=1 67 | while [ ${num} -le ${cookiecount} ]; do 68 | local allSharecode=${allSharecode}"&"${singleSharecode} 69 | num=$(expr $num + 1) 70 | done 71 | 72 | allSharecode=$(echo ${allSharecode} | awk '{print substr($1,2)}') 73 | 74 | # echo "${1}:${allSharecode}" 75 | 76 | #判断合成的助力码长度是否大于账号数,不大于,则可知没有助力码 77 | if [ ${#allSharecode} -gt ${cookiecount} ]; then 78 | echo "${1}:导出助力码" 79 | echo "${3}=${allSharecode}" 80 | export ${3}=${allSharecode} 81 | else 82 | echo "${1}:没有助力码,不导出" 83 | fi 84 | 85 | else 86 | echo "${1}:${logFile} 不存在,不导出助力码" 87 | fi 88 | 89 | } 90 | 91 | #生成助力码 92 | autoHelp() { 93 | if [ ${parameter} == "collect" ]; then 94 | 95 | # echo "收集助力码" 96 | collectSharecode ${1} ${2} ${3} 97 | 98 | elif [ ${parameter} == "export" ]; then 99 | 100 | # echo "导出助力码" 101 | exportSharecode ${1} ${2} ${3} 102 | fi 103 | } 104 | 105 | #日志需要为这种格式才能自动提取 106 | #Mar 07 00:15:10 【京东账号1(xxxxxx)的京喜财富岛好友互助码】3B41B250C4A369EE6DCA6834880C0FE0624BAFD83FC03CA26F8DEC7DB95D658C 107 | 108 | #新增自动助力活动格式 109 | # autoHelp 关键词 日志路径 变量名 110 | 111 | ############# 短期活动 ############# 112 | 113 | 114 | ############# 长期活动 ############# 115 | 116 | #东东农场 117 | autoHelp "东东农场好友互助码" "${logDir}/jd_fruit.log" "FRUITSHARECODES" 118 | 119 | #东东萌宠 120 | autoHelp "东东萌宠好友互助码" "${logDir}/jd_pet.log" "PETSHARECODES" 121 | 122 | #种豆得豆 123 | autoHelp "京东种豆得豆好友互助码" "${logDir}/jd_plantBean.log" "PLANT_BEAN_SHARECODES" 124 | 125 | #京喜工厂 126 | autoHelp "京喜工厂好友互助码" "${logDir}/jd_dreamFactory.log" "DREAM_FACTORY_SHARE_CODES" 127 | 128 | #东东工厂 129 | autoHelp "东东工厂好友互助码" "${logDir}/jd_jdfactory.log" "DDFACTORY_SHARECODES" 130 | 131 | #crazyJoy 132 | autoHelp "crazyJoy任务好友互助码" "${logDir}/jd_crazy_joy.log" "JDJOY_SHARECODES" 133 | 134 | #京喜财富岛 135 | autoHelp "京喜财富岛好友互助码" "${logDir}/jd_cfd.log" "JDCFD_SHARECODES" 136 | 137 | #京喜农场 138 | autoHelp "京喜农场好友互助码" "${logDir}/jd_jxnc.log" "JXNC_SHARECODES" 139 | 140 | #京东赚赚 141 | autoHelp "京东赚赚好友互助码" "${logDir}/jd_jdzz.log" "JDZZ_SHARECODES" 142 | 143 | ######### 日志打印格式需调整 ######### 144 | 145 | #口袋书店 146 | autoHelp "口袋书店好友互助码" "${logDir}/jd_bookshop.log" "BOOKSHOP_SHARECODES" 147 | 148 | #领现金 149 | autoHelp "签到领现金好友互助码" "${logDir}/jd_cash.log" "JD_CASH_SHARECODES" 150 | 151 | #闪购盲盒 152 | autoHelp "闪购盲盒好友互助码" "${logDir}/jd_sgmh.log" "JDSGMH_SHARECODES" 153 | 154 | #东东健康社区 155 | autoHelp "东东健康社区好友互助码" "${logDir}/jd_health.log" "JDHEALTH_SHARECODES" 156 | -------------------------------------------------------------------------------- /docker/bot/jd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyzaw/AllJDScripts/db09b94b0faa9cdec3c00b4fb7ff8b859157f438/docker/bot/jd.png -------------------------------------------------------------------------------- /docker/bot/requirements.txt: -------------------------------------------------------------------------------- 1 | python_telegram_bot==13.0 2 | requests==2.23.0 3 | MyQR==2.3.1 4 | telegram==0.0.1 5 | tzlocal<3.0 6 | -------------------------------------------------------------------------------- /docker/bot/setup.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # @Author : iouAkira(lof) 3 | # @mail : e.akimoto.akira@gmail.com 4 | # @CreateTime: 2020-11-02 5 | # @UpdateTime: 2021-03-21 6 | 7 | from setuptools import setup 8 | 9 | setup( 10 | name='jd-scripts-bot', 11 | version='0.2', 12 | scripts=['jd_bot', ], 13 | ) 14 | -------------------------------------------------------------------------------- /docker/docker_entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | #获取配置的自定义参数 5 | if [ -n "$1" ]; then 6 | run_cmd=$1 7 | fi 8 | 9 | ( 10 | if [ -f "/scripts/logs/pull.lock" ]; then 11 | echo "存在更新锁定文件,跳过git pull操作..." 12 | else 13 | echo "设定远程仓库地址..." 14 | cd /scripts 15 | git remote set-url origin "$REPO_URL" 16 | git reset --hard 17 | echo "git pull拉取最新代码..." 18 | git -C /scripts pull --rebase 19 | echo "npm install 安装最新依赖" 20 | npm install --prefix /scripts 21 | fi 22 | ) || exit 0 23 | 24 | # 默认启动telegram交互机器人的条件 25 | # 确认容器启动时调用的docker_entrypoint.sh 26 | # 必须配置TG_BOT_TOKEN、TG_USER_ID, 27 | # 且未配置DISABLE_BOT_COMMAND禁用交互, 28 | # 且未配置自定义TG_API_HOST,因为配置了该变量,说明该容器环境可能并能科学的连到telegram服务器 29 | if [[ -n "$run_cmd" && -n "$TG_BOT_TOKEN" && -n "$TG_USER_ID" && -z "$DISABLE_BOT_COMMAND" && -z "$TG_API_HOST" ]]; then 30 | ENABLE_BOT_COMMAND=True 31 | else 32 | ENABLE_BOT_COMMAND=False 33 | fi 34 | 35 | echo "------------------------------------------------执行定时任务任务shell脚本------------------------------------------------" 36 | #测试 37 | # sh /jd_docker/docker/default_task.sh "$ENABLE_BOT_COMMAND" "$run_cmd" 38 | #合并 39 | sh /scripts/docker/default_task.sh "$ENABLE_BOT_COMMAND" "$run_cmd" 40 | echo "--------------------------------------------------默认定时任务执行完成---------------------------------------------------" 41 | 42 | if [ -n "$run_cmd" ]; then 43 | # 增加一层jd_bot指令已经正确安装成功校验 44 | # 以上条件都满足后会启动jd_bot交互,否还是按照以前的模式启动,最大程度避免现有用户改动调整 45 | if [[ "$ENABLE_BOT_COMMAND" == "True" && -f /usr/bin/jd_bot ]]; then 46 | echo "启动crontab定时任务主进程..." 47 | crond 48 | echo "启动telegram bot指令交主进程..." 49 | jd_bot 50 | else 51 | echo "启动crontab定时任务主进程..." 52 | crond -f 53 | fi 54 | 55 | else 56 | echo "默认定时任务执行结束。" 57 | fi 58 | -------------------------------------------------------------------------------- /docker/example/custom-append.yml: -------------------------------------------------------------------------------- 1 | jd_scripts: 2 | image: lxk0301/jd_scripts 3 | # 配置服务器资源约束。此例子中服务被限制为使用内存不超过200M以及cpu不超过0.2(单核的20%) 4 | # 经过实际测试,建议不低于200M 5 | # deploy: 6 | # resources: 7 | # limits: 8 | # cpus: '0.2' 9 | # memory: 200M 10 | container_name: jd_scripts 11 | restart: always 12 | volumes: 13 | - ./my_crontab_list.sh:/scripts/docker/my_crontab_list.sh 14 | - ./logs:/scripts/logs 15 | tty: true 16 | # 因为更换仓库地址可能git pull的dns解析不到,可以在配置追加hosts 17 | extra_hosts: 18 | - "gitee.com:180.97.125.228" 19 | - "github.com:13.229.188.59" 20 | - "raw.githubusercontent.com:151.101.228.133" 21 | environment: 22 | #脚本更新仓库地址,配置了会切换到对应的地址 23 | - REPO_URL=git@gitee.com:lxk0301/jd_scripts.git 24 | # 注意环境变量填写值的时候一律不需要引号(""或者'')下面这些只是示例,根据自己的需求增加删除 25 | #jd cookies 26 | # 例: JD_COOKIE=pt_key=XXX;pt_pin=XXX; 27 | # 例(多账号): JD_COOKIE=pt_key=XXX;pt_pin=XXX;&pt_key=XXX;pt_pin=XXX;&pt_key=XXX;pt_pin=XXX; 28 | - JD_COOKIE= 29 | #微信server酱通知 30 | - PUSH_KEY= 31 | #Bark App通知 32 | - BARK_PUSH= 33 | #telegram机器人通知 34 | - TG_BOT_TOKEN= 35 | - TG_USER_ID= 36 | #钉钉机器人通知 37 | - DD_BOT_TOKEN= 38 | - DD_BOT_SECRET= 39 | #企业微信机器人通知 40 | - QYWX_KEY= 41 | #京东种豆得豆 42 | - PLANT_BEAN_SHARECODES= 43 | #京东农场 44 | # 例: FRUITSHARECODES=京东农场的互助码 45 | - FRUITSHARECODES= 46 | #京东萌宠 47 | # 例: PETSHARECODES=东东萌宠的互助码 48 | - PETSHARECODES= 49 | # 宠汪汪的喂食数量 50 | - JOY_FEED_COUNT= 51 | #东东超市 52 | # - SUPERMARKET_SHARECODES= 53 | #兑换多少数量的京豆(20,或者1000京豆,或者其他奖品的文字) 54 | # 例: MARKET_COIN_TO_BEANS=1000 55 | - MARKET_COIN_TO_BEANS= 56 | #如果设置了 RANDOM_DELAY_MAX ,则会启用随机延迟功能,延迟随机 0 到 RANDOM_DELAY_MAX-1 秒。如果不设置此项,则不使用延迟。 57 | #并不是所有的脚本都会被启用延迟,因为有一些脚本需要整点触发。延迟的目的有两个,1是降低抢占cpu资源几率,2是降低检查风险(主要是1) 58 | #填写数字,单位为秒,比如写为 RANDOM_DELAY_MAX=30 就是随机产生0到29之间的一个秒数,执行延迟的意思。 59 | - RANDOM_DELAY_MAX=120 60 | #使用自定义定任务追加默认任务之后,上面volumes挂载之后这里配置对应的文件名 61 | - CUSTOM_LIST_FILE=my_crontab_list.sh 62 | 63 | -------------------------------------------------------------------------------- /docker/example/custom-overwrite.yml: -------------------------------------------------------------------------------- 1 | jd_scripts: 2 | image: lxk0301/jd_scripts 3 | # 配置服务器资源约束。此例子中服务被限制为使用内存不超过200M以及cpu不超过0.2(单核的20%) 4 | # 经过实际测试,建议不低于200M 5 | # deploy: 6 | # resources: 7 | # limits: 8 | # cpus: '0.2' 9 | # memory: 200M 10 | container_name: jd_scripts 11 | restart: always 12 | volumes: 13 | - ./my_crontab_list.sh:/scripts/docker/my_crontab_list.sh 14 | - ./logs:/scripts/logs 15 | tty: true 16 | # 因为更换仓库地址可能git pull的dns解析不到,可以在配置追加hosts 17 | extra_hosts: 18 | - "gitee.com:180.97.125.228" 19 | - "github.com:13.229.188.59" 20 | - "raw.githubusercontent.com:151.101.228.133" 21 | environment: 22 | #脚本更新仓库地址,配置了会切换到对应的地址 23 | - REPO_URL=git@gitee.com:lxk0301/jd_scripts.git 24 | # 注意环境变量填写值的时候一律不需要引号(""或者'')下面这些只是示例,根据自己的需求增加删除 25 | #jd cookies 26 | # 例: JD_COOKIE=pt_key=XXX;pt_pin=XXX; 27 | #例(多账号): JD_COOKIE=pt_key=XXX;pt_pin=XXX;&pt_key=XXX;pt_pin=XXX;&pt_key=XXX;pt_pin=XXX; 28 | - JD_COOKIE= 29 | #微信server酱通知 30 | - PUSH_KEY= 31 | #Bark App通知 32 | - BARK_PUSH= 33 | #telegram机器人通知 34 | - TG_BOT_TOKEN= 35 | - TG_USER_ID= 36 | #钉钉机器人通知 37 | - DD_BOT_TOKEN= 38 | - DD_BOT_SECRET= 39 | #企业微信机器人通知 40 | - QYWX_KEY= 41 | #京东种豆得豆 42 | - PLANT_BEAN_SHARECODES= 43 | #京东农场 44 | # 例: FRUITSHARECODES=京东农场的互助码 45 | - FRUITSHARECODES= 46 | #京东萌宠 47 | # 例: PETSHARECODES=东东萌宠的互助码 48 | - PETSHARECODES= 49 | # 宠汪汪的喂食数量 50 | - JOY_FEED_COUNT= 51 | #东东超市 52 | # - SUPERMARKET_SHARECODES= 53 | #兑换多少数量的京豆(20,或者1000京豆,或者其他奖品的文字) 54 | # 例: MARKET_COIN_TO_BEANS=1000 55 | - MARKET_COIN_TO_BEANS= 56 | #如果设置了 RANDOM_DELAY_MAX ,则会启用随机延迟功能,延迟随机 0 到 RANDOM_DELAY_MAX-1 秒。如果不设置此项,则不使用延迟。 57 | #并不是所有的脚本都会被启用延迟,因为有一些脚本需要整点触发。延迟的目的有两个,1是降低抢占cpu资源几率,2是降低检查风险(主要是1) 58 | #填写数字,单位为秒,比如写为 RANDOM_DELAY_MAX=30 就是随机产生0到29之间的一个秒数,执行延迟的意思。 59 | - RANDOM_DELAY_MAX=120 60 | #使用自定义定任务覆盖默认任务,上面volumes挂载之后这里配置对应的文件名,和自定义文件使用方式为overwrite 61 | - CUSTOM_LIST_FILE=my_crontab_list.sh 62 | - CUSTOM_LIST_MERGE_TYPE=overwrite 63 | -------------------------------------------------------------------------------- /docker/example/default.yml: -------------------------------------------------------------------------------- 1 | jd_scripts: 2 | image: lxk0301/jd_scripts 3 | # 配置服务器资源约束。此例子中服务被限制为使用内存不超过200M以及cpu不超过0.2(单核的20%) 4 | # 经过实际测试,建议不低于200M 5 | # deploy: 6 | # resources: 7 | # limits: 8 | # cpus: '0.2' 9 | # memory: 200M 10 | container_name: jd_scripts 11 | restart: always 12 | volumes: 13 | - ./logs:/scripts/logs 14 | tty: true 15 | # 因为更换仓库地址可能git pull的dns解析不到,可以在配置追加hosts 16 | extra_hosts: 17 | - "gitee.com:180.97.125.228" 18 | - "github.com:13.229.188.59" 19 | - "raw.githubusercontent.com:151.101.228.133" 20 | environment: 21 | #脚本更新仓库地址,配置了会切换到对应的地址 22 | - REPO_URL=git@gitee.com:lxk0301/jd_scripts.git 23 | # 注意环境变量填写值的时候一律不需要引号(""或者'')下面这些只是示例,根据自己的需求增加删除 24 | #jd cookies 25 | # 例: JD_COOKIE=pt_key=XXX;pt_pin=XXX; 26 | # 例(多账号): JD_COOKIE=pt_key=XXX;pt_pin=XXX;&pt_key=XXX;pt_pin=XXX;&pt_key=XXX;pt_pin=XXX; 27 | - JD_COOKIE= 28 | #微信server酱通知 29 | - PUSH_KEY= 30 | #Bark App通知 31 | - BARK_PUSH= 32 | #telegram机器人通知 33 | - TG_BOT_TOKEN= 34 | - TG_USER_ID= 35 | #钉钉机器人通知 36 | - DD_BOT_TOKEN= 37 | - DD_BOT_SECRET= 38 | #企业微信机器人通知 39 | - QYWX_KEY= 40 | #京东种豆得豆 41 | - PLANT_BEAN_SHARECODES= 42 | #京东农场 43 | # 例: FRUITSHARECODES=京东农场的互助码 44 | - FRUITSHARECODES= 45 | #京东萌宠 46 | # 例: PETSHARECODES=东东萌宠的互助码 47 | - PETSHARECODES= 48 | # 宠汪汪的喂食数量 49 | - JOY_FEED_COUNT= 50 | #东东超市 51 | # - SUPERMARKET_SHARECODES= 52 | #兑换多少数量的京豆(20,或者1000京豆,或者其他奖品的文字) 53 | # 例: MARKET_COIN_TO_BEANS=1000 54 | - MARKET_COIN_TO_BEANS= 55 | 56 | #如果设置了 RANDOM_DELAY_MAX ,则会启用随机延迟功能,延迟随机 0 到 RANDOM_DELAY_MAX-1 秒。如果不设置此项,则不使用延迟。 57 | #并不是所有的脚本都会被启用延迟,因为有一些脚本需要整点触发。延迟的目的有两个,1是降低抢占cpu资源几率,2是降低检查风险(主要是1) 58 | #填写数字,单位为秒,比如写为 RANDOM_DELAY_MAX=30 就是随机产生0到29之间的一个秒数,执行延迟的意思。 59 | - RANDOM_DELAY_MAX=120 60 | -------------------------------------------------------------------------------- /docker/example/docker多账户使用独立容器使用说明.md: -------------------------------------------------------------------------------- 1 | ### 使用此方式,请先理解学会使用[docker办法一](https://github.com/LXK9301/jd_scripts/tree/master/docker#%E5%88%9B%E5%BB%BA%E4%B8%80%E4%B8%AA%E7%9B%AE%E5%BD%95jd_scripts%E7%94%A8%E4%BA%8E%E5%AD%98%E6%94%BE%E5%A4%87%E4%BB%BD%E9%85%8D%E7%BD%AE%E7%AD%89%E6%95%B0%E6%8D%AE%E8%BF%81%E7%A7%BB%E9%87%8D%E8%A3%85%E7%9A%84%E6%97%B6%E5%80%99%E5%8F%AA%E9%9C%80%E8%A6%81%E5%A4%87%E4%BB%BD%E6%95%B4%E4%B8%AAjd_scripts%E7%9B%AE%E5%BD%95%E5%8D%B3%E5%8F%AF)的使用方式 2 | > 发现有人好像希望不同账户任务并发执行,不想一个账户执行完了才能再执行另一个,这里写一个`docker办法一`的基础上实现方式,其实就是不同账户创建不同的容器,他们互不干扰单独定时执行自己的任务。 3 | 配置使用起来还是比较简单的,具体往下看 4 | ### 文件夹目录参考 5 | ![image](https://user-images.githubusercontent.com/6993269/97781779-885ae700-1bc8-11eb-93a4-b274cbd6062c.png) 6 | ### 具体使用说明直接在图片标注了,文件参考[图片下方](https://github.com/LXK9301/jd_scripts/new/master/docker#docker-composeyml%E6%96%87%E4%BB%B6%E5%8F%82%E8%80%83),配置完成后的[执行命令]() 7 | ![image](https://user-images.githubusercontent.com/6993269/97781610-a1af6380-1bc7-11eb-9397-903b47f5ad6b.png) 8 | #### `docker-compose.yml`文件参考 9 | ```yaml 10 | version: "3" 11 | services: 12 | jd_scripts1: #默认 13 | image: lxk0301/jd_scripts 14 | # 配置服务器资源约束。此例子中服务被限制为使用内存不超过200M以及cpu不超过 0.2(单核的20%) 15 | # 经过实际测试,建议不低于200M 16 | # deploy: 17 | # resources: 18 | # limits: 19 | # cpus: '0.2' 20 | # memory: 200M 21 | restart: always 22 | container_name: jd_scripts1 23 | tty: true 24 | volumes: 25 | - ./logs1:/scripts/logs 26 | environment: 27 | - JD_COOKIE=pt_key=AAJfjaNrADAS8ygfgIsOxxxxxxxKpfDaZ2pSBOYTxtPqLK8U1Q;pt_pin=lxxxxxx5; 28 | - TG_BOT_TOKEN=130xxxx280:AAExxxxxxWP10zNf91WQ 29 | - TG_USER_ID=12xxxx206 30 | # 互助助码等参数可自行增加,如下。 31 | # 京东种豆得豆 32 | # - PLANT_BEAN_SHARECODES= 33 | 34 | jd_scripts2: #默认 35 | image: lxk0301/jd_scripts 36 | restart: always 37 | container_name: jd_scripts2 38 | tty: true 39 | volumes: 40 | - ./logs2:/scripts/logs 41 | environment: 42 | - JD_COOKIE=pt_key=AAJfjaNrADAS8ygfgIsOxxxxxxxKpfDaZ2pSBOYTxtPqLK8U1Q;pt_pin=lxxxxxx5; 43 | - TG_BOT_TOKEN=130xxxx280:AAExxxxxxWP10zNf91WQ 44 | - TG_USER_ID=12xxxx206 45 | jd_scripts4: #自定义追加默认之后 46 | image: lxk0301/jd_scripts 47 | restart: always 48 | container_name: jd_scripts4 49 | tty: true 50 | volumes: 51 | - ./logs4:/scripts/logs 52 | - ./my_crontab_list4.sh:/scripts/docker/my_crontab_list.sh 53 | environment: 54 | - JD_COOKIE=pt_key=AAJfjaNrADAS8ygfgIsOxxxxxxxKpfDaZ2pSBOYTxtPqLK8U1Q;pt_pin=lxxxxxx5; 55 | - TG_BOT_TOKEN=130xxxx280:AAExxxxxxWP10zNf91WQ 56 | - TG_USER_ID=12xxxx206 57 | - CUSTOM_LIST_FILE=my_crontab_list.sh 58 | jd_scripts5: #自定义覆盖默认 59 | image: lxk0301/jd_scripts 60 | restart: always 61 | container_name: jd_scripts5 62 | tty: true 63 | volumes: 64 | - ./logs5:/scripts/logs 65 | - ./my_crontab_list5.sh:/scripts/docker/my_crontab_list.sh 66 | environment: 67 | - JD_COOKIE=pt_key=AAJfjaNrADAS8ygfgIsOxxxxxxxKpfDaZ2pSBOYTxtPqLK8U1Q;pt_pin=lxxxxxx5; 68 | - TG_BOT_TOKEN=130xxxx280:AAExxxxxxWP10zNf91WQ 69 | - TG_USER_ID=12xxxx206 70 | - CUSTOM_LIST_FILE=my_crontab_list.sh 71 | - CUSTOM_LIST_MERGE_TYPE=overwrite 72 | 73 | ``` 74 | #### 目录文件配置好之后在 `jd_scripts_multi`目录执行 75 | `docker-compose up -d` 启动; 76 | `docker-compose logs` 打印日志; 77 | `docker-compose pull` 更新镜像; 78 | `docker-compose stop` 停止容器; 79 | `docker-compose restart` 重启容器; 80 | `docker-compose down` 停止并删除容器; 81 | ![image](https://user-images.githubusercontent.com/6993269/97781935-8fcec000-1bc9-11eb-9d1a-d219e7a1caa9.png) 82 | 83 | 84 | -------------------------------------------------------------------------------- /docker/example/jd_scripts.custom-append.syno.json: -------------------------------------------------------------------------------- 1 | { 2 | "cap_add" : [], 3 | "cap_drop" : [], 4 | "cmd" : "", 5 | "cpu_priority" : 50, 6 | "devices" : null, 7 | "enable_publish_all_ports" : false, 8 | "enable_restart_policy" : true, 9 | "enabled" : true, 10 | "env_variables" : [ 11 | { 12 | "key" : "PATH", 13 | "value" : "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" 14 | }, 15 | { 16 | "key" : "CDN_JD_DAILYBONUS", 17 | "value" : "true" 18 | }, 19 | { 20 | "key" : "JD_COOKIE", 21 | "value" : "pt_key=xxx;pt_pin=xxx;" 22 | }, 23 | { 24 | "key" : "PUSH_KEY", 25 | "value" : "" 26 | }, 27 | { 28 | "key" : "CUSTOM_LIST_FILE", 29 | "value" : "my_crontab_list.sh" 30 | } 31 | ], 32 | "exporting" : false, 33 | "id" : "3a2f6f27c23f93bc104585c22569c760cc9ce82df09cdb41d53b491fe1d0341c", 34 | "image" : "lxk0301/jd_scripts", 35 | "is_ddsm" : false, 36 | "is_package" : false, 37 | "links" : [], 38 | "memory_limit" : 0, 39 | "name" : "jd_scripts", 40 | "network" : [ 41 | { 42 | "driver" : "bridge", 43 | "name" : "bridge" 44 | } 45 | ], 46 | "network_mode" : "default", 47 | "port_bindings" : [], 48 | "privileged" : false, 49 | "shortcut" : { 50 | "enable_shortcut" : false 51 | }, 52 | "use_host_network" : false, 53 | "volume_bindings" : [ 54 | { 55 | "host_volume_file" : "/docker/jd_scripts/my_crontab_list.sh", 56 | "mount_point" : "/scripts/docker/my_crontab_list.sh", 57 | "type" : "rw" 58 | }, 59 | { 60 | "host_volume_file" : "/docker/jd_scripts/logs", 61 | "mount_point" : "/scripts/logs", 62 | "type" : "rw" 63 | } 64 | ] 65 | } 66 | -------------------------------------------------------------------------------- /docker/example/jd_scripts.custom-overwrite.syno.json: -------------------------------------------------------------------------------- 1 | { 2 | "cap_add" : [], 3 | "cap_drop" : [], 4 | "cmd" : "", 5 | "cpu_priority" : 50, 6 | "devices" : null, 7 | "enable_publish_all_ports" : false, 8 | "enable_restart_policy" : true, 9 | "enabled" : true, 10 | "env_variables" : [ 11 | { 12 | "key" : "PATH", 13 | "value" : "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" 14 | }, 15 | { 16 | "key" : "CDN_JD_DAILYBONUS", 17 | "value" : "true" 18 | }, 19 | { 20 | "key" : "JD_COOKIE", 21 | "value" : "pt_key=xxx;pt_pin=xxx;" 22 | }, 23 | { 24 | "key" : "PUSH_KEY", 25 | "value" : "" 26 | }, 27 | { 28 | "key" : "CUSTOM_LIST_FILE", 29 | "value" : "my_crontab_list.sh" 30 | }, 31 | { 32 | "key" : "CUSTOM_LIST_MERGE_TYPE", 33 | "value" : "overwrite" 34 | } 35 | ], 36 | "exporting" : false, 37 | "id" : "3a2f6f27c23f93bc104585c22569c760cc9ce82df09cdb41d53b491fe1d0341c", 38 | "image" : "lxk0301/jd_scripts", 39 | "is_ddsm" : false, 40 | "is_package" : false, 41 | "links" : [], 42 | "memory_limit" : 0, 43 | "name" : "jd_scripts", 44 | "network" : [ 45 | { 46 | "driver" : "bridge", 47 | "name" : "bridge" 48 | } 49 | ], 50 | "network_mode" : "default", 51 | "port_bindings" : [], 52 | "privileged" : false, 53 | "shortcut" : { 54 | "enable_shortcut" : false 55 | }, 56 | "use_host_network" : false, 57 | "volume_bindings" : [ 58 | { 59 | "host_volume_file" : "/docker/jd_scripts/my_crontab_list.sh", 60 | "mount_point" : "/scripts/docker/my_crontab_list.sh", 61 | "type" : "rw" 62 | }, 63 | { 64 | "host_volume_file" : "/docker/jd_scripts/logs", 65 | "mount_point" : "/scripts/logs", 66 | "type" : "rw" 67 | } 68 | ] 69 | } 70 | -------------------------------------------------------------------------------- /docker/example/jd_scripts.syno.json: -------------------------------------------------------------------------------- 1 | { 2 | "cap_add" : null, 3 | "cap_drop" : null, 4 | "cmd" : "", 5 | "cpu_priority" : 0, 6 | "devices" : null, 7 | "enable_publish_all_ports" : false, 8 | "enable_restart_policy" : true, 9 | "enabled" : false, 10 | "env_variables" : [ 11 | { 12 | "key" : "PATH", 13 | "value" : "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" 14 | }, 15 | { 16 | "key" : "CDN_JD_DAILYBONUS", 17 | "value" : "true" 18 | }, 19 | { 20 | "key" : "JD_COOKIE", 21 | "value" : "pt_key=AAJfjaNrADASxxxxxxxKpfDaZ2pSBOYTxtPqLK8U1Q;pt_pin=lxxxxx5;" 22 | }, 23 | { 24 | "key" : "TG_BOT_TOKEN", 25 | "value" : "13xxxxxx80:AAEkNxxxxxxzNf91WQ" 26 | }, 27 | { 28 | "key" : "TG_USER_ID", 29 | "value" : "12xxxx206" 30 | }, 31 | { 32 | "key" : "PLANT_BEAN_SHARECODES", 33 | "value" : "" 34 | }, 35 | { 36 | "key" : "FRUITSHARECODES", 37 | "value" : "" 38 | }, 39 | { 40 | "key" : "PETSHARECODES", 41 | "value" : "" 42 | }, 43 | { 44 | "key" : "SUPERMARKET_SHARECODES", 45 | "value" : "" 46 | }, 47 | { 48 | "key" : "CRONTAB_LIST_FILE", 49 | "value" : "crontab_list.sh" 50 | } 51 | ], 52 | "exporting" : false, 53 | "id" : "18af38bc0ac37a40e4b9608a86fef56c464577cc160bbdddec90155284fcf4e5", 54 | "image" : "lxk0301/jd_scripts", 55 | "is_ddsm" : false, 56 | "is_package" : false, 57 | "links" : [], 58 | "memory_limit" : 0, 59 | "name" : "jd_scripts", 60 | "network" : [ 61 | { 62 | "driver" : "bridge", 63 | "name" : "bridge" 64 | } 65 | ], 66 | "network_mode" : "default", 67 | "port_bindings" : [], 68 | "privileged" : false, 69 | "shortcut" : { 70 | "enable_shortcut" : false, 71 | "enable_status_page" : false, 72 | "enable_web_page" : false, 73 | "web_page_url" : "" 74 | }, 75 | "use_host_network" : false, 76 | "volume_bindings" : [ 77 | { 78 | "host_volume_file" : "/docker/jd_scripts/logs", 79 | "mount_point" : "/scripts/logs", 80 | "type" : "rw" 81 | } 82 | ] 83 | } 84 | -------------------------------------------------------------------------------- /docker/example/multi.yml: -------------------------------------------------------------------------------- 1 | version: "3" 2 | services: 3 | jd_scripts1: #默认 4 | image: lxk0301/jd_scripts 5 | # 配置服务器资源约束。此例子中服务被限制为使用内存不超过200M以及cpu不超过 0.2(单核的20%) 6 | # 经过实际测试,建议不低于200M 7 | # deploy: 8 | # resources: 9 | # limits: 10 | # cpus: '0.2' 11 | # memory: 200M 12 | restart: always 13 | container_name: jd_scripts1 14 | tty: true 15 | volumes: 16 | - ./logs1:/scripts/logs 17 | environment: 18 | - JD_COOKIE=pt_key=AAJfjaNrADAS8ygfgIsOxxxxxxxKpfDaZ2pSBOYTxtPqLK8U1Q;pt_pin=lxxxxxx5; 19 | - TG_BOT_TOKEN=130xxxx280:AAExxxxxxWP10zNf91WQ 20 | - TG_USER_ID=12xxxx206 21 | # 互助助码等参数可自行增加,如下。 22 | # 京东种豆得豆 23 | # - PLANT_BEAN_SHARECODES= 24 | 25 | jd_scripts2: #默认 26 | image: lxk0301/jd_scripts 27 | restart: always 28 | container_name: jd_scripts2 29 | tty: true 30 | volumes: 31 | - ./logs2:/scripts/logs 32 | environment: 33 | - JD_COOKIE=pt_key=AAJfjaNrADAS8ygfgIsOxxxxxxxKpfDaZ2pSBOYTxtPqLK8U1Q;pt_pin=lxxxxxx5; 34 | - TG_BOT_TOKEN=130xxxx280:AAExxxxxxWP10zNf91WQ 35 | - TG_USER_ID=12xxxx206 36 | jd_scripts4: #自定义追加默认之后 37 | image: lxk0301/jd_scripts 38 | restart: always 39 | container_name: jd_scripts4 40 | tty: true 41 | volumes: 42 | - ./logs4:/scripts/logs 43 | - ./my_crontab_list4.sh:/scripts/docker/my_crontab_list.sh 44 | environment: 45 | - JD_COOKIE=pt_key=AAJfjaNrADAS8ygfgIsOxxxxxxxKpfDaZ2pSBOYTxtPqLK8U1Q;pt_pin=lxxxxxx5; 46 | - TG_BOT_TOKEN=130xxxx280:AAExxxxxxWP10zNf91WQ 47 | - TG_USER_ID=12xxxx206 48 | - CUSTOM_LIST_FILE=my_crontab_list.sh 49 | jd_scripts5: #自定义覆盖默认 50 | image: lxk0301/jd_scripts 51 | restart: always 52 | container_name: jd_scripts5 53 | tty: true 54 | volumes: 55 | - ./logs5:/scripts/logs 56 | - ./my_crontab_list5.sh:/scripts/docker/my_crontab_list.sh 57 | environment: 58 | - JD_COOKIE=pt_key=AAJfjaNrADAS8ygfgIsOxxxxxxxKpfDaZ2pSBOYTxtPqLK8U1Q;pt_pin=lxxxxxx5; 59 | - TG_BOT_TOKEN=130xxxx280:AAExxxxxxWP10zNf91WQ 60 | - TG_USER_ID=12xxxx206 61 | - CUSTOM_LIST_FILE=my_crontab_list.sh 62 | - CUSTOM_LIST_MERGE_TYPE=overwrite 63 | -------------------------------------------------------------------------------- /docker/notify_docker_user.js: -------------------------------------------------------------------------------- 1 | const notify = require('../sendNotify'); 2 | const fs = require('fs'); 3 | const notifyPath = '/scripts/logs/notify.txt'; 4 | async function image_update_notify() { 5 | if (fs.existsSync(notifyPath)) { 6 | const content = await fs.readFileSync(`${notifyPath}`, 'utf8');//读取notify.txt内容 7 | if (process.env.NOTIFY_CONTENT && !content.includes(process.env.NOTIFY_CONTENT)) { 8 | await notify.sendNotify("⚠️Docker镜像版本更新通知⚠️", process.env.NOTIFY_CONTENT); 9 | await fs.writeFileSync(`${notifyPath}`, process.env.NOTIFY_CONTENT); 10 | } 11 | } else { 12 | if (process.env.NOTIFY_CONTENT) { 13 | notify.sendNotify("⚠️Docker镜像版本更新通知⚠️", process.env.NOTIFY_CONTENT) 14 | await fs.writeFileSync(`${notifyPath}`, process.env.NOTIFY_CONTENT); 15 | } 16 | } 17 | } 18 | !(async() => { 19 | await image_update_notify(); 20 | })().catch((e) => console.log(e)) -------------------------------------------------------------------------------- /docker/proc_file.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [[ -f /usr/bin/jd_bot && -z "$DISABLE_SPNODE" ]]; then 4 | CMD="spnode" 5 | else 6 | CMD="node" 7 | fi 8 | 9 | echo "处理jd_crazy_joy_coin任务。。。" 10 | if [ ! $CRZAY_JOY_COIN_ENABLE ]; then 11 | echo "默认启用jd_crazy_joy_coin杀掉jd_crazy_joy_coin任务,并重启" 12 | eval $(ps -ef | grep "jd_crazy_joy_coin" | grep -v "grep" | awk '{print "kill "$1}') 13 | echo '' >/scripts/logs/jd_crazy_joy_coin.log 14 | $CMD /scripts/jd_crazy_joy_coin.js | ts >>/scripts/logs/jd_crazy_joy_coin.log 2>&1 & 15 | echo "默认jd_crazy_joy_coin重启完成" 16 | else 17 | if [ $CRZAY_JOY_COIN_ENABLE = "Y" ]; then 18 | echo "配置启用jd_crazy_joy_coin,杀掉jd_crazy_joy_coin任务,并重启" 19 | eval $(ps -ef | grep "jd_crazy_joy_coin" | grep -v "grep" | awk '{print "kill "$1}') 20 | echo '' >/scripts/logs/jd_crazy_joy_coin.log 21 | $CMD /scripts/jd_crazy_joy_coin.js | ts >>/scripts/logs/jd_crazy_joy_coin.log 2>&1 & 22 | echo "配置jd_crazy_joy_coin重启完成" 23 | else 24 | eval $(ps -ef | grep "jd_crazy_joy_coin" | grep -v "grep" | awk '{print "kill "$1}') 25 | echo "已配置不启用jd_crazy_joy_coin任务,仅杀掉" 26 | fi 27 | fi 28 | -------------------------------------------------------------------------------- /function/config.js: -------------------------------------------------------------------------------- 1 | module.exports = {"ThreadJs":[],"invokeKey":"RtKLB8euDo7KwsO0"} -------------------------------------------------------------------------------- /function/eval.js: -------------------------------------------------------------------------------- 1 | function mainEval($) { 2 | return ` 3 | !(async () => { 4 | jdcookie = process.env.JD_COOKIE ? process.env.JD_COOKIE.split("&") : require("./function/jdcookie").cookie; 5 | cookies={ 6 | 'all':jdcookie, 7 | 'help': typeof(help) != 'undefined' ? [...jdcookie].splice(0,parseInt(help)):[] 8 | } 9 | $.sleep=cookies['all'].length * 500 10 | taskCookie=cookies['all'] 11 | jxAlgo = new common.jxAlgo(); 12 | if ($.readme) { 13 | console.log(\`使用说明:\\n\${$.readme}\\n以上内容仅供参考,有需求自行添加\\n\`,) 14 | } 15 | console.log(\`======================本次任务共\${taskCookie.length}个京东账户Cookie======================\\n\`) 16 | try{ 17 | await prepare(); 18 | 19 | if ($.sharecode.length > 0) { 20 | $.sharecode = $.sharecode.filter(d=>d && JSON.stringify(d)!='{}') 21 | console.log('助力码', $.sharecode ) 22 | } 23 | }catch(e1){console.log("初始函数不存在,将继续执行主函数Main\\n")} 24 | if (typeof(main) != 'undefined') { 25 | try{ 26 | for (let i = 0; i < taskCookie.filter(d => d).length; i++) { 27 | $.cookie = taskCookie[i]; 28 | $.user = decodeURIComponent($.cookie.match(/pt_pin=([^;]+)/)[1]) 29 | $.index = parseInt(i) + 1; 30 | let info = { 31 | 'index': $.index, 32 | 'user': $.user, 33 | 'cookie': $.cookie 34 | } 35 | if (!$.thread) { 36 | console.log(\`\n******开始【京东账号\${$.index}】\${$.user} 任务*********\n\`); 37 | } 38 | if ($.config[\`\${$.runfile}_except\`] && $.config[\`\${$.runfile}_except\`].includes(\$.user)) { 39 | console.log(\`全局变量\${$.runfile}_except中配置了该账号pt_pin,跳过此次任务\`) 40 | }else{ 41 | $.setCookie($.cookie) 42 | try{ 43 | if ($.sharecode.length > 0) { 44 | for (let smp of $.sharecode) { 45 | smp = Object.assign({ ...info}, smp); 46 | $.thread ? main(smp) : await main(smp); 47 | } 48 | }else{ 49 | $.thread ? main(info) : await main(info); 50 | } 51 | } 52 | catch(em){ 53 | console.log(em.message) 54 | } 55 | } 56 | 57 | 58 | } 59 | }catch(em){console.log(em.message)} 60 | if ($.thread) { 61 | await $.wait($.sleep) 62 | } 63 | } 64 | if (typeof(extra) != 'undefined') { 65 | console.log(\`============================开始运行额外任务============================\`) 66 | try{ 67 | await extra(); 68 | }catch(e4){console.log(e4.message)} 69 | } 70 | })().catch((e) => { 71 | console.log(e.message) 72 | }).finally(() => { 73 | if ($.message.length > 0) { 74 | $.notify($.message) 75 | } 76 | $.done(); 77 | }); 78 | 79 | ` 80 | } 81 | module.exports = { 82 | mainEval 83 | } 84 | -------------------------------------------------------------------------------- /function/h5st.ts: -------------------------------------------------------------------------------- 1 | import axios from "axios" 2 | import {format} from "date-fns" 3 | import * as CryptoJS from 'crypto-js' 4 | 5 | class H5ST { 6 | tk: string; 7 | timestamp: string; 8 | rd: string; 9 | appId: string; 10 | fp: string; 11 | time: number; 12 | ua: string 13 | enc: string; 14 | 15 | constructor(appId: string, ua: string, fp: string) { 16 | this.appId = appId 17 | this.ua = ua 18 | this.fp = fp || this.__genFp() 19 | } 20 | 21 | __genFp() { 22 | let e = "0123456789"; 23 | let a = 13; 24 | let i = ''; 25 | for (; a--;) 26 | i += e[Math.random() * e.length | 0]; 27 | return (i + Date.now()).slice(0, 16) 28 | } 29 | 30 | async __genAlgo() { 31 | this.time = Date.now() 32 | this.timestamp = format(this.time, "yyyyMMddHHmmssSSS") 33 | let {data} = await axios.post(`https://cactus.jd.com/request_algo?g_ty=ajax`, { 34 | 'version': '3.0', 35 | 'fp': this.fp, 36 | 'appId': this.appId.toString(), 37 | 'timestamp': this.time, 38 | 'platform': 'web', 39 | 'expandParams': '' 40 | }, { 41 | headers: { 42 | 'Host': 'cactus.jd.com', 43 | 'accept': 'application/json', 44 | 'content-type': 'application/json', 45 | 'user-agent': this.ua, 46 | } 47 | }) 48 | this.tk = data.data.result.tk 49 | this.rd = data.data.result.algo.match(/rd='(.*)'/)[1] 50 | this.enc = data.data.result.algo.match(/algo\.(.*)\(/)[1] 51 | } 52 | 53 | __genKey(tk: string, fp: string, ts: string, ai: string, algo: object) { 54 | let str = `${tk}${fp}${ts}${ai}${this.rd}`; 55 | return algo[this.enc](str, tk) 56 | } 57 | 58 | __genH5st(body: object) { 59 | let y = this.__genKey(this.tk, this.fp, this.timestamp, this.appId, CryptoJS).toString(CryptoJS.enc.Hex) 60 | let s = '' 61 | for (let key of Object.keys(body)) { 62 | key === 'body' ? s += `${key}:${CryptoJS.SHA256(body[key]).toString(CryptoJS.enc.Hex)}&` : s += `${key}:${body[key]}&` 63 | } 64 | s = s.slice(0, -1) 65 | s = CryptoJS.HmacSHA256(s, y).toString(CryptoJS.enc.Hex) 66 | return encodeURIComponent(`${this.timestamp};${this.fp};${this.appId.toString()};${this.tk};${s};3.0;${this.time.toString()}`) 67 | } 68 | } 69 | 70 | export { 71 | H5ST 72 | } -------------------------------------------------------------------------------- /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 | console.log(`您的cookie选择的是用&隔开\n`) 13 | CookieJDs = process.env.JD_COOKIE.split('&'); 14 | } else if (process.env.JD_COOKIE.indexOf('\n') > -1) { 15 | console.log(`您的cookie选择的是用换行隔开\n`) 16 | CookieJDs = process.env.JD_COOKIE.split('\n'); 17 | } else { 18 | CookieJDs = [process.env.JD_COOKIE]; 19 | } 20 | } 21 | /* 22 | if (JSON.stringify(process.env).indexOf('GITHUB')>-1) { 23 | console.log(`请勿使用github action运行此脚本,无论你是从你自己的私库还是其他哪里拉取的源代码,都会导致我被封号\n`); 24 | !(async () => { 25 | // await require('./sendNotify').sendNotify('提醒', `请勿使用github action、滥用github资源会封我仓库以及账号`) 26 | // await process.exit(0); 27 | })() 28 | } 29 | */ 30 | CookieJDs = [...new Set(CookieJDs.filter(item => !!item))] 31 | console.log(`\n====================共有${CookieJDs.length}个京东账号Cookie=========\n`); 32 | console.log(`==================脚本执行- 北京时间(UTC+8):${new Date(new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000).toLocaleString()}=====================\n`) 33 | if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {}; 34 | for (let i = 0; i < CookieJDs.length; i++) { 35 | const index = (i + 1 === 1) ? '' : (i + 1); 36 | exports['CookieJD' + index] = CookieJDs[i].trim(); 37 | } 38 | -------------------------------------------------------------------------------- /function/jdcookie.js: -------------------------------------------------------------------------------- 1 | // 本地测试在这边填写cookie 2 | let cookie = [ 3 | ]; 4 | module.exports = { 5 | cookie 6 | } 7 | -------------------------------------------------------------------------------- /function/jinli_log.ts: -------------------------------------------------------------------------------- 1 | let logs = [ 2 | '"random":"34038984","log":"1649609592095~18RCD4zkS04d41d8cd98f00b204e9800998ecf8427e~1,1~E97F477EB64B001195F05A4D48067CD6C272595D~0doi8po~C~TRpGXBAPbWUeE0ZbWxoIam8ZFF9AXxAPBxQQQkEXDBoDBwYMAw8KBgcAAw4KAgEMABoeE0VQUhoIE0ZBQkxGV0dTFBQQRldUFAIQRVRBV01TRFMXGhpCVVwXDGMGHQIZBhQBHQAZB2UeE1hfFAIDHRBWRRoIEwVQUFpQAFABAAgEVAZTD1sGBwABUw9RCQMHDw1WCQAFFBQQX0IXDBp+WFxAThhKCQRqAAwQHRBBFAIQAAQBDw4CCAcMBAgLBBAZFFJZEwgXVxoeE1RFVBoIExAZFFZEEwgXcVddVl5QFnFcUhwXGhpcUEQXDBoLAwsGBRoeE0FWRBoIagQDARQBBgdoGhpAXhAPbRpTEx4XVxoeE1MXGhpTEx4XVxoeE1MXGhpTE28ZFFFdUBAPFF5UV1RTUExGEx4XV1IQCxBAFBQQUlsXDBpFAhwHGAwQHRBWUGdEEwgXBggQHRBXUhoIE0BUWFxdXA8GAggBCQsNAhoeE19fFAJpAR4FGghvHRBXWldVEwgXVxoeE19GURoIE1MXSw==~04y5u3i"', 3 | 4 | 5 | ] 6 | 7 | export { 8 | logs 9 | } -------------------------------------------------------------------------------- /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 | 8 | const qlDir = '/ql'; 9 | const fs = require('fs'); 10 | let Fileexists = fs.existsSync('/ql/data/config/auth.json'); 11 | let authFile=""; 12 | if (Fileexists) 13 | authFile="/ql/data/config/auth.json" 14 | else 15 | authFile="/ql/config/auth.json" 16 | //const authFile = path.join(qlDir, 'config/auth.json'); 17 | 18 | const api = got.extend({ 19 | prefixUrl: 'http://127.0.0.1:5600', 20 | retry: { limit: 0 }, 21 | }); 22 | 23 | async function getToken() { 24 | const authConfig = JSON.parse(await readFile(authFile)); 25 | return authConfig.token; 26 | } 27 | 28 | module.exports.getEnvs = async () => { 29 | const token = await getToken(); 30 | const body = await api({ 31 | url: 'api/envs', 32 | searchParams: { 33 | searchValue: 'JD_COOKIE', 34 | t: Date.now(), 35 | }, 36 | headers: { 37 | Accept: 'application/json', 38 | authorization: `Bearer ${token}`, 39 | }, 40 | }).json(); 41 | return body.data; 42 | }; 43 | 44 | module.exports.getEnvsCount = async () => { 45 | const data = await this.getEnvs(); 46 | return data.length; 47 | }; 48 | 49 | module.exports.addEnv = async (cookie, remarks) => { 50 | const token = await getToken(); 51 | const body = await api({ 52 | method: 'post', 53 | url: 'api/envs', 54 | params: { t: Date.now() }, 55 | json: [{ 56 | name: 'JD_COOKIE', 57 | value: cookie, 58 | remarks, 59 | }], 60 | headers: { 61 | Accept: 'application/json', 62 | authorization: `Bearer ${token}`, 63 | 'Content-Type': 'application/json;charset=UTF-8', 64 | }, 65 | }).json(); 66 | return body; 67 | }; 68 | 69 | module.exports.updateEnv = async (cookie, eid, remarks) => { 70 | const token = await getToken(); 71 | const body = await api({ 72 | method: 'put', 73 | url: 'api/envs', 74 | params: { t: Date.now() }, 75 | json: { 76 | name: 'JD_COOKIE', 77 | value: cookie, 78 | _id: eid, 79 | remarks, 80 | }, 81 | headers: { 82 | Accept: 'application/json', 83 | authorization: `Bearer ${token}`, 84 | 'Content-Type': 'application/json;charset=UTF-8', 85 | }, 86 | }).json(); 87 | return body; 88 | }; 89 | 90 | module.exports.updateEnv11 = async (cookie, eid, remarks) => { 91 | const token = await getToken(); 92 | const body = await api({ 93 | method: 'put', 94 | url: 'api/envs', 95 | params: { t: Date.now() }, 96 | json: { 97 | name: 'JD_COOKIE', 98 | value: cookie, 99 | id: eid, 100 | remarks, 101 | }, 102 | headers: { 103 | Accept: 'application/json', 104 | authorization: `Bearer ${token}`, 105 | 'Content-Type': 'application/json;charset=UTF-8', 106 | }, 107 | }).json(); 108 | return body; 109 | }; 110 | 111 | module.exports.DisableCk = async (eid) => { 112 | const token = await getToken(); 113 | const body = await api({ 114 | method: 'put', 115 | url: 'api/envs/disable', 116 | params: { t: Date.now() }, 117 | body: JSON.stringify([eid]), 118 | headers: { 119 | Accept: 'application/json', 120 | authorization: `Bearer ${token}`, 121 | 'Content-Type': 'application/json;charset=UTF-8', 122 | }, 123 | }).json(); 124 | return body; 125 | }; 126 | 127 | module.exports.EnableCk = async (eid) => { 128 | const token = await getToken(); 129 | const body = await api({ 130 | method: 'put', 131 | url: 'api/envs/enable', 132 | params: { t: Date.now() }, 133 | body: JSON.stringify([eid]), 134 | headers: { 135 | Accept: 'application/json', 136 | authorization: `Bearer ${token}`, 137 | 'Content-Type': 'application/json;charset=UTF-8', 138 | }, 139 | }).json(); 140 | return body; 141 | }; 142 | 143 | module.exports.getstatus = async(eid) => { 144 | const envs = await this.getEnvs(); 145 | var tempid = 0; 146 | for (let i = 0; i < envs.length; i++) { 147 | tempid = 0; 148 | if (envs[i]._id) { 149 | tempid = envs[i]._id; 150 | } 151 | if (envs[i].id) { 152 | tempid = envs[i].id; 153 | } 154 | if (tempid == eid) { 155 | return envs[i].status; 156 | } 157 | } 158 | return 99; 159 | }; 160 | 161 | module.exports.getEnvById = async(eid) => { 162 | const envs = await this.getEnvs(); 163 | var tempid = 0; 164 | for (let i = 0; i < envs.length; i++) { 165 | tempid = 0; 166 | if (envs[i]._id) { 167 | tempid = envs[i]._id; 168 | } 169 | if (envs[i].id) { 170 | tempid = envs[i].id; 171 | } 172 | if (tempid == eid) { 173 | return envs[i].value; 174 | } 175 | } 176 | return ""; 177 | }; 178 | 179 | module.exports.getEnvByPtPin = async (Ptpin) => { 180 | const envs = await this.getEnvs(); 181 | for (let i = 0; i < envs.length; i++) { 182 | var tempptpin = decodeURIComponent(envs[i].value.match(/pt_pin=([^; ]+)(?=;?)/) && envs[i].value.match(/pt_pin=([^; ]+)(?=;?)/)[1]); 183 | if(tempptpin==Ptpin){ 184 | return envs[i]; 185 | } 186 | } 187 | return ""; 188 | }; 189 | 190 | module.exports.delEnv = async (eid) => { 191 | const token = await getToken(); 192 | const body = await api({ 193 | method: 'delete', 194 | url: 'api/envs', 195 | params: { t: Date.now() }, 196 | body: JSON.stringify([eid]), 197 | headers: { 198 | Accept: 'application/json', 199 | authorization: `Bearer ${token}`, 200 | 'Content-Type': 'application/json;charset=UTF-8', 201 | }, 202 | }).json(); 203 | return body; 204 | }; 205 | -------------------------------------------------------------------------------- /icon/DD_bot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyzaw/AllJDScripts/db09b94b0faa9cdec3c00b4fb7ff8b859157f438/icon/DD_bot.png -------------------------------------------------------------------------------- /icon/Snipaste_2020-08-28_09-31-42.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyzaw/AllJDScripts/db09b94b0faa9cdec3c00b4fb7ff8b859157f438/icon/Snipaste_2020-08-28_09-31-42.png -------------------------------------------------------------------------------- /icon/TG_PUSH1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyzaw/AllJDScripts/db09b94b0faa9cdec3c00b4fb7ff8b859157f438/icon/TG_PUSH1.png -------------------------------------------------------------------------------- /icon/TG_PUSH2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyzaw/AllJDScripts/db09b94b0faa9cdec3c00b4fb7ff8b859157f438/icon/TG_PUSH2.png -------------------------------------------------------------------------------- /icon/TG_PUSH3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyzaw/AllJDScripts/db09b94b0faa9cdec3c00b4fb7ff8b859157f438/icon/TG_PUSH3.png -------------------------------------------------------------------------------- /icon/action1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyzaw/AllJDScripts/db09b94b0faa9cdec3c00b4fb7ff8b859157f438/icon/action1.png -------------------------------------------------------------------------------- /icon/action2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyzaw/AllJDScripts/db09b94b0faa9cdec3c00b4fb7ff8b859157f438/icon/action2.png -------------------------------------------------------------------------------- /icon/action3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyzaw/AllJDScripts/db09b94b0faa9cdec3c00b4fb7ff8b859157f438/icon/action3.png -------------------------------------------------------------------------------- /icon/bark.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyzaw/AllJDScripts/db09b94b0faa9cdec3c00b4fb7ff8b859157f438/icon/bark.jpg -------------------------------------------------------------------------------- /icon/bean_sign_simple.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyzaw/AllJDScripts/db09b94b0faa9cdec3c00b4fb7ff8b859157f438/icon/bean_sign_simple.jpg -------------------------------------------------------------------------------- /icon/disable-action.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyzaw/AllJDScripts/db09b94b0faa9cdec3c00b4fb7ff8b859157f438/icon/disable-action.jpg -------------------------------------------------------------------------------- /icon/fork.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyzaw/AllJDScripts/db09b94b0faa9cdec3c00b4fb7ff8b859157f438/icon/fork.png -------------------------------------------------------------------------------- /icon/git1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyzaw/AllJDScripts/db09b94b0faa9cdec3c00b4fb7ff8b859157f438/icon/git1.jpg -------------------------------------------------------------------------------- /icon/git10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyzaw/AllJDScripts/db09b94b0faa9cdec3c00b4fb7ff8b859157f438/icon/git10.jpg -------------------------------------------------------------------------------- /icon/git11.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyzaw/AllJDScripts/db09b94b0faa9cdec3c00b4fb7ff8b859157f438/icon/git11.jpg -------------------------------------------------------------------------------- /icon/git12.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyzaw/AllJDScripts/db09b94b0faa9cdec3c00b4fb7ff8b859157f438/icon/git12.jpg -------------------------------------------------------------------------------- /icon/git13.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyzaw/AllJDScripts/db09b94b0faa9cdec3c00b4fb7ff8b859157f438/icon/git13.jpg -------------------------------------------------------------------------------- /icon/git14.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyzaw/AllJDScripts/db09b94b0faa9cdec3c00b4fb7ff8b859157f438/icon/git14.jpg -------------------------------------------------------------------------------- /icon/git2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyzaw/AllJDScripts/db09b94b0faa9cdec3c00b4fb7ff8b859157f438/icon/git2.jpg -------------------------------------------------------------------------------- /icon/git3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyzaw/AllJDScripts/db09b94b0faa9cdec3c00b4fb7ff8b859157f438/icon/git3.jpg -------------------------------------------------------------------------------- /icon/git4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyzaw/AllJDScripts/db09b94b0faa9cdec3c00b4fb7ff8b859157f438/icon/git4.jpg -------------------------------------------------------------------------------- /icon/git5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyzaw/AllJDScripts/db09b94b0faa9cdec3c00b4fb7ff8b859157f438/icon/git5.jpg -------------------------------------------------------------------------------- /icon/git6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyzaw/AllJDScripts/db09b94b0faa9cdec3c00b4fb7ff8b859157f438/icon/git6.jpg -------------------------------------------------------------------------------- /icon/git7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyzaw/AllJDScripts/db09b94b0faa9cdec3c00b4fb7ff8b859157f438/icon/git7.png -------------------------------------------------------------------------------- /icon/git8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyzaw/AllJDScripts/db09b94b0faa9cdec3c00b4fb7ff8b859157f438/icon/git8.jpg -------------------------------------------------------------------------------- /icon/git9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyzaw/AllJDScripts/db09b94b0faa9cdec3c00b4fb7ff8b859157f438/icon/git9.jpg -------------------------------------------------------------------------------- /icon/iCloud1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyzaw/AllJDScripts/db09b94b0faa9cdec3c00b4fb7ff8b859157f438/icon/iCloud1.png -------------------------------------------------------------------------------- /icon/iCloud2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyzaw/AllJDScripts/db09b94b0faa9cdec3c00b4fb7ff8b859157f438/icon/iCloud2.png -------------------------------------------------------------------------------- /icon/iCloud3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyzaw/AllJDScripts/db09b94b0faa9cdec3c00b4fb7ff8b859157f438/icon/iCloud3.png -------------------------------------------------------------------------------- /icon/iCloud4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyzaw/AllJDScripts/db09b94b0faa9cdec3c00b4fb7ff8b859157f438/icon/iCloud4.png -------------------------------------------------------------------------------- /icon/iCloud5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyzaw/AllJDScripts/db09b94b0faa9cdec3c00b4fb7ff8b859157f438/icon/iCloud5.png -------------------------------------------------------------------------------- /icon/iCloud6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyzaw/AllJDScripts/db09b94b0faa9cdec3c00b4fb7ff8b859157f438/icon/iCloud6.png -------------------------------------------------------------------------------- /icon/iCloud7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyzaw/AllJDScripts/db09b94b0faa9cdec3c00b4fb7ff8b859157f438/icon/iCloud7.png -------------------------------------------------------------------------------- /icon/iCloud8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyzaw/AllJDScripts/db09b94b0faa9cdec3c00b4fb7ff8b859157f438/icon/iCloud8.png -------------------------------------------------------------------------------- /icon/jd1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyzaw/AllJDScripts/db09b94b0faa9cdec3c00b4fb7ff8b859157f438/icon/jd1.jpg -------------------------------------------------------------------------------- /icon/jd2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyzaw/AllJDScripts/db09b94b0faa9cdec3c00b4fb7ff8b859157f438/icon/jd2.jpg -------------------------------------------------------------------------------- /icon/jd3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyzaw/AllJDScripts/db09b94b0faa9cdec3c00b4fb7ff8b859157f438/icon/jd3.jpg -------------------------------------------------------------------------------- /icon/jd4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyzaw/AllJDScripts/db09b94b0faa9cdec3c00b4fb7ff8b859157f438/icon/jd4.jpg -------------------------------------------------------------------------------- /icon/jd5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyzaw/AllJDScripts/db09b94b0faa9cdec3c00b4fb7ff8b859157f438/icon/jd5.png -------------------------------------------------------------------------------- /icon/jd6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyzaw/AllJDScripts/db09b94b0faa9cdec3c00b4fb7ff8b859157f438/icon/jd6.png -------------------------------------------------------------------------------- /icon/jd7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyzaw/AllJDScripts/db09b94b0faa9cdec3c00b4fb7ff8b859157f438/icon/jd7.png -------------------------------------------------------------------------------- /icon/jd8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyzaw/AllJDScripts/db09b94b0faa9cdec3c00b4fb7ff8b859157f438/icon/jd8.png -------------------------------------------------------------------------------- /icon/jd_moneyTree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyzaw/AllJDScripts/db09b94b0faa9cdec3c00b4fb7ff8b859157f438/icon/jd_moneyTree.png -------------------------------------------------------------------------------- /icon/jd_pet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyzaw/AllJDScripts/db09b94b0faa9cdec3c00b4fb7ff8b859157f438/icon/jd_pet.png -------------------------------------------------------------------------------- /icon/qh1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyzaw/AllJDScripts/db09b94b0faa9cdec3c00b4fb7ff8b859157f438/icon/qh1.png -------------------------------------------------------------------------------- /icon/qh2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyzaw/AllJDScripts/db09b94b0faa9cdec3c00b4fb7ff8b859157f438/icon/qh2.png -------------------------------------------------------------------------------- /icon/qh3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyzaw/AllJDScripts/db09b94b0faa9cdec3c00b4fb7ff8b859157f438/icon/qh3.png -------------------------------------------------------------------------------- /icon/txy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyzaw/AllJDScripts/db09b94b0faa9cdec3c00b4fb7ff8b859157f438/icon/txy.png -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | //'use strict'; 2 | exports.main_handler = async (event, context, callback) => { 3 | try { 4 | const { TENCENTSCF_SOURCE_TYPE, TENCENTSCF_SOURCE_URL } = process.env 5 | //如果想在一个定时触发器里面执行多个js文件需要在定时触发器的【附加信息】里面填写对应的名称,用 & 链接 6 | //例如我想一个定时触发器里执行jd_speed.js和jd_bean_change.js,在定时触发器的【附加信息】里面就填写 jd_speed&jd_bean_change 7 | for (const v of event["Message"].split("&")) { 8 | console.log(v); 9 | var request = require('request'); 10 | switch (TENCENTSCF_SOURCE_TYPE) { 11 | case 'local': 12 | //1.执行自己上传的js文件 13 | delete require.cache[require.resolve('./'+v+'.js')]; 14 | require('./'+v+'.js') 15 | break; 16 | case 'git': 17 | //2.执行github远端的js文件(因github的raw类型的文件被墙,此方法云函数不推荐) 18 | request(`https://raw.githubusercontent.com/xxx/jd_scripts/master/${v}.js`, function (error, response, body) { 19 | eval(response.body) 20 | }) 21 | break; 22 | case 'custom': 23 | //3.执行自定义远端js文件网址 24 | if (!TENCENTSCF_SOURCE_URL) return console.log('自定义模式需要设置TENCENTSCF_SOURCE_URL变量') 25 | request(`${TENCENTSCF_SOURCE_URL}${v}.js`, function (error, response, body) { 26 | eval(response.body) 27 | }) 28 | break; 29 | default: 30 | //4.执行国内gitee远端的js文件(如果部署在国内节点,选择1或3。默认使用gitee的方式) 31 | request(`${v}.js`, function (error, response, body) { 32 | eval(response.body) 33 | }) 34 | break; 35 | } 36 | } 37 | } catch (e) { 38 | console.error(e) 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /jdCookie.js: -------------------------------------------------------------------------------- 1 | /* 2 | ================================================================================ 3 | 魔改自 https://github.com/shufflewzc/faker2/blob/main/jdCookie.js 4 | 修改内容:与task_before.sh配合,由task_before.sh设置要设置要做互助的活动的 ShareCodeConfigName 和 ShareCodeEnvName 环境变量, 5 | 然后在这里实际解析/ql/log/.ShareCode中该活动对应的配置信息(由code.sh生成和维护),注入到nodejs的环境变量中 6 | 修改原因:原先的task_before.sh直接将互助信息注入到shell的env中,在ck超过45以上时,互助码环境变量过大会导致调用一些系统命令 7 | (如date/cat)时报 Argument list too long,而在node中修改环境变量不会受这个限制,也不会影响外部shell环境,确保脚本可以正常运行 8 | 魔改作者:风之凌殇 9 | ================================================================================ 10 | 11 | 此文件为Node.js专用。其他用户请忽略 12 | */ 13 | //此处填写京东账号cookie。 14 | let CookieJDs = [ 15 | ] 16 | // 判断环境变量里面是否有京东ck 17 | if (process.env.JD_COOKIE) { 18 | if (process.env.JD_COOKIE.indexOf('&') > -1) { 19 | CookieJDs = process.env.JD_COOKIE.split('&'); 20 | } else if (process.env.JD_COOKIE.indexOf('\n') > -1) { 21 | CookieJDs = process.env.JD_COOKIE.split('\n'); 22 | } else { 23 | CookieJDs = [process.env.JD_COOKIE]; 24 | } 25 | } 26 | if (JSON.stringify(process.env).indexOf('GITHUB')>-1) { 27 | console.log(`请勿使用github action运行此脚本,无论你是从你自己的私库还是其他哪里拉取的源代码,都会导致我被封号\n`); 28 | !(async () => { 29 | await require('./sendNotify').sendNotify('提醒', `请勿使用github action、滥用github资源会封我仓库以及账号`) 30 | await process.exit(0); 31 | })() 32 | } 33 | CookieJDs = [...new Set(CookieJDs.filter(item => !!item))] 34 | console.log(`\n====================共${CookieJDs.length}个京东账号Cookie=========\n`); 35 | console.log(`==================脚本执行- 北京时间(UTC+8):${new Date(new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000).toLocaleString('zh', {hour12: false}).replace(' 24:',' 00:')}=====================\n`) 36 | if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {}; 37 | for (let i = 0; i < CookieJDs.length; i++) { 38 | if (!CookieJDs[i].match(/pt_pin=(.+?);/) || !CookieJDs[i].match(/pt_key=(.+?);/)) console.log(`\n提示:京东cookie 【${CookieJDs[i]}】填写不规范,可能会影响部分脚本正常使用。正确格式为: pt_key=xxx;pt_pin=xxx;(分号;不可少)\n`); 39 | const index = (i + 1 === 1) ? '' : (i + 1); 40 | exports['CookieJD' + index] = CookieJDs[i].trim(); 41 | } 42 | 43 | // 以下为注入互助码环境变量(仅nodejs内起效)的代码 44 | function SetShareCodesEnv(nameConfig = "", envName = "") { 45 | let rawCodeConfig = {} 46 | 47 | // 读取互助码 48 | shareCodeLogPath = `${process.env.QL_DIR}/log/.ShareCode/${nameConfig}.log` 49 | let fs = require('fs') 50 | if (fs.existsSync(shareCodeLogPath)) { 51 | // 因为faker2目前没有自带ini,改用已有的dotenv来解析 52 | // // 利用ini模块读取原始互助码和互助组信息 53 | // let ini = require('ini') 54 | // rawCodeConfig = ini.parse(fs.readFileSync(shareCodeLogPath, 'utf-8')) 55 | 56 | // 使用env模块 57 | require('dotenv').config({path: shareCodeLogPath}) 58 | rawCodeConfig = process.env 59 | } 60 | 61 | // 解析每个用户的互助码 62 | codes = {} 63 | Object.keys(rawCodeConfig).forEach(function (key) { 64 | if (key.startsWith(`My${nameConfig}`)) { 65 | codes[key] = rawCodeConfig[key] 66 | } 67 | }); 68 | 69 | // 解析每个用户要帮助的互助码组,将用户实际的互助码填充进去 70 | let helpOtherCodes = {} 71 | Object.keys(rawCodeConfig).forEach(function (key) { 72 | if (key.startsWith(`ForOther${nameConfig}`)) { 73 | helpCode = rawCodeConfig[key] 74 | for (const [codeEnv, codeVal] of Object.entries(codes)) { 75 | helpCode = helpCode.replace("${" + codeEnv + "}", codeVal) 76 | } 77 | 78 | helpOtherCodes[key] = helpCode 79 | } 80 | }); 81 | 82 | // 按顺序用&拼凑到一起,并放入环境变量,供目标脚本使用 83 | let shareCodes = [] 84 | let totalCodeCount = Object.keys(helpOtherCodes).length 85 | for (let idx = 1; idx <= totalCodeCount; idx++) { 86 | shareCodes.push(helpOtherCodes[`ForOther${nameConfig}${idx}`]) 87 | } 88 | let shareCodesStr = shareCodes.join('&') 89 | process.env[envName] = shareCodesStr 90 | 91 | console.info(`【风之凌殇】 友情提示:为避免ck超过45以上时,互助码环境变量过大而导致调用一些系统命令(如date/cat)时报 Argument list too long,改为在nodejs中设置 ${nameConfig} 的 互助码环境变量 ${envName},共计 ${totalCodeCount} 组互助码,总大小为 ${shareCodesStr.length}`) 92 | } 93 | 94 | // 若在task_before.sh 中设置了要设置互助码环境变量的活动名称和环境变量名称信息,则在nodejs中处理,供活动使用 95 | let nameConfig = process.env.ShareCodeConfigName 96 | let envName = process.env.ShareCodeEnvName 97 | if (nameConfig && envName) { 98 | SetShareCodesEnv(nameConfig, envName) 99 | } else { 100 | console.debug(`hyzaw 友情提示:您的脚本正常运行中`) 101 | } -------------------------------------------------------------------------------- /jdCookie.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # @Time : 2022/7/6 23:00 4 | # @Author : HarbourJ 5 | # @TG : https://t.me/HarbourToulu 6 | # @File : jdCookie.py 7 | 8 | import os 9 | import time 10 | from functools import partial 11 | print = partial(print, flush=True) 12 | 13 | 14 | def get_cookies(): 15 | CookieJDs = [] 16 | if os.environ.get("JD_COOKIE"): 17 | print("已获取并使用Env环境 Cookie") 18 | if '&' in os.environ["JD_COOKIE"]: 19 | CookieJDs = os.environ["JD_COOKIE"].split('&') 20 | elif '\n' in os.environ["JD_COOKIE"]: 21 | CookieJDs = os.environ["JD_COOKIE"].split('\n') 22 | else: 23 | CookieJDs = [os.environ["JD_COOKIE"]] 24 | # return CookieJDs 25 | else: 26 | if os.path.exists("JD_COOKIE.txt"): 27 | with open("JD_COOKIE.txt", 'r') as f: 28 | JD_COOKIEs = f.read().strip() 29 | if JD_COOKIEs: 30 | if '&' in JD_COOKIEs: 31 | CookieJDs = JD_COOKIEs.split('&') 32 | elif '\n' in JD_COOKIEs: 33 | CookieJDs = JD_COOKIEs.split('\n') 34 | else: 35 | CookieJDs = [JD_COOKIEs] 36 | CookieJDs = sorted(set(CookieJDs), key=CookieJDs.index) 37 | # return CookieJDs 38 | else: 39 | print("未获取到正确✅格式的京东账号Cookie") 40 | return 41 | 42 | print(f"====================共{len(CookieJDs)}个京东账号Cookie=========\n") 43 | print(f"==================脚本执行- 北京时间(UTC+8):{time.strftime('%Y/%m/%d %H:%M:%S', time.localtime())}=====================\n") 44 | return CookieJDs 45 | 46 | # if __name__ == "__main__": 47 | # get_cookies() 48 | # print(os.environ.get("JD_COOKIE")) 49 | -------------------------------------------------------------------------------- /jdDreamFactoryShareCodes.js: -------------------------------------------------------------------------------- 1 | /* 2 | 京喜工厂互助码 3 | 此文件为Node.js专用。其他用户请忽略 4 | 支持京东N个账号 5 | */ 6 | //云服务器腾讯云函数等NOde.js用户在此处填写东东萌宠的好友码。 7 | // 同一个京东账号的好友互助码用@符号隔开,不同京东账号之间用&符号或者换行隔开,下面给一个示例 8 | // 如: 京东账号1的shareCode1@京东账号1的shareCode2&京东账号2的shareCode1@京东账号2的shareCode2 9 | let shareCodes = [ 10 | ''] 11 | 12 | // 从日志获取互助码 13 | // const logShareCodes = require('./utils/jdShareCodes'); 14 | // if (logShareCodes.DREAM_FACTORY_SHARE_CODES.length > 0 && !process.env.DREAM_FACTORY_SHARE_CODES) { 15 | // process.env.DREAM_FACTORY_SHARE_CODES = logShareCodes.DREAM_FACTORY_SHARE_CODES.join('&'); 16 | // } 17 | 18 | // 判断环境变量里面是否有京喜工厂互助码 19 | if (process.env.DREAM_FACTORY_SHARE_CODES) { 20 | if (process.env.DREAM_FACTORY_SHARE_CODES.indexOf('&') > -1) { 21 | console.log(`您的互助码选择的是用&隔开\n`) 22 | shareCodes = process.env.DREAM_FACTORY_SHARE_CODES.split('&'); 23 | } else if (process.env.DREAM_FACTORY_SHARE_CODES.indexOf('\n') > -1) { 24 | console.log(`您的互助码选择的是用换行隔开\n`) 25 | shareCodes = process.env.DREAM_FACTORY_SHARE_CODES.split('\n'); 26 | } else { 27 | shareCodes = process.env.DREAM_FACTORY_SHARE_CODES.split(); 28 | } 29 | } else { 30 | console.log(`由于您环境变量(DREAM_FACTORY_SHARE_CODES)里面未提供助力码,故此处运行将会给脚本内置的码进行助力,请知晓!`) 31 | } 32 | for (let i = 0; i < shareCodes.length; i++) { 33 | const index = (i + 1 === 1) ? '' : (i + 1); 34 | exports['shareCodes' + index] = shareCodes[i]; 35 | } 36 | -------------------------------------------------------------------------------- /jdFactoryShareCodes.js: -------------------------------------------------------------------------------- 1 | /* 2 | 东东工厂互助码 3 | 此文件为Node.js专用。其他用户请忽略 4 | 支持京东N个账号 5 | */ 6 | //云服务器腾讯云函数等NOde.js用户在此处填写东东萌宠的好友码。 7 | // 同一个京东账号的好友互助码用@符号隔开,不同京东账号之间用&符号或者换行隔开,下面给一个示例 8 | // 如: 京东账号1的shareCode1@京东账号1的shareCode2&京东账号2的shareCode1@京东账号2的shareCode2 9 | let shareCodes = [ 10 | '',//账号一的好友shareCode,不同好友中间用@符号隔开 11 | '',//账号二的好友shareCode,不同好友中间用@符号隔开 12 | ] 13 | 14 | // 从日志获取互助码 15 | // const logShareCodes = require('./utils/jdShareCodes'); 16 | // if (logShareCodes.DDFACTORY_SHARECODES.length > 0 && !process.env.DDFACTORY_SHARECODES) { 17 | // process.env.DDFACTORY_SHARECODES = logShareCodes.DDFACTORY_SHARECODES.join('&'); 18 | // } 19 | 20 | // 判断环境变量里面是否有东东工厂互助码 21 | if (process.env.DDFACTORY_SHARECODES) { 22 | if (process.env.DDFACTORY_SHARECODES.indexOf('&') > -1) { 23 | console.log(`您的互助码选择的是用&隔开\n`) 24 | shareCodes = process.env.DDFACTORY_SHARECODES.split('&'); 25 | } else if (process.env.DDFACTORY_SHARECODES.indexOf('\n') > -1) { 26 | console.log(`您的互助码选择的是用换行隔开\n`) 27 | shareCodes = process.env.DDFACTORY_SHARECODES.split('\n'); 28 | } else { 29 | shareCodes = process.env.DDFACTORY_SHARECODES.split(); 30 | } 31 | } else { 32 | console.log(`由于您环境变量(DDFACTORY_SHARECODES)里面未提供助力码,故此处运行将会给脚本内置的码进行助力,请知晓!`) 33 | } 34 | for (let i = 0; i < shareCodes.length; i++) { 35 | const index = (i + 1 === 1) ? '' : (i + 1); 36 | exports['shareCodes' + index] = shareCodes[i]; 37 | } -------------------------------------------------------------------------------- /jdFruitShareCodes.js: -------------------------------------------------------------------------------- 1 | /* 2 | 东东农场互助码 3 | 此文件为Node.js专用。其他用户请忽略 4 | 支持京东N个账号 5 | */ 6 | //云服务器腾讯云函数等NOde.js用户在此处填写京东东农场的好友码。 7 | // 同一个京东账号的好友互助码用@符号隔开,不同京东账号之间用&符号或者换行隔开,下面给一个示例 8 | // 如: 京东账号1的shareCode1@京东账号1的shareCode2&京东账号2的shareCode1@京东账号2的shareCode2 9 | let FruitShareCodes = [ 10 | ''] 11 | 12 | // 从日志获取互助码 13 | // const logShareCodes = require('./utils/jdShareCodes'); 14 | // if (logShareCodes.FRUITSHARECODES.length > 0 && !process.env.FRUITSHARECODES) { 15 | // process.env.FRUITSHARECODES = logShareCodes.FRUITSHARECODES.join('&'); 16 | // } 17 | 18 | // 判断github action里面是否有东东农场互助码 19 | if (process.env.FRUITSHARECODES) { 20 | if (process.env.FRUITSHARECODES.indexOf('&') > -1) { 21 | console.log(`您的东东农场互助码选择的是用&隔开\n`) 22 | FruitShareCodes = process.env.FRUITSHARECODES.split('&'); 23 | } else if (process.env.FRUITSHARECODES.indexOf('\n') > -1) { 24 | console.log(`您的东东农场互助码选择的是用换行隔开\n`) 25 | FruitShareCodes = process.env.FRUITSHARECODES.split('\n'); 26 | } else { 27 | FruitShareCodes = process.env.FRUITSHARECODES.split(); 28 | } 29 | } else { 30 | console.log(`由于您环境变量(FRUITSHARECODES)里面未提供助力码,故此处运行将会给脚本内置的码进行助力,请知晓!`) 31 | } 32 | for (let i = 0; i < FruitShareCodes.length; i++) { 33 | const index = (i + 1 === 1) ? '' : (i + 1); 34 | exports['FruitShareCode' + index] = FruitShareCodes[i]; 35 | } 36 | -------------------------------------------------------------------------------- /jdJxncShareCodes.js: -------------------------------------------------------------------------------- 1 | /* 2 | 京喜农场助力码 3 | 此助力码要求种子 active 相同才能助力,多个账号的话可以种植同样的种子,如果种子不同的话,会自动跳过使用云端助力 4 | 此文件为Node.js专用。其他用户请忽略 5 | 支持京东N个账号 6 | */ 7 | //云服务器腾讯云函数等NOde.js用户在此处填写京京喜农场的好友码。 8 | // 同一个京东账号的好友助力码用@符号隔开,不同京东账号之间用&符号或者换行隔开,下面给一个示例 9 | // 如: 京东账号1的shareCode1@京东账号1的shareCode2&京东账号2的shareCode1@京东账号2的shareCode2 10 | // 注意:京喜农场 种植种子发生变化的时候,互助码也会变!! 11 | // 注意:京喜农场 种植种子发生变化的时候,互助码也会变!! 12 | // 注意:京喜农场 种植种子发生变化的时候,互助码也会变!! 13 | // 每个账号 shareCdoe 是一个 json,示例如下 14 | // {"smp":"22bdadsfaadsfadse8a","active":"jdnc_1_btorange210113_2","joinnum":"1"} 15 | let JxncShareCodes = [ 16 | '',//账号一的好友shareCode,不同好友中间用@符号隔开 17 | '',//账号二的好友shareCode,不同好友中间用@符号隔开 18 | ] 19 | // 判断github action里面是否有京喜农场助力码 20 | if (process.env.JXNC_SHARECODES) { 21 | if (process.env.JXNC_SHARECODES.indexOf('&') > -1) { 22 | console.log(`您的京喜农场助力码选择的是用&隔开\n`) 23 | JxncShareCodes = process.env.JXNC_SHARECODES.split('&'); 24 | } else if (process.env.JXNC_SHARECODES.indexOf('\n') > -1) { 25 | console.log(`您的京喜农场助力码选择的是用换行隔开\n`) 26 | JxncShareCodes = process.env.JXNC_SHARECODES.split('\n'); 27 | } else { 28 | JxncShareCodes = process.env.JXNC_SHARECODES.split(); 29 | } 30 | } else { 31 | console.log(`由于您环境变量里面(JXNC_SHARECODES)未提供助力码,故此处运行将会给脚本内置的码进行助力,请知晓!`) 32 | } 33 | JxncShareCodes = JxncShareCodes.filter(item => !!item); 34 | for (let i = 0; i < JxncShareCodes.length; i++) { 35 | const index = (i + 1 === 1) ? '' : (i + 1); 36 | exports['JxncShareCode' + index] = JxncShareCodes[i]; 37 | } 38 | -------------------------------------------------------------------------------- /jdPetShareCodes.js: -------------------------------------------------------------------------------- 1 | /* 2 | 东东萌宠互助码 3 | 此文件为Node.js专用。其他用户请忽略 4 | 支持京东N个账号 5 | */ 6 | //云服务器腾讯云函数等NOde.js用户在此处填写东东萌宠的好友码。 7 | // 同一个京东账号的好友互助码用@符号隔开,不同京东账号之间用&符号或者换行隔开,下面给一个示例 8 | // 如: 京东账号1的shareCode1@京东账号1的shareCode2&京东账号2的shareCode1@京东账号2的shareCode2 9 | let PetShareCodes = [ 10 | ''] 11 | 12 | // 从日志获取互助码 13 | // const logShareCodes = require('./utils/jdShareCodes'); 14 | // if (logShareCodes.PETSHARECODES.length > 0 && !process.env.PETSHARECODES) { 15 | // process.env.PETSHARECODES = logShareCodes.PETSHARECODES.join('&'); 16 | // } 17 | 18 | // 判断github action里面是否有东东萌宠互助码 19 | if (process.env.PETSHARECODES) { 20 | if (process.env.PETSHARECODES.indexOf('&') > -1) { 21 | console.log(`您的东东萌宠互助码选择的是用&隔开\n`) 22 | PetShareCodes = process.env.PETSHARECODES.split('&'); 23 | } else if (process.env.PETSHARECODES.indexOf('\n') > -1) { 24 | console.log(`您的东东萌宠互助码选择的是用换行隔开\n`) 25 | PetShareCodes = process.env.PETSHARECODES.split('\n'); 26 | } else { 27 | PetShareCodes = process.env.PETSHARECODES.split(); 28 | } 29 | } else { 30 | console.log(`由于您环境变量(PETSHARECODES)里面未提供助力码,故此处运行将会给脚本内置的码进行助力,请知晓!`) 31 | } 32 | for (let i = 0; i < PetShareCodes.length; i++) { 33 | const index = (i + 1 === 1) ? '' : (i + 1); 34 | exports['PetShareCode' + index] = PetShareCodes[i]; 35 | } -------------------------------------------------------------------------------- /jdPlantBeanShareCodes.js: -------------------------------------------------------------------------------- 1 | /* 2 | 京东种豆得豆互助码 3 | 此文件为Node.js专用。其他用户请忽略 4 | 支持京东N个账号 5 | */ 6 | //云服务器腾讯云函数等NOde.js用户在此处填写东东萌宠的好友码。 7 | // 同一个京东账号的好友互助码用@符号隔开,不同京东账号之间用&符号或者换行隔开,下面给一个示例 8 | // 如: 京东账号1的shareCode1@京东账号1的shareCode2&京东账号2的shareCode1@京东账号2的shareCode2 9 | let PlantBeanShareCodes = [ 10 | ''] 11 | 12 | // 从日志获取互助码 13 | // const logShareCodes = require('./utils/jdShareCodes'); 14 | // if (logShareCodes.PLANT_BEAN_SHARECODES.length > 0 && !process.env.PLANT_BEAN_SHARECODES) { 15 | // process.env.PLANT_BEAN_SHARECODES = logShareCodes.PLANT_BEAN_SHARECODES.join('&'); 16 | // } 17 | 18 | // 判断github action里面是否有种豆得豆互助码 19 | if (process.env.PLANT_BEAN_SHARECODES) { 20 | if (process.env.PLANT_BEAN_SHARECODES.indexOf('&') > -1) { 21 | console.log(`您的种豆互助码选择的是用&隔开\n`) 22 | PlantBeanShareCodes = process.env.PLANT_BEAN_SHARECODES.split('&'); 23 | } else if (process.env.PLANT_BEAN_SHARECODES.indexOf('\n') > -1) { 24 | console.log(`您的种豆互助码选择的是用换行隔开\n`) 25 | PlantBeanShareCodes = process.env.PLANT_BEAN_SHARECODES.split('\n'); 26 | } else { 27 | PlantBeanShareCodes = process.env.PLANT_BEAN_SHARECODES.split(); 28 | } 29 | } else { 30 | console.log(`由于您环境变量(PLANT_BEAN_SHARECODES)里面未提供助力码,故此处运行将会给脚本内置的码进行助力,请知晓!`) 31 | } 32 | for (let i = 0; i < PlantBeanShareCodes.length; i++) { 33 | const index = (i + 1 === 1) ? '' : (i + 1); 34 | exports['PlantBeanShareCodes' + index] = PlantBeanShareCodes[i]; 35 | } 36 | -------------------------------------------------------------------------------- /jd_doTreasureRank.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | """ 5 | File: jd_doTreasureRank.py(京东宝藏榜) 6 | Author: HarbourJ 7 | Date: 2022/9/19 22:00 8 | TG: https://t.me/HarbourToulu 9 | TgChat: https://t.me/HarbourSailing 10 | cron: 30 0 0 * * * 11 | new Env('京东宝藏榜'); 12 | ActivityEntry: 首页排行榜-宝藏榜 13 | """ 14 | 15 | import requests, sys, os, re, time 16 | from datetime import datetime 17 | from urllib.parse import quote_plus, unquote_plus 18 | from functools import partial 19 | print = partial(print, flush=True) 20 | import warnings 21 | warnings.filterwarnings("ignore", category=DeprecationWarning) 22 | 23 | try: 24 | from jd_sign import * 25 | except ImportError as e: 26 | print(e) 27 | if "No module" in str(e): 28 | print("请先运行Faker库依赖一键安装脚本(jd_check_dependent.py),安装jd_sign.so依赖") 29 | try: 30 | from jdCookie import get_cookies 31 | getCk = get_cookies() 32 | except: 33 | print("请先下载依赖脚本,\n下载链接: https://raw.githubusercontent.com/HarbourJ/HarbourToulu/main/jdCookie.py") 34 | sys.exit(3) 35 | 36 | def randomString(e, flag=False): 37 | t = "0123456789abcdef" 38 | if flag: t = t.upper() 39 | n = [random.choice(t) for _ in range(e)] 40 | return ''.join(n) 41 | 42 | def doTask(cookie): 43 | url = "https://api.m.jd.com/client.action" 44 | payload = f'functionId=doTreasureInteractive&body=%7B%22type%22%3A%223%22%2C%22itemId%22%3A%22%22%7D&appid=newrank_action&clientVersion=11.2.2&client=wh5&ext=%7B%22prstate%22%3A%220%22%7D' 45 | headers = { 46 | 'Host': 'api.m.jd.com', 47 | 'Accept': '*/*', 48 | 'Accept-Language': 'zh-CN,zh-Hans;q=0.9', 49 | 'Accept-Encoding': 'gzip, deflate, br', 50 | 'Content-Type': 'application/x-www-form-urlencoded', 51 | 'Origin': 'https://h5.m.jd.com', 52 | 'User-Agent': ua, 53 | 'Connection': 'keep-alive', 54 | 'Referer': 'https://h5.m.jd.com/', 55 | 'request-from': 'native', 56 | 'Cookie': cookie 57 | } 58 | response = requests.request("POST", url, headers=headers, data=payload) 59 | try: 60 | res = response.json() 61 | if res['isSuccess']: 62 | result = res['result'] 63 | if result['rewardType'] == 20001: 64 | print(f"🎉{result['rewardTitle']} {result['discount']}") 65 | else: 66 | print("已经领过了,明天再来") 67 | 68 | else: 69 | print(res) 70 | except: 71 | print(response.text) 72 | 73 | 74 | 75 | if __name__ == '__main__': 76 | try: 77 | cks = getCk 78 | if not cks: 79 | sys.exit() 80 | except: 81 | print("未获取到有效COOKIE,退出程序!") 82 | sys.exit() 83 | num = 0 84 | for cookie in cks[:]: 85 | num += 1 86 | global ua 87 | ua = userAgent() 88 | try: 89 | pt_pin = re.compile(r'pt_pin=(.*?);').findall(cookie)[0] 90 | pt_pin = unquote_plus(pt_pin) 91 | except IndexError: 92 | pt_pin = f'用户{num}' 93 | print(f'\n******开始【京东账号{num}】{pt_pin} *********\n') 94 | print(datetime.now()) 95 | doTask(cookie) 96 | time.sleep(2) 97 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /jd_farautomation.js: -------------------------------------------------------------------------------- 1 | //20 5,12,21 * * * m_jd_farm_automation.js 2 | //问题反馈:https://t.me/Wall_E_Channel 3 | const {Env} = require('./magic'); 4 | const $ = new Env('M农场自动化'); 5 | let level = process.env.M_JD_FARM_LEVEL ? process.env.M_JD_FARM_LEVEL * 1 : 2 6 | $.log('默认种植2级种子,自行配置请配置 M_JD_FARM_LEVEL') 7 | $.logic = async function () { 8 | let info = await api('initForFarm', 9 | {"version": 11, "channel": 3, "babelChannel": 0}); 10 | $.log(JSON.stringify(info)); 11 | if (!info?.farmUserPro?.treeState) { 12 | $.log('可能没玩农场') 13 | } 14 | if (info.farmUserPro.treeState === 1) { 15 | return 16 | } 17 | if (info.farmUserPro.treeState === 2) { 18 | await $.wait(1000, 3000) 19 | $.log(`${info.farmUserPro.name},种植时间:${$.formatDate( 20 | info.farmUserPro.createTime)}`); 21 | //成熟了 22 | let coupon = await api('gotCouponForFarm', 23 | {"version": 11, "channel": 3, "babelChannel": 0}); 24 | $.log(coupon) 25 | info = await api('initForFarm', 26 | {"version": 11, "channel": 3, "babelChannel": 0}); 27 | } 28 | if (info.farmUserPro.treeState !== 3) { 29 | return 30 | } 31 | let hongBao = info.myHongBaoInfo.hongBao; 32 | $.putMsg(`${hongBao.discount}红包,${$.formatDate(hongBao.endTime)}过期`) 33 | let element = info.farmLevelWinGoods[level][0]; 34 | await $.wait(1000, 3000) 35 | info = await api('choiceGoodsForFarm', { 36 | "imageUrl": '', 37 | "nickName": '', 38 | "shareCode": '', 39 | "goodsType": element.type, 40 | "type": "0", 41 | "version": 11, 42 | "channel": 3, 43 | "babelChannel": 0 44 | }); 45 | if (info.code * 1 === 0) { 46 | $.putMsg(`已种【${info.farmUserPro.name}】`) 47 | } 48 | await api('gotStageAwardForFarm', 49 | {"type": "4", "version": 11, "channel": 3, "babelChannel": 0}); 50 | await api('waterGoodForFarm', 51 | {"type": "", "version": 11, "channel": 3, "babelChannel": 0}); 52 | await api('gotStageAwardForFarm', 53 | {"type": "1", "version": 11, "channel": 3, "babelChannel": 0}); 54 | }; 55 | 56 | $.run({ 57 | wait: [20000, 30000], whitelist: ['1-15'] 58 | }).catch( 59 | reason => $.log(reason)); 60 | 61 | // noinspection DuplicatedCode 62 | async function api(fn, body) { 63 | let url = `https://api.m.jd.com/client.action?functionId=${fn}&body=${JSON.stringify( 64 | body)}&client=apple&clientVersion=10.0.4&osVersion=13.7&appid=wh5&loginType=2&loginWQBiz=interact` 65 | //↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓请求头↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ 66 | let headers = { 67 | "Cookie": $.cookie, 68 | "Connection": "keep-alive", 69 | "Accept": "*/*", 70 | "Host": "api.m.jd.com", 71 | 'User-Agent': `Mozilla/5.0 (iPhone; CPU iPhone OS 14_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.4(0x1800042c) NetType/4G Language/zh_CN miniProgram`, 72 | "Accept-Encoding": "gzip, deflate, br", 73 | "Accept-Language": "zh-cn" 74 | } 75 | let {data} = await $.request(url, headers) 76 | await $.wait(1000, 3000) 77 | return data; 78 | } 79 | 80 | -------------------------------------------------------------------------------- /jd_farm_automation.js: -------------------------------------------------------------------------------- 1 | //20 8 10 4 * jd_farm_automation.js 2 | 3 | console.log('默认种2级,如需调整请设置变量 M_JD_FARM_LEVEL\n使用率不高,指定(desi)账号运行\n') 4 | const {Env} = require('./function/magic'); 5 | const $ = new Env('农场自动种植兑换'); 6 | let level = process.env.M_JD_FARM_LEVEL ? process.env.M_JD_FARM_LEVEL * 1 : 2 7 | $.logic = async function () { 8 | let info = await api('initForFarm', 9 | {"version": 11, "channel": 3, "babelChannel": 0}); 10 | if (info.code !== '0') { 11 | $.log('可能没开通农场或者黑透了!!!') 12 | return 13 | } 14 | if (info.farmUserPro.treeState === 1) { 15 | return 16 | } 17 | if (info.farmUserPro.treeState === 2) { 18 | await $.wait(1000, 3000) 19 | $.log(`${info.farmUserPro.name},种植时间:${$.formatDate( 20 | info.farmUserPro.createTime)}`); 21 | //成熟了 22 | let coupon = await api('gotCouponForFarm', 23 | {"version": 11, "channel": 3, "babelChannel": 0}); 24 | $.log(coupon) 25 | info = await api('initForFarm', 26 | {"version": 11, "channel": 3, "babelChannel": 0}); 27 | } 28 | if (info.farmUserPro.treeState === 3) { 29 | let hongBao = info.myHongBaoInfo.hongBao; 30 | $.putMsg(`已兑换${hongBao.discount}红包,${$.formatDate(hongBao.endTime)}过期`) 31 | } 32 | 33 | let element = info.farmLevelWinGoods[level][0] || 0; 34 | await $.wait(1000, 3000) 35 | if (element) { 36 | info = await api('choiceGoodsForFarm', { 37 | "imageUrl": '', 38 | "nickName": '', 39 | "shareCode": '', 40 | "goodsType": element.type, 41 | "type": "0", 42 | "version": 11, 43 | "channel": 3, 44 | "babelChannel": 0 45 | }); 46 | if (info.code * 1 === 0) { 47 | $.putMsg(`\n再次种植【${info.farmUserPro.name}】`) 48 | } 49 | let a = await api('gotStageAwardForFarm', 50 | {"type": "4", "version": 11, "channel": 3, "babelChannel": 0}); 51 | let b = await api('waterGoodForFarm', 52 | {"type": "", "version": 11, "channel": 3, "babelChannel": 0}); 53 | let c = await api('gotStageAwardForFarm', 54 | {"type": "1", "version": 11, "channel": 3, "babelChannel": 0}); 55 | }else{ 56 | $.log('种子已抢完,下次在来!!!\n') 57 | } 58 | }; 59 | 60 | $.run({wait: [2000, 3000]}).catch(reason => $.log(reason)); 61 | 62 | // noinspection DuplicatedCode 63 | async function api(fn, body) { 64 | let url = `https://api.m.jd.com/client.action?functionId=${fn}&body=${JSON.stringify( 65 | body)}&client=apple&clientVersion=10.0.4&osVersion=13.7&appid=wh5&loginType=2&loginWQBiz=interact` 66 | //↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓请求头↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ 67 | let headers = { 68 | "Cookie": $.cookie, 69 | "Connection": "keep-alive", 70 | "Accept": "*/*", 71 | "Host": "api.m.jd.com", 72 | 'User-Agent': `Mozilla/5.0 (iPhone; CPU iPhone OS 14_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.4(0x1800042c) NetType/4G Language/zh_CN miniProgram`, 73 | "Accept-Encoding": "gzip, deflate, br", 74 | "Accept-Language": "zh-cn" 75 | } 76 | let {data} = await $.request(url, headers) 77 | await $.wait(1000, 3000) 78 | return data; 79 | } 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /jd_follow_shop.js: -------------------------------------------------------------------------------- 1 | /* 2 | 7 7 7 7 7 m_jd_follow_shop.js 3 | */ 4 | let mode = __dirname.includes('magic') 5 | const {Env} = mode ? require('./magic') : require('./magic') 6 | const $ = new Env('M关注有礼'); 7 | $.followShopArgv = process.env.M_FOLLOW_SHOP_ARGV 8 | ? process.env.M_FOLLOW_SHOP_ARGV 9 | : ''; 10 | if (mode) { 11 | $.followShopArgv = '1000104168_1000104168' 12 | } 13 | $.logic = async function () { 14 | let argv = $?.followShopArgv?.split('_'); 15 | $.shopId = argv?.[0]; 16 | $.venderId = argv?.[1]; 17 | if (!$.shopId || !$.venderId) { 18 | $.log(`无效的参数${$.followShopArgv}`) 19 | $.expire = true; 20 | return 21 | } 22 | let actInfo = await getShopHomeActivityInfo(); 23 | if (actInfo?.code !== '0') { 24 | $.log(JSON.stringify(actInfo)) 25 | if (actInfo?.message.includes('不匹配')) { 26 | $.expire = true; 27 | } 28 | return 29 | } 30 | let actInfoData = actInfo?.result; 31 | 32 | if (actInfoData?.shopGifts?.filter(o => o.rearWord.includes('京豆')).length 33 | > 0) { 34 | $.activityId = actInfoData?.activityId?.toString(); 35 | let gift = await drawShopGift(); 36 | if (gift?.code !== '0') { 37 | $.log(JSON.stringify(gift)) 38 | return 39 | } 40 | let giftData = gift?.result; 41 | $.log(giftData) 42 | for (let ele of 43 | giftData?.alreadyReceivedGifts?.filter(o => o.prizeType === 4) || []) { 44 | $.putMsg(`${ele.redWord}${ele.rearWord}`); 45 | } 46 | } else { 47 | $.putMsg(`没有豆子`); 48 | } 49 | }; 50 | let kv = {'jd': '京豆', 'jf': '积分', 'dq': 'q券'} 51 | $.after = async function () { 52 | $.msg.push(`\n${(await $.getShopInfo()).shopName}`); 53 | if ($?.content) { 54 | let message = `\n`; 55 | for (let ele of $.content || []) { 56 | message += ` ${ele.takeNum || ele.discount} ${kv[ele?.type]}\n` 57 | } 58 | $.msg.push(message) 59 | $.msg.push($.activityUrl); 60 | } 61 | } 62 | $.run({whitelist: ['1-5'], wait: [1000, 3000]}).catch(reason => $.log(reason)) 63 | 64 | async function drawShopGift() { 65 | $.log('店铺信息', $.shopId, $.venderId, $.activityId) 66 | let sb = { 67 | "follow": 0, 68 | "shopId": $.shopId, 69 | "activityId": $.activityId, 70 | "sourceRpc": "shop_app_home_window", 71 | "venderId": $.venderId 72 | }; 73 | let newVar = await $.sign('drawShopGift', sb); 74 | 75 | let headers = { 76 | 'J-E-H': '', 77 | 'Connection': 'keep-alive', 78 | 'Accept-Encoding': 'gzip, deflate, br', 79 | 'Content-Type': 'application/x-www-form-urlencoded', 80 | 'Host': 'api.m.jd.com', 81 | 'Referer': '', 82 | 'J-E-C': '', 83 | 'Accept-Language': 'zh-Hans-CN;q=1, en-CN;q=0.9', 84 | 'Accept': '*/*', 85 | 'User-Agent': 'JD4iPhone/167841 (iPhone; iOS; Scale/3.00)' 86 | } 87 | // noinspection DuplicatedCode 88 | headers['Cookie'] = $.cookie 89 | let url = `https://api.m.jd.com/client.action?functionId=` + newVar.fn 90 | let {status, data} = await $.request(url, headers, newVar.sign); 91 | return data; 92 | } 93 | 94 | async function getShopHomeActivityInfo() { 95 | let sb = { 96 | "shopId": $.shopId, 97 | "source": "app-shop", 98 | "latWs": "0", 99 | "lngWs": "0", 100 | "displayWidth": "1098.000000", 101 | "sourceRpc": "shop_app_home_home", 102 | "lng": "0", 103 | "lat": "0", 104 | "venderId": $.venderId 105 | } 106 | let newVar = await $.sign('getShopHomeActivityInfo', sb); 107 | let headers = { 108 | 'J-E-H': '', 109 | 'Connection': 'keep-alive', 110 | 'Accept-Encoding': 'gzip, deflate, br', 111 | 'Content-Type': 'application/x-www-form-urlencoded', 112 | 'Host': 'api.m.jd.com', 113 | 'Referer': '', 114 | 'J-E-C': '', 115 | 'Accept-Language': 'zh-Hans-CN;q=1, en-CN;q=0.9', 116 | 'Accept': '*/*', 117 | 'User-Agent': 'JD4iPhone/167841 (iPhone; iOS; Scale/3.00)' 118 | } 119 | // noinspection DuplicatedCode 120 | headers['Cookie'] = $.cookie 121 | let url = `https://api.m.jd.com/client.action?functionId=` + newVar.fn 122 | let {status, data} = await $.request(url, headers, newVar.sign); 123 | return data; 124 | } 125 | 126 | -------------------------------------------------------------------------------- /jd_fuck_sentry.py: -------------------------------------------------------------------------------- 1 | with open('/etc/hosts', 'a+') as f: 2 | if 'sentry.io' in open('/etc/hosts').read(): 3 | print('已屏蔽') 4 | else: 5 | f.write('\n127.0.0.1 o1098464.ingest.sentry.io\n') 6 | print('屏蔽成功') 7 | 8 | print(open('/etc/hosts').read()) 9 | 10 | import os 11 | 12 | ql_dists = ['/ql/dist', '/ql/static/dist'] 13 | for dist in ql_dists: 14 | try: 15 | files = os.listdir(dist) 16 | filesraw = os.listdir(dist) 17 | for i in filesraw: 18 | if os.path.isdir(dist + '/' + i) or '.gz' in i: 19 | files.remove(i) 20 | js_sec = [] 21 | jsd = [] 22 | for i in files: 23 | with open(dist + '/' + i, 'r', encoding='utf-8') as f: 24 | ff = f.read() 25 | if 'sentry.io' in ff: 26 | print(i, '文件中含有sentry.io') 27 | js_sec.append(i) 28 | if 'cdn.jsdelivr.net' in ff: 29 | print(i, '含有 cdn.jsdelivr.net') 30 | jsd.append(i) 31 | for i in js_sec: 32 | f = open(dist + '/' + i, 'r', encoding='utf-8') 33 | file_content = f.read() 34 | f.close() 35 | f = open(dist + '/' + i, 'w', encoding='utf-8') 36 | f.write(file_content.replace('sentry.io', '')) 37 | f.close() 38 | print('屏蔽js成功', i) 39 | for i in jsd: 40 | f = open(dist + '/' + i, 'r', encoding='utf-8') 41 | file_content = f.read() 42 | f.close() 43 | f = open(dist + '/' + i, 'w', encoding='utf-8') 44 | f.write(file_content.replace('cdn.jsdelivr.net', 'fastly.jsdelivr.net')) 45 | f.close() 46 | print('成功尝试解决白屏问题(替换cdn)', i) 47 | except: 48 | pass 49 | -------------------------------------------------------------------------------- /jd_indeps.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #依赖安装,运行一次就好 3 | #1 1 1 1 1 jd_indeps.sh 4 | #new Env('Faker库脚本依赖安装'); 5 | # 6 | 7 | npm_ver=`pnpm -v|awk -F. '{print $1}'` 8 | if [[ $npm_ver -ge 7 ]];then 9 | export PNPM_HOME="/root/.local/share/pnpm" 10 | export PATH="$PNPM_HOME:$PATH" 11 | fi 12 | 13 | echo -e "安装脚本所需依赖,不一定一次全部安装成功,请自己检查\n" 14 | echo -e "开始安装............\n" 15 | 16 | #apk add g++ make pixman-dev pango-dev cairo-dev pkgconf --no-cache 17 | apk add g++ make --no-cache 18 | pnpm config set registry https://registry.npm.taobao.org 19 | pnpm install -g 20 | pnpm install -g ds 21 | pnpm install -g png-js 22 | pnpm install -g date-fns 23 | pnpm install -g axios@0.27.2 24 | pnpm install -g crypto-js 25 | pnpm install -g ts-md5 26 | pnpm install -g tslib 27 | pnpm install -g @types/node 28 | pnpm install -g request 29 | pnpm install -g jsdom 30 | pnpm install -g moment 31 | pnpm install -g tough-cookie 32 | pnpm install -g https-proxy-agent 33 | pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple/ jieba 34 | pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple/ requests 35 | rm -rf /usr/local/pnpm-global/5/node_modules/.pnpm/canvas* 36 | rm -rf /root/.local/share/pnpm/global/5/.pnpm/canvas* 37 | echo -e "\n所需依赖安装完成,请检查有没有报错,可尝试再次运行" -------------------------------------------------------------------------------- /jd_jingBeanReceive.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | """ 5 | File: jd_jingBeanReceive.py(plus专属礼-天天领福利) 6 | Author: HarbourJ 7 | Date: 2022/9/19 22:00 8 | TG: https://t.me/HarbourToulu 9 | TgChat: https://t.me/HarbourSailing 10 | cron: 30 0 0 * * * 11 | new Env('plus专属礼-天天领福利'); 12 | """ 13 | 14 | import requests, sys, os, re, time 15 | from datetime import datetime 16 | from urllib.parse import quote_plus, unquote_plus 17 | from functools import partial 18 | print = partial(print, flush=True) 19 | import warnings 20 | warnings.filterwarnings("ignore", category=DeprecationWarning) 21 | 22 | try: 23 | from jd_sign import * 24 | except ImportError as e: 25 | print(e) 26 | if "No module" in str(e): 27 | print("请先运行Faker库依赖一键安装脚本(jd_check_dependent.py),安装jd_sign.so依赖") 28 | try: 29 | from jdCookie import get_cookies 30 | getCk = get_cookies() 31 | except: 32 | print("请先下载依赖脚本,\n下载链接: https://raw.githubusercontent.com/HarbourJ/HarbourToulu/main/jdCookie.py") 33 | sys.exit(3) 34 | 35 | def randomString(e, flag=False): 36 | t = "0123456789abcdef" 37 | if flag: t = t.upper() 38 | n = [random.choice(t) for _ in range(e)] 39 | return ''.join(n) 40 | 41 | def doTask(cookie): 42 | url = "https://api.m.jd.com/client.action?functionId=jingBeanReceive" 43 | payload = "avifSupport=1&body=%7B%22encryptAssignmentId%22%3A%226bzcu8ZNPHFhuWZC55MhLgJCPiW%22%2C%22firstType%22%3A1%7D&build=168311&client=apple&clientVersion=11.2.7&d_brand=apple&d_model=iPhone10%2C3&ef=1&eid=eidI21de81220cs4zwVxJDcwTxubBP9xskb8as8Fcpw827kSwFhxTs/xaamHiBAVj7C/YnZR%2BmODl1OUeH7f5I4xm/mIct00P8O2cmBrp3PIKEq208Zs&ep=%7B%22ciphertype%22%3A5%2C%22cipher%22%3A%7B%22screen%22%3A%22CJOyDIeyDNC2%22%2C%22wifiBssid%22%3A%22YtPwC2VrZWPrCJKmZNO4CNS3ENUnZWUzYJSmCwDuCNS%3D%22%2C%22osVersion%22%3A%22CJUkCy4n%22%2C%22area%22%3A%22CJvpCJYmCV8zDtCzXzYzCtUy%22%2C%22openudid%22%3A%22DwO2Czu5YJY1DQC2EJYmCzLvYJu5DJZrDNq1ZNDsZJPvDJVuDzO0ZG%3D%3D%22%2C%22uuid%22%3A%22aQf1ZRdxb2r4ovZ1EJZhcxYlVNZSZz09%22%7D%2C%22ts%22%3A1664322556%2C%22hdid%22%3A%22JM9F1ywUPwflvMIpYPok0tt5k9kW4ArJEU3lfLhxBqw%3D%22%2C%22version%22%3A%221.0.3%22%2C%22appname%22%3A%22com.360buy.jdmobile%22%2C%22ridx%22%3A-1%7D&ext=%7B%22prstate%22%3A%220%22%2C%22pvcStu%22%3A%221%22%7D&isBackground=N&joycious=90&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&partner=apple&rfs=0000&scope=11&sign=1068e427417088f66b6662841e9188b3&st=1664322629327&sv=111&uemps=0-0&uts=0f31TVRjBSsM4O1yK5LGrapaX3BEwS6R%2BmwPNn9dovB4gt4APFjVvh%2BoNgcWzJXrDASiBpSRQ3pc9ekEO5KCoTMPhPrXYRqXLR8bzfr3d%2B2gW/%2BNqeVTOVl22fjzmPi2glE4SD40Tb4WoZL4BC1v4ZOyc0E4NuLooRD0h6AO3RS64giA6YOFQa7z6Lnnnb8DCffGL0/zm0UQEfnIKCK8SA%3D%3D" 44 | headers = { 45 | 'Content-Type': 'application/x-www-form-urlencoded', 46 | 'Cookie': cookie, 47 | 'Host': 'api.m.jd.com', 48 | 'User-Agent': ua 49 | } 50 | response = requests.request("POST", url, headers=headers, data=payload) 51 | try: 52 | res = response.json() 53 | if res['isSuccess']: 54 | print(f"🎉 {res['data']['windowsContent']}") 55 | else: 56 | print(f"⛈ {res['message']}") 57 | except: 58 | print(response.text) 59 | 60 | if __name__ == '__main__': 61 | try: 62 | cks = getCk 63 | if not cks: 64 | sys.exit() 65 | except: 66 | print("未获取到有效COOKIE,退出程序!") 67 | sys.exit() 68 | num = 0 69 | for cookie in cks[:]: 70 | num += 1 71 | global ua 72 | ua = userAgent() 73 | try: 74 | pt_pin = re.compile(r'pt_pin=(.*?);').findall(cookie)[0] 75 | pt_pin = unquote_plus(pt_pin) 76 | except IndexError: 77 | pt_pin = f'用户{num}' 78 | print(f'\n******开始【京东账号{num}】{pt_pin} *********\n') 79 | print(datetime.now()) 80 | doTask(cookie) 81 | time.sleep(2) 82 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /jd_joy_joy_reward.ts: -------------------------------------------------------------------------------- 1 | /** 2 | 汪汪乐园-提现 3 | 3 0 0 * * 5 jd_joy_joy_reward.ts 4 | new Env('汪汪赛跑提现') 5 | 6 | **/ 7 | 8 | import {get, post, o2s, requireConfig, wait} from './function/TS_USER_AGENTS' 9 | import {H5ST} from "./function/h5st" 10 | 11 | let cookie: string = '', res: any = '', UserName: string = '', fp_448de: string = '' || process.env.FP_448DE, fp_b6ac3: string = '' || process.env.FP_B6AC3 12 | let h5stTool: H5ST = null 13 | 14 | !(async () => { 15 | let cookiesArr: string[] = await requireConfig() 16 | for (let [index, value] of cookiesArr.entries()) { 17 | cookie = value 18 | UserName = decodeURIComponent(cookie.match(/pt_pin=([^;]*)/)![1]) 19 | console.log(`\n开始【京东账号${index + 1}】${UserName}\n`) 20 | let rewardAmount: number = 0 21 | try { 22 | h5stTool = new H5ST('448de', 'jdltapp;', fp_448de) 23 | await h5stTool.__genAlgo() 24 | res = await team('runningMyPrize', {"linkId": "L-sOanK_5RJCz7I314FpnQ", "pageSize": 20, "time": null, "ids": null}) 25 | rewardAmount = res.data.rewardAmount 26 | if (res.data.runningCashStatus.currentEndTime && res.data.runningCashStatus.status === 0) { 27 | console.log('可提现', rewardAmount) 28 | res = await api('runningPrizeDraw', {"linkId": "L-sOanK_5RJCz7I314FpnQ", "type": 2}) 29 | await wait(2000) 30 | if (res.success){ 31 | console.log(res.data.message) 32 | } else { 33 | console.log('提现失败:', res.errMsg) 34 | } 35 | }else{ 36 | console.log('还未到提现时间') 37 | } 38 | } catch (e) { 39 | console.log('Error', e) 40 | await wait(1000) 41 | } 42 | } 43 | })() 44 | 45 | async function api(fn: string, body: object) { 46 | let timestamp: number = Date.now(), h5st: string = '' 47 | if (fn === 'runningOpenBox') { 48 | h5st = h5stTool.__genH5st({ 49 | appid: "activities_platform", 50 | body: JSON.stringify(body), 51 | client: "ios", 52 | clientVersion: "3.1.0", 53 | functionId: "runningOpenBox", 54 | t: timestamp.toString() 55 | }) 56 | } 57 | let params: string = `functionId=${fn}&body=${JSON.stringify(body)}&t=${timestamp}&appid=activities_platform&client=ios&clientVersion=3.1.0&cthr=1` 58 | h5st && (params += `&h5st=${h5st}`) 59 | return await post('https://api.m.jd.com/', params, { 60 | 'authority': 'api.m.jd.com', 61 | 'content-type': 'application/x-www-form-urlencoded', 62 | 'cookie': cookie, 63 | 'origin': 'https://h5platform.jd.com', 64 | 'referer': 'https://h5platform.jd.com/', 65 | 'user-agent': 'jdltapp;' 66 | }) 67 | } 68 | 69 | async function team(fn: string, body: object) { 70 | let timestamp: number = Date.now(), h5st: string 71 | h5st = h5stTool.__genH5st({ 72 | appid: "activities_platform", 73 | body: JSON.stringify(body), 74 | client: "ios", 75 | clientVersion: "3.1.0", 76 | functionId: fn, 77 | t: timestamp.toString() 78 | }) 79 | return await get(`https://api.m.jd.com/?functionId=${fn}&body=${encodeURIComponent(JSON.stringify(body))}&t=${timestamp}&appid=activities_platform&client=ios&clientVersion=3.1.0&cthr=1&h5st=${h5st}`, { 80 | 'Host': 'api.m.jd.com', 81 | 'User-Agent': 'jdltapp;', 82 | 'Origin': 'https://h5platform.jd.com', 83 | 'X-Requested-With': 'com.jd.jdlite', 84 | 'Referer': 'https://h5platform.jd.com/', 85 | 'Cookie': cookie 86 | }) 87 | } 88 | -------------------------------------------------------------------------------- /jd_joy_run_reward.ts: -------------------------------------------------------------------------------- 1 | /** 2 | 汪汪赛跑-提现10元 3 | 2 0 0 * * 5 jd_joy_run_reward.ts 4 | new Env('汪汪赛跑提现') 5 | Modify By Dylan from HW 6 | updateTime:2022-07-09 7 | **/ 8 | 9 | import {get, post, requireConfig, wait} from './function/TS_USER_AGENTS' 10 | import {H5ST} from "./function/h5st" 11 | 12 | let cookie: string = '', res: any = '', UserName: string = '', fp_448de: string = '' || process.env.FP_448DE, fp_b6ac3: string = '' || process.env.FP_B6AC3 13 | let h5stTool: H5ST = null 14 | 15 | !(async () => { 16 | let cookiesArr: string[] = await requireConfig() 17 | for (let [index, value] of cookiesArr.entries()) { 18 | cookie = value 19 | UserName = decodeURIComponent(cookie.match(/pt_pin=([^;]*)/)![1]) 20 | console.log(`\n开始【京东账号${index + 1}】${UserName}\n`) 21 | let rewardAmount: number = 0 22 | try { 23 | h5stTool = new H5ST('448de', 'jdltapp;', fp_448de) 24 | await h5stTool.__genAlgo() 25 | res = await team('runningMyPrize', {"linkId": "L-sOanK_5RJCz7I314FpnQ", "pageSize": 20, "time": null, "ids": null}) 26 | rewardAmount = res.data.rewardAmount 27 | if (res.data.runningCashStatus.currentEndTime) { 28 | console.log('可提现', rewardAmount) 29 | res = await api('runningPrizeDraw', {"linkId": "L-sOanK_5RJCz7I314FpnQ", "type": 2, "level": 3}) 30 | await wait(2000) 31 | if (res.success){ 32 | console.log(res.data.message) 33 | } else { 34 | console.log('提现失败:', res.errMsg) 35 | } 36 | }else{ 37 | console.log('还未到提现时间') 38 | } 39 | } catch (e) { 40 | console.log('Error', e) 41 | await wait(1000) 42 | } 43 | } 44 | })() 45 | 46 | async function api(fn: string, body: object) { 47 | let timestamp: number = Date.now(), h5st: string = '' 48 | if (fn === 'runningOpenBox') { 49 | h5st = h5stTool.__genH5st({ 50 | appid: "activities_platform", 51 | body: JSON.stringify(body), 52 | client: "ios", 53 | clientVersion: "3.1.0", 54 | functionId: "runningOpenBox", 55 | t: timestamp.toString() 56 | }) 57 | } 58 | let params: string = `functionId=${fn}&body=${JSON.stringify(body)}&t=${timestamp}&appid=activities_platform&client=ios&clientVersion=3.1.0&cthr=1` 59 | h5st && (params += `&h5st=${h5st}`) 60 | return await post('https://api.m.jd.com/', params, { 61 | 'authority': 'api.m.jd.com', 62 | 'content-type': 'application/x-www-form-urlencoded', 63 | 'cookie': cookie, 64 | 'origin': 'https://h5platform.jd.com', 65 | 'referer': 'https://h5platform.jd.com/', 66 | 'user-agent': 'jdltapp;' 67 | }) 68 | } 69 | 70 | async function team(fn: string, body: object) { 71 | let timestamp: number = Date.now(), h5st: string 72 | h5st = h5stTool.__genH5st({ 73 | appid: "activities_platform", 74 | body: JSON.stringify(body), 75 | client: "ios", 76 | clientVersion: "3.1.0", 77 | functionId: fn, 78 | t: timestamp.toString() 79 | }) 80 | return await get(`https://api.m.jd.com/?functionId=${fn}&body=${encodeURIComponent(JSON.stringify(body))}&t=${timestamp}&appid=activities_platform&client=ios&clientVersion=3.1.0&cthr=1&h5st=${h5st}`, { 81 | 'Host': 'api.m.jd.com', 82 | 'User-Agent': 'jdltapp;', 83 | 'Origin': 'https://h5platform.jd.com', 84 | 'X-Requested-With': 'com.jd.jdlite', 85 | 'Referer': 'https://h5platform.jd.com/', 86 | 'Cookie': cookie 87 | }) 88 | } 89 | -------------------------------------------------------------------------------- /jd_pzhb_notify.py: -------------------------------------------------------------------------------- 1 | # -*- coding:utf-8 -*- 2 | """ 3 | cron: 10 10 10 10 * jd_pzhb_notify.py 4 | new Env('膨胀红包通知') 5 | updatetime:2022/10/22 6 | by dylan 7 | """ 8 | 9 | import requests 10 | import json 11 | import time 12 | import os 13 | import re 14 | import sys 15 | import random 16 | import string 17 | import urllib 18 | 19 | def ramUA(): 20 | global uuid,addressid,iosVer,iosV,clientVersion,iPhone,area,ADID 21 | 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)) 22 | addressid = ''.join(random.sample('1234567898647', 10)) 23 | iosVer = ''.join(random.sample(["15.1.1","14.5.1", "14.4", "14.3", "14.2", "14.1", "14.0.1"], 1)) 24 | iosV = iosVer.replace('.', '_') 25 | clientVersion=''.join(random.sample(["10.3.0", "10.2.7", "10.2.4"], 1)) 26 | iPhone = ''.join(random.sample(["8", "9", "10", "11", "12", "13"], 1)) 27 | area=''.join(random.sample('0123456789', 2)) + '_' + ''.join(random.sample('0123456789', 4)) + '_' + ''.join(random.sample('0123456789', 5)) + '_' + ''.join(random.sample('0123456789', 4)) 28 | 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)) 29 | UserAgent='' 30 | if not UserAgent: 31 | 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' 32 | else: 33 | return UserAgent 34 | 35 | def printf(text): 36 | print(text) 37 | sys.stdout.flush() 38 | 39 | def load_send(): 40 | global send 41 | cur_path = os.path.abspath(os.path.dirname(__file__)) 42 | sys.path.append(cur_path) 43 | if os.path.exists(cur_path + "/sendNotify.py"): 44 | try: 45 | from sendNotify import send 46 | except: 47 | send=False 48 | print("加载通知服务失败~") 49 | else: 50 | send=False 51 | print("加载通知服务失败~") 52 | load_send() 53 | 54 | def get_remarkinfo(): 55 | url='http://127.0.0.1:5600/api/envs' 56 | try: 57 | with open(re.sub('scripts.*','config',os.getcwd())+'/auth.json', 'r') as f: 58 | token=json.loads(f.read())['token'] 59 | headers={ 60 | 'Accept':'application/json', 61 | 'authorization':'Bearer '+token, 62 | } 63 | response=requests.get(url=url,headers=headers) 64 | 65 | for i in range(len(json.loads(response.text)['data'])): 66 | if json.loads(response.text)['data'][i]['name']=='JD_COOKIE': 67 | try: 68 | if json.loads(response.text)['data'][i]['remarks'].find('@@')==-1: 69 | remarkinfos[json.loads(response.text)['data'][i]['value'].split(';')[1].replace('pt_pin=','')]=json.loads(response.text)['data'][i]['remarks'].replace('remark=','').replace(';','') 70 | else: 71 | remarkinfos[json.loads(response.text)['data'][i]['value'].split(';')[1].replace('pt_pin=','')]=json.loads(response.text)['data'][i]['remarks'].split("@@")[0].replace('remark=','').replace(';','') 72 | except: 73 | pass 74 | except: 75 | printf('读取auth.json文件出错,跳过获取备注\n') 76 | def getinfo(ck): 77 | global sendnotifycation 78 | global inflateMaxAward 79 | inflateMaxAward=0 80 | url='https://api.m.jd.com/client.action?functionId=promote_pk_getAmountForecast' 81 | headers={ 82 | 'content-type':'application/x-www-form-urlencoded', 83 | 'accept':'application/json, text/plain, */*', 84 | 'accept-language':'zh-cn', 85 | 'accept-encoding':'gzip, deflate, br', 86 | 'origin':'https://wbbny.m.jd.com', 87 | 'user-agent':UserAgent, 88 | 'referer':'https://wbbny.m.jd.com/', 89 | 'cookie':ck 90 | } 91 | data='functionId=promote_pk_getAmountForecast&client=m&clientVersion=-1&appid=signed_wh5&body={}' 92 | response=requests.post(url=url,headers=headers,data=data) 93 | try: 94 | printf('可膨胀金额:'+json.loads(response.text)['data']['result']['inflateMaxAward']+'\n\n') 95 | if(float(json.loads(response.text)['data']['result']['inflateMaxAward'])>=10): 96 | inflateMaxAward=float(json.loads(response.text)['data']['result']['inflateMaxAward']) 97 | except Exception as e: 98 | printf('获取失败,黑号或者没有参加5人以上的队伍\n\n') 99 | if __name__ == '__main__': 100 | remarkinfos={} 101 | get_remarkinfo()#获取备注 102 | msg='' 103 | sendnoty='true' 104 | try: 105 | cks = os.environ["JD_COOKIE"].split("&")#获取cookie 106 | except: 107 | f = open("/jd/config/config.sh", "r", encoding='utf-8') 108 | cks = re.findall(r'Cookie[0-9]*="(pt_key=.*?;pt_pin=.*?;)"', f.read()) 109 | f.close() 110 | for ck in cks: 111 | UserAgent=ramUA() 112 | ptpin = re.findall(r"pt_pin=(.*?);", ck)[0] 113 | try: 114 | if remarkinfos[ptpin]!='': 115 | printf("--账号:" + remarkinfos[ptpin] + "--") 116 | else: 117 | printf("--无备注账号:" + urllib.parse.unquote(ptpin) + "--") 118 | except: 119 | printf("--账号:" + urllib.parse.unquote(ptpin) + "--") 120 | getinfo(ck) 121 | try: 122 | if inflateMaxAward != 0: 123 | msg+=remarkinfos[ptpin] + ' 的膨胀红包最大金额为 '+str(inflateMaxAward)+' 元\n' 124 | except: 125 | msg+=urllib.parse.unquote(ptpin) + ' 的膨胀红包最大金额为 '+str(inflateMaxAward)+' 元\n' 126 | if sendnoty: 127 | try: 128 | send('穿越寻宝膨胀红包',msg) 129 | except: 130 | send('穿越寻宝膨胀红包','错误,请查看运行日志!') -------------------------------------------------------------------------------- /jd_shopCollectGift.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | """ 5 | File: jd_shopCollectGift.py(店铺会员礼包-监控脚本) 6 | Author: HarbourJ 7 | Date: 2022/9/2 12:00 8 | TG: https://t.me/HarbourToulu 9 | TgChat: https://t.me/HarbourSailing 10 | cron: 1 1 1 1 1 1 11 | new Env('店铺会员礼包-JK'); 12 | ActivityEntry: https://shop.m.jd.com/shop/home?shopId=1000003443 13 | Description: 部分账号开卡后无法自动领取开卡奖励,不自动开卡,仅领取已开卡的会员礼包 14 | 变量export jd_shopCollectGiftId="1000003443" 变量为店铺venderId 15 | """ 16 | 17 | import requests, sys, os, re, time 18 | from datetime import datetime 19 | from functools import partial 20 | print = partial(print, flush=True) 21 | import warnings 22 | warnings.filterwarnings("ignore", category=DeprecationWarning) 23 | from urllib.parse import quote_plus, unquote_plus 24 | try: 25 | from jd_sign import * 26 | except ImportError as e: 27 | print(e) 28 | if "No module" in str(e): 29 | print("请先运行Faker库依赖一键安装脚本(jd_check_dependent.py),安装jd_sign.so依赖") 30 | try: 31 | from jdCookie import get_cookies 32 | getCk = get_cookies() 33 | except: 34 | print("请先下载依赖脚本,\n下载链接: https://raw.githubusercontent.com/HarbourJ/HarbourToulu/main/jdCookie.py") 35 | sys.exit(3) 36 | 37 | venderId = os.environ.get("jd_shopCollectGiftId") if os.environ.get("jd_shopCollectGiftId") else "" 38 | 39 | if not venderId: 40 | print("⚠️未发现有效活动变量,退出程序!") 41 | sys.exit() 42 | 43 | def collectGift(venderId, activityId, activityType, cookie): 44 | url = f"https://api.m.jd.com/client.action?appid=jd_shop_member&functionId=collectGift&body=%7B%22venderId%22%3A%22{venderId}%22%2C%22activityId%22%3A{activityId}%2C%22activityType%22%3A{activityType}%7D&clientVersion=9.2.0&client=H5&uuid=88888" 45 | headers = { 46 | 'Host': 'api.m.jd.com', 47 | 'Accept': '*/*', 48 | 'Connection': 'keep-alive', 49 | 'Cookie': cookie, 50 | 'User-Agent': ua, 51 | 'Accept-Language': 'zh-CN,zh-Hans;q=0.9', 52 | 'Referer': 'https://shopmember.m.jd.com/', 53 | 'Accept-Encoding': 'gzip, deflate, br' 54 | } 55 | response = requests.request("GET", url, headers=headers) 56 | res = response.json() 57 | if res['success']: 58 | return res['message'] 59 | else: 60 | print(res) 61 | 62 | def getFansDetail(venderId, cookie): 63 | url = f"https://api.m.jd.com/client.action?appid=jd_shop_member&functionId=getFansFuseMemberDetail&clientVersion=9.2.0&client=H5&uuid=88888&body=%7B%22venderId%22%3A%22{venderId}%22%2C%22channel%22%3A406%2C%22queryVersion%22%3A%2210.5.2%22%7D" 64 | headers = { 65 | 'Host': 'api.m.jd.com', 66 | 'Accept': '*/*', 67 | 'Connection': 'keep-alive', 68 | 'Cookie': cookie, 69 | 'User-Agent': ua, 70 | 'Accept-Language': 'zh-CN,zh-Hans;q=0.9', 71 | 'Referer': 'https://shopmember.m.jd.com/', 72 | 'Accept-Encoding': 'gzip, deflate, br' 73 | } 74 | response = requests.request("GET", url, headers=headers) 75 | res = response.json() 76 | if res['success']: 77 | brandName = res['data'][0]['cardInfo']['brandName'] 78 | if 'newGiftList' in str(res) and res['data'][0]['newGiftList']: 79 | activityId = res['data'][0]['newGiftList'][0]['activityId'] 80 | activityType = res['data'][0]['newGiftList'][0]['activityType'] 81 | prizeTypeName = res['data'][0]['newGiftList'][0]['prizeTypeName'] 82 | discount = res['data'][0]['newGiftList'][0]['discount'] 83 | return activityId, activityType, discount, prizeTypeName, brandName 84 | else: 85 | print(f"{brandName} 未发现店铺礼包💨") 86 | 87 | if __name__ == '__main__': 88 | try: 89 | cks = getCk 90 | if not cks: 91 | sys.exit() 92 | except: 93 | print("未获取到有效COOKIE,退出程序!") 94 | sys.exit() 95 | num = 0 96 | for cookie in cks[:]: 97 | num += 1 98 | global ua 99 | ua = userAgent() 100 | try: 101 | pt_pin = re.compile(r'pt_pin=(.*?);').findall(cookie)[0] 102 | pt_pin = unquote_plus(pt_pin) 103 | except IndexError: 104 | pt_pin = f'用户{num}' 105 | print(f'\n******开始【京东账号{num}】{pt_pin} *********\n') 106 | print(datetime.now()) 107 | 108 | try: 109 | getFD = getFansDetail(venderId, cookie) 110 | if getFD: 111 | activityId = getFD[0] 112 | activityType = getFD[1] 113 | discount = getFD[2] 114 | prizeTypeName = getFD[3] 115 | brandName = getFD[4] 116 | cg = collectGift(venderId, activityId, activityType, cookie) 117 | if cg: 118 | if "领取成功" in cg: 119 | print(f"🎉🎉🎉{brandName} {discount}{prizeTypeName} {cg}") 120 | else: 121 | print(brandName, cg) 122 | except: 123 | continue 124 | time.sleep(0.5) -------------------------------------------------------------------------------- /jd_sign.js: -------------------------------------------------------------------------------- 1 | //48 9,22 * * * jd_sign.js 2 | /* 3 | [task_local] 4 | 京东签到 5 | 48 9,22 * * * jd_sign.js, tag=京东签到, enabled=true 6 | ================Loon============== 7 | [Script] 8 | cron "48 9,22 * * *" script-path=jd_sign.js,tag=京东签到 9 | */ 10 | const {Env} = require('./utils/magic'); 11 | const $ = new Env('M京东签到') 12 | $.logic = async function () { 13 | await signBeanIndex() 14 | await $.wait(3000, 5000) 15 | await cgame(); 16 | } 17 | $.run({filename: __filename, wait: [1000, 2000], random: true}) 18 | .catch(reason => console.log(reason)) 19 | 20 | async function signBeanIndex() { 21 | let url = `https://api.m.jd.com/client.action` 22 | let headers = { 23 | "Content-Type": "application/x-www-form-urlencoded", 24 | 'Host': `api.m.jd.com`, 25 | 'Origin': 'https://api.m.jd.com', 26 | 'Referer': `https://api.m.jd.com`, 27 | 'Cookie': $.cookie 28 | } 29 | let body = "functionId=signBeanIndex&appid=ld" 30 | let data = await $.post(url, body, headers) 31 | let title = data.data?.dailyAward?.title 32 | || data.data?.continuityAward?.title; 33 | let bean = data.data?.dailyAward?.beanAward?.beanCount 34 | || data.data?.continuityAward?.beanAward?.beanCount; 35 | if (bean) { 36 | $.log(`${title} 获得${bean}京豆`) 37 | } 38 | } 39 | 40 | async function cgame() { 41 | let url = `https://cgame-stadium.jd.com/api/v1/sign` 42 | let headers = { 43 | 'Connection': 'keep-alive', 44 | 'Accept-Encoding': 'gzip, deflate, br', 45 | 'Content-Type': 'application/json', 46 | 'Origin': 'https://pro.m.jd.com', 47 | 'ActivityId': '7c51826be9f241c1ad9733df34d242c5', 48 | 'Host': 'cgame-stadium.jd.com', 49 | 'Referer': 'https://pro.m.jd.com/mall/active/dj6us2JJRLMMBb4iDaSK4wxvBMt/index.html', 50 | 'Accept-Language': 'zh-cn', 51 | 'Accept': 'application/json', 52 | 'Cookie': $.cookie 53 | } 54 | let data = await $.post(url, {}, headers) 55 | let bean = data?.data?.beanNum || 0; 56 | if (bean > 0) { 57 | $.log(`汽车签到 获得${bean}京豆`) 58 | } 59 | } 60 | 61 | -------------------------------------------------------------------------------- /jd_tewu.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 京东-下拉 3 | * cron: 15 8,20 * * * 4 | */ 5 | 6 | import USER_AGENT, {requireConfig, wait, o2s, getshareCodeHW, post} from './TS_USER_AGENTS' 7 | 8 | interface ShareCode { 9 | activityId: number, 10 | encryptProjectId: string, 11 | encryptAssignmentId: string, 12 | itemId: string 13 | } 14 | 15 | let cookie: string = '', UserName: string = '', res: any = '', message: string = '', shareCodes: ShareCode[] = [], shareCodesSelf: ShareCode[] = [], shareCodesHW: any = [], black: string[] = [] 16 | 17 | !(async () => { 18 | let cookiesArr: string[] = await requireConfig() 19 | let activityId: number 20 | for (let [index, value] of cookiesArr.entries()) { 21 | cookie = value 22 | UserName = decodeURIComponent(cookie.match(/pt_pin=([^;]*)/)![1]) 23 | console.log(`\n开始【京东账号${index + 1}】${UserName}\n`) 24 | 25 | res = await api('showSecondFloorCardInfo', {"source": "card"}) 26 | try { 27 | activityId = res.data.result.activityBaseInfo.activityId 28 | } catch (e) { 29 | console.log('获取活动信息错误') 30 | black.push(UserName) 31 | await wait(2000) 32 | continue 33 | } 34 | let encryptProjectId: string = res.data.result.activityBaseInfo.encryptProjectId 35 | await wait(1000) 36 | 37 | // 任务 38 | res = await api('superBrandTaskList', {"source": "card", "activityId": activityId, "assistInfoFlag": 1}) 39 | o2s(res) 40 | 41 | for (let t of res.data.result.taskList) { 42 | if (t.completionCnt !== t.assignmentTimesLimit) { 43 | // 浏览、关注 44 | if (t.ext?.shoppingActivity || t.ext?.followShop) { 45 | let tp = t.ext?.shoppingActivity || t.ext?.followShop 46 | tp = tp[0] 47 | console.log(tp.title || tp.shopName, tp.itemId) 48 | res = await api('superBrandDoTask', {"source": "card", "activityId": activityId, "encryptProjectId": encryptProjectId, "encryptAssignmentId": t.encryptAssignmentId, "assignmentType": t.assignmentType, "itemId": tp.itemId, "actionType": 0}) 49 | console.log(res.data?.bizMsg) 50 | await wait(2000) 51 | } 52 | 53 | // 下拉 54 | if (t.ext?.sign2) { 55 | for (let sign of t.ext.sign2) { 56 | if (sign.status === 0 && [10, 18].includes(new Date().getHours())) { 57 | res = await api('superBrandDoTask', {"source": "card", "activityId": activityId, "encryptProjectId": encryptProjectId, "encryptAssignmentId": t.encryptAssignmentId, "assignmentType": t.assignmentType, "itemId": t.ext.currentSectionItemId, "actionType": 0}) 58 | console.log(res.data?.bizMsg) 59 | await wait(2000) 60 | console.log('下拉任务', t.ext?.sign2) 61 | } else if (sign.status !== 0) { 62 | console.log(`${sign.beginTime} 签到完成`) 63 | } 64 | } 65 | } 66 | } 67 | 68 | // 助力码 69 | if (t.ext?.assistTaskDetail) { 70 | console.log('助力码:', t.ext.assistTaskDetail.itemId) 71 | console.log('收到助力:', t.ext?.assistList?.length ?? 0) 72 | shareCodesSelf.push({ 73 | activityId: activityId, 74 | encryptProjectId: encryptProjectId, 75 | encryptAssignmentId: t.encryptAssignmentId, 76 | itemId: t.ext.assistTaskDetail.itemId 77 | }) 78 | } 79 | } 80 | 81 | // 抽奖 82 | try { 83 | if (new Date().getHours() === 20) { 84 | let sum: number = 0 85 | res = await api('superBrandSecondFloorMainPage', {"source": "card"}) 86 | let userStarNum: number = res.data.result.activityUserInfo.userStarNum 87 | console.log('可以抽奖', userStarNum, '次') 88 | for (let i = 0; i < userStarNum; i++) { 89 | res = await api('superBrandTaskLottery', {"source": "card", "activityId": activityId}) 90 | if (res.data.result?.rewardComponent?.beanList?.length) { 91 | console.log('抽奖获得京豆:', res.data.result.rewardComponent.beanList[0].quantity) 92 | sum += res.data.result.rewardComponent.beanList[0].quantity 93 | } else { 94 | console.log('没抽到?', JSON.stringify(res)) 95 | } 96 | await wait(2000) 97 | } 98 | message += `【京东账号${index + 1}】${UserName}\n抽奖${userStarNum}次,获得京豆${sum}\n\n` 99 | } 100 | } catch (e) { 101 | console.log('error') 102 | } 103 | await wait(2000) 104 | } 105 | 106 | o2s(shareCodesSelf) 107 | shareCodesHW = await getshareCodeHW('tewu') 108 | shareCodes = [...shareCodesSelf, ...shareCodesHW] 109 | 110 | let full: string[] = [] 111 | for (let [index, value] of cookiesArr.entries()) { 112 | cookie = value 113 | UserName = decodeURIComponent(cookie.match(/pt_pin=([^;]*)/)![1]) 114 | if (black.includes(UserName)) { 115 | console.log('黑号') 116 | continue 117 | } 118 | for (let code of shareCodes) { 119 | if (full.includes(code.itemId)) 120 | continue 121 | console.log(`账号${index + 1} ${UserName} 去助力 ${code.itemId}`) 122 | res = await api('superBrandDoTask', {"source": "card", "activityId": code.activityId, "encryptProjectId": code.encryptProjectId, "encryptAssignmentId": code.encryptAssignmentId, "assignmentType": 2, "itemId": code.itemId, "actionType": 0}) 123 | if (res.data.bizCode === '0') { 124 | console.log('助力成功') 125 | } else if (res.data.bizCode === '103') { 126 | console.log('助力满了') 127 | full.push(code.itemId) 128 | } else if (res.data.bizCode === '104') { 129 | console.log('已助力过') 130 | } else if (res.data.bizCode === '108') { 131 | console.log('上限') 132 | break 133 | } else if (res.data.bizCode === '109') { 134 | } else if (res.data.bizCode === '2001') { 135 | console.log('黑号') 136 | break 137 | } else if (res.data.bizCode === '4001') { 138 | console.log('助力码过期') 139 | } else { 140 | o2s(res, 'error') 141 | } 142 | await wait(2000) 143 | } 144 | } 145 | })() 146 | 147 | async function api(fn: string, body: object) { 148 | return await post(`https://api.m.jd.com/?uuid=&client=wh5&appid=ProductZ4Brand&functionId=${fn}&t=${Date.now()}&body=${encodeURIComponent(JSON.stringify(body))}`, '', { 149 | 'Host': 'api.m.jd.com', 150 | 'Origin': 'https://pro.m.jd.com', 151 | 'User-Agent': USER_AGENT, 152 | 'Referer': 'https://pro.m.jd.com/', 153 | 'Cookie': cookie 154 | }) 155 | } -------------------------------------------------------------------------------- /jd_tj.py: -------------------------------------------------------------------------------- 1 | import requests 2 | import random 3 | import time 4 | 5 | 6 | def tongji(): 7 | url = 'https://hm.baidu.com/hm.js?46f61b50a7dd539a4d07f70efc11f93f' 8 | headers = { 9 | 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36', 10 | 'Referer': 'https://tj.nz.lu', 11 | 'Accept-Encoding': 'gzip, deflate, br', 12 | 'Accept-Language': 'zh-CN,zh;q=0.9' 13 | } 14 | r = requests.get(url, headers=headers) 15 | # print(r.text) 16 | 17 | 18 | def tongji_sec(): 19 | url = 'https://hm.baidu.com/hm.gif' 20 | params = { 21 | 'cc': '0', 22 | 'ck': '1', 23 | 'cl': '24-bit', 24 | 'ds': '1440x900', 25 | 'vl': '372', 26 | 'ep': '%s,%s' % (random.randint(2000, 3000), random.randint(100, 200)), 27 | 'et': '3', 28 | 'fl': '', 29 | 'ja': '', 30 | 'ln': 'zh-cn', 31 | 'lo': '0', 32 | 'lt': int(time.time() / 1000), 33 | 'rnd': random.randint(1000000000, 9999999999), 34 | 'si': '46f61b50a7dd539a4d07f70efc11f93f', 35 | 'su': 'https://tj.nz.lu', 36 | 'v': '1.2.30', 37 | 'lv': '3', 38 | 'sn': int(time.time() / 1000) % 65535, 39 | 'u': 'tj.nz.lu' 40 | } 41 | headers = { 42 | 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36', 43 | 'Referer': 'https://tj.nz.lu', 44 | 'Accept-Encoding': 'gzip, deflate, br', 45 | 'Accept-Language': 'zh-CN,zh;q=0.9' 46 | } 47 | r = requests.get(url, params=params, headers=headers) 48 | print(r.text) 49 | 50 | 51 | if __name__ == '__main__': 52 | tongji() 53 | tongji_sec() 54 | print('上报百度统计成功') 55 | -------------------------------------------------------------------------------- /jd_track.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 京东快递更新通知 3 | * cron: 0 0-23/4 * * * 4 | */ 5 | 6 | import * as path from "path" 7 | import {sendNotify} from './sendNotify' 8 | import {existsSync, mkdirSync, readFileSync, writeFileSync} from "fs" 9 | import USER_AGENT, {get, requireConfig, exceptCookie, wait, o2s} from "./TS_USER_AGENTS" 10 | import {pushplus} from "./utils/pushplus"; 11 | 12 | let cookie: string = '', UserName: string, allMessage: string = '', res: any = '' 13 | 14 | !(async () => { 15 | let cookiesArr: string[] = await requireConfig() 16 | let except: string[] = exceptCookie(path.basename(__filename)) 17 | let orders: any = {}, pushplusArr: { pt_pin: string, pushplus: string }[], pushplusUser: string[] = [] 18 | try { 19 | pushplusArr = JSON.parse(readFileSync('./utils/account.json').toString()) 20 | } catch (e) { 21 | console.log('utils/account.json load failed') 22 | } 23 | for (let user of pushplusArr) { 24 | if (user.pushplus) 25 | pushplusUser.push(decodeURIComponent(user.pt_pin)) 26 | } 27 | if (existsSync('./json')) { 28 | if (existsSync('./json/jd_track.json')) { 29 | orders = JSON.parse(readFileSync('./json/jd_track.json').toString() || '{}') 30 | } else { 31 | writeFileSync('./json/jd_track.json', '{}') 32 | } 33 | } else { 34 | mkdirSync('./json') 35 | writeFileSync('./json/jd_track.json', '{}') 36 | } 37 | for (let [index, value] of cookiesArr.entries()) { 38 | cookie = value 39 | UserName = decodeURIComponent(cookie.match(/pt_pin=([^;]*)/)![1]) 40 | console.log(`\n开始【京东账号${index + 1}】${UserName}\n`) 41 | 42 | if (except.includes(encodeURIComponent(UserName))) { 43 | console.log('已设置跳过') 44 | continue 45 | } 46 | 47 | let message: string = '', markdown: string = '', i: number = 1 48 | 49 | let headers: object = { 50 | 'authority': 'wq.jd.com', 51 | 'user-agent': USER_AGENT, 52 | 'referer': 'https://wqs.jd.com/', 53 | 'cookie': cookie 54 | } 55 | 56 | res = await get(`https://wq.jd.com/bases/orderlist/list?order_type=2&start_page=1&last_page=0&page_size=10&callersource=mainorder&t=${Date.now()}&sceneval=2&_=${Date.now()}&sceneval=2`, headers) 57 | await wait(1000) 58 | 59 | for (let order of res.orderList) { 60 | let orderId: string = order.orderId 61 | let orderType: string = order.orderType 62 | let title: string = order.productList[0].title 63 | let t: string = order.progressInfo?.tip || null 64 | let status: string = order.progressInfo?.content || null 65 | let shopName: string = order.shopInfo.shopName 66 | 67 | res = await get(`https://wq.jd.com/bases/wuliudetail/dealloglist?deal_id=${orderId}&orderstate=15&ordertype=${orderType}&t=${Date.now()}&sceneval=2`, headers) 68 | await wait(1000) 69 | let carrier: string = res.carrier, carriageId: string = res.carriageId 70 | 71 | if (t && status) { 72 | if (status.match(/(?=签收|已取走|已暂存)/)) 73 | continue 74 | if (!pushplusUser.includes(UserName)) { 75 | console.log(`<${shopName}>\t${title}`) 76 | console.log('\t', t, status) 77 | console.log() 78 | } else { 79 | console.log('隐私保护,不显示日志') 80 | } 81 | if (!Object.keys(orders).includes(orderId) || orders[orderId]['status'] !== status) { 82 | if (pushplusUser.includes(UserName)) { 83 | console.log('+ pushplus') 84 | markdown += `${i++}. ${title}\n\t- ${carrier} ${carriageId}\n\t- ${t} ${status}\n` 85 | } else { 86 | console.log('+ sendNotify') 87 | message += `<${shopName}>\t${title}\n${carrier} ${carriageId}\n${t} ${status}\n\n` 88 | } 89 | } 90 | orders[orderId] = { 91 | user: UserName, shopName, title, t, status, carrier, carriageId 92 | } 93 | } 94 | } 95 | 96 | if (message) { 97 | message = `【京东账号${index + 1}】 ${UserName}\n\n${message}` 98 | allMessage += message 99 | } 100 | if (markdown) { 101 | markdown = `#### <${UserName}>\n${markdown}` 102 | await pushplus('京东快递更新', markdown, 'markdown') 103 | } 104 | await wait(1000) 105 | } 106 | 107 | 108 | let account: { pt_pin: string, remarks: string }[] = [] 109 | try { 110 | account = JSON.parse(readFileSync('./utils/account.json').toString()) 111 | } catch (e) { 112 | console.log('utils/account.json load failed') 113 | } 114 | 115 | // 删除已签收 116 | Object.keys(orders).map(key => { 117 | if (orders[key].status.match(/(?=签收|已取走|已暂存)/)) { 118 | delete orders[key] 119 | } 120 | if (pushplusUser.includes(orders[key].user)) { 121 | orders[key].title = '******' 122 | } 123 | }) 124 | 125 | // 替换通知中的用户名为备注 126 | orders = JSON.stringify(orders, null, 2) 127 | for (let acc of account) { 128 | orders = orders.replace(new RegExp(decodeURIComponent(acc.pt_pin), 'g'), acc.remarks ?? acc.pt_pin) 129 | } 130 | writeFileSync('./json/jd_track.json', orders) 131 | if (allMessage) 132 | await sendNotify('京东快递更新', allMessage) 133 | })() 134 | -------------------------------------------------------------------------------- /jd_try_notify.py: -------------------------------------------------------------------------------- 1 | #Source::https://github.com/Hyper-Beast/JD_Scripts 2 | 3 | """ 4 | cron: 20 20 * * * 5 | new Env('京东试用成功通知'); 6 | """ 7 | 8 | 9 | import requests 10 | import json 11 | import time 12 | import os 13 | import re 14 | import sys 15 | import random 16 | import string 17 | import urllib 18 | 19 | 20 | 21 | #以下部分参考Curtin的脚本:https://github.com/curtinlv/JD-Script 22 | 23 | def randomuserAgent(): 24 | global uuid,addressid,iosVer,iosV,clientVersion,iPhone,area,ADID,lng,lat 25 | 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)) 26 | addressid = ''.join(random.sample('1234567898647', 10)) 27 | iosVer = ''.join(random.sample(["15.1.1","14.5.1", "14.4", "14.3", "14.2", "14.1", "14.0.1"], 1)) 28 | iosV = iosVer.replace('.', '_') 29 | clientVersion=''.join(random.sample(["10.3.0", "10.2.7", "10.2.4"], 1)) 30 | iPhone = ''.join(random.sample(["8", "9", "10", "11", "12", "13"], 1)) 31 | area=''.join(random.sample('0123456789', 2)) + '_' + ''.join(random.sample('0123456789', 4)) + '_' + ''.join(random.sample('0123456789', 5)) + '_' + ''.join(random.sample('0123456789', 4)) 32 | 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)) 33 | lng='119.31991256596'+str(random.randint(100,999)) 34 | lat='26.1187118976'+str(random.randint(100,999)) 35 | UserAgent='' 36 | if not UserAgent: 37 | 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' 38 | else: 39 | return UserAgent 40 | 41 | #以上部分参考Curtin的脚本:https://github.com/curtinlv/JD-Script 42 | 43 | def load_send(): 44 | global send 45 | cur_path = os.path.abspath(os.path.dirname(__file__)) 46 | sys.path.append(cur_path) 47 | if os.path.exists(cur_path + "/sendNotify.py"): 48 | try: 49 | from sendNotify import send 50 | except: 51 | send=False 52 | print("加载通知服务失败~") 53 | else: 54 | send=False 55 | print("加载通知服务失败~") 56 | load_send() 57 | 58 | 59 | def printf(text): 60 | print(text) 61 | sys.stdout.flush() 62 | 63 | def get_remarkinfo(): 64 | url='http://127.0.0.1:5600/api/envs' 65 | try: 66 | with open('/ql/config/auth.json', 'r') as f: 67 | token=json.loads(f.read())['token'] 68 | headers={ 69 | 'Accept':'application/json', 70 | 'authorization':'Bearer '+token, 71 | } 72 | response=requests.get(url=url,headers=headers) 73 | 74 | for i in range(len(json.loads(response.text)['data'])): 75 | if json.loads(response.text)['data'][i]['name']=='JD_COOKIE': 76 | try: 77 | if json.loads(response.text)['data'][i]['remarks'].find('@@')==-1: 78 | remarkinfos[json.loads(response.text)['data'][i]['value'].split(';')[1].replace('pt_pin=','')]=json.loads(response.text)['data'][i]['remarks'].replace('remark=','') 79 | else: 80 | remarkinfos[json.loads(response.text)['data'][i]['value'].split(';')[1].replace('pt_pin=','')]=json.loads(response.text)['data'][i]['remarks'].split("@@")[0].replace('remark=','').replace(';','') 81 | except: 82 | pass 83 | except: 84 | print('读取auth.json文件出错,跳过获取备注') 85 | 86 | def get_succeedinfo(ck): 87 | url='https://api.m.jd.com/client.action' 88 | headers={ 89 | 'accept':'application/json, text/plain, */*', 90 | 'content-type':'application/x-www-form-urlencoded', 91 | 'origin':'https://prodev.m.jd.com', 92 | 'content-length':'249', 93 | 'accept-language':'zh-CN,zh-Hans;q=0.9', 94 | 'User-Agent':UserAgent, 95 | 'referer':'https://prodev.m.jd.com/', 96 | 'accept-encoding':'gzip, deflate, br', 97 | 'cookie':ck 98 | } 99 | data=f'appid=newtry&functionId=try_MyTrials&uuid={uuid}&clientVersion={clientVersion}&client=wh5&osVersion={iosVer}&area={area}&networkType=wifi&body=%7B%22page%22%3A1%2C%22selected%22%3A2%2C%22previewTime%22%3A%22%22%7D' 100 | response=requests.post(url=url,headers=headers,data=data) 101 | isnull=True 102 | try: 103 | for i in range(len(json.loads(response.text)['data']['list'])): 104 | if(json.loads(response.text)['data']['list'][i]['text']['text']).find('试用资格将保留')!=-1: 105 | print(json.loads(response.text)['data']['list'][i]['trialName']) 106 | try: 107 | send("京东试用待领取物品通知",'账号名称:'+remarkinfos[ptpin]+'\n'+'商品名称:'+json.loads(response.text)['data']['list'][i]['trialName']+"\n"+"商品链接:https://item.jd.com/"+json.loads(response.text)['data']['list'][i]['skuId']+".html") 108 | isnull=False 109 | except: 110 | send("京东试用待领取物品通知",'账号名称:'+urllib.parse.unquote(ptpin)+'\n'+'商品名称:'+json.loads(response.text)['data']['list'][i]['trialName']+"\n"+"商品链接:https://item.jd.com/"+json.loads(response.text)['data']['list'][i]['skuId']+".html") 111 | isnull=False 112 | if isnull==True: 113 | print("没有在有效期内待领取的试用品\n\n") 114 | except: 115 | print('获取信息出错,可能是账号已过期') 116 | if __name__ == '__main__': 117 | remarkinfos={} 118 | try: 119 | get_remarkinfo() 120 | except: 121 | pass 122 | try: 123 | cks = os.environ["JD_COOKIE"].split("&") 124 | except: 125 | f = open("/jd/config/config.sh", "r", encoding='utf-8') 126 | cks = re.findall(r'Cookie[0-9]*="(pt_key=.*?;pt_pin=.*?;)"', f.read()) 127 | f.close() 128 | for ck in cks: 129 | ck = ck.strip() 130 | if ck[-1] != ';': 131 | ck += ';' 132 | ptpin = re.findall(r"pt_pin=(.*?);", ck)[0] 133 | try: 134 | if remarkinfos[ptpin]!='': 135 | printf("--账号:" + remarkinfos[ptpin] + "--") 136 | else: 137 | printf("--无备注账号:" + urllib.parse.unquote(ptpin) + "--") 138 | except Exception as e: 139 | printf("--账号:" + urllib.parse.unquote(ptpin) + "--") 140 | UserAgent=randomuserAgent() 141 | get_succeedinfo(ck) 142 | -------------------------------------------------------------------------------- /jd_wechat_zz.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 赚赚 3 | * cron: 30 9 * * * 4 | */ 5 | 6 | import {requireConfig, wait, get, randomNumString} from './TS_USER_AGENTS' 7 | 8 | let cookie: string = '', UserName: string = '', res: any = '' 9 | 10 | !(async () => { 11 | let cookiesArr: string[] = await requireConfig() 12 | for (let [index, value] of cookiesArr.entries()) { 13 | cookie = value 14 | UserName = decodeURIComponent(cookie.match(/pt_pin=([^;]*)/)![1]) 15 | console.log(`\n开始【京东账号${index + 1}】${UserName}\n`) 16 | let headers: object = {'Host': 'api.m.jd.com', 'wqreferer': 'http://wq.jd.com/wxapp/pages/hd-interaction/task/index', 'User-Agent': 'MQQBrowser/26 Mozilla/5.0 (Linux; U; Android 2.3.7; zh-cn; MB200 Build/GRJ22; CyanogenMod-7) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1', 'Referer': 'https://servicewechat.com/wx8830763b00c18ac3/115/page-frame.html', 'Content-Type': 'application/json', 'Cookie': cookie} 17 | 18 | res = await get(`https://api.m.jd.com/client.action?functionId=interactTaskIndex&body=%7B%22mpVersion%22%3A%223.4.0%22%7D&appid=wh5&loginWQBiz=interact&g_ty=ls&g_tk=${randomNumString(9)}`, headers) 19 | console.log(res.data.cashExpected) 20 | 21 | for (let t of res.data.taskDetailResList) { 22 | if (t.times === 0) { 23 | console.log(t.taskName) 24 | let taskItem: object = {...t, "fullTaskName": `${t.taskName} (0/1)`, "btnText": "去完成"} 25 | res = await get(`https://api.m.jd.com/client.action?functionId=doInteractTask&body=${encodeURIComponent(JSON.stringify({"taskId": t.taskId, "taskItem": taskItem, "actionType": 0, "taskToken": t.taskToken, "mpVersion": "3.4.0"}))}&appid=wh5&loginWQBiz=interact&g_ty=ls&g_tk=${randomNumString(9)}`, headers) 26 | console.log(res.message) 27 | await wait(2000) 28 | } 29 | } 30 | await wait(2000) 31 | } 32 | })() -------------------------------------------------------------------------------- /jx_aid_cashback.js: -------------------------------------------------------------------------------- 1 | let common = require("./function/common"); 2 | let $ = new common.env('京喜购物返红包助力'); 3 | let min = 5, 4 | help = $.config[$.filename(__filename)] || Math.min(min, $.config.JdMain) || min; 5 | $.setOptions({ 6 | headers: { 7 | 'content-type': 'application/json', 8 | 'user-agent': 'jdapp;iPhone;9.4.6;14.2;965af808880443e4c1306a54afdd5d5ae771de46;network/wifi;supportApplePay/0;hasUPPay/0;hasOCPay/0;model/iPhone8,4;addressid/;supportBestPay/0;appBuild/167618;jdSupportDarkMode/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', 9 | 'referer': 'https://happy.m.jd.com/babelDiy/Zeus/3ugedFa7yA6NhxLN5gw2L3PF9sQC/index.html?asid=287215626&un_area=12_904_905_57901&lng=117.612969135975&lat=23.94014745198865', 10 | } 11 | }); 12 | $.readme = ` 13 | 在京喜下单,如订单有购物返现,脚本会自动查询返现groupid并予以助力,目前每个账号每天能助力3次 14 | 44 */6 * * * task ${$.runfile} 15 | export ${$.runfile}=2 #如需增加被助力账号,在这边修改人数 16 | ` 17 | eval(common.eval.mainEval($)); 18 | async function prepare() { 19 | let url = `https://wq.jd.com/bases/orderlist/list?order_type=3&start_page=1&last_page=0&page_size=10&callersource=newbiz&t=${$.timestamp}&traceid=&g_ty=ls&g_tk=606717070` 20 | for (let j of cookies['help']) { 21 | $.setCookie(j); 22 | await $.curl(url) 23 | try { 24 | for (let k of $.source.orderList) { 25 | try { 26 | let orderid = k.parentId != '0' ? k.parentId : k.orderId 27 | let url = `https://wq.jd.com/fanxianzl/zhuli/QueryGroupDetail?isquerydraw=1&orderid=${orderid}&groupid=&sceneval=2&g_login_type=1&g_ty=ls` 28 | let dec = await jxAlgo.dec(url) 29 | await $.curl(dec.url) 30 | let now = parseInt(new Date() / 1000) 31 | let end = $.source.data.groupinfo.end_time 32 | if (end > now && $.source.data.groupinfo.openhongbaosum != $.source.data.groupinfo.totalhongbaosum) { 33 | let groupid = $.source.data.groupinfo.groupid; 34 | $.sharecode.push({ 35 | 'groupid': groupid 36 | }) 37 | } 38 | } catch (e) {} 39 | } 40 | } catch (e) {} 41 | } 42 | } 43 | async function main(id) { 44 | common.assert(id.groupid, '没有可助力ID') 45 | let url = `http://wq.jd.com/fanxianzl/zhuli/Help?groupid=${id.groupid}&_stk=groupid&_ste=2&g_ty=ls&g_tk=1710198667&sceneval=2&g_login_type=1` 46 | let dec = await jxAlgo.dec(url) 47 | await $.curl(dec.url) 48 | console.log($.source.data.prize.discount) 49 | } 50 | -------------------------------------------------------------------------------- /magic.json: -------------------------------------------------------------------------------- 1 | { 2 | "api_id": 3741859, 3 | "api_hash": "f81a30b542215b3d578", 4 | "bot_id": 1657544667, 5 | "bot_token": "1657544667:AAGO7sit_k_0u_C1w7U", 6 | "user_id": 951306588, 7 | "proxy": true, 8 | "proxy_type": "socks5", 9 | "proxy_addr": "127.0.0.1", 10 | "proxy_port": 7890, 11 | "command": "task", 12 | "log_path": "/jd/log", 13 | "log_send": true, 14 | "monitor_cache_size": 30, 15 | "monitor_cars": [ 16 | -1001718319262, 17 | -1001533334185, 18 | 1657544667 19 | ], 20 | "monitor_auto_stops": [ 21 | "jd_AutoOpenCard" 22 | ], 23 | "monitor_scripts_path": "/jd/scripts", 24 | "monitor_scripts": { 25 | "M_WX_ADD_CART_URL": { 26 | "name": "M加购有礼", 27 | "file": "m_jd_wx_addCart.js", 28 | "wait": 0, 29 | "queue": false, 30 | "queue_name": "M_WX_ADD_CART_URL", 31 | "enable": true 32 | }, 33 | "M_WX_LUCK_DRAW_URL": { 34 | "name": "M幸运抽奖", 35 | "file": "m_jd_wx_luckDraw.js", 36 | "wait": 5, 37 | "queue": true, 38 | "queue_name": "M_WX_LUCK_DRAW_URL", 39 | "enable": true 40 | }, 41 | "M_WX_CENTER_DRAW_URL": { 42 | "name": "M老虎机抽奖", 43 | "file": "m_jd_wx_centerDraw.js", 44 | "wait": 0, 45 | "queue": false, 46 | "queue_name": "M_WX_CENTER_DRAW_URL", 47 | "enable": true 48 | }, 49 | "M_FAV_SHOP_ARGV": { 50 | "name": "M收藏有礼", 51 | "file": "m_jd_fav_shop_gift.js", 52 | "wait": 0, 53 | "queue": false, 54 | "queue_name": "M_FAV_SHOP_ARGV", 55 | "enable": true 56 | }, 57 | "M_FOLLOW_SHOP_ARGV": { 58 | "name": "M关注有礼", 59 | "file": "m_jd_follow_shop.js", 60 | "wait": 0, 61 | "queue": false, 62 | "queue_name": "M_FOLLOW_SHOP_ARGV", 63 | "enable": true 64 | }, 65 | "M_FANS_RED_PACKET_URL": { 66 | "name": "M粉丝红包", 67 | "file": "m_jd_fans_redPackt.js", 68 | "wait": 0, 69 | "queue": false, 70 | "queue_name": "M_FANS_RED_PACKET_URL", 71 | "enable": true 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /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": "LXK9301", 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": "https://github.com/LXK9301/jd_scripts.git" 12 | }, 13 | "keywords": [ 14 | "京东薅羊毛工具, 京东水果、宠物、种豆等等" 15 | ], 16 | "author": "LXK9301", 17 | "license": "ISC", 18 | "dependencies": { 19 | "crypto-js": "^4.0.0", 20 | "download": "^6.2.5", 21 | "got": "^11.5.1", 22 | "http-server": "^0.12.3", 23 | "qrcode-terminal": "^0.12.0", 24 | "request": "^2.88.2", 25 | "tough-cookie": "^4.0.0", 26 | "tunnel": "0.0.6", 27 | "ws": "^7.4.3", 28 | "png-js": "^1.0.0", 29 | "jsdom": "^17.0.0", 30 | "dotenv": "^10.0.0" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /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 | let Fileexists = fs.existsSync('/ql/data/config/auth.json'); 11 | let authFile=""; 12 | if (Fileexists) 13 | authFile="/ql/data/config/auth.json" 14 | else 15 | authFile="/ql/config/auth.json" 16 | //const authFile = path.join(qlDir, 'config/auth.json'); 17 | 18 | const api = got.extend({ 19 | prefixUrl: 'http://127.0.0.1:5600', 20 | retry: { limit: 0 }, 21 | }); 22 | 23 | async function getToken() { 24 | const authConfig = JSON.parse(await readFile(authFile)); 25 | return authConfig.token; 26 | } 27 | 28 | module.exports.getEnvs = async () => { 29 | const token = await getToken(); 30 | const body = await api({ 31 | url: 'api/envs', 32 | searchParams: { 33 | searchValue: 'JD_COOKIE', 34 | t: Date.now(), 35 | }, 36 | headers: { 37 | Accept: 'application/json', 38 | authorization: `Bearer ${token}`, 39 | }, 40 | }).json(); 41 | return body.data; 42 | }; 43 | 44 | module.exports.getEnvsCount = async () => { 45 | const data = await this.getEnvs(); 46 | return data.length; 47 | }; 48 | 49 | module.exports.addEnv = async (cookie, remarks) => { 50 | const token = await getToken(); 51 | const body = await api({ 52 | method: 'post', 53 | url: 'api/envs', 54 | params: { t: Date.now() }, 55 | json: [{ 56 | name: 'JD_COOKIE', 57 | value: cookie, 58 | remarks, 59 | }], 60 | headers: { 61 | Accept: 'application/json', 62 | authorization: `Bearer ${token}`, 63 | 'Content-Type': 'application/json;charset=UTF-8', 64 | }, 65 | }).json(); 66 | return body; 67 | }; 68 | 69 | module.exports.updateEnv = async (cookie, eid, remarks) => { 70 | const token = await getToken(); 71 | const body = await api({ 72 | method: 'put', 73 | url: 'api/envs', 74 | params: { t: Date.now() }, 75 | json: { 76 | name: 'JD_COOKIE', 77 | value: cookie, 78 | _id: eid, 79 | remarks, 80 | }, 81 | headers: { 82 | Accept: 'application/json', 83 | authorization: `Bearer ${token}`, 84 | 'Content-Type': 'application/json;charset=UTF-8', 85 | }, 86 | }).json(); 87 | return body; 88 | }; 89 | 90 | module.exports.updateEnv11 = async (cookie, eid, remarks) => { 91 | const token = await getToken(); 92 | const body = await api({ 93 | method: 'put', 94 | url: 'api/envs', 95 | params: { t: Date.now() }, 96 | json: { 97 | name: 'JD_COOKIE', 98 | value: cookie, 99 | id: eid, 100 | remarks, 101 | }, 102 | headers: { 103 | Accept: 'application/json', 104 | authorization: `Bearer ${token}`, 105 | 'Content-Type': 'application/json;charset=UTF-8', 106 | }, 107 | }).json(); 108 | return body; 109 | }; 110 | 111 | module.exports.DisableCk = async (eid) => { 112 | const token = await getToken(); 113 | const body = await api({ 114 | method: 'put', 115 | url: 'api/envs/disable', 116 | params: { t: Date.now() }, 117 | body: JSON.stringify([eid]), 118 | headers: { 119 | Accept: 'application/json', 120 | authorization: `Bearer ${token}`, 121 | 'Content-Type': 'application/json;charset=UTF-8', 122 | }, 123 | }).json(); 124 | return body; 125 | }; 126 | 127 | module.exports.EnableCk = async (eid) => { 128 | const token = await getToken(); 129 | const body = await api({ 130 | method: 'put', 131 | url: 'api/envs/enable', 132 | params: { t: Date.now() }, 133 | body: JSON.stringify([eid]), 134 | headers: { 135 | Accept: 'application/json', 136 | authorization: `Bearer ${token}`, 137 | 'Content-Type': 'application/json;charset=UTF-8', 138 | }, 139 | }).json(); 140 | return body; 141 | }; 142 | 143 | module.exports.getstatus = async(eid) => { 144 | const envs = await this.getEnvs(); 145 | var tempid = 0; 146 | for (let i = 0; i < envs.length; i++) { 147 | tempid = 0; 148 | if (envs[i]._id) { 149 | tempid = envs[i]._id; 150 | } 151 | if (envs[i].id) { 152 | tempid = envs[i].id; 153 | } 154 | if (tempid == eid) { 155 | return envs[i].status; 156 | } 157 | } 158 | return 99; 159 | }; 160 | 161 | module.exports.getEnvById = async(eid) => { 162 | const envs = await this.getEnvs(); 163 | var tempid = 0; 164 | for (let i = 0; i < envs.length; i++) { 165 | tempid = 0; 166 | if (envs[i]._id) { 167 | tempid = envs[i]._id; 168 | } 169 | if (envs[i].id) { 170 | tempid = envs[i].id; 171 | } 172 | if (tempid == eid) { 173 | return envs[i].value; 174 | } 175 | } 176 | return ""; 177 | }; 178 | 179 | module.exports.getEnvByPtPin = async (Ptpin) => { 180 | const envs = await this.getEnvs(); 181 | for (let i = 0; i < envs.length; i++) { 182 | var tempptpin = decodeURIComponent(envs[i].value.match(/pt_pin=([^; ]+)(?=;?)/) && envs[i].value.match(/pt_pin=([^; ]+)(?=;?)/)[1]); 183 | if(tempptpin==Ptpin){ 184 | return envs[i]; 185 | } 186 | } 187 | return ""; 188 | }; 189 | 190 | module.exports.delEnv = async (eid) => { 191 | const token = await getToken(); 192 | const body = await api({ 193 | method: 'delete', 194 | url: 'api/envs', 195 | params: { t: Date.now() }, 196 | body: JSON.stringify([eid]), 197 | headers: { 198 | Accept: 'application/json', 199 | authorization: `Bearer ${token}`, 200 | 'Content-Type': 'application/json;charset=UTF-8', 201 | }, 202 | }).json(); 203 | return body; 204 | }; 205 | -------------------------------------------------------------------------------- /scan.json: -------------------------------------------------------------------------------- 1 | { 2 | "userId": 9518, 3 | "botToken": "1657667:AAGO7sxIVvhdSHSJt_0u_C1w7U", 4 | "cookies": [ 5 | "pt_key=AAJi5jmpmW5aslpLbJxHVbjAWjlzxS_mPVOOQWA9UAloLTLuVViyOsxwWG0AGdSg4;pt_pin=jd_621c9;" 6 | ] 7 | } -------------------------------------------------------------------------------- /serverless.yml: -------------------------------------------------------------------------------- 1 | # serverless.yml 2 | 3 | #组件信息 4 | component: scf # (必选) 组件名称,在该实例中为scf 5 | name: jdscript # (必选) 组件实例名称。 6 | 7 | #组件参数配置 8 | inputs: 9 | name: scf-${name} # 云函数名称,默认为 ${name}-${stage}-${app} 10 | enableRoleAuth: true # 默认会尝试创建 SCF_QcsRole 角色,如果不需要配置成 false 即可 11 | src: ./ 12 | handler: index.main_handler #入口 13 | runtime: Nodejs12.16 # 运行环境 默认 Nodejs10.15 14 | region: ap-hongkong # 函数所在区域 15 | description: This is a function in ${app} application. 16 | memorySize: 128 # 内存大小,单位MB 17 | timeout: 900 # 超时时间,单位秒 18 | events: #触发器 19 | - timer: #签到 20 | parameters: 21 | name: beansign 22 | cronExpression: "0 0 0 * * * *" 23 | enable: true 24 | argument: jd_bean_sign 25 | - timer: #东东超市兑换奖品 #摇京豆 #京东汽车兑换 #家电星推官 #家电星推官好友互助 26 | parameters: 27 | name: blueCoin_clublottery_carexchange_xtg_xtghelp 28 | cronExpression: "0 0 0 * * * *" 29 | enable: true 30 | argument: jd_blueCoin&jd_club_lottery&jd_car_exchange&jd_xtg&jd_xtg_help 31 | - timer: #东东农场 #东东萌宠 #口袋书店 #京喜农场 #京东极速版签到 #京东家庭号 #金榜创造营 #明星小店 32 | parameters: 33 | name: fruit_pet_bookshop_jxnc_speedsign_family_goldcreator_starshop 34 | cronExpression: "0 5 6-18/6,8 * * * *" 35 | enable: true 36 | argument: jd_fruit&jd_pet&jd_bookshop&jd_jxnc&jd_speed_sign&jd_family&jd_gold_creator&jd_star_shop 37 | - timer: #宠汪汪喂食 #宠汪汪 #摇钱树 #京东种豆得豆 #京喜工厂 #东东工厂 #东东健康社区收集能量 38 | parameters: 39 | name: feedPets_joy_moneyTree_plantBean_dreamFactory_jdfactory_healthcollect 40 | cronExpression: "0 3 */1 * * * *" 41 | enable: true 42 | argument: jd_joy_feedPets&jd_joy&jd_moneyTree&jd_plantBean&jd_dreamFactory&jd_jdfactory&jd_health_collect 43 | - timer: #宠汪汪积分兑换京豆 #签到领现金 #点点券 #东东小窝 #京喜财富岛 #京东直播 #东东健康社区 #每日抽奖 #女装魔盒 #跳跳乐 #5G超级盲盒 44 | parameters: 45 | name: joyreward_cash_necklace_smallhome_cfd_live_health_dailylottery_nzmh_jump_mohe 46 | cronExpression: "0 0 0-16/8,20 * * * *" 47 | enable: true 48 | argument: jd_joy_reward&jd_cash&jd_necklace&jd_small_home&jd_cfd&jd_live&jd_health&jd_daily_lottery&jd_nzmh&jd_jump&jd_mohe 49 | - timer: #京东全民开红包 #进店领豆 #取关京东店铺商品 #京东抽奖机 #京东汽车 #京东秒秒币 50 | parameters: 51 | name: redPacket_shop_unsubscribe_lotteryMachine_car_ms 52 | cronExpression: "0 10 0 * * * *" 53 | enable: true 54 | argument: jd_redPacket&jd_shop&jd_unsubscribe&jd_lotteryMachine&jd_car&jd_ms 55 | - timer: #天天提鹅 #手机狂欢城 56 | parameters: 57 | name: dailyegg_carnivalcity 58 | cronExpression: "0 8 */3 * * * *" 59 | enable: true 60 | argument: jd_daily_egg&jd_carnivalcity 61 | - timer: #东东超市 #十元街 #动物联萌 #翻翻乐 62 | parameters: 63 | name: superMarket_syj_zoo_bigwinner 64 | cronExpression: "0 15 */1 * * * *" 65 | enable: true 66 | argument: jd_superMarket&jd_syj&jd_zoo&jd_big_winner 67 | - timer: #京豆变动通知 #疯狂的joy #监控crazyJoy分红 #京东排行榜 #领京豆额外奖励 #京东保价 #闪购盲盒 #新潮品牌狂欢 #京喜领88元红包 68 | parameters: 69 | name: beanchange_crazyjoy_crazyjoybonus_rankingList_beanhome_price_sgmh_mcxhd_jxlhb 70 | cronExpression: "0 30 7 * * * *" 71 | enable: true 72 | argument: jd_bean_change&jd_crazy_joy&jd_crazy_joy_bonus&jd_rankingList&jd_bean_home&jd_price&jd_sgmh&jd_mcxhd&jd_jxlhb 73 | - timer: #金融养猪 #京东快递 #京东赚赚 #京东极速版红包 #领金贴 74 | parameters: 75 | name: pigPet_kd_jdzz_speedredpocke_jintie 76 | cronExpression: "0 3 1 * * * *" 77 | enable: true 78 | argument: jd_pigPet&jd_kd&jd_jdzz&jd_speed_redpocke&jd_jin_tie 79 | environment: # 环境变量 80 | variables: # 环境变量对象 81 | AAA: BBB # 不要删除,用来格式化对齐追加的变量的 82 | -------------------------------------------------------------------------------- /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/MoveMentFaker.js: -------------------------------------------------------------------------------- 1 | const https = require('https'); 2 | const fs = require('fs/promises'); 3 | const { R_OK } = require('fs').constants; 4 | const vm = require('vm'); 5 | const UA = require('../USER_AGENTS.js').USER_AGENT; 6 | 7 | const URL = 'https://wbbny.m.jd.com/babelDiy/Zeus/2rtpffK8wqNyPBH6wyUDuBKoAbCt/index.html'; 8 | // const REG_MODULE = /(\d+)\:function\(.*(?=smashUtils\.get_risk_result)/gm; 9 | const SYNTAX_MODULE = '!function(n){var r={};function o(e){if(r[e])'; 10 | const REG_SCRIPT = /