├── .gitignore
├── .vscode
└── settings.json
├── JS_USER_AGENTS.js
├── LICENSE
├── README.md
├── USER_AGENTS.js
├── backUp
└── jd_inviteFission2.js
├── config.json
├── desktop.ini
├── function
├── assets
│ ├── h5_3_1_src.js
│ ├── h5_4_1_src.js
│ ├── h5_4_2_src.js
│ └── h5_4_3_src.js
├── cache
│ └── index.js
├── config.js
├── dylank.js
├── dylanx.js
├── dylany.js
├── getH5st3_0.js
├── getSign.js
├── getToken.js
├── jdCommon.js
├── jdCrypto.js
├── jdcookie.js
├── krgetH5st.js
├── krgetSign.js
├── krgetToken.js
├── krgetua.js
├── krh5st.js
├── krsavePrize.js
├── ql.js
├── sendJDNotify.js
└── wxSavePrize.js
├── githubAction.md
├── icon
└── jd_pet.png
├── index.js
├── jdCookie.js
├── jdCookie.py
├── jd_10.js
├── jd_AJMH.js
├── jd_OpenCard.js
├── jd_OpenCard_Force.js
├── jd_SuperBrandJXZ.js
├── jd_a2.js
├── jd_beanSign.js
├── jd_bean_change.js
├── jd_bean_home.js
├── jd_bean_info.js
├── jd_bigwinner_exchange.py
├── jd_car_exc.js
├── jd_car_play.js
├── jd_car_play_exchange.js
├── jd_cashtored.js
├── jd_categoryUnion.js
├── jd_categoryUnion_draw.js
├── jd_cjdaily.js
├── jd_cleancart_nolan.js
├── jd_completeInfoActivity.js
├── jd_cxjhelp_draw.js
├── jd_daily.js
├── jd_ddnc_farmpark.js
├── jd_dlgf.js
├── jd_dongDongFarm_draw.js
├── jd_dongDongFarm_help.js
├── jd_dongDongFarm_task.js
├── jd_dpqd.js
├── jd_drawCenter.js
├── jd_drawShopGift.js
├── jd_dwapp.js
├── jd_dygetbeans.js
├── jd_dyson.js
├── jd_exchange.js
├── jd_exchangejxbeans.js
├── jd_fansDraw.js
├── jd_fans_fansactiveall.js
├── jd_fans_videofangrowth.js
├── jd_fcwb_auto.js
├── jd_fcwb_help.js
├── jd_fen2bean.js
├── jd_festival.js
├── jd_fh_draw.js
├── jd_floor.js
├── jd_follow.js
├── jd_fruit_friend.js
├── jd_fruit_help.js
├── jd_fruit_task.js
├── jd_fruit_watering.js
├── jd_fruit_zdhelp.js
├── jd_gwfd.js
├── jd_gzsl_contactWare.js
├── jd_gzsl_getLottery.js
├── jd_gzsl_shopGiftBag.js
├── jd_hbCount.js
├── jd_hcredrain.js
├── jd_hdcheck.js
├── jd_healthCheck.js
├── jd_insight.js
├── jd_inviteFission.js
├── jd_jdgj_sign.js
├── jd_jdzz_exchange.js
├── jd_jinggeng_showInviteJoin.js
├── jd_jj_wwly.js
├── jd_jj_wwly_help.js
├── jd_jjqdtx.js
├── jd_joy_feedPets.js
├── jd_joyjd_open.js
├── jd_joymatch.js
├── jd_joyrun_red.py
├── jd_joyrunred.js
├── jd_jrsign.js
├── jd_kd.js
├── jd_krsign.js
├── jd_kuaidi_leaf.js
├── jd_loadBlindBox.js
├── jd_lottery.js
├── jd_lottery_cart.js
├── jd_lotty.js
├── jd_luck_draw.js
├── jd_lzkj_loreal_cart.js
├── jd_lzkj_loreal_dailyGrabs.js
├── jd_lzkj_loreal_daySign.js
├── jd_lzkj_loreal_draw.js
├── jd_lzkj_loreal_followGoods.js
├── jd_lzkj_loreal_followShop.js
├── jd_lzkj_loreal_invite.js
├── jd_lzkj_loreal_inviteFollowShop.js
├── jd_lzkj_loreal_know.js
├── jd_lzkj_loreal_lkFollowShop.js
├── jd_lzkj_loreal_organizeTeam.js
├── jd_lzkj_loreal_perfectInfo.js
├── jd_lzkj_loreal_pointsExchange.js
├── jd_lzkj_loreal_share.js
├── jd_lzkj_loreal_shopGift.js
├── jd_lzkj_loreal_sign.js
├── jd_lzkj_loreal_upperSign.js
├── jd_marketmh.js
├── jd_mengniu_draw.js
├── jd_mfn.js
├── jd_mfredrain.js
├── jd_morningSc.js
├── jd_moxigame.js
├── jd_mpdz_carv.js
├── jd_opencardDPLHTY.js
├── jd_opencardJBK.js
├── jd_opencardLCD.js
├── jd_pay_contract.js
├── jd_pdd1_draw.js
├── jd_pdd1_help.js
├── jd_pdd2_help.js
├── jd_pdd_draw.js
├── jd_pdd_help.js
├── jd_pdkh.js
├── jd_plantBean.js
├── jd_plantBean_help.js
├── jd_pointExgBeans.js
├── jd_pointExgHb.js
├── jd_pointExgShiWu.js
├── jd_ppdt_.js
├── jd_price.js
├── jd_prodev.js
├── jd_qdtx.js
├── jd_seckillViewTask.js
├── jd_share.js
├── jd_shopDraw.js
├── jd_shopSign.js
├── jd_showCart.js
├── jd_showDrawOne.js
├── jd_showFavoriteShop.js
├── jd_showInviteJoin.js
├── jd_showPartition.js
├── jd_showPerfectInformation.js
├── jd_showSign.js
├── jd_showTaskDraw.js
├── jd_sign_graphics.js
├── jd_signbeanact.js
├── jd_sk2_draw.js
├── jd_slider_sign.js
├── jd_speed_redpocke.js
├── jd_speed_sign_new.js
├── jd_speed_signfree.js
├── jd_superBrand.js
├── jd_superBrandJK_1.js
├── jd_superBrandStar.js
├── jd_superBrandz1.js
├── jd_sxLottery.js
├── jd_szxyun_bw.js
├── jd_tj_nnly.js
├── jd_tj_nnly_help.js
├── jd_tj_sign.js
├── jd_token.js
├── jd_ttlhb.js
├── jd_ttlhb2.js
├── jd_txzj_cart_item.js
├── jd_txzj_collect_item.js
├── jd_txzj_collect_shop.js
├── jd_txzj_lottery.js
├── jd_txzj_share_new.js
├── jd_txzj_shop_gift.js
├── jd_txzj_sign_in.js
├── jd_unsubscribe.js
├── jd_wish.js
├── jd_wwmanor_merge.js
├── jd_wwpark_merge.js
├── jd_wwzy.js
├── jd_wwzy_help.js
├── jd_wxBuildActivity.js
├── jd_wxCartKoi.js
├── jd_wxCollectCard.js
├── jd_wxCollectionActivity.js
├── jd_wxFansInterActionActivity.js
├── jd_wxGameActivity.js
├── jd_wxKnowledgeActivity.js
├── jd_wxMcLevelAndBirthGifts.js
├── jd_wxSecond.js
├── jd_wxShareActivity.js
├── jd_wxShopFollowActivity.js
├── jd_wxShopGift.js
├── jd_wxSign.js
├── jd_wxTeam.js
├── jd_wxUnPackingActivity.js
├── jd_wxgame.js
├── jd_wxttzq.js
├── jd_wyw.js
├── jd_xbh_exchange.js
├── jd_xbhdla.js
├── jd_xm_draw.js
├── jd_yh.js
├── jd_ylynj.js
├── jd_yqs.js
├── jd_yy.js
├── jd_zmlyq.js
├── jd_zzhb.js
├── jx_lhb.js
├── jx_niuniu_merge.js
├── package.json
├── sendNotify.js
├── serverless.yml
├── ty_CheckRpeat.js
├── ty_install.sh
├── ty_jd_wskey.py
└── utils
├── Env.js
├── JDJRValidator.js
├── JDJRValidator_Aaron.js
├── JDJRValidator_Pure.js
├── JDSign.js
├── JDSignValidator.js
├── MoveMentFaker.js
├── ZooFaker_Necklace.js
├── __pycache__
├── h5st31.cpython-311.pyc
└── jdsign.cpython-311.pyc
├── h5st.js
├── h5st3.js
├── h5st31.py
├── jdsign.py
├── magic.js
├── share_code.js
└── sign_graphics_validate.js
/.gitignore:
--------------------------------------------------------------------------------
1 | /node_modules/
2 | /box.dat
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "editor.suggest.snippetsPreventQuickSuggestions": false,
3 | "aiXcoder.showTrayIcon": true
4 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | 到处搬运,很少自写,反混淆的脚本能解开的都会解开。
2 | 拉库命令,国内机拉库失败的自己准备代理。
3 |
4 |
5 | `ql repo https://github.com/nyqty/scripts.git "jd_|jx_|ty_|CheckRpeat" "activity|backUp|icon" "^jd[^_]|^JD|USER|utils|function|^sign|sendNotify|jdCookie"`
6 |
--------------------------------------------------------------------------------
/USER_AGENTS.js:
--------------------------------------------------------------------------------
1 | function _0x3f24c4(_0x16f52a) {
2 | let _0x457ae9 = "0123456789abcdef",
3 | _0x89b519 = "";
4 | for (let _0x20a762 = 0; _0x20a762 < _0x16f52a; _0x20a762++) {
5 | _0x89b519 += _0x457ae9[Math.ceil(100000000 * Math.random()) % _0x457ae9.length];
6 | }
7 | return _0x89b519;
8 | }
9 |
10 | function _0x236b64(arr, _0x444f12) {
11 | let _0x433350 = new Array();
12 | for (let _0x52f677 in arr) {
13 | _0x433350.push(arr[_0x52f677]);
14 | }
15 | let _0x1ecefb = new Array();
16 | for (let _0x3368d3 = 0; _0x3368d3 < _0x444f12; _0x3368d3++) {
17 | if (_0x433350.length > 0) {
18 | let _0x455ec8 = Math.floor(Math.random() * _0x433350.length);
19 | _0x1ecefb[_0x3368d3] = _0x433350[_0x455ec8];
20 | _0x433350.splice(_0x455ec8, 1);
21 | } else {
22 | break;
23 | }
24 | }
25 | return _0x1ecefb;
26 | }
27 |
28 | function UARAM(tjb=false) {
29 | const dictionary={"A":"K","B":"L","C":"M","D":"N","E":"O","F":"P","G":"Q","H":"R","I":"S","J":"T","K":"A","L":"B","M":"C","N":"D","O":"E","P":"F","Q":"G","R":"H","S":"I","T":"J","e":"o","f":"p","g":"q","h":"r","i":"s","j":"t","k":"u","l":"v","m":"w","n":"x","o":"e","p":"f","q":"g","r":"h","s":"i","t":"j","u":"k","v":"l","w":"m","x":"n"};
30 | const _0x1cd700 = {
31 | "ud": "",
32 | "sv": "",
33 | "iad": ""
34 | };
35 | let sv = _0x236b64([12, 13, 14, 15, 16], 1) + "." + _0x236b64([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 1) + "." + _0x236b64([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 1),
36 | _0x4d5e80 = _0x236b64([9, 10, 11], 1) + "." + _0x236b64([0, 1, 2, 3, 4, 5, 6, 7, 8], 1) + "." + _0x236b64([0, 1, 2, 3, 4, 5], 1),
37 | _0x16e12c = _0x236b64([4, 5, 6], 1) + "." + _0x236b64([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 1) + "." + _0x236b64([0, 1, 2, 3, 4, 5], 1),
38 | ep = {
39 | "ciphertype": 5,
40 | "cipher": _0x1cd700,
41 | "ts": parseInt(new Date().getTime() / 1000),
42 | "hdid": "",
43 | "version": "1.0.3",
44 | "appname": "",
45 | "ridx": -1
46 | };
47 | ep.cipher.sv = new Buffer.from(sv).toString("base64").split("").map(_0x49219d => dictionary[_0x49219d] || _0x49219d).join("");
48 | ep.cipher.ud = new Buffer.from(_0x3f24c4(40)).toString("base64").split("").map(_0x2db617 => dictionary[_0x2db617] || _0x2db617).join("");
49 | ep.appname = "com.360buy.jdmobile";
50 | ep.hdid = "JM9F1ywUPwflvMIpYPok0tt5k9kW4ArJEU3lfLhxBqw=";
51 | let _0x26d294 = "jdapp;iPhone;" + _0x4d5e80 + ";;;M/5.0;appBuild/168341;jdSupportDarkMode/0;ef/1;ep/" + encodeURIComponent(JSON.stringify(ep)) + ";Mozilla/5.0 (iPhone; CPU iPhone OS " + sv.replace(/\./g, "_") + " like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1;";
52 | ep.appname = "com.jd.jdmobilelite";
53 | ep.hdid = "ViZLFbOc+bY6wW3m9/8iSFjgglIbmHPOGSM9aXIoBes=";
54 | ep.ridx = 1;
55 | let _0x579fcc = "jdltapp;iPhone;" + _0x16e12c + ";;;M/5.0;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;hasOCPay/0;appBuild/1338;supportBestPay/0;jdSupportDarkMode/0;ef/1;ep/" + encodeURIComponent(JSON.stringify(ep)) + ";Mozilla/5.0 (iPhone; CPU iPhone OS " + sv.replace(/\./g, "_") + " like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1;";
56 | return tjb ? _0x579fcc : _0x26d294;
57 | }
58 |
59 | module.exports = {
60 | "USER_AGENT": UARAM(),
61 | "UARAM": UARAM
62 | };
--------------------------------------------------------------------------------
/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "jd_fruit":[6, 12 ,18],
3 | "jx_sign": [8, 13],
4 | "jd_bean_sign": [0],
5 | "jd_cfd": [6, 8, 10, 12, 14, 16, 18, 20, 22],
6 | "jd_dreamFactory": [4, 6, 8, 10, 12, 14, 16, 18, 20, 22],
7 | "jd_joy": 2,
8 | "jd_big_winner": [6, 9, 12, 15, 18, 21],
9 | "jd_bean_home": [7],
10 | "jd_cash": [7],
11 | "jd_ccSign": [7],
12 | "jd_cfd_mooncake": [7, 23],
13 | "jd_club_lottery": [1, 23],
14 | "jd_connoisseur": [3, 9],
15 | "jd_ddly": [9],
16 | "jd_dwapp": [7, 19],
17 | "jd_fcdyj": [6, 15, 21],
18 | "jd_gold_creator": [1, 22],
19 | "jd_health": [6, 22],
20 | "jd_jdzz": [1],
21 | "jd_jin_tie": [1],
22 | "jd_joy_park": [3, 6, 9, 12, 15, 18, 21],
23 | "jd_joy_park_task": [6, 12, 18],
24 | "jd_joy_run": [14, 19],
25 | "jd_jxlhb": [3, 21],
26 | "jd_jxmc": [2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22],
27 | "jd_kd": [3],
28 | "jd_live": [12, 13, 14],
29 | "jd_mohe": [1, 4, 8, 12, 16, 20],
30 | "jd_moneyTree_help": [6, 10, 14, 18, 22],
31 | "jd_moneyTree": [6, 14, 22],
32 | "jd_ms": [7],
33 | "jd_nzmh": [8, 12],
34 | "jd_pet": [6, 12, 18],
35 | "jd_pigPet": [2, 8, 14, 20],
36 | "jd_plantBean": [7, 9, 11, 13, 15, 17, 19, 21],
37 | "jd_sddd": [1, 12],
38 | "jd_sgmh": [8],
39 | "jd_shop": [1],
40 | "jd_sign_graphics": [5],
41 | "jd_speed_redpocke": [2, 22],
42 | "jd_superBrand": [9,20],
43 | "jd_superMarket": [6, 8, 10, 12, 14, 16, 18, 20, 22],
44 | "jd_tyt": [6, 10, 14, 18, 22],
45 | "jd_wish": [1, 3],
46 | "jd_wsdlb": [6, 12, 18],
47 | "jd_z_health_energy": [6, 8, 10, 12, 14, 16, 18, 20, 22],
48 | "jd_zjb": [7],
49 | "jd_car": [7],
50 | "jd_ddworld": [9, 19],
51 | "jd_zsign":[10],
52 | "jd_genz":[13],
53 | "jd_jmf": [9,21],
54 | "jd_ttpt": [1],
55 | "jd_daily_egg": 1,
56 | "jd_jump":[3, 21],
57 | "jd_nnfls": [10,20],
58 | "jd_vivo": [3,9,16],
59 | "jd_fanli": [10],
60 | "jd_bean_change": [17],
61 | "jd_jdfactory": [6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23],
62 | "jd_speed_sign": [11],
63 | "jd_try": [4],
64 | "jd_unsubscribe": [23],
65 | "jd_cfd_loop": [8, 16],
66 | "jd_joy_steal": 3,
67 | "params":
68 | {
69 | "global":
70 | {
71 | "timeout": 10
72 | },
73 | "jd_try":
74 | {
75 | "timeout": 30
76 | },
77 | "jd_speed_sign":
78 | {
79 | "timeout": 55
80 | }
81 | }
82 | }
--------------------------------------------------------------------------------
/desktop.ini:
--------------------------------------------------------------------------------
1 | [LocalizedFileNames]
2 | jd_carnivalcity.js=@jd_carnivalcity.js,0
3 | jd_supergz.js=@jd_supergz.js,0
4 |
--------------------------------------------------------------------------------
/function/cache/index.js:
--------------------------------------------------------------------------------
1 | let IllIII = require("ds");
2 | try {
3 | IllIII.toString() === "[object Object]" && (IllIII = IllIII.DS);
4 | } catch {}
5 | function ii1li(IIll1 = 0, ll1il = null) {
6 | let lilii = this;
7 | lilii.now = function () {
8 | return new Date().getTime();
9 | };
10 | lilii.ttl = IIll1 || 0;
11 | if (ll1il) {
12 | lilii.data = new IllIII(ll1il);
13 | } else {
14 | lilii.data = new IllIII();
15 | }
16 | let l1iiI = function () {
17 | if (ll1il) {
18 | lilii.data.save(ll1il);
19 | }
20 | return lilii;
21 | },
22 | ll1li = function (I11iIl) {
23 | delete lilii.data[I11iIl];
24 | l1iiI();
25 | return lilii;
26 | };
27 | lilii.get = function (l1iIl, illIll) {
28 | let l1iIIl = null,
29 | iiilll = lilii.data[l1iIl];
30 | iiilll && (iiilll.expires == 0 || lilii.now() < iiilll.expires ? l1iIIl = iiilll.val : (l1iIIl = null, ll1li(l1iIl)));
31 | if (illIll) {
32 | illIll(l1iIIl);
33 | }
34 | return l1iIIl;
35 | };
36 | lilii.del = function (IilIl1, lIII1l) {
37 | let IiII = lilii.get(IilIl1);
38 | ll1li(IilIl1);
39 | if (lIII1l) {
40 | lIII1l(IiII);
41 | }
42 | return IiII;
43 | };
44 | lilii.put = function (llIIli, lIII1I = null, illIlI = 0, liIiI) {
45 | if (illIlI == 0) {
46 | illIlI = lilii.ttl;
47 | }
48 | let l1il1I = illIlI == 0 ? 0 : lilii.now() + illIlI;
49 | var Iiili = lilii.del(llIIli);
50 | lIII1I !== null && (lilii.data[llIIli] = {
51 | expires: l1il1I,
52 | val: lIII1I
53 | }, l1iiI());
54 | if (liIiI) {
55 | liIiI(Iiili);
56 | }
57 | return Iiili;
58 | };
59 | }
60 | module.exports = ii1li;
--------------------------------------------------------------------------------
/function/config.js:
--------------------------------------------------------------------------------
1 | module.exports = {"ThreadJs":[],"invokeKey":"RtKLB8euDo7KwsO0"}
--------------------------------------------------------------------------------
/function/dylank.js:
--------------------------------------------------------------------------------
1 | const _0x8da1c6 = require("ds").DS,
2 | _0x269d6c = require("got");
3 | const _0x135f1b = require("./dylanx");
4 | class _0x392694 {
5 | constructor(_0x546231 = 0, _0x4e2f43 = null) {
6 | this.ttl = _0x546231 || 0;
7 | this.file = _0x4e2f43;
8 | _0x4e2f43 ? this.data = new _0x8da1c6(_0x4e2f43) : this.data = new _0x8da1c6();
9 | }
10 | ["now"]() {
11 | return new Date().getTime();
12 | }
13 | ["_0x5c09x3e"]() {
14 | if (this.file) {
15 | this.data.save(this.file);
16 | }
17 | return this;
18 | }
19 | ["_0x5c09x3f"](_0x5417ed) {
20 | delete this.data[_0x5417ed];
21 | this._0x5c09x3e();
22 | return this;
23 | }
24 | ["get"](_0x2420ed, _0x136bf3) {
25 | let _0xf58704 = null,
26 | _0x157cb0 = this.data[_0x2420ed];
27 | if (_0x157cb0) {
28 | if (_0x157cb0.expires == 0 || this.now() < _0x157cb0.expires) {
29 | _0xf58704 = _0x157cb0.val;
30 | } else {
31 | _0xf58704 = null;
32 | this._0x5c09x3f(_0x2420ed);
33 | }
34 | }
35 | if (_0x136bf3) {
36 | _0x136bf3(_0xf58704);
37 | }
38 | return _0xf58704;
39 | }
40 | ["del"](_0x406631, _0x5b8082) {
41 | let _0x596e78 = this.get(_0x406631);
42 | this._0x5c09x3f(_0x406631);
43 | _0x5b8082 && _0x5b8082(_0x596e78);
44 | return _0x596e78;
45 | }
46 | ["put"](_0x208090, _0x224d4d = null, _0x497e3e = 0, _0x516146) {
47 | if (_0x497e3e == 0) {
48 | _0x497e3e = this.ttl;
49 | }
50 | let _0x33557b = _0x497e3e == 0 ? 0 : this.now() + _0x497e3e;
51 | var _0x5afbe5 = this.del(_0x208090);
52 | if (_0x224d4d !== null) {
53 | const _0x24ccdd = {
54 | "expires": _0x33557b,
55 | "val": _0x224d4d
56 | };
57 | this.data[_0x208090] = _0x24ccdd;
58 | this._0x5c09x3e();
59 | }
60 | _0x516146 && _0x516146(_0x5afbe5);
61 | return _0x5afbe5;
62 | }
63 | }
64 | let _0x3093cd = 900000;
65 | let _0xa9835e = new _0x392694(_0x3093cd, __dirname + "/cache/token.json");
66 | function _0x444e77(_0x2880da = "", _0xffc8ed) {
67 | let _0x5a261a = _0xffc8ed.exec(_0x2880da);
68 | if (_0x5a261a && _0x5a261a.length > 0) {
69 | return _0x5a261a[0].trim();
70 | }
71 | return "";
72 | }
73 | function _0x5c9c65(_0x3beda2, _0x13f811) {
74 | let _0x43b85d = new Date().getHours();
75 | if (_0x43b85d >= 0 && _0x43b85d <= 3) {
76 | return _0x3beda2;
77 | }
78 | return _0x3beda2 + "_" + _0x13f811;
79 | }
80 | function _0x424449(_0x39b03e) {
81 | return new Promise(_0x5b8759 => setTimeout(_0x5b8759, _0x39b03e));
82 | }
83 | async function _0xbb5e87(_0x45f1bf, _0x205c87) {
84 | let _0x162c92 = "";
85 | try {
86 | let _0x263cb4 = _0x444e77(_0x45f1bf, /(?<=pt_pin=)([^;]+)/);
87 | if (_0x263cb4) {
88 | let _0x3afed7 = _0x5c9c65(_0x263cb4, _0x205c87);
89 | _0x162c92 = _0xa9835e.get(_0x3afed7) || "";
90 | if (_0x162c92 === "") {
91 | const _0x4da6c0 = {
92 | "url": _0x205c87,
93 | "id": ""
94 | };
95 | let _0x30e012 = _0x135f1b.getbody("isvObfuscator", _0x4da6c0),
96 | _0x26b938 = await _0x269d6c.post("https://api.m.jd.com/client.action?functionId=isvObfuscator", {
97 | "headers": {
98 | "Host": "api.m.jd.com",
99 | "Content-Type": "application/x-www-form-urlencoded",
100 | "Cookie": _0x45f1bf,
101 | "User-Agent": "JD4iPhone/167650 (iPhone; iOS 13.7; Scale/3.00)",
102 | "Accept-Language": "zh-Hans-CN;q=1",
103 | "Accept-Encoding": "gzip, deflate, br"
104 | },
105 | "body": _0x30e012
106 | }).json().catch(async _0x1890dc => {
107 | if (_0x1890dc.response) {
108 | console.log("🚫 getToken API请求失败 ➜ Response code " + (_0x1890dc.response.statusCode || "") + " (" + (_0x1890dc.response.statusMessage || "") + ")");
109 | } else {
110 | console.log("🚫 getToken API请求失败\n" + (_0x1890dc.message || "") + "\n");
111 | }
112 | });
113 | if (_0x26b938) {
114 | if (_0x26b938.code === "0") {
115 | _0x162c92 = _0x26b938.token;
116 | _0xa9835e.put(_0x3afed7, _0x162c92, _0x3093cd);
117 | console.log("获取token成功\n");
118 | } else {
119 | _0x26b938.code === "3" && _0x26b938.errcode === 264 ? console.log("🚫 getToken API请求失败 ➜ 账号无效") : console.log("🚫 getToken API接口返回异常 ➜ " + JSON.stringify(_0x26b938));
120 | }
121 | }
122 | } else {
123 | console.log("已读取本地缓存token\n");
124 | }
125 | }
126 | } catch (_0x2c0d3f) {
127 | console.log(_0x2c0d3f);
128 | console.log("getToken API请求失败");
129 | }
130 | return _0x162c92;
131 | }
132 | module.exports = _0xbb5e87;
--------------------------------------------------------------------------------
/function/dylanx.js:
--------------------------------------------------------------------------------
1 | const _0x45d0c8 = require("crypto-js");
2 | function _0x2fc1f5(_0x2982c0 = "") {
3 | return _0x2982c0;
4 | }
5 | function _0x44f129(_0xe4b106) {
6 | let _0x132d16 = [];
7 | for (let _0x17def4 of _0xe4b106.split("")) {
8 | let _0x10ebdc = _0x17def4.charCodeAt();
9 | _0x132d16 = _0x132d16.concat([(_0x10ebdc & 128) >> 7, (_0x10ebdc & 64) >> 6, (_0x10ebdc & 32) >> 5, (_0x10ebdc & 16) >> 4, (_0x10ebdc & 8) >> 3, (_0x10ebdc & 4) >> 2, (_0x10ebdc & 2) >> 1, _0x10ebdc & 1]);
10 | }
11 | return _0x132d16;
12 | }
13 | function _0x265eaa(_0x4b4834) {
14 | let _0x19e7cb = Array.from({
15 | "length": parseInt(_0x4b4834.length / 8)
16 | }).map(_0x2bcc5f => 0);
17 | for (let _0x2d9557 in _0x19e7cb) {
18 | _0x19e7cb[_0x2d9557] = _0x4b4834[_0x2d9557 * 8] << 7 | _0x4b4834[_0x2d9557 * 8 + 1] << 6 | _0x4b4834[_0x2d9557 * 8 + 2] << 5 | _0x4b4834[_0x2d9557 * 8 + 3] << 4 | _0x4b4834[_0x2d9557 * 8 + 4] << 3 | _0x4b4834[_0x2d9557 * 8 + 5] << 2 | _0x4b4834[_0x2d9557 * 8 + 6] << 1 | _0x4b4834[_0x2d9557 * 8 + 7];
19 | }
20 | return _0x2fc1f5(_0x19e7cb);
21 | }
22 | function _0x515c33(_0x5c43c2) {
23 | let _0x8ce7ff = [55, 146, 68, 104, 165, 61, 204, 127, 187, 15, 217, 136, 238, 154, 233, 90];
24 | let _0x308861 = "80306f4370b39fd5630ad0529f77adb6";
25 | const _0x189e34 = {
26 | "length": _0x5c43c2.length
27 | };
28 | let _0x204dfd = Array.from(_0x189e34).map(_0x326561 => 0),
29 | _0x548cba,
30 | _0x537923,
31 | _0x5a7a70,
32 | _0x715ab1;
33 | for (i in _0x204dfd) {
34 | _0x548cba = _0x5c43c2[i].charCodeAt();
35 | _0x5a7a70 = _0x8ce7ff[i & 15];
36 | _0x715ab1 = _0x308861[i & 7].charCodeAt();
37 | _0x548cba = _0x5a7a70 ^ _0x548cba;
38 | _0x548cba = _0x548cba ^ _0x715ab1;
39 | _0x548cba = _0x548cba + _0x5a7a70;
40 | _0x5a7a70 = _0x5a7a70 ^ _0x548cba;
41 | _0x537923 = _0x308861[i & 7].charCodeAt();
42 | _0x5a7a70 = _0x5a7a70 ^ _0x537923;
43 | _0x204dfd[i] = _0x5a7a70 & 255;
44 | }
45 | return _0x2fc1f5(_0x204dfd);
46 | }
47 | function _0x44488d(_0x3ec985) {
48 | let _0x45e279 = [[0, 0], [1, 4], [2, 61], [3, 15], [4, 56], [5, 40], [6, 6], [7, 59], [8, 62], [9, 58], [10, 17], [11, 2], [12, 12], [13, 8], [14, 32], [15, 60], [16, 13], [17, 45], [18, 34], [19, 14], [20, 36], [21, 21], [22, 22], [23, 39], [24, 23], [25, 25], [26, 26], [27, 20], [28, 1], [29, 33], [30, 46], [31, 55], [32, 35], [33, 24], [34, 57], [35, 19], [36, 53], [37, 37], [38, 38], [39, 5], [40, 30], [41, 41], [42, 42], [43, 18], [44, 47], [45, 27], [46, 9], [47, 44], [48, 51], [49, 7], [50, 49], [51, 63], [52, 28], [53, 43], [54, 54], [55, 52], [56, 31], [57, 10], [58, 29], [59, 11], [60, 3], [61, 16], [62, 50], [63, 48]],
49 | _0x24fcb8 = _0x44f129(_0x3ec985),
50 | _0x17fedf = Array.from({
51 | "length": _0x24fcb8.length
52 | }).map(_0x14c4fb => 0);
53 | for (let _0x217a7c in _0x17fedf) {
54 | _0x17fedf[_0x45e279[_0x217a7c][1]] = _0x24fcb8[_0x45e279[_0x217a7c][0]];
55 | }
56 | return _0x265eaa(_0x17fedf);
57 | }
58 | function _0x291d75(_0x12ae6d) {
59 | let _0x9f9424 = [[0, 6, 0, 1], [1, 4, 1, 0], [2, 5, 0, 1], [3, 0, 0, 1], [4, 2, 0, 1], [5, 3, 0, 1], [6, 1, 1, 0], [7, 7, 0, 1]],
60 | _0x46a522 = _0x44f129(_0x12ae6d),
61 | _0x1f60ed = [0, 0, 0, 0, 0, 0, 0, 0];
62 | for (var _0x4964fd in _0x1f60ed) {
63 | _0x46a522[_0x4964fd] == 0 ? _0x1f60ed[_0x9f9424[_0x4964fd][1]] = _0x9f9424[_0x4964fd][2] : _0x1f60ed[_0x9f9424[_0x4964fd][1]] = _0x9f9424[_0x4964fd][3];
64 | }
65 | return _0x265eaa(_0x1f60ed);
66 | }
67 | function _0x233e39(_0x5de7f1) {
68 | let _0x195eb7 = [];
69 | for (let _0x56bb1f = 0; _0x56bb1f < _0x5de7f1.length; _0x56bb1f += 8) {
70 | let _0x57e354 = _0x5de7f1.slice(_0x56bb1f, _0x56bb1f + 8);
71 | _0x57e354.length == 1 ? _0x195eb7 = _0x195eb7.concat(_0x291d75(_0x57e354)) : _0x195eb7 = _0x195eb7.concat(_0x44488d(_0x57e354));
72 | }
73 | return _0x195eb7;
74 | }
75 | function _0x34012b(_0x2d3c4f, _0x29d1af, _0x1cc8d6) {
76 | let _0x2a88fe = [0, 1, 2];
77 | _0x1cc8d6 == 1 && (_0x2a88fe = [1, 2, 0]);
78 | _0x1cc8d6 == 2 && (_0x2a88fe = [2, 0, 1]);
79 | let _0x1aab6d = _0x2a88fe[_0x29d1af];
80 | if (_0x1aab6d == 0) {
81 | return _0x233e39(_0x2d3c4f);
82 | }
83 | if (_0x1aab6d == 2) {
84 | return _0x515c33(_0x2d3c4f);
85 | }
86 | }
87 | function _0x637bce(_0x40a230, _0x429a5d, _0x462591) {
88 | let _0x571046 = __filename.split(/[\\/]/).pop(),
89 | _0x319f75 = __dirname.split(/[\\/]/).pop();
90 | let _0x2e7902 = "android",
91 | _0x1b6cc6 = "11.2.2",
92 | _0x27006c = [[0, 0], [0, 2], [1, 1], [1, 2], [2, 0], [2, 1]],
93 | _0x1dc3b2,
94 | _0x230e6d;
95 | [_0x1dc3b2, _0x230e6d] = _0x27006c[Math.floor(Math.random() * _0x27006c.length)];
96 | let _0x237d67 = "1" + _0x1dc3b2 + _0x230e6d,
97 | _0x58b277 = new Date().getTime();
98 | _0x429a5d = typeof _0x429a5d == "string" ? _0x429a5d : JSON.stringify(_0x429a5d);
99 | let _0x252ed1 = new Buffer.from(_0x429a5d).toString("latin1"),
100 | _0xf7377c = _0x45d0c8.MD5(_0x462591 ? String(_0x462591) : String(Date.now())).toString().substring(0, 30 - (_0x40a230 + _0x252ed1).length % 8),
101 | _0x90f593 = "functionId=" + _0x40a230 + "&body=" + _0x252ed1 + "&uuid=" + _0xf7377c + "&client=" + _0x2e7902 + "&clientVersion=" + _0x1b6cc6 + "&st=" + _0x58b277 + "&sv=" + _0x237d67,
102 | _0x2937af = _0x34012b(_0x90f593, _0x1dc3b2, _0x230e6d),
103 | _0x3399c9 = new Buffer.from(_0x2937af).toString("base64");
104 | if (_0x571046 !== "dylanx.js" || _0x319f75 !== "function") {
105 | _0x3399c9 = _0x3399c9 + "BAGA";
106 | }
107 | let _0x1e0d0c = _0x45d0c8.MD5(_0x3399c9).toString();
108 | return "body=" + encodeURIComponent(_0x429a5d) + "&client=" + _0x2e7902 + "&clientVersion=" + _0x1b6cc6 + "&uuid=" + _0xf7377c + "&st=" + _0x58b277 + "&sign=" + _0x1e0d0c + "&sv=" + _0x237d67;
109 | }
110 | const _0x553326 = {
111 | "getbody": _0x637bce
112 | };
113 | module.exports = _0x553326;
--------------------------------------------------------------------------------
/function/getH5st3_0.js:
--------------------------------------------------------------------------------
1 | /*
2 | new Env('getH5st3_0');
3 | */
4 |
5 | const jsdom = require("jsdom");
6 | let domWindow = null;
7 |
8 | async function sleep(t) {
9 | return new Promise((resolve, reject) => {
10 | setTimeout(() => {
11 | resolve(t);
12 | }, t);
13 | });
14 | }
15 |
16 | async function loadH5Sdk() {
17 | const { JSDOM } = jsdom;
18 | let resourceLoader = new jsdom.ResourceLoader({
19 | userAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Firefox/91.0",
20 | referrer: "https://msitepp-fm.jd.com/rest/priceprophone/priceProPhoneMenu",
21 | });
22 | let virtualConsole = new jsdom.VirtualConsole();
23 | let options = {
24 | url: "https://msitepp-fm.jd.com/rest/priceprophone/priceProPhoneMenu",
25 | referrer: "https://msitepp-fm.jd.com/rest/priceprophone/priceProPhoneMenu",
26 | userAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Firefox/91.0",
27 | runScripts: "dangerously",
28 | resources: resourceLoader,
29 | includeNodeLocations: true,
30 | storageQuota: 10000000,
31 | pretendToBeVisual: true,
32 | virtualConsole,
33 | };
34 | const dom = new JSDOM(
35 | `
36 |
37 |
38 |
39 | `,
40 | options
41 | );
42 | await sleep(500);
43 | domWindow = dom.window;
44 | }
45 |
46 | /**
47 | * @describe 获取JD H5st 3.0版本验参
48 | * @param businessId appId
49 | * @param req body
50 | */
51 | async function getH5st(businessId, req) {
52 | let timer = null;
53 | if (!domWindow) {
54 | await loadH5Sdk();
55 | }
56 | return new Promise(async (resolve) => {
57 | if (typeof domWindow.signWaap === "function") {
58 | const h5st = await domWindow.signWaap(businessId, req);
59 | resolve(h5st);
60 | } else {
61 | timer = setInterval(async () => {
62 | if (typeof domWindow.signWaap === "function") {
63 | clearInterval(timer);
64 | timer = null;
65 | const h5st = await domWindow.signWaap(businessId, req);
66 | resolve(h5st);
67 | }
68 | }, 100);
69 | }
70 | });
71 | }
72 |
73 | module.exports = getH5st;
74 |
--------------------------------------------------------------------------------
/function/getSign.js:
--------------------------------------------------------------------------------
1 | /*
2 | new Env('getSign');
3 | */
4 |
5 | const got = require("got");
6 | const API = process.env.JD_SIGN_API || "http://api.nolanstore.cc/sign"; // 默认为 Nolan 杂货铺公益接口
7 |
8 | /**
9 | * @describe 获取JD签名(杂货铺接口基准格式)
10 | * @param functionId functionId
11 | * @param params body
12 | */
13 | async function getSign(functionId, params) {
14 | let sign = "";
15 | let body = JSON.stringify({
16 | fn: functionId,
17 | body: JSON.stringify(params),
18 | });
19 | try {
20 | const res = await got
21 | .post(API, {
22 | headers: {
23 | "Content-Type": "application/json",
24 | },
25 | body: body,
26 | retry: 1,
27 | timeout: 10000,
28 | })
29 | .catch((err) => {
30 | console.error(`🚫 getSign API请求失败 ➜ ${err || ""}`);
31 | });
32 |
33 | if (res && typeof res === "object") {
34 | if (res.body) {
35 | data = JSON.parse(res.body);
36 | sign = data.body;
37 | } else {
38 | console.log(`🚫 getSign API接口返回异常`);
39 | }
40 | }
41 | } catch (err) {
42 | console.log(`🚫 getSign API在处理请求时遇到了错误`);
43 | console.log(err);
44 | }
45 | return sign;
46 | }
47 |
48 | module.exports = getSign;
49 |
--------------------------------------------------------------------------------
/function/getToken.js:
--------------------------------------------------------------------------------
1 | /*
2 | new Env('getToken');
3 | */
4 |
5 | const got = require("got");
6 | const getSign = require("./getSign");
7 | const Cache = require("./cache/index");
8 |
9 | // 定义缓存 token 有效时间
10 | let cacheDefaultTTL = 15 * 60 * 1000;
11 |
12 | const cacheFile = new Cache(cacheDefaultTTL, __dirname + "/cache/token.json");
13 |
14 | function regExecFirst(str = "", reg) {
15 | let exec = reg.exec(str);
16 | if (exec && exec.length > 0) {
17 | return exec[0].trim();
18 | }
19 | return "";
20 | }
21 |
22 | function getCacheKey(ptPin, domain) {
23 | let hour = new Date().getHours();
24 | // 0-3 点不判断域名
25 | if (hour >= 0 && hour <= 3) {
26 | return ptPin;
27 | }
28 | return `${ptPin}_${domain}`;
29 | }
30 |
31 | async function getToken(cookie, domain) {
32 | async function timeWait(t) {
33 | return new Promise((e) => setTimeout(e, t));
34 | }
35 |
36 | let token = "";
37 | let ptPin = regExecFirst(cookie, /(?<=pt_pin=)([^;]+)/);
38 | if (ptPin) {
39 | let cacheKey = getCacheKey(ptPin, domain);
40 | // 读取本地缓存并判断是否过期
41 | token = cacheFile.get(cacheKey) || "";
42 | if (token === "") {
43 | // console.log('请求新TOKEN');
44 | let sign = await getSign("isvObfuscator", {
45 | url: domain,
46 | id: "",
47 | });
48 | if (sign) {
49 | try {
50 | const res = await got
51 | .post("https://api.m.jd.com/client.action?functionId=isvObfuscator", {
52 | headers: {
53 | Host: "api.m.jd.com",
54 | "Content-Type": "application/x-www-form-urlencoded",
55 | Cookie: cookie,
56 | "User-Agent": "JD4iPhone/167650 (iPhone; iOS 13.7; Scale/3.00)",
57 | "Accept-Language": "zh-Hans-CN;q=1",
58 | "Accept-Encoding": "gzip, deflate, br",
59 | },
60 | body: sign,
61 | timeout: 30000,
62 | })
63 | .catch(async (err) => {
64 | if (err.response) {
65 | console.log(`🚫 getToken API请求失败 ➜ Response code ${err.response.statusCode || ""} (${err.response.statusMessage || ""})`);
66 | if (err.response.statusCode == 403) {
67 | let waitTimes = Math.floor(Math.random() * (1000 - 2000)) + 2000;
68 | await timeWait(waitTimes); // 随机延迟 2~10 秒
69 | }
70 | } else if (err.response.body) {
71 | console.log(`🚫 getToken API请求失败\n${err.response.body || ""}\n`);
72 | } else {
73 | console.log(`🚫 getToken API请求失败\n${err || ""}\n`);
74 | }
75 | });
76 | if (res && typeof res === "object") {
77 | if (res.body) {
78 | let data = JSON.parse(res.body);
79 | if (data.code === "0") {
80 | token = data.token;
81 | // 缓存
82 | cacheFile.put(cacheKey, token, cacheDefaultTTL);
83 | } else if (data.code === "3" && data.errcode === 264) {
84 | console.log(`🚫 getToken API请求失败 ➜ 账号无效`);
85 | } else {
86 | console.log(`🚫 getToken API接口返回异常 ➜ ${JSON.stringify(data)}`);
87 | }
88 | } else {
89 | console.log(`🚫 getToken API请求失败 ➜ 接口返回为空`);
90 | }
91 | }
92 | } catch (err) {
93 | console.log(`🚫 getToken API在处理请求时遇到了错误`);
94 | console.log(err);
95 | }
96 | } else {
97 | console.log(`🚫 getToken API请求错误 ➜ 签名获取失败`);
98 | }
99 | } else {
100 | // console.log(`本地缓存token ➜ ${token}`);
101 | // console.log(`已读取本地缓存token\n`);
102 | }
103 | }
104 | return token;
105 | }
106 |
107 | module.exports = getToken;
108 |
--------------------------------------------------------------------------------
/function/jdCrypto.js:
--------------------------------------------------------------------------------
1 | /*
2 | 业务加密通用库
3 | new Env('JDCrypto');
4 | */
5 | var version_ = "jsjiami.com.v7";
6 | const IiIl = require("crypto-js");
7 | class IiIi {
8 | wuxianDefense() {
9 | const l1il1l = ["/api/task/building/build", "/api/prize/draw", "/api/task/member/rank/getMember", "/api/task/rank/getRankInfo", "/api/task/member/rank/getMember", "/api/prize/receive/acquire", "/api/task/daySign/getSignClick", "/api/task/addSku/toDo", "/api/task/followGoods/followGoods", "/api/task/dmpss/toDo", "/api/task/dailyGift/todo", "/api/group/draw/toDo", "/api/basic/task/toDo", "/api/task/jiugongge/toDo", "/api/task/niudanji/toDo", "/api/task/organizeTeam/saveMember", "/api/questionnaire/answer"],
10 | liIil = ["/wxScratchActive/start", "/wxPointDrawActivity/start", "/wxPointBlindBox/start", "/wxGashaponActive/start", "/wxDollGrabbing/start", "/wxDrawActivity/start", "/wxShopFollowActivity/getPrize", "/wx/completeInfoActivity/save", "/activity/daily/wx/grabGift", "/sign/wx/signUp", "/sign/sevenDay/wx/signUp", "/wxTeam/saveCaptain", "/wxTeam/saveMember"],
11 | IllI1I = [...l1il1l, ...liIil];
12 | function liIii(I1lIii, IiI1I, illlIl) {
13 | function IIIIIi(liiIIi) {
14 | liiIIi = liiIIi.split("").reverse().join("");
15 | const lil11I = new Uint8Array(12),
16 | Iliii1 = new TextEncoder().encode(liiIIi);
17 | for (let lillIl = 0; lillIl < Iliii1.length; lillIl += 2) {
18 | let iIiIl = Iliii1[lillIl] << 5 | Iliii1[lillIl + 1] & 255;
19 | iIiIl %= 63;
20 | lil11I[lillIl >> 1] = iIiIl;
21 | }
22 | let iIiIi = "";
23 | for (let iiilii = 0; iiilii < lil11I.length; iiilii++) {
24 | iIiIi += (lil11I[iiilii] + 256).toString(2).slice(1);
25 | }
26 | let iil1ll = "",
27 | iiilil = "";
28 | for (let li1i1i = 0; li1i1i < 16; li1i1i++) {
29 | if (li1i1i !== 0) {
30 | const IlIli1 = li1i1i * 6,
31 | illIiI = iIiIi.substring(IlIli1, IlIli1 + 6);
32 | let lI1lli = parseInt(illIiI, 2);
33 | const Ill1l = iiilil.split("");
34 | for (let llI1Il = 0; llI1Il < Ill1l.length; llI1Il++) {
35 | if (Ill1l[llI1Il] === "1") {
36 | lI1lli = (lI1lli >> 6 - llI1Il | lI1lli << llI1Il) & 63;
37 | }
38 | }
39 | iiilil = (lI1lli & 63).toString(2).padStart(6, "0");
40 | } else {
41 | iiilil = iIiIi.substring(0, 6);
42 | }
43 | iil1ll += iiilil;
44 | }
45 | for (let lllI1l = 0; lllI1l < 12; lllI1l++) {
46 | const i11iii = lllI1l * 8;
47 | lil11I[lllI1l] = parseInt(iil1ll.substring(i11iii, i11iii + 8), 2);
48 | }
49 | const iil1li = btoa(String.fromCharCode.apply(null, lil11I));
50 | return iil1li;
51 | }
52 | const IIIIIl = ["B6dB3QqGZP1lKNICTaiAeNJSHKNepO5GGgtL6FUceqSlpFZCdx2SZ5MPPbzrgy91HeR0dnJazcMrvMgPF7bhFrfsGaApJKk4JohEEhoJ4kKJpAaGsfrFhb7FPgMvrMczaJnd0ReH19ygrzbPPM5ZS2xdCZFplSqecUF6LtgGG5OpeNKHSJNeAiaTCINKl1PZGqQ3Bd6B", "EUhzJoyKP7VydtpyBwNUGU2tqzI0QB0LIpQ10Fk3hX2ZcPoGRpACqmzcTQbKd98i3U7raFz2rMl2kys0ODgtAh22E3i57wmh38RbbR83hmw75i3E22hAtgDO0syk2lMr2zFar7U3i89dKbQTczmqCApRGoPcZ2Xh3kF01QpIL0BQ0Izqt2UGUNwByptdyV7PKyoJzhUE", "xexcHoyVwOs5TYTQVvU0iXn56ryKVdWedLTpq3KEKmbUHfwzuZjIpZOPVXMEappFhjdqwtp1bBrWaRBCfPFwCq2W8SsyvwqZ6sIGGIs6ZqwvysS8W2qCwFPfCBRaWrBb1ptwqdjhFppaEMXVPOZpIjZuzwfHUbmKEK3qpTLdeWdVKyr65nXi0UvVQTYT5sOwVyoHcxex", "2Llnegc5i4flqd4HZPFK210yh61boBxRSdnNVMeudKimx92Qi4aPuHP12HmEImbWrXjLgBGqy1bSnKvLhqMqhknyuse4nFoeLTkJJkTLeoFn4esuynkhqMqhLvKnSb1yqGBgLjXrWbmIEmH21PHuPa4iQ29xmiKdueMVNndSRxBob16hy012KFPZH4dqlf4i5cgenlL2", "dZzoMZF6xtt3voTFDbPzEZ7GeM8t7uY05d4K4xfhtdxELh96dDRB4oRYA2smET5dy1dafGkXOz2V7tNOVi0vSqfuhI99IKprVK6QQ6KVrpKI99IhufqSv0iVONt7V2zOXkGfad1yd5TEms2AYRo4BRDd69hLExdthfx4K4d50Yu7t8MeG7ZEzPbDFTov3ttx6FZMozZd", "SNYr3bWMtQulWZO2FEwuhSFp3EXPR1TujPRJwUFlxBh9Pvf2MeTEpR7a3dU6e9rNUMyBh2osDdK4Vdm4gZ0XcRCoHZPi2jiXT2dCCd2TXij2iPZHoCRcX0Zg4mdV4KdDso2hByMUNr9e6Ud3a7RpETeM2fvP9hBxlFUwJRPjuT1RPXE3pFShuwEF2OZWluQtMWb3rYNS", "4viQ2FrYHcrH44gqvPLo6KtiFu56AW1eXbDBZrBepzdLKE33Ey4TwFERnkVLnbHAXbKqAi0HFP9Eu7yg8WNlI7q2dvXGGiPaMbrBBrbMaPiGGXvd2q7IlNW8gy7uE9PFH0iAqKbXAHbnLVknREFwT4yE33EKLdzpeBrZBDbXe1WA65uFitK6oLPvqg44HrcHYrF2Qiv4", "0VIoSHBNVAW8De7NquFyEUm0o9xNnQJGn2OR1yOK9djWALhyP3a1XoQEwTnXuzypRuwsaLPUlertksOY6LYmnbQmPgdDQRXXKdKooKdKXXRQDdgPmQbnmYL6YOsktrelUPLaswuRpyzuXnTwEQoX1a3PyhLAWjd9KOy1RO2nGJQnNx9o0mUEyFuqN7eD8WAVNBHSoIV0", "fdJPBiTra9E0qg2HJrobeEC2SkOfSzbw6nG5J5ACx42GQDBsCyGfxNlHHYhl7EmkdvYaKAXUVXSKcTT1KhyYaj9Q4YtyhnOA7cLrrLc7AOnhytY4Q9jaYyhK1TTcKSXVUXAKaYvdkmE7lhYHHlNxfGyCsBDQG24xCA5J5Gn6wbzSfOkS2CEeborJH2gq0E9arTiBPJdf", "kLOA93PyUOX3QdlLuZ9JgNq1peyIITAQSnKzuLBZ2NthOSseAJMGCecvSLVKAww61Y31hJ4l7kAOcjLmtqQNJlNyJb5yu9d9vqWUUWqv9d9uy5bJyNlJNQqtmLjcOAk7l4Jh13Y16wwAKVLSvceCGMJAesSOhtN2ZBLuzKnSQATIIyep1qNgJ9ZuLldQ3XOUyP39AOLk"];
53 | let I1lIil = Date.now() + parseInt(illlIl);
54 | typeof I1lIii != "object" && (I1lIii = JSON.parse(I1lIii));
55 | I1lIii.nowTime = I1lIil;
56 | let IIIl1i = IiI1I + I1lIil;
57 | const liiII1 = IIIl1i.substring(0, IIIl1i.length - 5);
58 | let IIIl1l = "";
59 | for (let iiiliI = 0; iiiliI < liiII1.length; iiiliI++) {
60 | let illIii = liiII1.charCodeAt(iiiliI),
61 | ii1il1 = illIii % 10,
62 | lI1llI = IIIIIl[ii1il1][iiiliI];
63 | IIIl1l += lI1llI;
64 | }
65 | var lllll = IIIl1l.length,
66 | i11ili = Math.floor(lllll / 24),
67 | iil1l1 = "";
68 | for (var lllli = 0; lllli < 24; lllli++) {
69 | var iiili1 = (lllli + 1) * i11ili;
70 | lllli === 23 && (iiili1 = lllll);
71 | var ill11i = IIIl1l.substring(lllli * i11ili, iiili1),
72 | lllill = [];
73 | for (var ill11l = 0; ill11l < ill11i.length; ill11l++) {
74 | lllill.push(ill11i.charCodeAt(ill11l));
75 | }
76 | var I1lIiI = lllill.reduce(function (Ill1I, i11iiI) {
77 | return Ill1I + i11iiI;
78 | }, 0),
79 | lllili = Math.floor(I1lIiI / lllill.length);
80 | iil1l1 += String.fromCharCode(lllili);
81 | }
82 | IIIl1l = iil1l1;
83 | const IliiiI = IIIIIi(IIIl1l),
84 | Ill11 = IiIl.enc.Utf8.parse(IliiiI),
85 | liiIII = IiIl.enc.Utf8.parse(""),
86 | li1i11 = IiIl.AES.encrypt(JSON.stringify(I1lIii), Ill11, {
87 | iv: liiIII,
88 | mode: IiIl.mode.ECB,
89 | padding: IiIl.pad.Pkcs7
90 | });
91 | return li1i11.toString();
92 | }
93 | function II1ll1(IlIlii) {
94 | const i1l1i1 = IllI1I,
95 | liil11 = Object.fromEntries(i1l1i1.map(l1l111 => [l1l111, true])),
96 | iiillI = liil11[IlIlii] !== undefined;
97 | return iiillI;
98 | }
99 | function IlI1Ii() {
100 | const IIIIII = IiIl.enc.Utf8.parse("Hd5W5ONsYKmGm9QA"),
101 | lillII = IiIl.enc.Utf8.parse("2JjUvJEAsA2Yog==");
102 | function ii1ilI(iIiI1) {
103 | const liil1I = IiIl.enc.Utf8.parse(iIiI1),
104 | i11ii1 = IiIl.AES.encrypt(liil1I, IIIIII, {
105 | iv: lillII,
106 | mode: IiIl.mode.CBC,
107 | padding: IiIl.pad.Pkcs7
108 | });
109 | return IiIl.enc.Base64.stringify(i11ii1.ciphertext);
110 | }
111 | function lI1ll1(iiill1) {
112 | const lIli1i = IiIl.enc.Base64.parse(iiill1),
113 | IIIII1 = IiIl.enc.Base64.stringify(lIli1i),
114 | I1lIlI = IiIl.AES.decrypt(IIIII1, IIIIII, {
115 | iv: lillII,
116 | mode: IiIl.mode.CBC,
117 | padding: IiIl.pad.Pkcs7
118 | });
119 | return IiIl.enc.Utf8.stringify(I1lIlI).toString();
120 | }
121 | return {
122 | encrypt: ii1ilI,
123 | decrypt: lI1ll1
124 | };
125 | }
126 | return {
127 | encrypt: liIii,
128 | isDefenseApi: II1ll1,
129 | interactionV2: IlI1Ii
130 | };
131 | }
132 | }
133 | const iI1ll1 = new IiIi();
134 | module.exports = {
135 | wuxianDefense: iI1ll1.wuxianDefense()
136 | };
137 | var version_ = "jsjiami.com.v7";
--------------------------------------------------------------------------------
/function/jdcookie.js:
--------------------------------------------------------------------------------
1 | // 本地测试在这边填写cookie
2 | let cookie = [
3 | ];
4 | module.exports = {
5 | cookie
6 | }
7 |
--------------------------------------------------------------------------------
/function/krgetSign.js:
--------------------------------------------------------------------------------
1 | /*
2 | new Env('getSign');
3 | */
4 |
5 | const lIiIlIII = require("got"),
6 | iiIi1I = process.env.JD_SIGN_KRAPI || "";
7 | iiIi1I ? (console.log("⚠ 您当前使用自定义Sign服务 ⚠"), console.log("✅ : " + iiIi1I + "\n")) : console.log("⚠ 您当前使用内置Sign服务\n");
8 | function llilliI1(I11IIIii, li11IiI) {
9 | return Math.floor(Math.random() * (li11IiI - I11IIIii)) + I11IIIii;
10 | }
11 | async function iIl1(IiI1IIII, liiIIii1) {
12 | let liIi1ilI = "";
13 | if (iiIi1I) {
14 | let llIIIi1l = "body=" + JSON.stringify(liiIIii1) + "&functionId=" + IiI1IIII;
15 | liIi1ilI = lIiIlIII.post(iiIi1I, {
16 | "headers": {
17 | "Content-Type": "application/x-www-form-urlencoded;charset=utf-8"
18 | },
19 | "body": llIIIi1l,
20 | "retry": 1,
21 | "timeout": 10000
22 | }).json().catch(I1iI1lll => {
23 | console.log(I1iI1lll.message);
24 | console.error("🚫 getSign API请求失败");
25 | });
26 | } else {
27 | const I1IIillI = ["http://api.nolanstore.cc/sign", "http://kr.kingran.cf/sign"],
28 | ilii1 = I1IIillI[llilliI1(0, I1IIillI.length)],
29 | iilIIlII = ilii1;
30 | let iilIi1I1 = {
31 | "fn": IiI1IIII,
32 | "body": JSON.stringify(liiIIii1)
33 | };
34 | liIi1ilI = lIiIlIII.post(iilIIlII, {
35 | "headers": {
36 | "Content-Type": "application/json"
37 | },
38 | "body": JSON.stringify(iilIi1I1),
39 | "retry": 1,
40 | "timeout": 10000
41 | }).json().catch(Illl1Il1 => {
42 | console.log(Illl1Il1.message);
43 | console.error("🚫 getSign API请求失败");
44 | });
45 | }
46 | return liIi1ilI;
47 | }
48 | module.exports = iIl1;
49 |
--------------------------------------------------------------------------------
/function/krgetToken.js:
--------------------------------------------------------------------------------
1 | /*
2 | new Env('getToken');
3 |
4 | 变量:
5 | JD_TOKEN_INTERVAL //获取接口403延迟等待时长(正整数),默认延迟 30s=30000ms
6 | JD_NEWTOKEN_INTERVAL //获取接口成功延迟等待时长(正整数),默认延迟 0s
7 | JD_CACHE_INTERVAL //缓存TOKEN时长(正整数),默认缓存 25 分钟
8 | JD_PROXY_OPEN // 代理启用变量,默认不开启(true/false)
9 | JD_PROXY_TUNNRL // 代理地址变量,默认不开启,仅支持代理池模式(auto-proxy-pool),格式为:http://ip:port
10 | JD_NO_PROXY // 禁止走代理,默认 127.0.0.1,*.baidu.com 需要自行修改
11 | JD_TOKEN_CUSTOM_CACHE // 定义默认缓存文件路径 此文件默认存储在仓库 `function/cache` 目录下
12 | 根据自行需要设定,缓存文件数据通用,不再区分域名
13 | */
14 |
15 | const lliII111 = require("got"),
16 | lIi1iI = require("./krgetSign"),
17 | I1lIIII1 = process.env.JD_CACHE_INTERVAL || "25";
18 | let lliIIll = parseInt(I1lIIII1) * 60 * 1000;
19 | const lI111i11 = require("./cache/index"),
20 | liIiiiil = new lI111i11(lliIIll, process.env.JD_TOKEN_CUSTOM_CACHE || __dirname + "/cache/token.json"),
21 | llilIll = ["http://api.nolanstore.cc/sign", "http://kr.kingran.cf/sign"],
22 | I1iI11l1 = llilIll[Iil1l1ll(0, llilIll.length)],
23 | I11llIIl = process.env.JD_SIGN_KRAPI || "",
24 | I1iI1Ii1 = process.env.JD_PROXY_OPEN === "true",
25 | iii1I1l = process.env.JD_PROXY_TUNNRL || "",
26 | il1ll111 = process.env.JD_NO_PROXY || "127.0.0.1,*.baidu.com",
27 | IIl1il = process.env.JD_TOKEN_INTERVAL || "30",
28 | llii111i = process.env.JD_NEWTOKEN_INTERVAL || "0";
29 | let IilIi11l = false;
30 | if (I1iI1Ii1) {
31 | IilIi11l = true;
32 | try {
33 | require("global-agent/bootstrap");
34 | global.GLOBAL_AGENT.HTTP_PROXY = iii1I1l || "";
35 | global.GLOBAL_AGENT.NO_PROXY = "*.kingran.cf," + il1ll111;
36 | iii1I1l == "" ? (console.log("⚠ 当前检测到已开启代理,但未填写代理地址变量"), console.log("⚠ 请知晓代理地址仅支持代理池模式(auto-proxy-pool)"), console.log("⚠ 变量:export JD_PROXY_TUNNRL='http://ip:port' 不填直连\n")) : (console.log("☑️ 代理已开启,建议设置Token等待时间为 0 秒"), console.log("☑️ 代理地址为:" + global.GLOBAL_AGENT.HTTP_PROXY + "\n"));
37 | } catch (i1iIii1I) {
38 | console.log("请安装global-agent依赖,才能启用代理!\n");
39 | }
40 | } else console.log("⚠ 检测当前模式未开启代理,默认直连运行"), console.log("⚠ 开启代理变量:export JD_PROXY_OPEN='true' \n");
41 | console.log("☑️ Token失败等待 " + IIl1il + " 秒 | 成功等待 " + llii111i + " 秒 | 缓存时间 " + I1lIIII1 + " 分钟\n");
42 | const lIIIlI1l = process.env.JD_TOKEN_REDIS_CACHE_URL || "",
43 | lIIiIli1 = process.env.JD_TOKEN_REDIS_CACHE_KEY || "",
44 | i1iIl1Ii = !(process.env.JD_TOKEN_REDIS_CACHE_SUBMIT === "false"),
45 | II1Ilii1 = //.test(lIIiIli1);
46 | let lIl1Ii1 = null;
47 | if (lIIIlI1l) {
48 | let l1iIliii = null;
49 | try {
50 | l1iIliii = require("redis");
51 | } catch (IIlIIiIl) {
52 | console.log("❌ getToken Redis模块加载失败 ➜ " + IIlIIiIl.message);
53 | }
54 | if (l1iIliii) try {
55 | lIl1Ii1 = l1iIliii.createClient({
56 | "url": lIIIlI1l
57 | });
58 | lIl1Ii1.on("ready", () => {});
59 | lIl1Ii1.on("error", il1iIill => {
60 | lIl1Ii1 = null;
61 | });
62 | lIl1Ii1.connect(ii1ililI => {
63 | if (ii1ililI) lIl1Ii1 = null;else {}
64 | });
65 | } catch (lii1IliI) {}
66 | }
67 | function illlll(iIlIIII = "", iil11i1i) {
68 | let l1l1IIli = iil11i1i.exec(iIlIIII);
69 | if (l1l1IIli && l1l1IIli.length > 0) return l1l1IIli[0].trim();
70 | return "";
71 | }
72 | function lllliill(iil1l1ll, llilll1) {
73 | let I11llil1 = new Date().getHours();
74 | if (I11llil1 >= 0 && I11llil1 <= 23) return iil1l1ll;
75 | return iil1l1ll + "_" + llilll1;
76 | }
77 | function Iil1l1ll(lIi1ilIl, Il1il1II) {
78 | return Math.floor(Math.random() * (Il1il1II - lIi1ilIl)) + lIi1ilIl;
79 | }
80 | async function IiiiilI1(liIl1i1i, ll1iiil) {
81 | async function l1IIiI1I(i1IiIil) {
82 | return new Promise(I11IlliI => setTimeout(I11IlliI, i1IiIil));
83 | }
84 | let I1iI1lI = "",
85 | iIIi111 = illlll(liIl1i1i, /(?<=pt_pin=)([^;]+)/);
86 | if (iIIi111) {
87 | let iI1i1ii = lllliill(iIIi111, ll1iiil);
88 | I1iI1lI = liIiiiil.get(iI1i1ii) || "";
89 | if (I1iI1lI) {
90 | return console.log("已读取本地缓存token\n"), I1iI1lI;
91 | }
92 | if (lIl1Ii1) {
93 | const l1IIIil = encodeURIComponent(II1Ilii1 ? lIIiIli1.replace(//g, iIIi111) : "" + lIIiIli1 + iIIi111);
94 | I1iI1lI = (await lIl1Ii1.get(l1IIIil)) || "";
95 | if (I1iI1lI) return I1iI1lI;
96 | }
97 | if (I1iI1lI === "") {
98 | let iil1iI11 = await lIi1iI("isvObfuscator", {
99 | "url": ll1iiil,
100 | "id": ""
101 | });
102 | if (iil1iI11) try {
103 | if (I11llIIl) body = iil1iI11?.["data"]?.["convertUrl"];else {
104 | body = iil1iI11?.["body"];
105 | }
106 | const IIiI1li = await lliII111.post("https://api.m.jd.com/client.action?functionId=isvObfuscator", {
107 | "headers": {
108 | "Host": "api.m.jd.com",
109 | "Content-Type": "application/x-www-form-urlencoded",
110 | "Cookie": liIl1i1i,
111 | "User-Agent": "JD4iPhone/167650 (iPhone; iOS 13.7; Scale/3.00)",
112 | "Accept-Language": "zh-Hans-CN;q=1",
113 | "Accept-Encoding": "gzip, deflate, br"
114 | },
115 | "body": body,
116 | "timeout": 30000
117 | }).catch(async I1illil => {
118 | if (I1illil?.["response"]) {
119 | console.log("🚫 getToken API请求失败 ➜ Response code " + (I1illil.response.statusCode || "") + " (" + (I1illil.response.statusMessage || "") + ")");
120 | if (I1illil?.["response"]?.["statusCode"] == 403) {
121 | let IiI1Ilii = parseInt(IIl1il) * 1000;
122 | await l1IIiI1I(IiI1Ilii);
123 | }
124 | } else I1illil?.["response"]?.["body"] ? console.log("🚫 getToken API请求失败\n" + (I1illil?.["response"]?.["body"] || "") + "\n") : console.log("🚫 getToken API请求失败\n" + (I1illil || "") + "\n");
125 | });
126 | if (IIiI1li && typeof IIiI1li === "object") {
127 | if (IIiI1li?.["body"]) {
128 | let IiIl1IIi = JSON.parse(IIiI1li?.["body"]);
129 | if (IiIl1IIi?.["code"] === "0") {
130 | I1iI1lI = IiIl1IIi?.["token"];
131 | liIiiiil.put(iI1i1ii, I1iI1lI, lliIIll);
132 | if (lIl1Ii1 && i1iIl1Ii) {
133 | const iIIii1iI = encodeURIComponent(II1Ilii1 ? lIIiIli1.replace(//g, iIIi111) : "" + lIIiIli1 + iIIi111),
134 | iIl1Ilii = I1iI1lI,
135 | lllI1II = Math.floor((Date.now() + lliIIll) / 1000);
136 | try {
137 | await lIl1Ii1.set(iIIii1iI, iIl1Ilii);
138 | await lIl1Ii1.EXPIREAT(iIIii1iI, lllI1II);
139 | console.log("☑️ getToken Redis缓存成功\n");
140 | } catch (I1IiIIii) {
141 | console.log("❌ getToken Redis缓存失败 ➜ " + (I1IiIIii.message || I1IiIIii));
142 | }
143 | }
144 | let llIl1lI = parseInt(llii111i) * 1000;
145 | await l1IIiI1I(llIl1lI);
146 | } else IiIl1IIi?.["code"] === "3" && IiIl1IIi?.["errcode"] === 264 ? console.log("🚫 getToken API请求失败 ➜ 账号无效") : console.log("🚫 getToken API接口返回异常 ➜ " + JSON.stringify(IiIl1IIi));
147 | } else console.log("🚫 getToken API请求失败 ➜ 接口返回为空");
148 | }
149 | } catch (iiI1ili) {
150 | console.log("🚫 getToken API在处理请求时遇到了错误");
151 | console.log(iiI1ili);
152 | } else console.log("🚫 getToken API请求错误 ➜ 签名获取失败");
153 | }
154 | }
155 | return I1iI1lI;
156 | }
157 | module.exports = IiiiilI1;
--------------------------------------------------------------------------------
/function/krgetua.js:
--------------------------------------------------------------------------------
1 | const IiI1I = require("crypto-js");
2 | function illlIl(i11ill, IIIIIi, IIIIIl = {}) {
3 | function IIIl1i(il1iIl) {
4 | il1iIl = il1iIl.replace(/rn/g, "n");
5 | var il1iIi = "";
6 | for (var iii1il = 0; iii1il < il1iIl.length; iii1il++) {
7 | var II11li = il1iIl.charCodeAt(iii1il);
8 | if (II11li < 128) il1iIi += String.fromCharCode(II11li);else {
9 | if (II11li > 127 && II11li < 2048) {
10 | il1iIi += String.fromCharCode(II11li >> 6 | 192);
11 | il1iIi += String.fromCharCode(II11li & 63 | 128);
12 | } else {
13 | il1iIi += String.fromCharCode(II11li >> 12 | 224);
14 | il1iIi += String.fromCharCode(II11li >> 6 & 63 | 128);
15 | il1iIi += String.fromCharCode(II11li & 63 | 128);
16 | }
17 | }
18 | }
19 | return il1iIi;
20 | }
21 | function liiII1(ililIl, liiI1l) {
22 | liiI1l = liiI1l || "KLMNOPQRSTABCDEFGHIJUVWXYZabcdopqrstuvwxefghijklmnyz0123456789+/";
23 | var lilIIi = "";
24 | var i1l1Il, llIli, i1i11l, i1i11i, II11l1, Iil1lI, IiiliI;
25 | var I1l11l = 0;
26 | ililIl = IIIl1i(ililIl);
27 | while (I1l11l < ililIl.length) {
28 | i1l1Il = ililIl.charCodeAt(I1l11l++);
29 | llIli = ililIl.charCodeAt(I1l11l++);
30 | i1i11l = ililIl.charCodeAt(I1l11l++);
31 | i1i11i = i1l1Il >> 2;
32 | II11l1 = (i1l1Il & 3) << 4 | llIli >> 4;
33 | Iil1lI = (llIli & 15) << 2 | i1i11l >> 6;
34 | IiiliI = i1i11l & 63;
35 | if (isNaN(llIli)) Iil1lI = IiiliI = 64;else {
36 | if (isNaN(i1i11l)) {
37 | IiiliI = 64;
38 | }
39 | }
40 | lilIIi = lilIIi + liiI1l.charAt(i1i11i) + liiI1l.charAt(II11l1) + liiI1l.charAt(Iil1lI) + liiI1l.charAt(IiiliI);
41 | }
42 | while (lilIIi.length % 4 > 1) lilIIi += "=";
43 | return lilIIi;
44 | }
45 | const IIIl1l = IIIIIi || "jd",
46 | lllll = {
47 | "jd": {
48 | "app": "jdapp",
49 | "appBuild": "168392",
50 | "client": "android",
51 | "clientVersion": "10.1.0"
52 | },
53 | "lite": {
54 | "app": "jdltapp",
55 | "appBuild": "1247",
56 | "client": "ios",
57 | "clientVersion": "6.0.0"
58 | }
59 | };
60 | if (!lllll[IIIl1l]) {
61 | console.log("获取[" + IIIl1l + "]UA失败");
62 | return;
63 | }
64 | const i11ili = IIIIIl?.["ep"] ? IIIIIl?.["ep"] : true,
65 | iil1l1 = IIIIIl?.["client"] ? IIIIIl?.["client"] : lllll[IIIl1l].client,
66 | lllli = IIIIIl?.["clientVersion"] ? IIIIIl?.["clientVersion"] : lllll[IIIl1l].clientVersion,
67 | iiili1 = ["15.1.1", "14.5.1", "14.4", "14.3", "14.2", "14.1", "14.0.1", "13.2"],
68 | ill11i = iiili1[Math.floor(Math.random() * iiili1.length)],
69 | lllill = "iPhone; CPU iPhone OS " + ill11i.replace(".", "_") + " like Mac OS X",
70 | ill11l = iil1l1 == "apple" ? "iPhone" : "android",
71 | I1lIiI = JSON.stringify({
72 | "ciphertype": 5,
73 | "cipher": {
74 | "ud": liiII1(IiI1I.SHA1(i11ill).toString()),
75 | "sv": liiII1(ill11i),
76 | "iad": ""
77 | },
78 | "ts": Date.now(),
79 | "hdid": "JM9F1ywUPwflvMIpYPok0tt5k9kW4ArJEU3lfLhxBqw=",
80 | "version": "1.0.3",
81 | "appname": "com.360buy.jdmobile",
82 | "ridx": -1
83 | });
84 | let lllili = "";
85 | for (let II11lI of "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx") {
86 | if (II11lI == "x") lllili += "0123456789abcdef".charAt(Math.floor(Math.random() * "0123456789abcdef".length));else {
87 | if (II11lI == "X") lllili += "0123456789abcdef".charAt(Math.floor(Math.random() * "0123456789abcdef".length)).toUpperCase();else {
88 | lllili += II11lI;
89 | }
90 | }
91 | }
92 | let IliiiI = [lllll[IIIl1l].app, ill11l, lllli, "", "rn/" + lllili, "M/5.0", "hasUPPay/0", "pushNoticeIsOpen/0", "lang/zh_CN", "hasOCPay/0", "appBuild/" + lllll[IIIl1l].appBuild, "supportBestPay/0", "jdSupportDarkMode/0", "ef/1", i11ili ? "ep/" + encodeURIComponent(I1lIiI) : "", "Mozilla/5.0 (" + lllill + ") AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148", "supportJDSHWK/1", ""];
93 | return IliiiI.join(";");
94 | }
95 | module.exports = illlIl;
--------------------------------------------------------------------------------
/function/krh5st.js:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | new Env('h5st');
4 | */
5 | const i1ilIl1l = require("jsdom");
6 | let i1i111il = null,
7 | lli1llIl = null;
8 | async function i1111ill(Iiil1ili) {
9 | return new Promise((l11iiiIl, l1ii1i1I) => {
10 | setTimeout(() => {
11 | l11iiiIl(Iiil1ili);
12 | }, Iiil1ili);
13 | });
14 | }
15 | async function iIli1l(III1111I) {
16 | const {
17 | JSDOM: lIlI11l
18 | } = i1ilIl1l;
19 | let IlllI1i = new i1ilIl1l.ResourceLoader({
20 | "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Firefox/91.0",
21 | "referrer": "https://msitepp-fm.jd.com/rest/priceprophone/priceProPhoneMenu"
22 | }),
23 | lI1IIIIi = new i1ilIl1l.VirtualConsole(),
24 | I111il = {
25 | "url": "https://msitepp-fm.jd.com/rest/priceprophone/priceProPhoneMenu",
26 | "referrer": "https://msitepp-fm.jd.com/rest/priceprophone/priceProPhoneMenu",
27 | "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Firefox/91.0",
28 | "runScripts": "dangerously",
29 | "resources": IlllI1i,
30 | "includeNodeLocations": true,
31 | "storageQuota": 10000000,
32 | "pretendToBeVisual": true,
33 | "virtualConsole": lI1IIIIi
34 | };
35 | const l1lliIi = new lIlI11l("\n \n \n \n ", I111il);
36 | await i1111ill(500);
37 | switch (III1111I.charAt(0)) {
38 | case "3":
39 | i1i111il = l1lliIi.window;
40 | break;
41 | case "4":
42 | lli1llIl = l1lliIi.window;
43 | break;
44 | }
45 | }
46 | async function Il1iI11i(l111IiII, iIlilli, Ili1ll1 = "4.1") {
47 | Ili1ll1 !== "3.1" && (Ili1ll1 = "4.1");
48 | switch (Ili1ll1.charAt(0)) {
49 | case "3":
50 | !i1i111il && (await iIli1l(Ili1ll1));
51 | break;
52 | case "4":
53 | !lli1llIl && (await iIli1l(Ili1ll1));
54 | break;
55 | }
56 | return new Promise(async IIiliiIl => {
57 | switch (Ili1ll1.charAt(0)) {
58 | case "3":
59 | if (typeof i1i111il.signWaap === "function") {
60 | const lllilii1 = await i1i111il.signWaap(l111IiII, iIlilli);
61 | IIiliiIl(lllilii1);
62 | } else {
63 | let iIii1lI = null;
64 | iIii1lI = setInterval(async () => {
65 | if (typeof i1i111il.signWaap === "function") {
66 | clearInterval(iIii1lI);
67 | iIii1lI = null;
68 | const IIli1iii = await i1i111il.signWaap(l111IiII, iIlilli);
69 | IIiliiIl(IIli1iii);
70 | }
71 | }, 100);
72 | }
73 | break;
74 | case "4":
75 | if (typeof lli1llIl.signWaap === "function") {
76 | const IiIIllil = await lli1llIl.signWaap(l111IiII, iIlilli);
77 | IIiliiIl(IiIIllil);
78 | } else {
79 | let IIlII1ii = null;
80 | IIlII1ii = setInterval(async () => {
81 | if (typeof lli1llIl.signWaap === "function") {
82 | clearInterval(IIlII1ii);
83 | IIlII1ii = null;
84 | const i1ili = await lli1llIl.signWaap(l111IiII, iIlilli);
85 | IIiliiIl(i1ili);
86 | }
87 | }, 100);
88 | }
89 | break;
90 | }
91 | });
92 | }
93 | module.exports = Il1iI11i;
--------------------------------------------------------------------------------
/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 = process.env.QL_DIR || '/ql';
9 | const authFile = path.join(qlDir, 'config/auth.json');
10 |
11 | const api = got.extend({
12 | prefixUrl: process.env.QL_URL || 'http://localhost:5600',
13 | retry: { limit: 0 },
14 | });
15 |
16 | async function getToken() {
17 | const authConfig = JSON.parse(await readFile(authFile));
18 | return authConfig.token;
19 | }
20 |
21 | module.exports.getEnvs = async () => {
22 | const token = await getToken();
23 | const body = await api({
24 | url: 'api/envs',
25 | searchParams: {
26 | searchValue: 'JD_COOKIE',
27 | t: Date.now(),
28 | },
29 | headers: {
30 | Accept: 'application/json',
31 | authorization: `Bearer ${token}`,
32 | },
33 | }).json();
34 | return body.data;
35 | };
36 |
37 | module.exports.getEnvsCount = async () => {
38 | const data = await this.getEnvs();
39 | return data.length;
40 | };
41 |
42 | module.exports.addEnv = async (cookie, remarks) => {
43 | const token = await getToken();
44 | const body = await api({
45 | method: 'post',
46 | url: 'api/envs',
47 | params: { t: Date.now() },
48 | json: [{
49 | name: 'JD_COOKIE',
50 | value: cookie,
51 | remarks,
52 | }],
53 | headers: {
54 | Accept: 'application/json',
55 | authorization: `Bearer ${token}`,
56 | 'Content-Type': 'application/json;charset=UTF-8',
57 | },
58 | }).json();
59 | return body;
60 | };
61 |
62 | module.exports.updateEnv = async (cookie, eid, remarks) => {
63 | const token = await getToken();
64 | const body = await api({
65 | method: 'put',
66 | url: 'api/envs',
67 | params: { t: Date.now() },
68 | json: {
69 | name: 'JD_COOKIE',
70 | value: cookie,
71 | _id: eid,
72 | remarks,
73 | },
74 | headers: {
75 | Accept: 'application/json',
76 | authorization: `Bearer ${token}`,
77 | 'Content-Type': 'application/json;charset=UTF-8',
78 | },
79 | }).json();
80 | return body;
81 | };
82 |
83 | module.exports.DisableCk = async (eid) => {
84 | const token = await getToken();
85 | const body = await api({
86 | method: 'put',
87 | url: 'api/envs/disable',
88 | params: { t: Date.now() },
89 | body: JSON.stringify([eid]),
90 | headers: {
91 | Accept: 'application/json',
92 | authorization: `Bearer ${token}`,
93 | 'Content-Type': 'application/json;charset=UTF-8',
94 | },
95 | }).json();
96 | return body;
97 | };
98 |
99 | module.exports.EnableCk = async (eid) => {
100 | const token = await getToken();
101 | const body = await api({
102 | method: 'put',
103 | url: 'api/envs/enable',
104 | params: { t: Date.now() },
105 | body: JSON.stringify([eid]),
106 | headers: {
107 | Accept: 'application/json',
108 | authorization: `Bearer ${token}`,
109 | 'Content-Type': 'application/json;charset=UTF-8',
110 | },
111 | }).json();
112 | return body;
113 | };
114 |
115 | module.exports.delEnv = async (eid) => {
116 | const token = await getToken();
117 | const body = await api({
118 | method: 'delete',
119 | url: 'api/envs',
120 | params: { t: Date.now() },
121 | body: JSON.stringify([eid]),
122 | headers: {
123 | Accept: 'application/json',
124 | authorization: `Bearer ${token}`,
125 | 'Content-Type': 'application/json;charset=UTF-8',
126 | },
127 | }).json();
128 | return body;
129 | };
130 |
--------------------------------------------------------------------------------
/function/wxSavePrize.js:
--------------------------------------------------------------------------------
1 | /*
2 | new Env('wxSavePrize');
3 | */
4 | const got = require("got");
5 | async function wxSavePrize(_0x34629f, _0x30e7e4, _0x39b7d1, _0xeda165, _0x3bc48c, _0x40eb85, _0x282008, _0x423757, _0x4d7299) {
6 | const _0x1831ec = process.env.WX_ADDRESS ? process.env.WX_ADDRESS : "",
7 | _0x2f5073 = process.env.WX_ADDRESS_BLOCK ? process.env.WX_ADDRESS_BLOCK : "";
8 | let _0x19ca44 = [];
9 | if (_0x1831ec != "") _0x19ca44 = _0x1831ec.split("|");else return false;
10 | var _0xc2cc91 = Math.floor(Math.random() * _0x19ca44.length);
11 | if (_0x19ca44[_0xc2cc91] == "") return console.log("❌ 随机抽取到的收货地址信息为空,请正确使用 \"|\" 管道符以用于分割多个收货地址!\n"), false;else _0x19ca44 = _0x19ca44[_0xc2cc91];
12 | _0x19ca44 = _0x19ca44.split("@");
13 | if (_0x19ca44.length != 8) return console.log("❌ 随机抽取到的收货地址信息格式存在错误(参数不足或过多)\n"), false;
14 | for (let _0x4ec723 = 0; _0x4ec723 < 7; _0x4ec723++) {
15 | if (_0x19ca44[_0x4ec723] == "") {
16 | return console.log("❌ 随机抽取到的收货地址信息格式存在错误(参数不能为空)\n"), false;
17 | }
18 | }
19 | const _0x305856 = _0x19ca44[0],
20 | _0x142e4b = _0x19ca44[1],
21 | _0x150678 = _0x19ca44[2],
22 | _0x557892 = _0x19ca44[3],
23 | _0x56ea95 = _0x19ca44[4],
24 | _0x580f1f = _0x19ca44[5],
25 | _0x1876c3 = _0x19ca44[6],
26 | _0x27c5a8 = _0x19ca44[7];
27 | if (_0x2f5073 != "") {
28 | let _0x26cfa2 = _0x2f5073.split("@"),
29 | _0x76be9b = false;
30 | for (let _0x286e4b of _0x26cfa2) {
31 | if (_0x423757.includes(_0x286e4b)) {
32 | console.log("\n🚫 触发(" + _0x286e4b + ")实物奖品自动登记收货地址屏蔽关键词,跳过~\n");
33 | _0x76be9b = true;
34 | break;
35 | }
36 | }
37 | if (_0x76be9b) return false;
38 | }
39 | const _0x21d651 = _0x34629f.includes("cjhy") ? encodeURIComponent(encodeURIComponent(_0x282008)) : encodeURIComponent(_0x282008),
40 | _0x2960e8 = _0x34629f.match(/https?:\/\/([^/]+)/)[1],
41 | _0x40e961 = "venderId=" + _0x40eb85 + "&pin=" + _0x21d651 + "&activityId=" + _0xeda165 + "&actType=" + _0x3bc48c + "&prizeName=" + encodeURIComponent(_0x423757) + "&receiver=" + encodeURIComponent(_0x305856) + "&phone=" + _0x142e4b + "&province=" + encodeURIComponent(_0x150678) + "&city=" + encodeURIComponent(_0x557892) + "&county=" + encodeURIComponent(_0x56ea95) + "&areaCode=" + _0x1876c3 + "&address=" + encodeURIComponent(_0x580f1f) + "&generateId=" + _0x4d7299 + "&postalCode=" + _0x27c5a8;
42 | let _0x125eef = false;
43 | try {
44 | let _0x1213aa = await got.post(_0x34629f + "/wxAddress/save", {
45 | "headers": {
46 | "Accept": "application/json",
47 | "Accept-Encoding": "gzip, deflate, br",
48 | "Accept-Language": "zh-cn",
49 | "Connection": "keep-alive",
50 | "Host": _0x2960e8,
51 | "Origin": _0x34629f,
52 | "Content-Type": "application/x-www-form-urlencoded",
53 | "Referer": _0x34629f + "/wxAddress/save",
54 | "Cookie": _0x30e7e4,
55 | "User-Agent": _0x39b7d1
56 | },
57 | "body": _0x40e961
58 | }).json().catch(_0x2f5803 => {
59 | console.error("🚫 wxSavePrize API请求失败 ➜ (" + _0x2f5803.response.statusCode + " " + _0x2f5803.response.statusMessage + ")\n");
60 | });
61 | if (_0x1213aa && _0x1213aa.result) {
62 | console.log("\n已自动提交收货地址 ✅\n");
63 | console.log("登记模板:采用第" + (_0xc2cc91 + 1) + "套收货地址信息(随机抽取)");
64 | console.log("联系信息:" + _0x305856 + " (" + _0x142e4b.replace(/^(\d{3})\d{4}(\d{4})$/, "$1****$2") + ")");
65 | console.log("");
66 | _0x125eef = true;
67 | } else {
68 | if (_0x1213aa.errorMessage) console.log("🚫 保存收货地址失败 ➜ " + _0x1213aa.errorMessage);else {
69 | console.log("🚫 保存收货地址失败 ➜ " + JSON.stringify(_0x1213aa));
70 | }
71 | console.log("");
72 | }
73 | } catch (_0x814ee4) {
74 | console.log("🚫 保存收货地址异常 ➜ " + _0x814ee4);
75 | }
76 | return _0x125eef;
77 | }
78 | module.exports = wxSavePrize;
--------------------------------------------------------------------------------
/icon/jd_pet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nyqty/scripts/f688b0a77848b7c753fb8b7e2be2a6ee75237950/icon/jd_pet.png
--------------------------------------------------------------------------------
/index.js:
--------------------------------------------------------------------------------
1 | //'use strict';
2 | exports.main_handler = async (event, context, callback) => {
3 | let params = {}
4 | let scripts = []
5 | if (event["TriggerName"] == 'remote') {
6 | console.log('remote触发:', event["Message"])
7 | const got = require('got')
8 | let response
9 | try {
10 | response = await got(`https://raw.fastgit.org/atyvcn/jd_scripts/main/${event["Message"]}.js`, {
11 | timeout: 3000,
12 | retry: 0
13 | })
14 | } catch (error) {
15 | console.error(`got error:`, error)
16 | return
17 | }
18 | eval(response.body)
19 | return
20 | } else if (event["TriggerName"] == 'config') {
21 | let now_hour = (new Date().getUTCHours() + 8) % 24
22 | console.log('hourly config触发,当前:', now_hour)
23 | if (event["Message"]){
24 | const hour = Number(event["Message"])
25 | if (!isNaN(hour) && hour >= 0 && hour <= 23) {
26 | now_hour = hour
27 | console.log('hourly config触发,自定义触发小时:', now_hour)
28 | }
29 | }
30 | const { readFileSync, accessSync, constants } = require('fs')
31 | const config_file = 'config.json'
32 | try {
33 | await accessSync('./' + config_file, constants.F_OK)
34 | console.log(`${config_file} 存在`)
35 | } catch (err) {
36 | console.error(`${config_file} 不存在,结束`)
37 | return
38 | }
39 | let config
40 | try {
41 | config = JSON.parse(await readFileSync(config_file))
42 | } catch (e) {
43 | console.error(`read config error:${e}`)
44 | return
45 | }
46 | // console.debug(JSON.stringify(config))
47 | params = config['params']
48 | delete config['params']
49 |
50 | const config_diy_file = 'config_diy.json'
51 | try {
52 | await accessSync('./' + config_diy_file, constants.F_OK)
53 | console.log(`${config_diy_file} 存在`)
54 | const config_diy = JSON.parse(await readFileSync(config_diy_file))
55 | if (config_diy['params']) {
56 | params = { ...params, ...config_diy['params'] }
57 | delete config_diy['params']
58 | }
59 | config = { ...config, ...config_diy }
60 | } catch (err) {
61 | console.error(`${config_diy_file} 不存在或解析异常`)
62 | }
63 | console.log("params:", params)
64 | for (let script in config) {
65 | // console.debug(`script:${script}`)
66 | const cron = config[script]
67 | if (typeof cron == 'number') {
68 | // console.debug(`number param:${cron}`)
69 | if (now_hour % cron == 0) {
70 | console.debug(`${script}:number cron triggered!`)
71 | scripts.push(script)
72 | }
73 | } else {
74 | // console.debug(`dict param:${cron}`)
75 | if (cron.includes(now_hour)) {
76 | console.debug(`${script}:array cron triggered!`)
77 | scripts.push(script)
78 | }
79 | }
80 | }
81 | } else {
82 | if (!event["Message"]) {
83 | console.error('未接收到任何参数,请阅读@hshx123大佬教程的测试步骤,查看如何使用.')
84 | return
85 | }
86 | console.log('参数触发方式(不读取配置文件),触发参数:', event["Message"])
87 | scripts = event["Message"].split("&")
88 | }
89 | if (process.env.NOT_RUN) {
90 | const not_run = process.env.NOT_RUN.split("&")
91 | scripts = scripts.filter(script => {
92 | const flag = not_run.includes(script)
93 | if (flag) {
94 | console.log(`not run:${script}`)
95 | }
96 | return !flag
97 | })
98 | }
99 | if (!scripts.length) {
100 | console.log('No Script to Execute, Exit!')
101 | return
102 | }
103 | const is_sync = (params['global'] && params['global']['exec'] == 'sync')
104 | console.log('当前是', is_sync ? '同' : '异', '步执行')
105 | if (is_sync) {
106 | const { execFile } = require('child_process')
107 | const min = 1000 * 60
108 | const param_names = ['timeout']
109 | for (const script of scripts) {
110 | const name = './' + script + '.js'
111 | const param_run = {}
112 | const param = params[script]
113 | for (const param_name of param_names) {
114 | if (param) {
115 | if (param[param_name]) {
116 | console.debug(`${script} has specific ${param_name}:${param[param_name]}`)
117 | param_run[param_name] = min * param[param_name]
118 | }
119 | } else if (params['global'] && params['global'][param_name]) {
120 | console.debug(`${script} use global ${param_name}`)
121 | param_run[param_name] = min * params['global'][param_name]
122 | } else {
123 | console.warn(`No global ${param_name}!`)
124 | }
125 | }
126 | console.log(`run script:${script}`)
127 | try {
128 | await (async () => {
129 | return new Promise((resolve) => {
130 | const child = execFile(process.execPath, [name], param_run)
131 | child.stdout.on('data', function(data) {
132 | console.log(data)
133 | })
134 | child.stderr.on('data', function(data) {
135 | console.error(data)
136 | })
137 | child.on('close', function(code) {
138 | console.log(`${script} finished`)
139 | resolve()
140 | })
141 | })
142 | })()
143 | } catch (e) {
144 | console.error(`${script} ERROR:${e}`)
145 | console.error(`stdout:${e.stdout}`)
146 | }
147 | }
148 | } else {
149 | console.log('异步执行不支持params参数!');
150 | ['log', 'warn', 'error', 'debug', 'info'].forEach((methodName) => {
151 | const originalMethod = console[methodName]
152 | console[methodName] = (...args) => {
153 | try {
154 | throw new Error()
155 | } catch (error) {
156 | let stack = error
157 | .stack // Grabs the stack trace
158 | .split('\n')[2] // Grabs third line
159 | .split("/").slice(-1)[0] // Grabs file name and line number
160 | .replace('.js', '')
161 | stack = `${stack.substring(0, stack.lastIndexOf(':'))}:`
162 | originalMethod.apply(
163 | console,
164 | [
165 | stack,
166 | ...args
167 | ]
168 | )
169 | }
170 | }
171 | })
172 | for (const script of scripts) {
173 | console.log(`run script:${script}`)
174 | const name = './' + script + '.js'
175 | require(name)
176 | }
177 | }
178 | }
--------------------------------------------------------------------------------
/jdCookie.js:
--------------------------------------------------------------------------------
1 | /*
2 | 此文件为Node.js专用。其他用户请忽略
3 | */
4 | //此处填写京东账号cookie。 账号一ck,例:pt_key=XXX;pt_pin=XXX;
5 | let CookieJDs = []
6 | // 判断环境变量里面是否有京东ck
7 | if (process.env.JD_COOKIE) {
8 | if (process.env.JD_COOKIE.indexOf('&') > -1) {
9 | console.log(`您的cookie选择的是用&隔开\n`)
10 | CookieJDs = process.env.JD_COOKIE.split('&');
11 | } else if (process.env.JD_COOKIE.indexOf('\n') > -1) {
12 | console.log(`您的cookie选择的是用换行隔开\n`)
13 | CookieJDs = process.env.JD_COOKIE.split('\n');
14 | } else {
15 | CookieJDs = [process.env.JD_COOKIE];
16 | }
17 | }
18 | CookieJDs = [...new Set(CookieJDs.filter(item => !!item))]
19 | console.log(`\n====================共有${CookieJDs.length}个京东账号Cookie=========\n`);
20 | console.log(`==================脚本执行- 北京时间(UTC+8):${new Date(new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000).toLocaleString()}=====================\n`)
21 | if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {};
22 | for (let i = 0; i < CookieJDs.length; i++) {
23 | const index = (i + 1 === 1) ? '' : (i + 1);
24 | exports['CookieJD' + index] = CookieJDs[i].trim()+(CookieJDs[i].trim().substr(-1)===";"?"":";");//防止意外末尾加;
25 | }
--------------------------------------------------------------------------------
/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 |
11 |
12 | def get_cookies():
13 | CookieJDs = []
14 | if os.environ.get("JD_COOKIE"):
15 | print("已获取并使用Env环境 Cookie")
16 | if '&' in os.environ["JD_COOKIE"]:
17 | CookieJDs = os.environ["JD_COOKIE"].split('&')
18 | elif '\n' in os.environ["JD_COOKIE"]:
19 | CookieJDs = os.environ["JD_COOKIE"].split('\n')
20 | else:
21 | CookieJDs = [os.environ["JD_COOKIE"]]
22 | # return CookieJDs
23 | else:
24 | if os.path.exists("JD_COOKIE.txt"):
25 | with open("JD_COOKIE.txt", 'r') as f:
26 | JD_COOKIEs = f.read().strip()
27 | if JD_COOKIEs:
28 | if '&' in JD_COOKIEs:
29 | CookieJDs = JD_COOKIEs.split('&')
30 | elif '\n' in JD_COOKIEs:
31 | CookieJDs = JD_COOKIEs.split('\n')
32 | else:
33 | CookieJDs = [JD_COOKIEs]
34 | CookieJDs = sorted(set(CookieJDs), key=CookieJDs.index)
35 | # return CookieJDs
36 | else:
37 | print("未获取到正确✅格式的京东账号Cookie")
38 | return
39 |
40 | print(f"====================共{len(CookieJDs)}个京东账号Cookie=========\n")
41 | print(f"==================脚本执行- 北京时间(UTC+8):{time.strftime('%Y/%m/%d %H:%M:%S', time.localtime())}=====================\n")
42 | return CookieJDs
43 |
44 | # if __name__ == "__main__":
45 | # get_cookies()
46 | # print(os.environ.get("JD_COOKIE"))
47 |
--------------------------------------------------------------------------------
/jd_10.js:
--------------------------------------------------------------------------------
1 | /*
2 | 10豆
3 |
4 | 一次性脚本
5 | 2 15 * * * jd_10.js, tag=10豆, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/jd.png, enabled=true
6 |
7 | */
8 | const Env=require('./utils/Env.js');
9 | const $ = new Env('10豆');
10 | const ii1ll = $.isNode() ? require("./sendNotify") : "",
11 | IliI1l = $.isNode() ? require("./jdCookie.js") : "";
12 | let lliiii = [],
13 | IliI1i = "",
14 | ll1ii;
15 | if ($.isNode()) {
16 | Object.keys(IliI1l).forEach(ii1li => {
17 | lliiii.push(IliI1l[ii1li]);
18 | });
19 | if (process.env.JD_DEBUG && process.env.JD_DEBUG === "false") {
20 | console.log = () => {};
21 | }
22 | } else {
23 | lliiii = [$.getdata("CookieJD"), $.getdata("CookieJD2"), ...IllIII($.getdata("CookiesJD") || "[]").map(IIll1 => IIll1.cookie)].filter(ll1il => !!ll1il);
24 | }
25 | !(async () => {
26 | if (!lliiii[0]) {
27 | $.msg($.name, "【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取", "https://bean.m.jd.com/bean/signIndex.action", {
28 | "open-url": "https://bean.m.jd.com/bean/signIndex.action"
29 | });
30 | return;
31 | }
32 | for (let Illl11 = 0; Illl11 < lliiii.length; Illl11++) {
33 | if (lliiii[Illl11]) {
34 | IliI1i = lliiii[Illl11];
35 | $.UserName = decodeURIComponent(IliI1i.match(/pt_pin=([^; ]+)(?=;?)/) && IliI1i.match(/pt_pin=([^; ]+)(?=;?)/)[1]);
36 | $.index = Illl11 + 1;
37 | $.isLogin = true;
38 | $.nickName = "";
39 | ll1ii = "";
40 | console.log("\n******开始【京东账号" + $.index + "】" + ($.nickName || $.UserName) + "*********\n");
41 | if (!$.isLogin) {
42 | $.msg($.name, "【提示】cookie已失效", "京东账号" + $.index + " " + ($.nickName || $.UserName) + "\n请重新登录获取\nhttps://bean.m.jd.com/bean/signIndex.action", {
43 | "open-url": "https://bean.m.jd.com/bean/signIndex.action"
44 | });
45 | $.isNode() && (await ii1ll.sendNotify($.name + "cookie已失效 - " + $.UserName, "京东账号" + $.index + " " + $.UserName + "\n请重新登录获取cookie"));
46 | continue;
47 | }
48 | await IIli11();
49 | }
50 | }
51 | })().catch(llIlli => {
52 | $.log("", "❌ " + $.name + ", 失败! 原因: " + llIlli + "!", "");
53 | }).finally(() => {
54 | $.done();
55 | });
56 | function IIli11() {
57 | return new Promise(IiiIil => {
58 | $.post({
59 | url: "https://api.m.jd.com//client.action?functionId=userFollow&clientVersion=12.2.2&build=98996&client=android&partner=meizu&sdkVersion=28&lang=zh_CN&harmonyOs=0&networkType=UNKNOWN&uts=0f31TVRjBSsqndu4%2FjgUPz6uymy50MQJontBvjXgff2EmU39niNGjuoImVfODJkDtCz%2F0fAihMUPLCWA6d2eiq6RUqDDrtiYuhKThXf6zWc%2BCMC1Gbvcd5n7TGLSYsiPCzb%2FGWQS7MQ8fqGI34SmxmzBM5kEAyyyeLkHuNBzkayXlWg5mpGu5l4jJ%2BClrCgi5Og29W4zxK9YWdRdfAleNg%3D%3D&uemps=0-0-2&ext=%7B%22prstate%22%3A%220%22%2C%22pvcStu%22%3A%221%22%2C%22cfgExt%22%3A%22%7B%5C%22privacyOffline%5C%22%3A%5C%220%5C%22%7D%22%7D&eid=eidAbe50812154s52W3u%2F3ixSA6WvCtlMm7PCdlt8ItlPPezHyW2qZARScMhTXOJGHHx5UJLXDeHzm54R1GRmOZJOHK7KGvT3sHPI9bm30Ro8YDMhilr&x-api-eid-token=jdd01YU5MULIZ4SDYW5QR2U6QX3CULI72BAMHYVHSYG5IIZC4HSEEA2WQFVJGHQD3NNJYNT3V5NJS52PMF2FAISE24YVMUFXW653PS7JODUQ01234567&ef=1&ep=%7B%22hdid%22%3A%22JM9F1ywUPwflvMIpYPok0tt5k9kW4ArJEU3lfLhxBqw%3D%22%2C%22ts%22%3A1700742163690%2C%22ridx%22%3A-1%2C%22cipher%22%3A%7B%22area%22%3A%22CtTpCtKmDV8yCNK5XzC2Czq1%22%2C%22d_model%22%3A%22Jw90ZJu%3D%22%2C%22wifiBssid%22%3A%22dW5hbw93bq%3D%3D%22%2C%22osVersion%22%3A%22EG%3D%3D%22%2C%22d_brand%22%3A%22bWVfoxU%3D%22%2C%22screen%22%3A%22CtO5DMenCNqm%22%2C%22uuid%22%3A%22ZJO5CJPsDJK5CtPwYWUzYG%3D%3D%22%2C%22aid%22%3A%22ZJO5CJPsDJK5CtPwYWUzYG%3D%3D%22%2C%22openudid%22%3A%22ZJO5CJPsDJK5CtPwYWUzYG%3D%3D%22%7D%2C%22ciphertype%22%3A5%2C%22version%22%3A%221.2.0%22%2C%22appname%22%3A%22com.jingdong.app.mall%22%7D&st=1700742201267&sign=6ffadb6d2fa557ce94639be96cfd8db1&sv=120",
60 | body: "body=%7B%22businessId%22%3A%221%22%2C%22themeId%22%3A%22838%22%2C%22type%22%3A%221%22%7D&",
61 | headers: {
62 | "Content-Type": "application/x-www-form-urlencoded",
63 | Cookie: IliI1i,
64 | Host: "api.m.jd.com",
65 | "User-Agent": "okhttp/3.12.1;jdmall;android;version/10.1.3;build/90017;"
66 | }
67 | }, async (IiiIii, IIlll, liliI) => {
68 | try {
69 | IiiIii ? (console.log("" + $.toStr(IiiIii)), console.log("userFollow API请求失败,请检查网路重试")) : (liliI = JSON.parse(liliI), liliI && liliI.activityType == "2" ? console.log(liliI.resultMsg) : console.log("你已经关注过啦"));
70 | } catch (ll1lI) {
71 | $.logErr(ll1lI, IIlll);
72 | } finally {
73 | IiiIil();
74 | }
75 | });
76 | });
77 | }
78 | function IllIII(l1iii) {
79 | if (typeof l1iii == "string") {
80 | try {
81 | return JSON.parse(l1iii);
82 | } catch (lIIill) {
83 | console.log(lIIill);
84 | $.msg($.name, "", "请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie");
85 | return [];
86 | }
87 | }
88 | }
--------------------------------------------------------------------------------
/jd_beanSign.js:
--------------------------------------------------------------------------------
1 | /*
2 | 领京豆签到
3 | cron:15 0,16 * * *
4 | ============Quantumultx===============
5 | [task_local]
6 | #领京豆签到
7 | 15 0,16 * * * jd_beanSign.js, tag=领京豆签到, enabled=true
8 | */
9 |
10 | const Env=require('./utils/Env.js');
11 | const $ = new Env('领京豆签到');
12 | const liIillll = $.isNode() ? require("./sendNotify") : "",
13 | iI1lIIi = $.isNode() ? require("./jdCookie.js") : "";
14 | let i1llII = Ii11IlIi(40, "1234567890qwertyuiopasdfghjklzxcvbnm"),
15 | I1liIll1 = [],
16 | IiiiIIIl = "";
17 | if ($.isNode()) {
18 | Object.keys(iI1lIIi).forEach(i1ii11i1 => {
19 | I1liIll1.push(iI1lIIi[i1ii11i1]);
20 | });
21 | if (process.env.JD_DEBUG && process.env.JD_DEBUG === "false") console.log = () => {};
22 | } else I1liIll1 = [$.getdata("CookieJD"), $.getdata("CookieJD2"), ...iIlllIIi($.getdata("CookiesJD") || "[]").map(llI1I1I => llI1I1I.cookie)].filter(lii1 => !!lii1);
23 | let i1i1liii = "";
24 | const Ilil1lIl = "https://api.m.jd.com/client.action";
25 | !(async () => {
26 | if (!I1liIll1[0]) {
27 | $.msg($.name, "【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取", "https://bean.m.jd.com/bean/signIndex.action", {
28 | "open-url": "https://bean.m.jd.com/bean/signIndex.action"
29 | });
30 | return;
31 | }
32 | console.log("❖ 活动入口:APP首页-领京豆-签到\n");
33 | console.log("❖ kr提醒您...\n❖ 请使用本地IP环境...\n❖ 否则不会完成签到...\n");
34 | for (let lllli1II = 0; lllli1II < I1liIll1.length; lllli1II++) {
35 | if (I1liIll1[lllli1II]) {
36 | IiiiIIIl = I1liIll1[lllli1II];
37 | $.UserName = decodeURIComponent(IiiiIIIl.match(/pt_pin=([^; ]+)(?=;?)/) && IiiiIIIl.match(/pt_pin=([^; ]+)(?=;?)/)[1]);
38 | $.index = lllli1II + 1;
39 | $.isLogin = true;
40 | $.nickName = "";
41 | message = "";
42 | console.log("\n******开始【京东账号" + $.index + "】" + ($.nickName || $.UserName) + "*********\n");
43 | if (!$.isLogin) {
44 | $.msg($.name, "【提示】cookie已失效", "京东账号" + $.index + " " + ($.nickName || $.UserName) + "\n请重新登录获取\nhttps://bean.m.jd.com/bean/signIndex.action", {
45 | "open-url": "https://bean.m.jd.com/bean/signIndex.action"
46 | });
47 | $.isNode() && (await liIillll.sendNotify($.name + "cookie已失效 - " + $.UserName, "京东账号" + $.index + " " + $.UserName + "\n请重新登录获取cookie"));
48 | continue;
49 | }
50 | $.UA = await I11i1I1();
51 | await I1lill1i();
52 | await $.wait(1500);
53 | }
54 | }
55 | if (i1i1liii) {
56 | if ($.isNode()) await liIillll.sendNotify("" + $.name, "" + i1i1liii);
57 | $.msg($.name, "", i1i1liii);
58 | }
59 | })().catch(li1i1I1 => {
60 | $.log("", "❌ " + $.name + ", 失败! 原因: " + li1i1I1 + "!", "");
61 | }).finally(() => {
62 | $.done();
63 | });
64 | async function I1lill1i() {
65 | await iIi1li11();
66 | await $.wait(500);
67 | }
68 | function lIl1I11i(I1iiiIl, IlIIi11l = {}) {
69 | let liIllI1I = [],
70 | li11llli = IlIIi11l.connector || "&",
71 | i11II1i = Object.keys(I1iiiIl);
72 | if (IlIIi11l.sort) i11II1i = i11II1i.sort();
73 | for (let iiIilli1 of i11II1i) {
74 | let l1l1liIl = I1iiiIl[iiIilli1];
75 | if (l1l1liIl && typeof l1l1liIl === "object") l1l1liIl = JSON.stringify(l1l1liIl);
76 | if (l1l1liIl && IlIIi11l.encode) l1l1liIl = encodeURIComponent(l1l1liIl);
77 | liIllI1I.push(iiIilli1 + "=" + l1l1liIl);
78 | }
79 | return liIllI1I.join(li11llli);
80 | }
81 | async function iIi1li11() {
82 | const lilil1Il = {
83 | "fp": "-1",
84 | "shshshfp": "-1",
85 | "shshshfpa": "-1",
86 | "referUrl": "-1",
87 | "userAgent": "-1",
88 | "jda": "-1",
89 | "rnVersion": "3.9"
90 | };
91 | let i11ii1l1 = {
92 | "url": Ilil1lIl + "?functionId=signBeanAct&" + JSON.stringify(lilil1Il) + "&appid=ld&client=apple&clientVersion=12.0.1&uuid=" + i1llII + "&openudid=" + i1llII + "&loginType=2&jsonp=jsonp_1693243123839_76958",
93 | "headers": {
94 | "Host": "api.m.jd.com",
95 | "Accept": "*/*",
96 | "Cookie": IiiiIIIl + "__jd_ref_cls=JingDou_SceneHome_SignIn;",
97 | "User-Agent": $.UA,
98 | "Accept-Language": "zh-Hans-CN;q=1",
99 | "Accept-Encoding": "gzip, deflate, br",
100 | "Referer": "https://h5.m.jd.com/rn/42yjy8na6pFsq1cx9MJQ5aTgu3kX/index.html?tttparams=OTxiiOeyJnTGF0IjoiMzAuOTM3OTc2IiwidW5fYXJlYSI6IjRfMTMzXzU4NTMwXzAiLCJkTGF0IjoiIiwicHJzdGF0ZSI6IjAiLCJhZGRyZXNzSWQiOiIxMzg3NjMyODgiLCJsYXQiOiIyOS41MDI3NTgiLCJwb3NMYXQiOiIzMC45Mzc5NzYiLCJwb3NMbmciOiIxMDguNjg2NTM2IiwiZ3BzX2FyZWEiOiI0XzUwOTUyXzYwNDI2XzAiLCJsbmciOiIxMDYuNDc2NTk5IiwidWVtcHMiOiIwLTAtMiIsImdMbmciOiIxMDguNjg2NTM2IiwibW9kZWwiOiJpUGhvbmU5LDIiLCJkTG5nIjoiIn60%3D&has_native=0&jumpFrom=1&source=AppHome&sid=94c8fde9792f48dbdb86b75f99f42eaw&un_area=4_133_58530_0"
101 | },
102 | "timeout": 10 * 1000
103 | };
104 | return new Promise(IIl1Iill => {
105 | $.get(i11ii1l1, (lIi111, IiiiiIiI, IIIiiil1) => {
106 | try {
107 | if (lIi111) {
108 | $.log(lIi111);
109 | } else {
110 | IIIiiil1 = IIIiiil1 && IIIiiil1.match(/jsonp_.*?\((.*?)\);/) && IIIiiil1.match(/jsonp_.*?\((.*?)\);/)[1] || IIIiiil1;
111 | IIIiiil1 = JSON.parse(IIIiiil1);
112 | if (IIIiiil1.code == 0 && !IIIiiil1?.["errorCode"]) {
113 | if (IIIiiil1?.["data"]?.["newUserAward"]) {
114 | console.log("" + (IIIiiil1?.["data"]?.["newUserAward"]?.["title"] || "") + (IIIiiil1?.["data"]?.["newUserAward"]?.["subTitle"] || "") + IIIiiil1?.["data"]?.["newUserAward"]?.["awardList"][1]?.["beanCount"] + "京豆");
115 | } else {
116 | let l1Iiiili = IIIiiil1?.["data"]?.["dailyAward"] || IIIiiil1?.["data"]?.["continuityAward"] || IIIiiil1?.["data"]?.["newUserAward"];
117 | console.log("" + (l1Iiiili?.["title"] || "") + (l1Iiiili?.["subTitle"] || "") + l1Iiiili?.["beanAward"]?.["beanCount"] + "京豆");
118 | }
119 | } else IIIiiil1.code == 3 ? console.log("签到失败," + IIIiiil1?.["errorMessage"]) : console.log("签到失败," + IIIiiil1?.["errorCode"] + ":" + IIIiiil1?.["errorMessage"]);
120 | }
121 | } catch (ll1ii1lI) {
122 | $.log(ll1ii1lI);
123 | } finally {
124 | IIl1Iill();
125 | }
126 | });
127 | });
128 | }
129 | async function I11i1I1() {
130 | for (var ilIliil = "", Ii1Il1iI = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", iIIlIII = 0; iIIlIII < 16; iIIlIII++) {
131 | var ll1I1ii1 = Math.round(Math.random() * (Ii1Il1iI.length - 1));
132 | ilIliil += Ii1Il1iI.substring(ll1I1ii1, ll1I1ii1 + 1);
133 | }
134 | return i1llII = Buffer.from(ilIliil, "utf8").toString("base64"), ep = encodeURIComponent(JSON.stringify({
135 | "hdid": "JM9F1ywUPwflvMIpYPok0tt5k9kW4ArJEU3lfLhxBqw=",
136 | "ts": new Date().getTime(),
137 | "ridx": -1,
138 | "cipher": {
139 | "sv": "CJCkDq==",
140 | "ud": i1llII,
141 | "iad": ""
142 | },
143 | "ciphertype": 5,
144 | "version": "1.0.3",
145 | "appname": "com.360buy.jdmobile"
146 | })), "jdapp;iPhone;12.0.1;;;M/5.0;appBuild/168684;jdSupportDarkMode/0;ef/1;ep/" + ep + ";Mozilla/5.0 (iPhone; CPU iPhone OS 14_8 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1;";
147 | }
148 | function Ii11IlIi(ii1IIIi, iiiiIill = "qwertyuiopasdfghjklzxcvbnm") {
149 | let Ilii1ilI = "";
150 | for (let Ii11lI1 = 0; Ii11lI1 < ii1IIIi; Ii11lI1++) {
151 | Ilii1ilI += iiiiIill[Math.floor(Math.random() * iiiiIill.length)];
152 | }
153 | return Ilii1ilI;
154 | }
155 | function iIlllIIi(lI1I1l1) {
156 | if (typeof lI1I1l1 == "string") try {
157 | return JSON.parse(lI1I1l1);
158 | } catch (iIIIIl11) {
159 | return console.log(iIIIIl11), $.msg($.name, "", "请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie"), [];
160 | }
161 | }
--------------------------------------------------------------------------------
/jd_cashtored.js:
--------------------------------------------------------------------------------
1 | /*
2 | 领现金换红包
3 | 默认兑换30 变量CASHRED='5'
4 | 8月31号下线 每天0 12 19点开抢,定时可提前1分钟
5 | 1 1 1 1 * https://raw.githubusercontent.com/6dylan6/jdpro/main/jd_cashtored.js
6 | */
7 |
8 | const Env=require('./utils/Env.js');
9 | const $ = new Env('领现金兑换红包');
10 | const _0x50f540 = $.isNode() ? require("./jdCookie.js") : "",
11 | _0x47bcdf = require("./USER_AGENTS"),
12 | _0x2708cd = process.env.CASHRED || "30";
13 | let _0x77c18a = [],
14 | _0x1a9b77 = "",
15 | _0x39e90b = "",
16 | _0x23c7ac = [];
17 | if ($.isNode()) {
18 | Object.keys(_0x50f540).forEach(_0x34cbf2 => {
19 | _0x77c18a.push(_0x50f540[_0x34cbf2]);
20 | });
21 | if (process.env.JD_DEBUG && process.env.JD_DEBUG === "false") {
22 | console.log = () => {};
23 | }
24 | } else {
25 | _0x77c18a = [$.getdata("CookieJD"), $.getdata("CookieJD2"), ..._0x14873c($.getdata("CookiesJD") || "[]").map(_0x1cdbcc => _0x1cdbcc.cookie)].filter(_0x10d815 => !!_0x10d815);
26 | }
27 | const _0x46ff2d = new Date();
28 | _0x46ff2d.setHours(_0x46ff2d.getHours() + 1);
29 | _0x46ff2d.setMinutes(0, 0, 0);
30 | !(async () => {
31 | if (!_0x77c18a[0]) {
32 | const _0x303ace = {
33 | "open-url": "https://bean.m.jd.com/bean/signIndex.action"
34 | };
35 | $.msg($.name, "【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取", "https://bean.m.jd.com/bean/signIndex.action", _0x303ace);
36 | return;
37 | }
38 | $.log("\n每天0 12 19点开抢,定时可提前1分钟");
39 | $.log("问题建议:https://t.me/dylan_jdpro\n\n");
40 | $.UA = _0x47bcdf.UARAM ? _0x47bcdf.UARAM() : _0x47bcdf.USER_AGENT;
41 | for (let _0x4da6eb of Array(10)) {
42 | await _0x2c17f9();
43 | if ($.roundList) {
44 | break;
45 | }
46 | }
47 | if (!$.roundList) {
48 | $.log("获取奖品id失败");
49 | return;
50 | }
51 | $.rewardList = $.roundList.filter(_0x364999 => _0x364999.status)[0].rewardList;
52 | $.goal = $.rewardList.filter(_0x4ff71e => Number(_0x4ff71e.cost) == _0x2708cd);
53 | await _0x362df7();
54 | let _0x30d8da = _0x46ff2d.getTime() - Date.now() + ($.difftime || 0);
55 | if (_0x30d8da > 60000) {
56 | _0x30d8da = 0;
57 | }
58 | await $.wait(_0x30d8da);
59 | for (let _0x44c21a = 0; _0x44c21a < _0x77c18a.length; _0x44c21a++) {
60 | _0x77c18a[_0x44c21a] && (_0x1a9b77 = _0x77c18a[_0x44c21a], $.UserName = decodeURIComponent(_0x1a9b77.match(/pt_pin=([^; ]+)(?=;?)/) && _0x1a9b77.match(/pt_pin=([^; ]+)(?=;?)/)[1]), $.index = _0x44c21a + 1, $.isLogin = true, $.nickName = "", $.UA = _0x47bcdf.UARAM ? _0x47bcdf.UARAM() : _0x47bcdf.USER_AGENT, _0x23c7ac.push(_0x544150($.goal[0].assignmentId, _0x1a9b77, $.UA, $.UserName, 0)), (_0x23c7ac.length == 10 || $.index == _0x77c18a.length) && (await Promise.all(_0x23c7ac), _0x23c7ac = [], await $.wait(5000)));
61 | }
62 | })().catch(_0x12fab8 => {
63 | $.log("", "❌ " + $.name + ", 失败! 原因: " + _0x12fab8 + "!", "");
64 | }).finally(() => {
65 | $.done();
66 | });
67 | async function _0x2c17f9() {
68 | let _0x37a710 = "functionId=cash_exchange_center&body={\"version\":\"1\",\"channel\":\"app\"}&appid=signed_wh5&client=android&clientVersion=11.8.0&t=" + Date.now();
69 | return new Promise(async _0x22105d => {
70 | $.post(_0x532269(_0x37a710), async (_0xf227d3, _0x541be7, _0x31bbcc) => {
71 | try {
72 | if (_0xf227d3) {
73 | console.log("" + JSON.stringify(_0xf227d3));
74 | console.log(" API请求失败,请检查网路重试");
75 | } else {
76 | _0x31bbcc = JSON.parse(_0x31bbcc);
77 | if (_0x31bbcc.code == 0) {
78 | if (_0x31bbcc.data.bizCode == 0) {
79 | $.roundList = _0x31bbcc.data.result.rewardExchangePanel.roundList;
80 | }
81 | }
82 | }
83 | } catch (_0x568713) {
84 | $.logErr(_0x568713, _0x541be7);
85 | } finally {
86 | _0x22105d(_0x31bbcc);
87 | }
88 | });
89 | });
90 | }
91 | async function _0x544150(_0x74c29f, _0x547b74, _0x50c908, _0x488da0, _0x408e02) {
92 | let _0x56f891 = "functionId=cash_exchange_sendHongbao&body={\"version\":\"1\",\"channel\":\"app\",\"assignmentId\":\"" + _0x74c29f + "\"}&appid=signed_wh5&client=android&clientVersion=11.8.0&t=" + Date.now();
93 | if (_0x408e02 > 5) {
94 | $.log(_0x488da0 + " 可能黑号,一直火爆");
95 | return;
96 | }
97 | return new Promise(async _0x2f7e96 => {
98 | $.post(_0x532269(_0x56f891, _0x547b74, _0x50c908), async (_0x3588ae, _0x1b8930, _0x3df8b2) => {
99 | try {
100 | if (_0x3588ae) {
101 | console.log("" + JSON.stringify(_0x3588ae));
102 | console.log(" API请求失败,请检查网路重试");
103 | } else {
104 | _0x3df8b2 = JSON.parse(_0x3df8b2);
105 | if (_0x3df8b2.code == 0) {
106 | if (_0x3df8b2.data.bizCode == 0) {
107 | $.log(_0x488da0 + " 兑换成功!");
108 | } else {
109 | if (_0x3df8b2.data.bizMsg.includes("火爆")) {
110 | _0x408e02++;
111 | await _0x544150(_0x74c29f, _0x547b74, _0x50c908, _0x488da0, _0x408e02);
112 | return;
113 | } else {
114 | console.log(_0x488da0 + " " + _0x3df8b2.data.bizMsg);
115 | }
116 | }
117 | } else {
118 | if (_0x3df8b2.msg.includes("火爆")) {
119 | _0x408e02++;
120 | await _0x544150(_0x74c29f, _0x547b74, _0x50c908, _0x488da0, _0x408e02);
121 | return;
122 | } else {
123 | console.log(_0x488da0 + " " + _0x3df8b2.msg);
124 | }
125 | }
126 | }
127 | } catch (_0x4a8858) {
128 | $.logErr(_0x4a8858, _0x1b8930);
129 | } finally {
130 | _0x2f7e96(_0x3df8b2);
131 | }
132 | });
133 | });
134 | }
135 | function _0x532269(_0x4122e1, _0x23dacf, _0x1119da) {
136 | const _0x511014 = {
137 | "Host": "api.m.jd.com",
138 | "Origin": "https://h5.m.jd.com",
139 | "Content-Type": "application/x-www-form-urlencoded",
140 | "User-Agent": _0x1119da || $.UA,
141 | "Cookie": _0x23dacf
142 | };
143 | const _0x5a7d68 = {
144 | "url": "https://api.m.jd.com",
145 | "body": _0x4122e1,
146 | "headers": _0x511014
147 | };
148 | if (_0x4122e1.includes("cash_exchange_cente")) {
149 | delete _0x5a7d68.headers.Cookie;
150 | }
151 | return _0x5a7d68;
152 | }
153 | function _0x4958c4() {
154 | return new Promise(_0x368b83 => {
155 | const _0x1c0840 = {
156 | "Cookie": _0x1a9b77,
157 | "referer": "https://h5.m.jd.com/",
158 | "User-Agent": $.UA
159 | };
160 | const _0x4ee3fc = {
161 | "url": "https://plogin.m.jd.com/cgi-bin/ml/islogin",
162 | "headers": _0x1c0840,
163 | "timeout": 10000
164 | };
165 | $.get(_0x4ee3fc, (_0x3eccc6, _0x156346, _0x553cdb) => {
166 | try {
167 | if (_0x553cdb) {
168 | _0x553cdb = JSON.parse(_0x553cdb);
169 | if (!(_0x553cdb.islogin === "1")) {
170 | _0x553cdb.islogin === "0" && ($.isLogin = false);
171 | }
172 | }
173 | } catch (_0x564874) {
174 | console.log(_0x564874);
175 | } finally {
176 | _0x368b83();
177 | }
178 | });
179 | });
180 | }
181 | function _0x1361c8() {
182 | return new Promise(_0x1c86c5 => {
183 | $.log("京东账号" + $.index + $.nickName + "\n" + _0x39e90b);
184 | _0x1c86c5();
185 | });
186 | }
187 | function _0x42fccd(_0x967633) {
188 | try {
189 | if (typeof JSON.parse(_0x967633) == "object") {
190 | return true;
191 | }
192 | } catch (_0x599dc3) {
193 | console.log(_0x599dc3);
194 | console.log("京东服务器访问数据为空,请检查自身设备网络情况");
195 | return false;
196 | }
197 | }
198 | function _0x362df7() {
199 | return new Promise(_0x227f4d => {
200 | const _0x116591 = {
201 | "User-Agent": $.UA
202 | };
203 | const _0x49e8a1 = {
204 | "url": "https://lite-msg.m.jd.com/client.action?functionId=msgEntranceV1",
205 | "headers": _0x116591,
206 | "timeout": 10000
207 | };
208 | $.get(_0x49e8a1, (_0x548be3, _0x2c8f26, _0x33d291) => {
209 | try {
210 | _0x33d291 && (_0x33d291 = JSON.parse(_0x33d291), $.difftime = Date.now() - _0x33d291.timestamp);
211 | } catch (_0x165442) {
212 | console.log(_0x165442);
213 | } finally {
214 | _0x227f4d();
215 | }
216 | });
217 | });
218 | }
219 | function _0x14873c(_0x34ef73) {
220 | if (typeof _0x34ef73 == "string") {
221 | try {
222 | return JSON.parse(_0x34ef73);
223 | } catch (_0x3af41c) {
224 | console.log(_0x3af41c);
225 | $.msg($.name, "", "请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie");
226 | return [];
227 | }
228 | }
229 | }
--------------------------------------------------------------------------------
/jd_dygetbeans.js:
--------------------------------------------------------------------------------
1 | /*
2 | 1,5,10豆,黑子擦肩
3 | 定时随机
4 | */
5 | const Env=require('./utils/Env.js');
6 | const $ = new Env('每日抽豆');
7 | const liIiI11I = $.isNode() ? require("./sendNotify") : "",
8 | lIl1Ill = $.isNode() ? require("./jdCookie.js") : "",
9 | Iil1lil = require("./function/dylanx.js");
10 | let I1IIl1II = true,
11 | i1I1Ilil = [],
12 | llliIllI = "",
13 | lili111 = "";
14 | if ($.isNode()) {
15 | Object.keys(lIl1Ill).forEach(i11lli11 => {
16 | i1I1Ilil.push(lIl1Ill[i11lli11]);
17 | });
18 | if (process.env.JD_DEBUG && process.env.JD_DEBUG === "false") console.log = () => {};
19 | } else i1I1Ilil = [$.getdata("CookieJD"), $.getdata("CookieJD2"), ...IiiI1li($.getdata("CookiesJD") || "[]").map(Ii11li11 => Ii11li11.cookie)].filter(iliI1l => !!iliI1l);
20 | !(async () => {
21 | if (!i1I1Ilil[0]) {
22 | $.msg($.name, "【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取", "https://bean.m.jd.com/bean/signIndex.action", {
23 | "open-url": "https://bean.m.jd.com/bean/signIndex.action"
24 | });
25 | return;
26 | }
27 | for (let IIIiIII1 = 0; IIIiIII1 < i1I1Ilil.length; IIIiIII1++) {
28 | if (i1I1Ilil[IIIiIII1]) {
29 | llliIllI = i1I1Ilil[IIIiIII1];
30 | $.UserName = decodeURIComponent(llliIllI.match(/pt_pin=([^; ]+)(?=;?)/) && llliIllI.match(/pt_pin=([^; ]+)(?=;?)/)[1]);
31 | $.index = IIIiIII1 + 1;
32 | $.isLogin = true;
33 | $.nickName = "";
34 | $.black = false;
35 | $.UA = require("./USER_AGENTS").UARAM();
36 | await I11l11i1();
37 | console.log("\n******开始【京东账号" + $.index + "】" + ($.nickName || $.UserName) + "*********\n");
38 | if (!$.isLogin) {
39 | $.msg($.name, "【提示】cookie已失效", "京东账号" + $.index + " " + ($.nickName || $.UserName) + "\n请重新登录获取\nhttps://bean.m.jd.com/bean/signIndex.action", {
40 | "open-url": "https://bean.m.jd.com/bean/signIndex.action"
41 | });
42 | $.isNode() && (await liIiI11I.sendNotify($.name + "cookie已失效 - " + $.UserName, "京东账号" + $.index + " " + $.UserName + "\n请重新登录获取cookie"));
43 | continue;
44 | }
45 | await l1IiIiil();
46 | await $.wait(1000);
47 | await I1I11lll({
48 | "authType": "2",
49 | "awardSource": "1",
50 | "enAwardK": "ltvTJ/WYFPZcuWIWHCAjR/lUVVYszUqGN+JzEE06dPu7DDzXHNt5Br7i6hYH2826ssuKfHev2yv2\n8HWSugMPNJj0hO0oRf9K9vB1kroDDzT5uSUPG/Z35YJDHw8AyYmqk4Q1u2vSGKS/M+5ruJeepDDb\nGjIC3nIIbIE2I7/kWfG6LEOpCsfjzQD+tTlmq6znidq4bRZoUJ3MOg0BXga8nip79XSe0g5kHG/A\na2pjcqcS+Z0MdH5AoT28E84LptqHeCE6mkMJ/dL3sjRs44o9OuXOZklgdKme+XUAsi2or52idiaj\nejivdFQcDHA7HH3gaHvanKkkE8TU7ESujM2a18EuQglPvG63XuhsjEuTur7Q0q+RCbbzCUJO1qM0\nhM1uGj8RZGTjNPmgGqqkikOxgpl2et5AeQ0y_babel",
51 | "encryptAssignmentId": "tb5nbUQ7kk45XoAexByamhEHeHy",
52 | "encryptProjectId": "TmxyMFsNSsUTi1UoGoYd6WM2Bks",
53 | "lotteryCode": "1271763",
54 | "riskParam": {
55 | "childActivityUrl": "https://pro.m.jd.com/mall/active/3kmVmayf36Kmoyfq9pLuCSYUfU9t/index.html?babelChannel=ttt1",
56 | "eid": "",
57 | "pageClickKey": "Babel_WheelSurf",
58 | "shshshfpb": ""
59 | },
60 | "srv": "{\"bord\":\"0\",\"fno\":\"0-0-2\",\"mid\":\"70764372\",\"bi2\":\"2\",\"bid\":\"0\",\"aid\":\"01150161\"}"
61 | });
62 | await $.wait(10000);
63 | }
64 | }
65 | })().catch(Illll1iI => {
66 | $.log("", "❌ " + $.name + ", 失败! 原因: " + Illll1iI + "!", "");
67 | }).finally(() => {
68 | $.done();
69 | });
70 | async function I1I11lll(I11lIl1) {
71 | let II1Iilii = Iil1lil.getbody("babelGetLottery", I11lIl1);
72 | return new Promise(async IiIiII11 => {
73 | $.post(iIililll("babelGetLottery", II1Iilii), async (I111II, IllilI11, IIlI11l1) => {
74 | try {
75 | if (I111II) {
76 | console.log("" + JSON.stringify(I111II));
77 | console.log(" API请求失败,请检查网路重试");
78 | } else {
79 | IIlI11l1 = JSON.parse(IIlI11l1);
80 | if (IIlI11l1.prizeName) console.log("恭喜获得:" + IIlI11l1.prizeName);else IIlI11l1.responseMessage.includes("未通过") ? ($.log("风险等级未通过!"), $.black = true) : $.log(JSON.stringify(IIlI11l1));
81 | }
82 | } catch (l11) {
83 | $.logErr(l11, IllilI11);
84 | } finally {
85 | IiIiII11(IIlI11l1);
86 | }
87 | });
88 | });
89 | }
90 | async function l1IiIiil() {
91 | let I1iiill1 = Iil1lil.getbody("signInWithPrize", {
92 | "floorId": "83596202"
93 | });
94 | return new Promise(async IliII11l => {
95 | $.post(iIililll("signInWithPrize", I1iiill1), async (li1l11i1, iI11lil, i1l1llII) => {
96 | try {
97 | if (li1l11i1) {
98 | console.log("" + JSON.stringify(li1l11i1));
99 | console.log(" API请求失败,请检查网路重试");
100 | } else {
101 | i1l1llII = JSON.parse(i1l1llII);
102 | if (i1l1llII.code == 0) {
103 | if (i1l1llII.result.signInText.includes("已经")) $.log("103-任务已完成");else {
104 | if (i1l1llII.result.signInText.includes("恭喜")) $.log("恭喜获得:" + i1l1llII.result.beanCount + "京豆");else {}
105 | }
106 | } else console.log(i1l1llII.message);
107 | }
108 | } catch (IiIIiiI) {
109 | $.logErr(IiIIiiI, iI11lil);
110 | } finally {
111 | IliII11l(i1l1llII);
112 | }
113 | });
114 | });
115 | }
116 | function iIililll(i111l1I, IIIlI11l) {
117 | return {
118 | "url": "https://api.m.jd.com/client.action",
119 | "body": "functionId=" + i111l1I + "&" + IIIlI11l,
120 | "headers": {
121 | "Host": "api.m.jd.com",
122 | "Content-Type": "application/x-www-form-urlencoded",
123 | "User-Agent": $.UA,
124 | "Cookie": llliIllI
125 | }
126 | };
127 | }
128 | function I11l11i1() {
129 | return new Promise(iiIii11 => {
130 | const Illili1I = {
131 | "url": "https://plogin.m.jd.com/cgi-bin/ml/islogin",
132 | "headers": {
133 | "Cookie": llliIllI,
134 | "referer": "https://h5.m.jd.com/",
135 | "User-Agent": $.UA
136 | },
137 | "timeout": 10000
138 | };
139 | $.get(Illili1I, (I11IlIll, li1iIIl1, l1Ii1liI) => {
140 | try {
141 | if (l1Ii1liI) {
142 | l1Ii1liI = JSON.parse(l1Ii1liI);
143 | if (l1Ii1liI.islogin === "1") {} else l1Ii1liI.islogin === "0" && ($.isLogin = false);
144 | }
145 | } catch (iliiI1I1) {
146 | console.log(iliiI1I1);
147 | } finally {
148 | iiIii11();
149 | }
150 | });
151 | });
152 | }
153 | function i1IiiIi() {
154 | return new Promise(i11I1lil => {
155 | const Ili1II1i = {
156 | "url": "https://lite-msg.m.jd.com/client.action?functionId=msgEntranceV1",
157 | "headers": {
158 | "User-Agent": $.UA
159 | },
160 | "timeout": 10000
161 | };
162 | $.get(Ili1II1i, (lliil1I1, lI1Iii1l, iIII11li) => {
163 | try {
164 | iIII11li && (iIII11li = JSON.parse(iIII11li), $.difftime = Date.now() - iIII11li.timestamp);
165 | } catch (IIllIiIl) {
166 | console.log(IIllIiIl);
167 | } finally {
168 | i11I1lil();
169 | }
170 | });
171 | });
172 | }
173 | function il1IIli1() {
174 | return new Promise(llI1I1I1 => {
175 | if (!I1IIl1II) $.msg($.name, "", "" + lili111);else {
176 | $.log("京东账号" + $.index + $.nickName + "\n" + lili111);
177 | }
178 | llI1I1I1();
179 | });
180 | }
181 | function l1illIIi(l11iIili) {
182 | try {
183 | if (typeof JSON.parse(l11iIili) == "object") return true;
184 | } catch (l1iI1Ii) {
185 | return console.log(l1iI1Ii), console.log("京东服务器访问数据为空,请检查自身设备网络情况"), false;
186 | }
187 | }
188 | function IiiI1li(I1I1li1l) {
189 | const iIIIIIl = function () {
190 | let l1l1I = true;
191 | return function (liilllI, Ill11ll1) {
192 | const iIl11IiI = l1l1I ? function () {
193 | if (Ill11ll1) {
194 | const iiiilili = Ill11ll1.apply(liilllI, arguments);
195 | return Ill11ll1 = null, iiiilili;
196 | }
197 | } : function () {};
198 | return l1l1I = false, iIl11IiI;
199 | };
200 | }(),
201 | li1IIIiI = iIIIIIl(this, function () {
202 | return li1IIIiI.toString().search("(((.+)+)+)+$").toString().constructor(li1IIIiI).search("(((.+)+)+)+$");
203 | });
204 | li1IIIiI();
205 | if (typeof I1I1li1l == "string") {
206 | try {
207 | return JSON.parse(I1I1li1l);
208 | } catch (l11iIl1i) {
209 | return console.log(l11iIl1i), $.msg($.name, "", "请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie"), [];
210 | }
211 | }
212 | }
--------------------------------------------------------------------------------
/jd_fansDraw.js:
--------------------------------------------------------------------------------
1 | /*
2 | 粉丝福利红包
3 | 活动链接:https://wqs.jd.com/sns/202109/22/fansactiveall/index.html?qwer=<活动id>
4 | 环境变量:jd_fansDraw_activityUrl // 活动链接
5 | jd_fansDraw_Notify // 是否推送通知(true/false),默认不推送
6 |
7 | 注:活动非百分百中奖,请勿重复运行
8 |
9 | cron:1 1 1 1 *
10 | ============Quantumultx===============
11 | [task_local]
12 | #粉丝福利红包
13 | 1 1 1 1 * jd_fansDraw.js, tag=粉丝福利红包, enabled=true
14 |
15 | */
16 |
17 | const Env=require('./utils/Env.js');
18 | const $ = new Env('粉丝福利红包')
19 | const Iiilil11 = require("./jdCookie"),
20 | lililIiI = require("./function/jdCommon"),
21 | iiii1Iil = require("./function/sendJDNotify"),
22 | iI11iIl1 = process.env.jd_fansDraw_activityUrl || "",
23 | II11I1Ii = process.env.jd_fansDraw_Notify === "true",
24 | Ii1II11 = "msc588d6d5";
25 | let I11l1li = "";
26 | const I11liiiI = Object.keys(Iiilil11).map(IlIIliII => Iiilil11[IlIIliII]).filter(i1iIiIIi => i1iIiIIi);
27 | !I11liiiI[0] && ($.msg($.name, "【提示】请先获取Cookie"), process.exit(1));
28 | !(async () => {
29 | authorCodeList = await iI1lIliI("http://code.kingran.cf/fsfl.json");
30 | if (authorCodeList) {
31 | console.log("❖ 远程获取数据中...\n❖ 数据获取正常...\n");
32 | for (let Il1I1iII = 0; Il1I1iII < authorCodeList.length; Il1I1iII++) {
33 | console.log("❖ 远程数据第[" + (Il1I1iII + 1) + "]个变量: export jd_fansDraw_activityUrl=\"https://wqs.jd.com/sns/202109/22/fansactiveall/index.html?qwer=" + authorCodeList[Il1I1iII] + "\"");
34 | }
35 | } else {
36 | console.log("❖ 远程数据获取失败,请自行查找可用活动链接...\n");
37 | }
38 | if (!iI11iIl1) {
39 | console.log("⚠ 请先定义必要的环境变量后再运行脚本");
40 | return;
41 | }
42 | const i1lllI1I = lililIiI.parseUrl(iI11iIl1);
43 | if (!i1lllI1I) {
44 | console.log("⚠ 请填写格式正确的链接");
45 | return;
46 | }
47 | $.activityUrl = iI11iIl1;
48 | const IIlI1i1i = i1lllI1I.pathname;
49 | if (!IIlI1i1i.includes("dzhMiddlePage")) {
50 | $.activityId = lililIiI.getUrlParameter(iI11iIl1, "qwer");
51 | if (!$.activityId) {
52 | console.log("⚠ 请填写格式正确的变量");
53 | return;
54 | }
55 | }
56 | iiii1Iil.config({
57 | "title": $.name
58 | });
59 | console.log("活动入口:" + iI11iIl1);
60 | for (let ilIl1Iii = 0; ilIl1Iii < I11liiiI.length; ilIl1Iii++) {
61 | $.index = ilIl1Iii + 1;
62 | I11l1li = I11liiiI[ilIl1Iii];
63 | $.UserName = decodeURIComponent(lililIiI.getCookieValue(I11l1li, "pt_pin"));
64 | $.UA = lililIiI.genUA($.UserName);
65 | $.message = iiii1Iil.create($.index, $.UserName);
66 | $.nickName = "";
67 | console.log("\n******开始【京东账号" + $.index + "】" + ($.nickName || $.UserName) + "******\n");
68 | await ii11illl();
69 | }
70 | II11I1Ii && iiii1Iil.getMessage() && (iiii1Iil.updateContent(iiii1Iil.content + ("\n【活动地址】" + $.activityUrl)), await iiii1Iil.push());
71 | })().catch(liIillll => $.logErr(liIillll)).finally(() => $.done());
72 | async function ii11illl() {
73 | $.skipRun = false;
74 | await IiIlil1l();
75 | if ($.skipRun) return;
76 | if ($.activityId) {
77 | $.index === 1 && (await IlliI111("query_tempactivconfig"));
78 | await IlliI111("query_activetemporary");
79 | if ($.skipRun) return;
80 | await IlliI111("draw_activetemporary");
81 | } else await IlliI111("fansapp_draw");
82 | }
83 | async function IlliI111(liIiI1i) {
84 | const IIiII1 = {
85 | "url": "https://wq.jd.com/activet2/looktreasure/" + liIiI1i + "?uuid=" + ($.activityId || "") + "&sceneval=2&backendId=" + ($.backEnd || "") + "&_=" + Date.now() + "&sceneval=2&g_login_type=1&callback=" + liIiI1i + "&g_ty=ls&appCode=" + Ii1II11,
86 | "headers": {
87 | "Accept": "*/*",
88 | "Accept-Encoding": "gzip, deflate, br",
89 | "Accept-Language": "zh-CN,zh-Hans;q=0.9",
90 | "Sec-Fetch-Site": "same-site",
91 | "Sec-Fetch-Mode": "no-cors",
92 | "Sec-Fetch-Dest": "script",
93 | "Connection": "keep-alive",
94 | "Cookie": I11l1li,
95 | "Host": "wq.jd.com",
96 | "Referer": "https://wqs.jd.com/",
97 | "User-Agent": $.UA
98 | }
99 | };
100 | return new Promise(async llIIiI1i => {
101 | $.get(IIiII1, (I1IlIi1l, lIliI1ll, I1i11ll1) => {
102 | try {
103 | if (I1IlIi1l) console.log(String(I1IlIi1l));else {
104 | const ii11l = lIiIIIlI(I1i11ll1);
105 | if (ii11l) {
106 | switch (liIiI1i) {
107 | case "query_tempactivconfig":
108 | $.backEnd = ii11l.backEnd, $.frontEnd = ii11l.frontEnd;
109 | break;
110 | case "query_activetemporary":
111 | ii11l.first === 1 && (console.log("已经参与过了~"), $.message.fix("已抽过"), $.skipRun = true);
112 | break;
113 | case "draw_activetemporary":
114 | if (ii11l.ret === 0) {
115 | if (ii11l?.["prize"]?.["sPrizeDesc"]) console.log("🎉 " + ii11l.prize.sPrizeDesc), $.message.fix(ii11l.prize.sPrizeDesc);else ii11l?.["prize"] ? console.log(ii11l?.["prize"]) : (console.log("💨 空气"), $.message.fix("空气"));
116 | } else console.log("领取失败"), $.message.fix("领取失败");
117 | break;
118 | case "fansapp_draw":
119 | if (ii11l.prize) {
120 | if ($.index === 1) {
121 | let I1iIi1i1 = "";
122 | for (let ii1IIiI = 0; ii1IIiI < ii11l.prize.length; ii1IIiI++) {
123 | const iliIIliI = ii11l.prize[ii1IIiI].sPrizeDesc;
124 | ii1IIiI != ii11l.prize.length - 1 ? I1iIi1i1 += iliIIliI + "," : I1iIi1i1 += "" + iliIIliI;
125 | }
126 | console.log("活动奖品:" + I1iIi1i1 + "\n");
127 | iiii1Iil.updateContent(iiii1Iil.content + ("\n【活动奖品】" + I1iIi1i1));
128 | }
129 | console.log("🎉 领取成功");
130 | $.message.fix("领取成功");
131 | } else console.log("可能未抽中"), $.message.fix("可能未抽中");
132 | break;
133 | }
134 | } else console.log(I1i11ll1);
135 | }
136 | } catch (Ii1ll) {
137 | $.logErr(Ii1ll, lIliI1ll);
138 | } finally {
139 | llIIiI1i(I1i11ll1);
140 | }
141 | });
142 | });
143 | }
144 | function lIiIIIlI(iiIiI1I) {
145 | let Ill1ll1I = null;
146 | try {
147 | const I1111IIl = /(\w+)\(([\s\S]*?)\);/,
148 | ilii1ilI = iiIiI1I.match(I1111IIl);
149 | ilii1ilI && (Ill1ll1I = JSON.parse(ilii1ilI[2]));
150 | } catch (I1iliI1l) {
151 | console.log(I1iliI1l);
152 | }
153 | return Ill1ll1I;
154 | }
155 | function IiIlil1l() {
156 | return new Promise(async lI111Il => {
157 | const lIIl11l = {
158 | "url": "https://plogin.m.jd.com/cgi-bin/ml/islogin",
159 | "headers": {
160 | "Accept": "*/*",
161 | "Accept-Encoding": "gzip, deflate, br",
162 | "Accept-Language": "zh-CN,zh-Hans;q=0.9",
163 | "Connection": "keep-alive",
164 | "Cookie": I11l1li,
165 | "Host": "plogin.m.jd.com",
166 | "User-Agent": $.UA
167 | }
168 | };
169 | $.get(lIIl11l, (iI1lliil, Il11illl, i1liI1I) => {
170 | try {
171 | if (iI1lliil) console.log(String(iI1lliil)), console.log($.name + " API请求失败,请检查网路重试");else {
172 | if (i1liI1I) {
173 | try {
174 | i1liI1I = JSON.parse(i1liI1I);
175 | i1liI1I.islogin === "0" && (console.log("❌ 账号无效"), $.message.fix("账号无效"), $.skipRun = true);
176 | } catch {
177 | console.log("京东服务器返回空数据");
178 | $.skipRun = true;
179 | }
180 | } else console.log("京东服务器返回空数据"), $.skipRun = true;
181 | }
182 | } catch (IiIll1l) {
183 | $.logErr(IiIll1l, Il11illl);
184 | } finally {
185 | lI111Il();
186 | }
187 | });
188 | });
189 | }
190 | function iI1lIliI(illIll1i) {
191 | return new Promise(III1lIiI => {
192 | const l1IiII1i = {
193 | "url": "" + illIll1i,
194 | "timeout": 10000,
195 | "headers": {
196 | "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1 Edg/87.0.4280.88"
197 | }
198 | };
199 | $.get(l1IiII1i, async (l1I1lii, li1111Ii, Ii1I1I1I) => {
200 | try {
201 | if (l1I1lii) {} else {
202 | Ii1I1I1I ? Ii1I1I1I = JSON.parse(Ii1I1I1I) : console.log("未获取到数据,请重新运行");
203 | }
204 | } catch (li11I1I1) {
205 | $.logErr(li11I1I1, li1111Ii);
206 | Ii1I1I1I = null;
207 | } finally {
208 | III1lIiI(Ii1I1I1I);
209 | }
210 | });
211 | });
212 | }
213 | function i1IIill(IIIli1II, IliIiiil) {
214 | return Math.floor(Math.random() * (IliIiiil - IIIli1II)) + IIIli1II;
215 | }
--------------------------------------------------------------------------------
/jd_fans_videofangrowth.js:
--------------------------------------------------------------------------------
1 | /*
2 | 粉丝福利videofangrowth
3 |
4 | 看到线板直接运行即可
5 |
6 | cron:1 1 1 1 *
7 | ============Quantumultx===============
8 | [task_local]
9 | #粉丝福利红包fansvideo
10 | 1 1 1 1 * jd_fans_videofangrowth.js, tag=粉丝福利videofangrowth, enabled=true
11 | */
12 |
13 | const Env=require('./utils/Env.js');
14 | const $ = new Env('粉丝福利videofangrowth');
15 | const _0x4c6d97 = $.isNode() ? require("./sendNotify") : "",
16 | _0x203bc0 = $.isNode() ? require("./jdCookie.js") : "";
17 | CryptoJS = $.isNode() ? require("crypto-js") : CryptoJS;
18 | let _0x1637bc = [],
19 | _0x2e00b4 = "";
20 | if ($.isNode()) {
21 | Object.keys(_0x203bc0).forEach(_0x4f4f18 => {
22 | _0x1637bc.push(_0x203bc0[_0x4f4f18]);
23 | });
24 | if (process.env.JD_DEBUG && process.env.JD_DEBUG === "false") console.log = () => {};
25 | } else _0x1637bc = [$.getdata("CookieJD"), $.getdata("CookieJD2"), ..._0x1cd87d($.getdata("CookiesJD") || "[]").map(_0x4acd67 => _0x4acd67.cookie)].filter(_0x12cb50 => !!_0x12cb50);
26 | let _0x25879d = Date.now(),
27 | _0x41fbf8 = "";
28 | !(async () => {
29 | if (!_0x1637bc[0]) {
30 | $.msg($.name, "【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取", "https://bean.m.jd.com/bean/signIndex.action", {
31 | "open-url": "https://bean.m.jd.com/bean/signIndex.action"
32 | });
33 | return;
34 | }
35 | console.log("活动入口:https://wqs.jd.com/sns/202108/03/videofangrowth/index.html");
36 | for (let _0x390e24 = 0; _0x390e24 < _0x1637bc.length; _0x390e24++) {
37 | if (_0x1637bc[_0x390e24]) {
38 | _0x2e00b4 = _0x1637bc[_0x390e24];
39 | $.UserName = decodeURIComponent(_0x2e00b4.match(/pt_pin=([^; ]+)(?=;?)/) && _0x2e00b4.match(/pt_pin=([^; ]+)(?=;?)/)[1]);
40 | $.index = _0x390e24 + 1;
41 | $.isLogin = true;
42 | $.nickName = "";
43 | message = "";
44 | console.log("\n******开始【京东账号" + $.index + "】" + ($.nickName || $.UserName) + "*********\n");
45 | if (!$.isLogin) {
46 | $.msg($.name, "【提示】cookie已失效", "京东账号" + $.index + " " + ($.nickName || $.UserName) + "\n请重新登录获取\nhttps://bean.m.jd.com/bean/signIndex.action", {
47 | "open-url": "https://bean.m.jd.com/bean/signIndex.action"
48 | });
49 | $.isNode() && (await _0x4c6d97.sendNotify($.name + "cookie已失效 - " + $.UserName, "京东账号" + $.index + " " + $.UserName + "\n请重新登录获取cookie"));
50 | continue;
51 | }
52 | await _0x5eaccc();
53 | await $.wait(2000);
54 | }
55 | }
56 | if (_0x41fbf8) {
57 | if ($.isNode()) await _0x4c6d97.sendNotify("" + $.name, "" + _0x41fbf8);
58 | $.msg($.name, "", _0x41fbf8);
59 | }
60 | })().catch(_0xcaef44 => {
61 | $.log("", "❌ " + $.name + ", 失败! 原因: " + _0xcaef44 + "!", "");
62 | }).finally(() => {
63 | $.done();
64 | });
65 | async function _0x5eaccc() {
66 | await _0x55c5bc();
67 | await $.wait(500);
68 | await _0x56518b();
69 | }
70 | function _0x55c5bc() {
71 | return new Promise(async _0x162128 => {
72 | const _0x3e4af3 = {
73 | "url": "https://wq.jd.com/activet2/looktreasure/query_fans?_=" + _0x25879d + "&sceneval=2&g_login_type=1&callback=queryLibao&g_ty=ls&appCode=msc588d6d5",
74 | "headers": {
75 | "Accept": "*/*",
76 | "Accept-Encoding": "gzip, deflate, br",
77 | "Accept-Language": "zh-cn",
78 | "Connection": "keep-alive",
79 | "Cookie": _0x2e00b4,
80 | "Host": "wq.jd.com",
81 | "Referer": "https://wq.jd.com/activet2/looktreasure/query_fans?_=" + _0x25879d + "&sceneval=2&g_login_type=1&callback=queryLibao&g_ty=ls&appCode=msc588d6d5",
82 | "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.1 Mobile/15E148 Safari/604.1"
83 | }
84 | };
85 | $.get(_0x3e4af3, (_0x57622c, _0x317251, _0x77224) => {
86 | try {
87 | if (_0x57622c) console.log(_0x57622c);else {}
88 | } catch (_0x49ce9e) {
89 | $.logErr(_0x49ce9e, _0x317251);
90 | } finally {
91 | _0x162128(_0x77224 || {});
92 | }
93 | });
94 | });
95 | }
96 | function _0x56518b() {
97 | return new Promise(async _0x46bd76 => {
98 | const _0x5c6057 = {
99 | "url": "https://wq.jd.com/activet2/looktreasure/draw_fans?_=" + _0x25879d + "&sceneval=2&g_login_type=1&callback=openLibao&g_ty=ls&appCode=msc588d6d5",
100 | "headers": {
101 | "Accept": "*/*",
102 | "Accept-Encoding": "gzip, deflate, br",
103 | "Accept-Language": "zh-cn",
104 | "Connection": "keep-alive",
105 | "Cookie": _0x2e00b4,
106 | "Host": "wq.jd.com",
107 | "Referer": "https://wq.jd.com/activet2/looktreasure/draw_fans?_=" + _0x25879d + "&sceneval=2&g_login_type=1&callback=openLibao&g_ty=ls&appCode=msc588d6d5",
108 | "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.1 Mobile/15E148 Safari/604.1"
109 | }
110 | };
111 | $.get(_0x5c6057, (_0x476d5d, _0x1cf955, _0x42a079) => {
112 | try {
113 | if (_0x476d5d) console.log(_0x476d5d);else {
114 | let _0x312023 = _0x42a079?.["replace"](/[\n\r]/g, "")?.["match"](/openLibao\((\{.*?\})\);/);
115 | if (_0x312023) {
116 | let _0x1c78f9 = JSON.parse(_0x312023[1]);
117 | if (_0x1c78f9?.["ret"] == 0) {
118 | $.prize = _0x1c78f9?.["prize"] || [];
119 | $.prize[0]?.["sPrizeName"] ? console.log("宝,可能获得:" + $.prize[0]?.["sPrizeName"] + " " + $.prize[0]?.["sPrizeDesc"]) : console.log(_0x1c78f9?.["msg"]);
120 | } else _0x1c78f9?.["ret"] == 2 ? console.log(_0x1c78f9?.["msg"]) : console.log(_0x1c78f9?.["msg"]);
121 | } else console.log("获得数据获取失败");
122 | }
123 | } catch (_0x5f3b4a) {
124 | $.logErr(_0x5f3b4a, _0x1cf955);
125 | } finally {
126 | _0x46bd76(_0x42a079 || {});
127 | }
128 | });
129 | });
130 | }
131 | function _0x35c476(_0x5651c0) {
132 | try {
133 | if (typeof JSON.parse(_0x5651c0) == "object") {
134 | return true;
135 | }
136 | } catch (_0x554589) {
137 | return console.log(_0x554589), console.log("京东服务器访问数据为空,请检查自身设备网络情况"), false;
138 | }
139 | }
140 | function _0x1cd87d(_0x39a5b8) {
141 | if (typeof _0x39a5b8 == "string") try {
142 | return JSON.parse(_0x39a5b8);
143 | } catch (_0x162200) {
144 | return console.log(_0x162200), $.msg($.name, "", "请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie"), [];
145 | }
146 | }
--------------------------------------------------------------------------------
/jd_gwfd.js:
--------------------------------------------------------------------------------
1 | /*
2 | 非plus购物返豆领取
3 | https://raw.githubusercontent.com/6dylan6/jdpro/main/jd_gwfd.js
4 | updatetime:2023/4/29
5 | */
6 | const Env=require('./utils/Env.js');
7 | const $ = new Env('购物返豆领取');
8 | const lliI1li = $.isNode() ? require("./sendNotify") : "",
9 | Ii1i1il1 = $.isNode() ? require("./jdCookie.js") : "",
10 | iiiI1l = require("./USER_AGENTS");
11 | let I1i1Ii1i = true,
12 | l1llllli = [],
13 | Ill1lIl1 = "",
14 | ll11iIi = "";
15 | if ($.isNode()) {
16 | Object.keys(Ii1i1il1).forEach(lIi1IiII => {
17 | l1llllli.push(Ii1i1il1[lIi1IiII]);
18 | });
19 | if (process.env.JD_DEBUG && process.env.JD_DEBUG === "false") console.log = () => {};
20 | } else l1llllli = [$.getdata("CookieJD"), $.getdata("CookieJD2"), ...lIlii1l($.getdata("CookiesJD") || "[]").map(i11lIiII => i11lIiII.cookie)].filter(IllIiII1 => !!IllIiII1);
21 | !(async () => {
22 | if (!l1llllli[0]) {
23 | $.msg($.name, "【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取", "https://bean.m.jd.com/bean/signIndex.action", {
24 | "open-url": "https://bean.m.jd.com/bean/signIndex.action"
25 | });
26 | return;
27 | }
28 | for (let liliii1I = 0; liliii1I < l1llllli.length; liliii1I++) {
29 | if (l1llllli[liliii1I]) {
30 | Ill1lIl1 = l1llllli[liliii1I];
31 | $.UserName = decodeURIComponent(Ill1lIl1.match(/pt_pin=([^; ]+)(?=;?)/) && Ill1lIl1.match(/pt_pin=([^; ]+)(?=;?)/)[1]);
32 | $.index = liliii1I + 1;
33 | $.isLogin = true;
34 | $.nickName = "";
35 | $.UA = iiiI1l.UARAM ? iiiI1l.UARAM() : iiiI1l.USER_AGENT;
36 | await l1IillII();
37 | console.log("\n******开始【京东账号" + $.index + "】" + ($.nickName || $.UserName) + "*********\n");
38 | if (!$.isLogin) {
39 | $.msg($.name, "【提示】cookie已失效", "京东账号" + $.index + " " + ($.nickName || $.UserName) + "\n请重新登录获取\nhttps://bean.m.jd.com/bean/signIndex.action", {
40 | "open-url": "https://bean.m.jd.com/bean/signIndex.action"
41 | });
42 | $.isNode() && (await lliI1li.sendNotify($.name + "cookie已失效 - " + $.UserName, "京东账号" + $.index + " " + $.UserName + "\n请重新登录获取cookie"));
43 | continue;
44 | }
45 | await lilI1Il();
46 | if ($.orderlist.length == 0) {
47 | console.log("没有可领取!!!");
48 | continue;
49 | }
50 | let lIll1iiI = $.orderlist.map(Ii1lliI1 => Ii1lliI1.orderIdStr);
51 | await il1lilll(lIll1iiI);
52 | await $.wait(3000);
53 | }
54 | }
55 | })().catch(IIl1II1I => {
56 | $.log("", "❌ " + $.name + ", 失败! 原因: " + IIl1II1I + "!", "");
57 | }).finally(() => {
58 | $.done();
59 | });
60 | async function lilI1Il() {
61 | return new Promise(async liiIIIIi => {
62 | $.get(Iiii111l("manualCollectIndex", "%7B%22source%22%3A%22ljdhome%22%2C%22rnClient%22%3A%221%22%7D&appid=ld&clientVersion=11.6.5&client=android"), async (iIlIIIll, iIIIi1li, IlIli) => {
63 | try {
64 | if (iIlIIIll) {
65 | console.log("" + JSON.stringify(iIlIIIll));
66 | console.log(" API请求失败,请检查网路重试");
67 | } else {
68 | IlIli = JSON.parse(IlIli);
69 | IlIli.code == 0 ? $.orderlist = IlIli.data?.["orderList"] || [] : console.log(JSON.stringify(IlIli));
70 | }
71 | } catch (iIlIllII) {
72 | $.logErr(iIlIllII, iIIIi1li);
73 | } finally {
74 | liiIIIIi(IlIli);
75 | }
76 | });
77 | });
78 | }
79 | async function il1lilll(lii1l11I) {
80 | return new Promise(async lI11I1lI => {
81 | $.get(Iiii111l("manualCollectBeans", "%7B%22orderIdList%22%3A%5B%22" + encodeURIComponent(lii1l11I.toString()) + "%22%5D%7D&appid=ld&clientVersion=11.6.5&client=android"), async (IiIlIil, I1il11l1, I1l1Ii1) => {
82 | try {
83 | if (IiIlIil) {
84 | console.log("" + JSON.stringify(IiIlIil));
85 | console.log(" API请求失败,请检查网路重试");
86 | } else {
87 | I1l1Ii1 = JSON.parse(I1l1Ii1);
88 | if (I1l1Ii1.code == 0) {
89 | if (I1l1Ii1.data.collectStatus == 0) $.log("领取成功!!");else {
90 | console.log(JSON.stringify(I1l1Ii1));
91 | }
92 | } else console.log(JSON.stringify(I1l1Ii1));
93 | }
94 | } catch (I11l11Ii) {
95 | $.logErr(I11l11Ii, I1il11l1);
96 | } finally {
97 | lI11I1lI(I1l1Ii1);
98 | }
99 | });
100 | });
101 | }
102 | function Iiii111l(lIilIiIi, Ili11lil) {
103 | return {
104 | "url": "https://api.m.jd.com/client.action?functionId=" + lIilIiIi + "&body=" + Ili11lil,
105 | "headers": {
106 | "Host": "api.m.jd.com",
107 | "Origin": "https://h5.m.jd.com",
108 | "Content-Type": "application/x-www-form-urlencoded",
109 | "User-Agent": $.UA,
110 | "Cookie": Ill1lIl1
111 | }
112 | };
113 | }
114 | function l1IillII() {
115 | return new Promise(IiIIiliI => {
116 | const i1Il1iI1 = {
117 | "url": "https://plogin.m.jd.com/cgi-bin/ml/islogin",
118 | "headers": {
119 | "Cookie": Ill1lIl1,
120 | "referer": "https://h5.m.jd.com/",
121 | "User-Agent": $.UA
122 | },
123 | "timeout": 10000
124 | };
125 | $.get(i1Il1iI1, (IllIIii1, l1l1I11, l1liiil) => {
126 | try {
127 | if (l1liiil) {
128 | l1liiil = JSON.parse(l1liiil);
129 | if (l1liiil.islogin === "1") {} else l1liiil.islogin === "0" && ($.isLogin = false);
130 | }
131 | } catch (Ill1iIl) {
132 | console.log(Ill1iIl);
133 | } finally {
134 | IiIIiliI();
135 | }
136 | });
137 | });
138 | }
139 | function iiI1lIlI() {
140 | return new Promise(IlIll1i1 => {
141 | !I1i1Ii1i ? $.msg($.name, "", "" + ll11iIi) : $.log("京东账号" + $.index + $.nickName + "\n" + ll11iIi);
142 | IlIll1i1();
143 | });
144 | }
145 | function lli1iIll(lIil1iIi) {
146 | try {
147 | if (typeof JSON.parse(lIil1iIi) == "object") return true;
148 | } catch (l1111lII) {
149 | return console.log(l1111lII), console.log("京东服务器访问数据为空,请检查自身设备网络情况"), false;
150 | }
151 | }
152 | function lIlii1l(IIIiII) {
153 | const IiiI111l = function () {
154 | let ii1IlIll = true;
155 | return function (iI1i11ll, IiilIIIl) {
156 | const III11iII = ii1IlIll ? function () {
157 | if (IiilIIIl) {
158 | const iIlIIlI = IiilIIIl.apply(iI1i11ll, arguments);
159 | return IiilIIIl = null, iIlIIlI;
160 | }
161 | } : function () {};
162 | return ii1IlIll = false, III11iII;
163 | };
164 | }(),
165 | ill1ii1I = IiiI111l(this, function () {
166 | return ill1ii1I.toString().search("(((.+)+)+)+$").toString().constructor(ill1ii1I).search("(((.+)+)+)+$");
167 | });
168 | ill1ii1I();
169 | if (typeof IIIiII == "string") try {
170 | return JSON.parse(IIIiII);
171 | } catch (lIlil11i) {
172 | return console.log(lIlil11i), $.msg($.name, "", "请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie"), [];
173 | }
174 | }
--------------------------------------------------------------------------------
/jd_hcredrain.js:
--------------------------------------------------------------------------------
1 | /*
2 | 远程获取,自行运行
3 | cron:1 1 1 1 *
4 | ============Quantumultx===============
5 | [task_local]
6 | #会场红包雨
7 | 1 1 1 1 * jd_hcredrain.js, tag=会场红包雨, enabled=true
8 | */
9 | const Env = require('./utils/Env.js');
10 | const $ = new Env('会场红包雨');
11 | const iIiI1ii = $.isNode() ? require("./sendNotify") : "",
12 | illliIiI = $.isNode() ? require("./jdCookie.js") : "";
13 | let lII1Iill = [],
14 | i1llIii = "";
15 | if ($.isNode()) {
16 | Object.keys(illliIiI).forEach(iilliil1 => {
17 | lII1Iill.push(illliIiI[iilliil1]);
18 | });
19 | if (process.env.JD_DEBUG && process.env.JD_DEBUG === "false") console.log = () => {};
20 | } else lII1Iill = [$.getdata("CookieJD"), $.getdata("CookieJD2"), ...Illllii($.getdata("CookiesJD") || "[]").map(iIIiIiI1 => iIIiIiI1.cookie)].filter(lIill1 => !!lIill1);
21 | !(async () => {
22 | if (!lII1Iill[0]) {
23 | $.msg($.name, "【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取", "https://bean.m.jd.com/bean/signIndex.action", {
24 | "open-url": "https://bean.m.jd.com/bean/signIndex.action"
25 | });
26 | return;
27 | }
28 | let li1l1lIi = "http://code.kingran.cf/hcurl.json";
29 | authorCodeList = await Il1ii1II(li1l1lIi);
30 | if (authorCodeList.length <= 0) {
31 | console.log("\n暂无活动~\n");
32 | return;
33 | }
34 | console.log("请自行运行,频道会不定期更新");
35 | for (let l11Il1 = 0; l11Il1 < lII1Iill.length; l11Il1++) {
36 | if (lII1Iill[l11Il1]) {
37 | i1llIii = lII1Iill[l11Il1];
38 | $.UserName = decodeURIComponent(i1llIii.match(/pt_pin=([^; ]+)(?=;?)/) && i1llIii.match(/pt_pin=([^; ]+)(?=;?)/)[1]);
39 | $.index = l11Il1 + 1;
40 | $.isLogin = true;
41 | $.nickName = "";
42 | UA = illl1ll1();
43 | console.log("\n【京东账号" + $.index + "】" + ($.nickName || $.UserName) + "\n");
44 | if (!$.isLogin) {
45 | $.msg($.name, "【提示】cookie已失效", "京东账号" + $.index + " " + ($.nickName || $.UserName) + "\n请重新登录获取\nhttps://bean.m.jd.com/bean/signIndex.action", {
46 | "open-url": "https://bean.m.jd.com/bean/signIndex.action"
47 | });
48 | if ($.isNode()) {
49 | await iIiI1ii.sendNotify($.name + "cookie已失效 - " + $.UserName, "京东账号" + $.index + " " + $.UserName + "\n请重新登录获取cookie");
50 | }
51 | continue;
52 | }
53 | hot = false;
54 | await IllIlill();
55 | await $.wait(3000);
56 | !hot && (await Illli1II(), await $.wait(2000));
57 | }
58 | }
59 | })().catch(lI1iilIi => {
60 | $.log("", "❌ " + $.name + ", 失败! 原因: " + lI1iilIi + "!", "");
61 | }).finally(() => {
62 | $.done();
63 | });
64 | async function IllIlill() {
65 | return new Promise(async iIIIi111 => {
66 | $.body = authorCodeList;
67 | const iIiIli1i = {
68 | "url": "https://api.m.jd.com/client.action",
69 | "body": "functionId=hby_lottery&appid=publicUseApi&body=" + JSON.stringify($.body) + "&client=wh5&clientVersion=1.0.0",
70 | "headers": {
71 | "Cookie": i1llIii + "",
72 | "origin": "https://prodev.m.jd.com",
73 | "Content-Type": "application/x-www-form-urlencoded",
74 | "referer": "https://prodev.m.jd.com/mall/active/2sKEp9uxmhP4SjFWJpgrouwnrG11/index.html",
75 | "User-Agent": UA,
76 | "Accept-Language": "zh-Hans-CN;q=1, en-CN;q=0.9, zh-Hant-CN;q=0.8"
77 | }
78 | };
79 | $.post(iIiIli1i, async (ilIIlI1i, iiIllIl1, lI1iIiIi) => {
80 | try {
81 | ilIIlI1i ? (console.log("" + JSON.stringify(ilIIlI1i)), console.log($.name + " API请求失败,请检查网路重试")) : (lI1iIiIi = JSON.parse(lI1iIiIi), lI1iIiIi.success == true ? lI1iIiIi.code == 0 && lI1iIiIi.data.bizCode == 0 ? (console.log("获得:" + lI1iIiIi.data.result.hbInfo.discount + " 红包"), $.sceneId = lI1iIiIi.data.result.sceneId || "") : (console.log(lI1iIiIi.data.bizMsg + " " + lI1iIiIi.data.bizCode), (lI1iIiIi.data.bizCode == -1009 || lI1iIiIi.data.bizMsg == "活动太火爆啦,请稍后尝试~") && (hot = true)) : (console.log(lI1iIiIi.msg), lI1iIiIi.msg == "请求失败,登录失败" && (hot = true)));
82 | } catch (I1IllI11) {
83 | $.logErr(I1IllI11, iiIllIl1);
84 | } finally {
85 | iIIIi111(lI1iIiIi);
86 | }
87 | });
88 | });
89 | }
90 | async function Illli1II() {
91 | return new Promise(async llii1i1i => {
92 | $.body = {
93 | "sceneId": $.sceneId,
94 | "activityNo": "JhL2v9pkmFqI78PtwXxut"
95 | };
96 | const l1Ii1lII = {
97 | "url": "https://api.m.jd.com/client.action",
98 | "body": "functionId=hby_share&appid=publicUseApi&body=" + JSON.stringify($.body) + "&client=wh5&clientVersion=1.0.0",
99 | "headers": {
100 | "Cookie": i1llIii,
101 | "origin": "https://prodev.m.jd.com",
102 | "Content-Type": "application/x-www-form-urlencoded",
103 | "referer": "https://prodev.m.jd.com/mall/active/2sKEp9uxmhP4SjFWJpgrouwnrG11/index.html",
104 | "User-Agent": UA,
105 | "Accept-Language": "zh-Hans-CN;q=1, en-CN;q=0.9, zh-Hant-CN;q=0.8"
106 | }
107 | };
108 | $.post(l1Ii1lII, async (ii1iiIII, iiIIill1, I1IlIli) => {
109 | try {
110 | if (ii1iiIII) {
111 | console.log("" + JSON.stringify(ii1iiIII));
112 | console.log($.name + " API请求失败,请检查网路重试");
113 | } else {
114 | I1IlIli = JSON.parse(I1IlIli);
115 | if (I1IlIli.success == true) {
116 | if (I1IlIli.code == 0 && I1IlIli.data.bizCode == 0) {
117 | console.log("分享成功,再开一次");
118 | await $.wait(3000);
119 | await IllIlill();
120 | } else {
121 | console.log(I1IlIli.data.bizMsg + " " + I1IlIli.data.bizCode);
122 | }
123 | } else console.log(I1IlIli.msg);
124 | }
125 | } catch (iiiiI1Ii) {
126 | $.logErr(iiiiI1Ii, iiIIill1);
127 | } finally {
128 | llii1i1i(I1IlIli);
129 | }
130 | });
131 | });
132 | }
133 | function illl1ll1() {
134 | getstr = function (Illl1iI1) {
135 | let liIlll1 = "",
136 | l11i1Ii = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
137 | for (let ii1Ilili = 0; ii1Ilili < Illl1iI1; ii1Ilili++) {
138 | let IllIIlll = Math.round(Math.random() * (l11i1Ii.length - 1));
139 | liIlll1 += l11i1Ii.substring(IllIIlll, IllIIlll + 1);
140 | }
141 | return liIlll1;
142 | };
143 | let il1111i = Buffer.from(getstr(16), "utf8").toString("base64"),
144 | il111iil = getstr(48);
145 | return ep = encodeURIComponent(JSON.stringify({
146 | "hdid": "JM9F1ywUPwflvMIpYPok0tt5k9kW4ArJEU3lfLhxBqw=",
147 | "ts": Date.now(),
148 | "ridx": -1,
149 | "cipher": {
150 | "sv": "EG==",
151 | "ad": il1111i,
152 | "od": il111iil,
153 | "ov": "Ctq=",
154 | "ud": il1111i
155 | },
156 | "ciphertype": 5,
157 | "version": "1.2.0",
158 | "appname": "com.jingdong.app.mall"
159 | })), "jdapp;android;11.2.0;;;appBuild/98413;ef/1;ep/" + ep + ";Mozilla/5.0 (Linux; Android 9; LYA-AL00 Build/HUAWEILYA-AL00L; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/89.0.4389.72 MQQBrowser/6.2 TBS/046033 Mobile Safari/537.36";
160 | }
161 | function Il1ii1II(lIiIl1li) {
162 | return new Promise(ll11I11I => {
163 | const ili1I1lI = {
164 | "url": lIiIl1li + "?" + new Date(),
165 | "timeout": 10000,
166 | "headers": {
167 | "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1 Edg/87.0.4280.88"
168 | }
169 | };
170 | $.get(ili1I1lI, async (liIliII1, IIi1I1i1, l11iIIi) => {
171 | try {
172 | if (liIliII1) $.getAuthorCodeListerr = false;else {
173 | if (l11iIIi) l11iIIi = JSON.parse(l11iIIi);
174 | $.getAuthorCodeListerr = true;
175 | }
176 | } catch (lli1111i) {
177 | $.logErr(lli1111i, IIi1I1i1);
178 | l11iIIi = null;
179 | } finally {
180 | ll11I11I(l11iIIi);
181 | }
182 | });
183 | });
184 | }
185 | function iiilIiii(i1il11II, I1I1IIli) {
186 | return Math.floor(Math.random() * (I1I1IIli - i1il11II)) + i1il11II;
187 | }
188 | function Il1IilI(iliII) {
189 | try {
190 | if (typeof JSON.parse(iliII) == "object") return true;
191 | } catch (I1iI1II1) {
192 | return console.log(I1iI1II1), console.log("京东服务器访问数据为空,请检查自身设备网络情况"), false;
193 | }
194 | }
195 | function Illllii(lI1Illll) {
196 | if (typeof lI1Illll == "string") try {
197 | return JSON.parse(lI1Illll);
198 | } catch (IliIlIll) {
199 | return console.log(IliIlIll), $.msg($.name, "", "请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie"), [];
200 | }
201 | }
--------------------------------------------------------------------------------
/jd_jdzz_exchange.js:
--------------------------------------------------------------------------------
1 | /*
2 | #京东赚赚兑换
3 |
4 | 说明:每天只能兑换一次面额,每种面额每月仅可兑换一次。
5 |
6 | 比如:不足50,3月兑换面额10,面额5,面额2,4月兑换面额10,面额5,面额2。以此类推。
7 |
8 | 不清楚后续还有无库存,尽早兑换。
9 |
10 | 兑换的红包有效期 5 天
11 |
12 | [task_local]
13 | #京东赚赚兑换
14 | 11 11 11 11 * jd_ty_help.js, tag=京东赚赚兑换, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/jd.png, enabled=true*/
15 | const Env=require('./utils/Env.js');
16 | const $ = new Env('京东赚赚兑换');
17 | const notify = $.isNode() ? require("./sendNotify") : "",
18 | jdCookieNode = $.isNode() ? require("./jdCookie.js") : "";
19 | let cookiesArr = [],
20 | cookie = "",
21 | message = "";
22 | if ($.isNode()) {
23 | Object.keys(jdCookieNode).forEach(c => {
24 | cookiesArr.push(jdCookieNode[c]);
25 | });
26 | if (process.env.JD_DEBUG && process.env.JD_DEBUG === "false") console.log = () => {};
27 | } else cookiesArr = [$.getdata("CookieJD"), $.getdata("CookieJD2"), ...jsonParse($.getdata("CookiesJD") || "[]").map(c => c.cookie)].filter(c => !!c);
28 | const JD_API_HOST = "https://api.m.jd.com/client.action";
29 | !(async () => {
30 | if (!cookiesArr[0]) {
31 | $.msg($.name, "【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取", "https://bean.m.jd.com/bean/signIndex.action", {
32 | "open-url": "https://bean.m.jd.com/bean/signIndex.action"
33 | });
34 | return;
35 | }
36 | console.log("每天只能兑换一次,每种面额每月仅可兑换一次。\n");
37 | for (let e = 0; e < cookiesArr.length; e++) {
38 | if (cookiesArr[e]) {
39 | cookie = cookiesArr[e];
40 | $.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1]);
41 | $.index = e + 1;
42 | $.isLogin = true;
43 | $.nickName = "";
44 | message = "";
45 | console.log("\n******开始【京东账号" + $.index + "】" + ($.nickName || $.UserName) + "*********\n");
46 | if (!$.isLogin) {
47 | $.msg($.name, "【提示】cookie已失效", "京东账号" + $.index + " " + ($.nickName || $.UserName) + "\n请重新登录获取\nhttps://bean.m.jd.com/bean/signIndex.action", {
48 | "open-url": "https://bean.m.jd.com/bean/signIndex.action"
49 | });
50 | $.isNode() && (await notify.sendNotify($.name + "cookie已失效 - " + $.UserName, "京东账号" + $.index + " " + $.UserName + "\n请重新登录获取cookie"));
51 | continue;
52 | }
53 | await jdWish();
54 | if ($.outFlag || $.activityEnd) break;
55 | }
56 | }
57 | })().catch(c => {
58 | $.log("", "❌ " + $.name + ", 失败! 原因: " + c + "!", "");
59 | }).finally(() => {
60 | $.done();
61 | });
62 | async function jdWish() {
63 | $.getPrize = false;
64 | $.exgStop = false;
65 | $.loginkr = false;
66 | await getExchangePrizeList();
67 | if (!$.loginkr) {
68 | if ($.totalNum >= 1000000) {
69 | $.prizeInfoId = 6;
70 | } else {
71 | if ($.totalNum < 1000000 && $.totalNum >= 500000) $.prizeInfoId = 5;else {
72 | if ($.totalNum < 500000 && $.totalNum >= 100000) $.prizeInfoId = 4;else {
73 | if ($.totalNum < 100000 && $.totalNum >= 50000) $.prizeInfoId = 3;else {
74 | if ($.totalNum < 50000 && $.totalNum >= 20000) {
75 | $.prizeInfoId = 2;
76 | }
77 | }
78 | }
79 | }
80 | }
81 | if ($.prizeInfoId) {
82 | console.log("");
83 | for (let g = 0; g < 10; g++) {
84 | await exchangePrize($.prizeInfoId);
85 | if ($.getPrize || $.exgStop || $.activityEnd) break;
86 | await $.wait(3000);
87 | }
88 | } else {
89 | console.log("");
90 | console.log("\n没有符合您兑换的红包额度");
91 | }
92 | }
93 | }
94 | function getExchangePrizeList() {
95 | return new Promise(d => {
96 | $.post(taskUrl("getExchangePrizeList", {}), async (f, g, h) => {
97 | try {
98 | f ? (console.log("" + JSON.stringify(f)), console.log($.name + " API请求失败,请检查网路重试")) : safeGet(h) && (h = JSON.parse(h), h.code == "0" ? ($.totalNum = h.data.totalNum, $.cashExpected = h.data.cashExpected || "", $.exchangePrizeList = h.data.exchangePrizeList || [], console.log("目前分值:" + $.totalNum + "," + $.cashExpected), $.totalNum < 20000 && (console.log("\n没有符合您兑换的红包额度"), $.loginkr = true)) : (console.log(h.message), h.message == "用户未登陆" && ($.loginkr = true)));
99 | } catch (m) {
100 | $.logErr(m, g);
101 | } finally {
102 | d(h);
103 | }
104 | });
105 | });
106 | }
107 | function exchangePrize(c) {
108 | return new Promise(e => {
109 | const g = "{\"prizeId\":" + c + "}";
110 | $.post(taskUrl("exchangePrize", g), async (h, i, j) => {
111 | try {
112 | if (h) {
113 | console.log("" + JSON.stringify(h));
114 | console.log($.name + " API请求失败,请检查网路重试");
115 | } else {
116 | if (safeGet(j)) {
117 | j = JSON.parse(j);
118 | if (j.code == "0") {
119 | console.log("兑换成功:" + j.data.prizeName);
120 | $.getPrize = true;
121 | } else {
122 | console.log(j.message);
123 | for (let k of ["不足", "上限", "抢完", "未登陆"]) {
124 | if (j.message.includes(k)) {
125 | $.exgStop = true;
126 | break;
127 | }
128 | }
129 | for (let m of ["已用完"]) {
130 | if (j.message.includes(m)) {
131 | console.log("\n检测到本月已兑换过当前额度,开始轮询~");
132 | $.openList = [5, 4, 3, 2];
133 | for (let n = 0; n < $.openList.length; n++) {
134 | $.prizeInfoIds = $.openList[n];
135 | console.log("");
136 | await $.wait(10000);
137 | await exchangePrize1($.prizeInfoIds);
138 | if ($.getPrize || $.exgStop || $.activityEnd) break;
139 | await $.wait(1000);
140 | }
141 | }
142 | }
143 | }
144 | }
145 | }
146 | } catch (q) {
147 | $.logErr(q, i);
148 | } finally {
149 | e(j);
150 | }
151 | });
152 | });
153 | }
154 | function exchangePrize1(c) {
155 | return new Promise(e => {
156 | const g = "{\"prizeId\":" + c + "}";
157 | $.post(taskUrl("exchangePrize", g), async (h, i, j) => {
158 | try {
159 | if (h) {
160 | console.log("" + JSON.stringify(h));
161 | console.log($.name + " API请求失败,请检查网路重试");
162 | } else {
163 | if (safeGet(j)) {
164 | j = JSON.parse(j);
165 | if (j.code == "0") {
166 | console.log("兑换成功:" + j.data.prizeName);
167 | $.getPrize = true;
168 | } else {
169 | console.log(j.message);
170 | for (let n of ["上限", "抢完", "未登陆"]) {
171 | if (j.message.includes(n)) {
172 | $.exgStop = true;
173 | break;
174 | }
175 | }
176 | }
177 | }
178 | }
179 | } catch (r) {
180 | $.logErr(r, i);
181 | } finally {
182 | e(j);
183 | }
184 | });
185 | });
186 | }
187 | function taskUrl(c, d = {}) {
188 | return {
189 | "url": JD_API_HOST + "?functionId=" + c + "&body=" + d + "&client=wh5&clientVersion=9.1.0",
190 | "headers": {
191 | "Cookie": cookie,
192 | "Host": "api.m.jd.com",
193 | "Connection": "keep-alive",
194 | "Content-Type": "application/json",
195 | "Referer": "http://wq.jd.com/wxapp/pages/hd-interaction/index/index",
196 | "User-Agent": $.isNode() ? process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : require("./USER_AGENTS").USER_AGENT : $.getdata("JDUA") ? $.getdata("JDUA") : "jdapp;iPhone;9.4.4;14.3;network/4g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1",
197 | "Accept-Language": "zh-cn",
198 | "Accept-Encoding": "gzip, deflate, br"
199 | }
200 | };
201 | }
202 | function safeGet(c) {
203 | try {
204 | if (typeof JSON.parse(c) == "object") return true;
205 | } catch (g) {
206 | return console.log(g), console.log("京东服务器访问数据为空,请检查自身设备网络情况"), false;
207 | }
208 | }
209 | function jsonParse(c) {
210 | if (typeof c == "string") try {
211 | return JSON.parse(c);
212 | } catch (g) {
213 | return console.log(g), $.msg($.name, "", "不要在BoxJS手动复制粘贴修改cookie"), [];
214 | }
215 | }
--------------------------------------------------------------------------------
/jd_joyrunred.js:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | 赛跑兑10红包
4 | 1 1 1 1 * jd_joyrunred.js
5 | */
6 |
7 | const Env=require('./utils/Env.js');
8 | const $ = new Env('赛跑兑10红包');
9 | const notify = $.isNode() ? require('./sendNotify') : ''
10 | //Node.js用户请在jdCookie.js处填写京东ck;
11 | const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''
12 | let jdNotify=true;
13 | let cookiesArr=[],cookie='',message='';
14 |
15 | if ($.isNode()) {
16 | Object.keys(jdCookieNode).forEach((item) => {
17 | cookiesArr.push(jdCookieNode[item])
18 | })
19 | if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => { };
20 | } else {
21 | cookiesArr = [$.getdata('CookieJD'), $.getdata('CookieJD2'), ...jsonfomat($.getdata('CookiesJD') || "[]").map(item => item.cookie)].filter(item => !!item);
22 | }
23 |
24 | !(async()=>{
25 | if (!cookiesArr[0]) {
26 | $.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', { "open-url": "https://bean.m.jd.com/bean/signIndex.action" });
27 | return;
28 | }
29 |
30 | for(let i=0;i {
53 | $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '')
54 | })
55 | .finally(() => {
56 | $.done();
57 | })
58 |
59 | async function tx(){
60 | return new Promise(async(resolve)=>{
61 | $.post(getUrl(),async(err,resp,data)=>{
62 | try{
63 | if(err){
64 | console.log(`${JSON.stringify(err)}`)
65 | console.log(` API请求失败,请检查网路重试`)
66 | }else{
67 | console.log(data)
68 | }
69 | }catch(e){
70 | $.logErr(e, resp)
71 | }finally{
72 | resolve(data)
73 | }
74 | })
75 | })
76 | }
77 |
78 | function getUrl(){
79 | return {
80 | url: `https://api.m.jd.com/`,
81 | body: `functionId=runningPrizeDraw&body={"linkId":"L-sOanK_5RJCz7I314FpnQ","type":1,"level":3}&t=1676473011489&appid=activities_platform&client=android&clientVersion=4.8.2&cthr=1&screen=393*873&networkType=wifi&lang=zh_CN&partner=xiaomi&eid=`,
82 | headers: {
83 | 'Host': 'api.m.jd.com',
84 | 'Origin': 'https://h5platform.jd.com',
85 | 'Content-Type': 'application/x-www-form-urlencoded',
86 | 'User-Agent': $.UA,
87 | 'Cookie': cookie
88 | }
89 | }
90 | }
91 |
92 | function TotalBean() {
93 | return new Promise((resolve) => {
94 | const options = {
95 | url: 'https://plogin.m.jd.com/cgi-bin/ml/islogin',
96 | headers: {
97 | "Cookie": cookie,
98 | "referer": "https://h5.m.jd.com/",
99 | "User-Agent": $.UA,
100 | },
101 | timeout: 10000
102 | }
103 | $.get(options, (err, resp, data) => {
104 | try {
105 | if (data) {
106 | data = JSON.parse(data);
107 | if (data.islogin === "1") {
108 | } else if (data.islogin === "0") {
109 | $.isLogin = false;
110 | }
111 | }
112 | } catch (e) {
113 | console.log(e);
114 | }
115 | finally {
116 | resolve();
117 | }
118 | });
119 | });
120 | }
121 |
122 | function showMsg() {
123 | return new Promise(resolve => {
124 | if (!jdNotify) {
125 | $.msg($.name, '', `${message}`);
126 | } else {
127 | $.log(`京东账号${$.index}${$.nickName}\n${message}`);
128 | }
129 | resolve()
130 | })
131 | }
132 |
133 | function safeGet(data) {
134 | try {
135 | if (typeof JSON.parse(data) == "object") {
136 | return true;
137 | }
138 | } catch (e) {
139 | console.log(e);
140 | console.log(`京东服务器访问数据为空,请检查自身设备网络情况`);
141 | return false;
142 | }
143 | }
144 |
145 | function jsonfomat(str) {
146 | if (typeof str == "string") {
147 | try {
148 | return JSON.parse(str);
149 | } catch (e) {
150 | console.log(e);
151 | $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie')
152 | return [];
153 | }
154 | }
155 | }
--------------------------------------------------------------------------------
/jd_kd.js:
--------------------------------------------------------------------------------
1 | /*
2 | 京东快递签到
3 | 活动入口:https://jingcai-h5.jd.com/#/
4 | 签到领豆,14天内满4次和7次享额外奖励,每天运行一次即可
5 | 更新地址:jd_kd.js
6 |
7 | 已支持IOS双京东账号, Node.js支持N个京东账号
8 | 脚本兼容: QuantumultX, Surge, Loon, 小火箭,JSBox, Node.js
9 | ============Quantumultx===============
10 | [task_local]
11 | #京东快递签到
12 | 10 0 * * * jd_kd.js, tag=京东快递签到, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_kd.png, enabled=true
13 |
14 | ================Loon==============
15 | [Script]
16 | cron "10 0 * * *" script-path=jd_kd.js, tag=京东快递签到
17 |
18 | ===============Surge=================
19 | 京东快递签到 = type=cron,cronexp="10 0 * * *",wake-system=1,timeout=3600,script-path=jd_kd.js
20 |
21 | ============小火箭=========
22 | 京东快递签到 = type=cron,script-path=jd_kd.js, cronexpr="10 0 * * *", timeout=3600, enable=true
23 | */
24 | const Env = require('./utils/Env');
25 | const $ = new Env('京东快递签到');
26 |
27 | const notify = $.isNode() ? require('./sendNotify') : '';
28 | //Node.js用户请在jdCookie.js处填写京东ck;
29 | const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
30 | let jdNotify = true;//是否关闭通知,false打开通知推送,true关闭通知推送
31 | const randomCount = $.isNode() ? 20 : 5;
32 | //IOS等用户直接用NobyDa的jd cookie
33 | let cookiesArr = [], cookie = '', message, allMsg = '';
34 | if ($.isNode()) {
35 | Object.keys(jdCookieNode).forEach((item) => {
36 | cookiesArr.push(jdCookieNode[item])
37 | })
38 | if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {};
39 | } else {
40 | cookiesArr = [$.getdata('CookieJD'), $.getdata('CookieJD2'), ...jsonParse($.getdata('CookiesJD') || "[]").map(item => item.cookie)].filter(item => !!item);
41 | }
42 | const JD_API_HOST = 'https://api.m.jd.com/api';
43 | !(async () => {
44 | if (!cookiesArr[0]) {
45 | $.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', {"open-url": "https://bean.m.jd.com/bean/signIndex.action"});
46 | return;
47 | }
48 | for (let i = 0; i < cookiesArr.length; i++) {
49 | if (cookiesArr[i]) {
50 | cookie = cookiesArr[i];
51 | $.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1])
52 | $.index = i + 1;
53 | $.isLogin = true;
54 | $.nickName = '';
55 | message = '';
56 | //await TotalBean();
57 | console.log(`\n******开始【京东账号${$.index}】${$.nickName || $.UserName}*********\n`);
58 | if (!$.isLogin) {
59 | $.msg($.name, `【提示】cookie已失效`, `京东账号${$.index} ${$.nickName || $.UserName}\n请重新登录获取\nhttps://bean.m.jd.com/bean/signIndex.action`, {"open-url": "https://bean.m.jd.com/bean/signIndex.action"});
60 |
61 | if ($.isNode()) {
62 | await notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`);
63 | }
64 | continue
65 | }
66 | await userSignIn();
67 | // await showMsg();
68 | }
69 | }
70 | if (allMsg) {
71 | $.msg($.name, '', allMsg);
72 | }
73 | })()
74 | .catch((e) => {
75 | $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '')
76 | })
77 | .finally(() => {
78 | $.done();
79 | })
80 |
81 | function showMsg() {
82 | return new Promise(resolve => {
83 | $.msg($.name, '', `【京东账号${$.index}】${$.nickName}\n${message}`);
84 | resolve()
85 | })
86 | }
87 | function userSignIn() {
88 | return new Promise(resolve => {
89 | $.post(taskUrl(), (err, resp, data) => {
90 | try {
91 | if (err) {
92 | console.log(`${JSON.stringify(err)}`)
93 | console.log(resp)
94 | console.log(`${$.name} API请求失败,请检查网路重试`)
95 | } else {
96 | if (safeGet(data)) {
97 | data = JSON.parse(data);
98 | if (data.code === 1) {
99 | console.log(`今日签到成功,获得${data.content[0].title}`)
100 | message += `京东账号${$.index}${$.nickName}\n今日签到成功,获得${data.content[0].title} 🐶\n`;
101 | allMsg += message;
102 | } else if (data.code === -1) {
103 | console.log(`今日已签到`)
104 | // message += `【签到】失败,今日已签到`;
105 | } else {
106 | console.log(`异常:${JSON.stringify(data)}`)
107 | }
108 | }
109 | }
110 | } catch (e) {
111 | $.logErr(e, resp)
112 | } finally {
113 | resolve();
114 | }
115 | })
116 | })
117 | }
118 | function taskUrl() {
119 | let t = +new Date()
120 | return {
121 | url: `https://lop-proxy.jd.com/jiFenApi/signInAndGetReward`,
122 | body: '[{"userNo":"$cooMrdGatewayUid$"}]',
123 | headers: {
124 | 'uuid': `${t}${t * 2}`,
125 | 'Host': 'lop-proxy.jd.com',
126 | 'lop-dn': 'jingcai.jd.com',
127 | 'biz-type': 'service-monitor',
128 | 'app-key': 'jexpress',
129 | 'access': 'H5',
130 | 'content-type': 'application/json;charset=utf-8',
131 | 'accept-encoding': 'gzip, deflate, br',
132 | 'clientinfo': '{"appName":"jingcai","client":"m"}',
133 | 'accept': 'application/json, text/plain, */*',
134 | 'jexpress-report-time': t,
135 | 'x-requested-with': 'XMLHttpRequest',
136 | 'source-client': '2',
137 | 'appparams': '{"appid":158,"ticket_type":"m"}',
138 | 'version': '1.0.0',
139 | 'origin': 'https://jingcai-h5.jd.com',
140 | 'sec-fetch-site': 'same-site',
141 | 'sec-fetch-mode': 'cors',
142 | 'sec-fetch-dest': 'empty',
143 | 'referer': 'https://jingcai-h5.jd.com/',
144 | 'accept-language': 'zh-CN,zh-Hans;q=0.9',
145 | "Cookie": cookie,
146 | 'app-key': 'jexpress',
147 | "User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.4.4;14.3;network/4g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1"),
148 | }
149 | }
150 | }
151 | function TotalBean() {
152 | return new Promise(async resolve => {
153 | const options = {
154 | "url": `https://wq.jd.com/user/info/QueryJDUserInfo?sceneval=2`,
155 | "headers": {
156 | "Accept": "application/json,text/plain, */*",
157 | "Content-Type": "application/x-www-form-urlencoded",
158 | "Accept-Encoding": "gzip, deflate, br",
159 | "Accept-Language": "zh-cn",
160 | "Connection": "keep-alive",
161 | "Cookie": cookie,
162 | "Referer": "https://wqs.jd.com/my/jingdou/my.shtml?sceneval=2",
163 | "User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.4.4;14.3;network/4g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1")
164 | }
165 | }
166 | $.post(options, (err, resp, data) => {
167 | try {
168 | if (err) {
169 | console.log(`${JSON.stringify(err)}`)
170 | console.log(`${$.name} API请求失败,请检查网路重试`)
171 | } else {
172 | if (data) {
173 | data = JSON.parse(data);
174 | if (data['retcode'] === 13) {
175 | $.isLogin = false; //cookie过期
176 | return
177 | }
178 | if (data['retcode'] === 0) {
179 | $.nickName = (data['base'] && data['base'].nickname) || $.UserName;
180 | } else {
181 | $.nickName = $.UserName
182 | }
183 | } else {
184 | console.log(`京东服务器返回空数据`)
185 | }
186 | }
187 | } catch (e) {
188 | $.logErr(e, resp)
189 | } finally {
190 | resolve();
191 | }
192 | })
193 | })
194 | }
195 | function safeGet(data) {
196 | try {
197 | if (typeof JSON.parse(data) == "object") {
198 | return true;
199 | }
200 | } catch (e) {
201 | console.log(e);
202 | console.log(`京东服务器访问数据为空,请检查自身设备网络情况`);
203 | return false;
204 | }
205 | }
206 | function jsonParse(str) {
207 | if (typeof str == "string") {
208 | try {
209 | return JSON.parse(str);
210 | } catch (e) {
211 | console.log(e);
212 | $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie')
213 | return [];
214 | }
215 | }
216 | }
--------------------------------------------------------------------------------
/jd_krsign.js:
--------------------------------------------------------------------------------
1 | /*
2 | 小豆签到
3 |
4 | cron: 35 9 * * * jd_krsign.js
5 |
6 | */
7 |
8 | const Env=require('./utils/Env.js');
9 | const $ = new Env('小豆签到')
10 | const ilIi1ill = require("./jdCookie"),
11 | li1ll = require("./function/sendJDNotify"),
12 | IiIil111 = require("./function/jdCommon"),
13 | i1IIli1l = false;
14 | let iIIlil1I = "";
15 | const iI1liIli = Object.keys(ilIi1ill).map(IIiIliiI => ilIi1ill[IIiIliiI]).filter(II1il1Il => II1il1Il);
16 | !iI1liIli[0] && ($.msg($.name, "【提示】请先获取Cookie"), process.exit(1));
17 | !(async () => {
18 | li1ll.config({
19 | "title": $.name
20 | });
21 | for (let ilI1il11 = 0; ilI1il11 < iI1liIli.length; ilI1il11++) {
22 | $.index = ilI1il11 + 1;
23 | iIIlil1I = iI1liIli[ilI1il11];
24 | IiIil111.setCookie(iIIlil1I);
25 | $.UserName = decodeURIComponent(IiIil111.getCookieValue(iIIlil1I, "pt_pin"));
26 | $.UA = IiIil111.genUA($.UserName);
27 | $.message = li1ll.create($.index, $.UserName);
28 | $.nickName = "";
29 | console.log("\n******开始【京东账号" + $.index + "】" + ($.nickName || $.UserName) + "******\n");
30 | await liIiI111();
31 | IiIil111.unsetCookie();
32 | if ($.runEnd) break;
33 | await $.wait(1000);
34 | }
35 | i1IIli1l && li1ll.getMessage() && (li1ll.updateContent(li1ll.content + ("\n【店铺地址】https://shop.m.jd.com/?shopId=" + $.shopId + "&venderId=" + $.venderId)), await li1ll.push());
36 | })().catch(II1iIiIl => $.logErr(II1iIiIl)).finally(() => $.done());
37 | async function liIiI111() {
38 | const Ii1l1lli = await IiIil111.getLoginStatus(iIIlil1I);
39 | if (!Ii1l1lli && typeof Ii1l1lli !== undefined) {
40 | console.log("账号无效");
41 | return;
42 | }
43 | try {
44 | await llI1iIi("main");
45 | } catch (ii1l1lIi) {
46 | console.log(ii1l1lIi.message);
47 | }
48 | }
49 | async function l1ili1ll(liIlli11, lIII111I) {
50 | try {
51 | switch (liIlli11) {
52 | case "main":
53 | if (lIII111I.success === true && lIII111I?.["data"]?.["signResultDTO"]) {
54 | const l1iilIiI = lIII111I?.["data"]?.["signResultDTO"];
55 | l1iilIiI?.["signStatus"] ? console.log("签到成功" + (l1iilIiI?.["rewardMsg"] ? "," + l1iilIiI?.["rewardMsg"] : "")) : l1iilIiI?.["msg"] === "任务已完成" ? (console.log("今日已签"), $.message.fix("今日已签")) : (console.log("签到失败," + l1iilIiI?.["msg"]), $.message.fix("签到失败," + l1iilIiI?.["msg"]));
56 | } else lIII111I.msg ? (console.log(lIII111I.msg), $.message.fix(lIII111I.msg)) : console.log("❓" + liIlli11 + " " + JSON.stringify(lIII111I));
57 | break;
58 | }
59 | } catch (lIiii1I1) {
60 | console.log("❌ 未能正确处理 " + liIlli11 + " 请求响应 " + (lIiii1I1.message || lIiii1I1));
61 | }
62 | }
63 | async function llI1iIi(IlIIi1l1) {
64 | if ($.runEnd || $.outFlag) return;
65 | let li1llllI = "",
66 | iIIIiill = {},
67 | I1il1i1i = "POST";
68 | switch (IlIIi1l1) {
69 | case "main":
70 | iIIIiill = "appid=laputa&functionId=jdh_laputa_handleSoaRequest&body=" + encodeURIComponent(JSON.stringify({
71 | "methodName": "handleBeanInfo2595",
72 | "functionId": "sign",
73 | "osName": "feedProduct",
74 | "appId": "807635028594484682708c54f69b1217",
75 | "version": "1",
76 | "deviceNo": "a73dece2-61b4-435b-9f0e-10bf337279f1",
77 | "handleType": "sign",
78 | "encryptProjectId": "3vRVP84ukngNhNYVDQTXuQQzJjit",
79 | "encryptAssignmentIds": ["3LbDQhTDsr5n7wL4XPyubMvEuUR3"],
80 | "deviceType": 1,
81 | "lng": 115.491643,
82 | "lat": 38.897564,
83 | "itemId": "1"
84 | })), li1llllI = "https://api.m.jd.com/api";
85 | break;
86 | default:
87 | console.log("❌ 未知请求 " + IlIIi1l1);
88 | return;
89 | }
90 | const IlliI1Ii = {
91 | "url": li1llllI,
92 | "headers": {
93 | "Accept": "application/json, text/plain, */*",
94 | "Accept-Encoding": "gzip, deflate, br",
95 | "Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7,en-GB;q=0.6",
96 | "Connection": "keep-alive",
97 | "Content-Type": "application/x-www-form-urlencoded",
98 | "Cookie": iIIlil1I,
99 | "Host": "api.m.jd.com",
100 | "Referer": "https://pro.m.jd.com/mall/active/2KMRByvMg6Z2nwDmQ1StFTtKJc81/index.html",
101 | "Origin": "https://pro.m.jd.com",
102 | "Sec-Fetch-Dest": "empty",
103 | "Sec-Fetch-Mode": "cors",
104 | "Sec-Fetch-Site": "same-origin",
105 | "User-Agent": $.UA
106 | },
107 | "body": iIIIiill,
108 | "timeout": 30000
109 | };
110 | if ($.token) {
111 | IlliI1Ii.headers.token = $.token;
112 | }
113 | if (I1il1i1i === "GET") {
114 | delete IlliI1Ii.body;
115 | delete IlliI1Ii.headers["Content-Type"];
116 | }
117 | const Ii1I1Ill = 5;
118 | let iIlllli1 = 0,
119 | liiil1ii = null,
120 | lli1111l = false;
121 | while (iIlllli1 < Ii1I1Ill) {
122 | iIlllli1 > 0 && (await $.wait(1000));
123 | const {
124 | err: il1111il,
125 | res: illIIIll,
126 | data: l1Il1IiI
127 | } = await l1liiIII(IlliI1Ii, I1il1i1i);
128 | if (il1111il) {
129 | if (typeof il1111il === "string" && il1111il.includes("Timeout awaiting 'request'")) liiil1ii = IlIIi1l1 + " 请求超时,请检查网络重试";else {
130 | const l1lIli1l = illIIIll?.["statusCode"];
131 | if (l1lIli1l) {
132 | if ([403, 493].includes(l1lIli1l)) liiil1ii = IlIIi1l1 + " 请求失败,IP被限制(Response code " + l1lIli1l + ")", lli1111l = true;else [400, 404].includes(l1lIli1l) ? liiil1ii = IlIIi1l1 + " 请求配置参数错误,请联系开发者进行反馈(Response code " + l1lIli1l + ")" : liiil1ii = IlIIi1l1 + " 请求失败(Response code " + l1lIli1l + ")";
133 | } else liiil1ii = IlIIi1l1 + " 请求失败 => " + (il1111il.message || il1111il);
134 | }
135 | iIlllli1++;
136 | } else {
137 | const IllIi1I = IiIil111.getResponseCookie(illIIIll),
138 | IIII11il = false;
139 | IIII11il && (console.log("\n---------------------------------------------------\n"), console.log("🔧 " + IlIIi1l1 + " 响应Body => " + (l1Il1IiI || "无") + "\n"), console.log("🔧 " + IlIIi1l1 + " 响应Cookie => " + (IllIi1I || "无") + "\n"), console.log("🔧 " + IlIIi1l1 + " 请求参数"), console.log(IlliI1Ii), console.log("\n---------------------------------------------------\n"));
140 | try {
141 | const l1ll111l = JSON.parse(l1Il1IiI);
142 | l1ili1ll(IlIIi1l1, l1ll111l);
143 | break;
144 | } catch (ll1l11l) {
145 | liiil1ii = "❌ " + IlIIi1l1 + " 接口响应数据解析失败: " + ll1l11l.message;
146 | console.log("🚫 " + IlIIi1l1 + " => " + String(l1Il1IiI || "无响应数据"));
147 | IIII11il && (console.log("\n---------------------------------------------------\n"), console.log(activityCookie), console.log("\n---------------------------------------------------\n"));
148 | iIlllli1++;
149 | }
150 | lli1111l = false;
151 | }
152 | }
153 | iIlllli1 >= Ii1I1Ill && (console.log(liiil1ii), lli1111l && ($.outFlag = true, $.message && $.message.fix(liiil1ii)));
154 | }
155 | async function l1liiIII(lill11iI, IlillI1i = "POST") {
156 | if (IlillI1i === "POST") {
157 | return new Promise(async ll1i1Ill => {
158 | $.post(lill11iI, (Iilii11l, ii11iIl1, ilii1Iii) => {
159 | ll1i1Ill({
160 | "err": Iilii11l,
161 | "res": ii11iIl1,
162 | "data": ilii1Iii
163 | });
164 | });
165 | });
166 | } else {
167 | if (IlillI1i === "GET") return new Promise(async l11II1l => {
168 | $.get(lill11iI, (liII11l1, Ii1lIi1i, Il1I11il) => {
169 | l11II1l({
170 | "err": liII11l1,
171 | "res": Ii1lIi1i,
172 | "data": Il1I11il
173 | });
174 | });
175 | });else {
176 | const Iiil11il = "不支持的请求方法";
177 | return {
178 | "err": Iiil11il,
179 | "res": null,
180 | "data": null
181 | };
182 | }
183 | }
184 | }
--------------------------------------------------------------------------------
/jd_seckillViewTask.js:
--------------------------------------------------------------------------------
1 | /*
2 | 39 5 * * * jd_seckillViewTask.js
3 | */
4 | const Env=require('./utils/Env.js');
5 | const $ = new Env('秒杀浏览商品领豆');
6 | var version_ = "jsjiami.com.v7";
7 | const ii1iiI = $.isNode() ? require("./sendNotify") : "",
8 | lllilI = $.isNode() ? require("./jdCookie.js") : "",
9 | ilil11 = require("./function/jdCommon");
10 | let IIIl11 = [],
11 | I1lIi1 = "";
12 | if ($.isNode()) {
13 | Object.keys(lllilI).forEach(lillIl => {
14 | IIIl11.push(lllilI[lillIl]);
15 | });
16 | if (process.env.JD_DEBUG && process.env.JD_DEBUG === "false") {
17 | console.log = () => {};
18 | }
19 | } else {
20 | IIIl11 = [$.getdata("CookieJD"), $.getdata("CookieJD2"), ...iil1li($.getdata("CookiesJD") || "[]").map(iIiIl => iIiIl.cookie)].filter(iiilii => !!iiilii);
21 | }
22 | !(async () => {
23 | if (!IIIl11[0]) {
24 | $.msg($.name, "【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取", "https://bean.m.jd.com/bean/signIndex.action", {
25 | "open-url": "https://bean.m.jd.com/bean/signIndex.action"
26 | });
27 | return;
28 | }
29 | $.UA = ilil11.genUA($.UserName);
30 | await lil11I();
31 | for (let illIii = 0; illIii < IIIl11.length; illIii++) {
32 | if (IIIl11[illIii]) {
33 | I1lIi1 = IIIl11[illIii];
34 | $.UserName = decodeURIComponent(I1lIi1.match(/pt_pin=([^; ]+)(?=;?)/) && I1lIi1.match(/pt_pin=([^; ]+)(?=;?)/)[1]);
35 | $.index = illIii + 1;
36 | $.isLogin = true;
37 | $.nickName = "";
38 | $.UA = ilil11.genUA($.UserName);
39 | console.log("\n******开始【京东账号" + $.index + "】" + ($.nickName || $.UserName) + "*********\n");
40 | if (!$.isLogin) {
41 | $.msg($.name, "【提示】cookie已失效", "京东账号" + $.index + " " + ($.nickName || $.UserName) + "\n请重新登录获取\nhttps://bean.m.jd.com/bean/signIndex.action", {
42 | "open-url": "https://bean.m.jd.com/bean/signIndex.action"
43 | });
44 | $.isNode() && (await ii1iiI.sendNotify($.name + "cookie已失效 - " + $.UserName, "京东账号" + $.index + " " + $.UserName + "\n请重新登录获取cookie"));
45 | continue;
46 | }
47 | let ii1il1 = await Iliii1("{\"taskType\": 0 }");
48 | if (ii1il1.data?.["taskThreshold"] && !ii1il1.data?.["awardStatus"]) {
49 | $.log("开始浏览商品...");
50 | let lI1llI = iiilil($.skulist, ii1il1.data.taskThreshold - ii1il1.data.taskProgress);
51 | for (let illIil of lI1llI) {
52 | console.log("浏览 " + illIil);
53 | ii1il1 = await Iliii1("{ \"skuId\": \"" + illIil + "\", \"taskType\": 1 }");
54 | await $.wait(2000);
55 | }
56 | ii1il1 = await Iliii1("{\"taskType\": 2 }");
57 | ii1il1.data?.["awardStatus"] ? console.log("浏览完成,获得 " + ii1il1.data.beanNum + "豆") : console.log(JSON.stringify(ii1il1));
58 | } else {
59 | $.log("今日已完成浏览!!!");
60 | }
61 | await $.wait(3000);
62 | }
63 | }
64 | })().catch(lllI1I => {
65 | $.log("", "❌ " + $.name + ", 失败! 原因: " + lllI1I + "!", "");
66 | }).finally(() => {
67 | $.done();
68 | });
69 | async function lil11I() {
70 | let IlIlii = {
71 | url: "https://pro.m.jd.com/mall/active/Md9FMi1pJXg2q7qc8CmE9FNYDS4/index.html",
72 | headers: {
73 | "User-Agent": $.UA
74 | }
75 | };
76 | return new Promise(async l1iIII => {
77 | $.get(IlIlii, async (llI1I1, IlIlil, lIli1I) => {
78 | try {
79 | llI1I1 ? (console.log("" + JSON.stringify(llI1I1)), console.log(" API请求失败,请检查网路重试")) : (lIli1I = lIli1I.match(/\"skuId\":\"(\d+)\"/g), $.skulist = [...new Set(lIli1I.map(II1il => II1il.match(/\d+/)[0]))]);
80 | } catch (lllI11) {
81 | $.logErr(lllI11, IlIlil);
82 | } finally {
83 | l1iIII(lIli1I);
84 | }
85 | });
86 | });
87 | }
88 | async function Iliii1(II1ii) {
89 | let lillII = {
90 | url: "https://api.m.jd.com/client.action",
91 | body: "appid=signed_wh5_ihub&client=android&networkType=wifi&openudid=&uuid=&eu=&fv=&d_model=&body=" + II1ii + "&functionId=seckillViewTask&t=" + Date.now(),
92 | headers: {
93 | Host: "api.m.jd.com",
94 | Origin: "https://pro.m.jd.com",
95 | Referer: "https://pro.m.jd.com/mall/active/Md9FMi1pJXg2q7qc8CmE9FNYDS4/index.html",
96 | "Content-Type": "application/x-www-form-urlencoded",
97 | "User-Agent": $.UA,
98 | Cookie: I1lIi1
99 | }
100 | };
101 | return new Promise(async i11ii1 => {
102 | $.post(lillII, async (llI1II, lIli1l, lillIi) => {
103 | try {
104 | llI1II ? (console.log("" + JSON.stringify(llI1II)), console.log(" API请求失败,请检查网路重试")) : lillIi = JSON.parse(lillIi);
105 | } catch (ii1ili) {
106 | $.logErr(ii1ili, lIli1l);
107 | } finally {
108 | i11ii1(lillIi);
109 | }
110 | });
111 | });
112 | }
113 | function iIiIi() {
114 | return new Promise(i1i11I => {
115 | const iii1ii = {
116 | url: "https://plogin.m.jd.com/cgi-bin/ml/islogin",
117 | headers: {
118 | Cookie: I1lIi1,
119 | referer: "https://h5.m.jd.com/",
120 | "User-Agent": $.UA
121 | },
122 | timeout: 10000
123 | };
124 | $.get(iii1ii, (lilIIl, ililIl, liiI1l) => {
125 | try {
126 | if (liiI1l) {
127 | liiI1l = JSON.parse(liiI1l);
128 | if (!(liiI1l.islogin === "1")) {
129 | liiI1l.islogin === "0" && ($.isLogin = false);
130 | }
131 | }
132 | } catch (i1ill) {
133 | console.log(i1ill);
134 | } finally {
135 | i1i11I();
136 | }
137 | });
138 | });
139 | }
140 | function iil1ll(i1l1Il) {
141 | for (let iilli = i1l1Il.length - 1; iilli > 0; iilli--) {
142 | const IlllIl = Math.floor(Math.random() * (iilli + 1));
143 | [i1l1Il[iilli], i1l1Il[IlllIl]] = [i1l1Il[IlllIl], i1l1Il[iilli]];
144 | }
145 | return i1l1Il;
146 | }
147 | function iiilil(II11lI, lI1IIi) {
148 | const Ilil1l = iil1ll(II11lI),
149 | iIIiii = [];
150 | for (let I1iIIi = 0; I1iIIi < Ilil1l.length; I1iIIi++) {
151 | if (iIIiii.length === lI1IIi) {
152 | break;
153 | }
154 | const I1iIIl = Ilil1l[I1iIIi];
155 | if (!iIIiii.includes(I1iIIl)) {
156 | iIIiii.push(I1iIIl);
157 | }
158 | }
159 | return iIIiii;
160 | }
161 | function iil1li(iii1lI) {
162 | if (typeof iii1lI == "string") {
163 | try {
164 | return JSON.parse(iii1lI);
165 | } catch (Iiilii) {
166 | console.log(Iiilii);
167 | $.msg($.name, "", "请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie");
168 | return [];
169 | }
170 | }
171 | }
172 | var version_ = "jsjiami.com.v7";
--------------------------------------------------------------------------------
/jd_shopDraw.js:
--------------------------------------------------------------------------------
1 | /*
2 | 店铺左侧刮刮乐
3 |
4 | 店铺抽奖 左侧
5 |
6 | 也可点击顶部【精选】后面的【活动】选项,找到抽奖活动
7 |
8 | 必须有venderId= 参数
9 | //export jd_shopDraw_venderId="" //店铺ID,多个 @ 链接或者 | 链接 或者 & 链接
10 |
11 | cron:1 1 1 1 *
12 | ============Quantumultx===============
13 | [task_local]
14 | #店铺左侧刮刮乐
15 | 1 1 1 1 * jd_shopDraw.js, tag=店铺刮刮乐, enabled=true
16 | */
17 |
18 | const Env=require('./utils/Env.js');
19 | const $ = new Env('店铺左侧刮刮乐');
20 | const _0x276998 = $.isNode() ? require("./sendNotify") : "",
21 | _0x47f881 = $.isNode() ? require("./jdCookie.js") : "",
22 | _0x40e627 = require("./function/krgetSign");
23 | let _0x520315 = [],
24 | _0x56f896 = "";
25 | if ($.isNode()) {
26 | Object.keys(_0x47f881).forEach(_0x518c4a => {
27 | _0x520315.push(_0x47f881[_0x518c4a]);
28 | });
29 | if (process.env.JD_DEBUG && process.env.JD_DEBUG === "false") console.log = () => {};
30 | } else _0x520315 = [$.getdata("CookieJD"), $.getdata("CookieJD2"), ..._0x305f6d($.getdata("CookiesJD") || "[]").map(_0x533ff1 => _0x533ff1.cookie)].filter(_0x2a2e7c => !!_0x2a2e7c);
31 | let _0x53f6c6 = [];
32 | if (process.env.jd_shopDraw_venderId) {
33 | if (process.env.jd_shopDraw_venderId.includes("|")) _0x53f6c6 = [...process.env.jd_shopDraw_venderId.split("|"), ..._0x53f6c6];else process.env.jd_shopDraw_venderId.includes("@") ? _0x53f6c6 = [...process.env.jd_shopDraw_venderId.split("@"), ..._0x53f6c6] : _0x53f6c6 = [...process.env.jd_shopDraw_venderId.split("&"), ..._0x53f6c6];
34 | }
35 | const _0x27d64d = process.env.JD_SIGN_KRAPI || "";
36 | let _0x2a79c5 = "";
37 | const _0x40a731 = "https://api.m.jd.com/client.action";
38 | !(async () => {
39 | if (_0x53f6c6.length <= 0) {
40 | $.log("活动id不存在");
41 | return;
42 | }
43 | if (!_0x520315[0]) {
44 | $.msg($.name, "【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取", "https://bean.m.jd.com/bean/signIndex.action", {
45 | "open-url": "https://bean.m.jd.com/bean/signIndex.action"
46 | });
47 | return;
48 | }
49 | console.log("活动ID:" + _0x53f6c6);
50 | for (let _0x1ca1f8 = 0; _0x1ca1f8 < _0x520315.length; _0x1ca1f8++) {
51 | if (_0x520315[_0x1ca1f8]) {
52 | _0x56f896 = _0x520315[_0x1ca1f8];
53 | $.UserName = decodeURIComponent(_0x56f896.match(/pt_pin=([^; ]+)(?=;?)/) && _0x56f896.match(/pt_pin=([^; ]+)(?=;?)/)[1]);
54 | $.index = _0x1ca1f8 + 1;
55 | $.isLogin = true;
56 | $.nickName = "";
57 | message = "";
58 | console.log("\n【京东账号" + $.index + "】" + ($.nickName || $.UserName) + "\n");
59 | if (!$.isLogin) {
60 | $.msg($.name, "【提示】cookie已失效", "京东账号" + $.index + " " + ($.nickName || $.UserName) + "\n请重新登录获取\nhttps://bean.m.jd.com/bean/signIndex.action", {
61 | "open-url": "https://bean.m.jd.com/bean/signIndex.action"
62 | });
63 | $.isNode() && (await _0x276998.sendNotify($.name + "cookie已失效 - " + $.UserName, "京东账号" + $.index + " " + $.UserName + "\n请重新登录获取cookie"));
64 | continue;
65 | }
66 | await _0x3891f7();
67 | }
68 | }
69 | if (_0x2a79c5) {
70 | if ($.isNode()) await _0x276998.sendNotify("" + $.name, "" + _0x2a79c5);
71 | $.msg($.name, "", _0x2a79c5);
72 | }
73 | })().catch(_0x5a78f4 => {
74 | $.log("", "❌ " + $.name + ", 失败! 原因: " + _0x5a78f4 + "!", "");
75 | }).finally(() => {
76 | $.done();
77 | });
78 | async function _0x3891f7() {
79 | for (let _0xdebd26 = 0; _0xdebd26 < _0x53f6c6.length; _0xdebd26++) {
80 | console.log("开始第" + (_0xdebd26 + 1) + "个店铺抽奖:" + _0x53f6c6[_0xdebd26]);
81 | $.venderId = _0x53f6c6[_0xdebd26];
82 | await _0x760b02();
83 | await $.wait(500);
84 | $.index == 1 && (await _0x28fac4());
85 | await $.wait(500);
86 | $.isSign != 2 ? await _0xf70f80() : console.log("已经参与过活动~\n");
87 | }
88 | }
89 | async function _0x760b02() {
90 | sign = await _0x40e627("getSignInfo", {
91 | "vendorId": $.venderId
92 | });
93 | _0x27d64d ? $.signStr = sign?.["data"]?.["convertUrl"] || "" : $.signStr = sign?.["body"] || "";
94 | if (!$.signStr) {
95 | console.log("接口获取失败,跳过");
96 | }
97 | let _0x2c2e65 = {
98 | "url": _0x40a731 + "?functionId=getSignInfo",
99 | "headers": {
100 | "Host": "api.m.jd.com",
101 | "Content-Type": "application/x-www-form-urlencoded",
102 | "Accept": "*/*",
103 | "Connection": "keep-alive",
104 | "Cookie": _0x56f896,
105 | "User-Agent": "JD4iPhone/167650 (iPhone; iOS 13.7; Scale/3.00)",
106 | "Accept-Language": "zh-Hans-CN;q=1",
107 | "Accept-Encoding": "gzip, deflate, br"
108 | },
109 | "body": "" + $.signStr
110 | };
111 | return new Promise(_0x31660c => {
112 | $.post(_0x2c2e65, (_0x265e17, _0x19d022, _0x15de19) => {
113 | try {
114 | _0x265e17 ? $.log(_0x265e17) : (_0x15de19 = JSON.parse(_0x15de19), typeof _0x15de19 == "object" ? _0x15de19.code == 0 && ($.isSign = _0x15de19.result.signInfo.isSign) : console.log("京东返回了空数据"));
115 | } catch (_0x5a79d4) {
116 | $.log(_0x5a79d4);
117 | } finally {
118 | _0x31660c();
119 | }
120 | });
121 | });
122 | }
123 | async function _0x28fac4() {
124 | sign = await _0x40e627("signActivityRule", {
125 | "vendorId": $.venderId
126 | });
127 | _0x27d64d ? $.signStr = sign?.["data"]?.["convertUrl"] || "" : $.signStr = sign?.["body"] || "";
128 | !$.signStr && console.log("接口获取失败,跳过");
129 | let _0x23a1d5 = {
130 | "url": _0x40a731 + "?functionId=signActivityRule",
131 | "headers": {
132 | "Host": "api.m.jd.com",
133 | "Content-Type": "application/x-www-form-urlencoded",
134 | "Accept": "*/*",
135 | "Connection": "keep-alive",
136 | "Cookie": _0x56f896,
137 | "User-Agent": "JD4iPhone/167650 (iPhone; iOS 13.7; Scale/3.00)",
138 | "Accept-Language": "zh-Hans-CN;q=1",
139 | "Accept-Encoding": "gzip, deflate, br"
140 | },
141 | "body": "" + $.signStr
142 | };
143 | return new Promise(_0x316155 => {
144 | $.post(_0x23a1d5, (_0x4bff80, _0x3d7e78, _0x31eb8e) => {
145 | try {
146 | _0x4bff80 ? $.log(_0x4bff80) : (_0x31eb8e = JSON.parse(_0x31eb8e), typeof _0x31eb8e == "object" ? _0x31eb8e.code == 0 && console.log("活动奖品:" + _0x31eb8e.result.awardDescription + "\n") : $.log("京东返回了空数据"));
147 | } catch (_0x538fa7) {
148 | $.log(_0x538fa7);
149 | } finally {
150 | _0x316155();
151 | }
152 | });
153 | });
154 | }
155 | async function _0xf70f80() {
156 | sign = await _0x40e627("sign", {
157 | "vendorId": $.venderId,
158 | "sourceRpc": "shop_app_sign_home"
159 | });
160 | if (_0x27d64d) $.signStr = sign?.["data"]?.["convertUrl"] || "";else {
161 | $.signStr = sign?.["body"] || "";
162 | }
163 | !$.signStr && console.log("接口获取失败,跳过");
164 | let _0x6dc66d = {
165 | "url": _0x40a731 + "?functionId=sign",
166 | "headers": {
167 | "Host": "api.m.jd.com",
168 | "Content-Type": "application/x-www-form-urlencoded",
169 | "Accept": "*/*",
170 | "Connection": "keep-alive",
171 | "Cookie": _0x56f896,
172 | "User-Agent": "JD4iPhone/167650 (iPhone; iOS 13.7; Scale/3.00)",
173 | "Accept-Language": "zh-Hans-CN;q=1",
174 | "Accept-Encoding": "gzip, deflate, br"
175 | },
176 | "body": "" + $.signStr
177 | };
178 | return new Promise(_0x4a0e9d => {
179 | $.post(_0x6dc66d, (_0x1e7457, _0x6e4414, _0x1394a4) => {
180 | try {
181 | if (_0x1e7457) $.log(_0x1e7457);else {
182 | _0x1394a4 = JSON.parse(_0x1394a4);
183 | if (typeof _0x1394a4 == "object") _0x1394a4.code == 0 ? _0x1394a4.result.isWin ? ($.Prize = _0x1394a4.result.signReward.name || "", console.log("抽奖结果:" + $.Prize + " 🐶\n")) : console.log("抽奖结果:💨 空气\n") : console.log("账号未登录\n");else {
184 | console.log("京东返回了空数据");
185 | }
186 | }
187 | } catch (_0x1c7393) {
188 | $.log(_0x1c7393);
189 | } finally {
190 | _0x4a0e9d();
191 | }
192 | });
193 | });
194 | }
195 | function _0x305f6d(_0x324481) {
196 | if (typeof _0x324481 == "string") try {
197 | return JSON.parse(_0x324481);
198 | } catch (_0x23d105) {
199 | return console.log(_0x23d105), $.msg($.name, "", "请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie"), [];
200 | }
201 | }
202 | function _0x21e61a(_0x33a50d, _0x1c585d) {
203 | let _0x4d3bd6 = new RegExp("(^|[&?])" + _0x1c585d + "=([^&]*)(&|$)"),
204 | _0x127065 = _0x33a50d.match(_0x4d3bd6);
205 | if (_0x127065 != null) {
206 | return unescape(_0x127065[2]);
207 | }
208 | return "";
209 | }
--------------------------------------------------------------------------------
/jd_signbeanact.js:
--------------------------------------------------------------------------------
1 | /*
2 | APP首页-领京豆
3 | 金融双签领取
4 | 21 3 * * * jd_signbeanact.js
5 | */
6 |
7 |
8 | const Env=require('./utils/Env.js');
9 | const $ = new Env('领京豆签到');
10 | const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
11 | let cookiesArr = [];
12 | if ($.isNode()) {
13 | Object.keys(jdCookieNode).forEach((item) => {
14 | cookiesArr.push(jdCookieNode[item])
15 | })
16 | if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => { };
17 | } else {
18 | cookiesArr = [$.getdata('CookieJD'), $.getdata('CookieJD2'), ...jsonformat($.getdata('CookiesJD') || "[]").map(item => item.cookie)].filter(item => !!item);
19 | }
20 | const ua = require('./USER_AGENTS');
21 | const jdVersion = '10.1.2'
22 |
23 |
24 | !(async () => {
25 | if (!cookiesArr[0]) {
26 | $.msg('【京东账号一】宠汪汪积分兑换奖品失败', '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', { "open-url": "https://bean.m.jd.com/bean/signIndex.action" });
27 | return
28 | }
29 |
30 | for (let i = 0; i < cookiesArr.length; i++) {
31 | if (cookiesArr[i]) {
32 | $.cookie = cookiesArr[i] + '';
33 | $.UserName = decodeURIComponent($.cookie.match(/pt_pin=([^; ]+)(?=;?)/) && $.cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1])
34 | $.index = i + 1;
35 | $.bean = 0
36 | iphoneVersion = [Math.ceil(Math.random() * 2 + 12), Math.ceil(Math.random() * 4)]
37 | UA = `jdapp;iPhone;${jdVersion};${Math.ceil(Math.random() * 2 + 12)}.${Math.ceil(Math.random() * 4)};${randomString(40)};network/wifi;model/iPhone12,1;addressid/0;appBuild/167802;jdSupportDarkMode/0;Mozilla/5.0 (iPhone; CPU iPhone OS ${iphoneVersion[0]}_${iphoneVersion[1]} like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1`
38 | UUID = randomString(40);
39 | UA =ua.UARAM();
40 | console.log(`\n*****开始【京东账号${$.index}】${$.UserName}****\n`);
41 | await run();
42 | await $.wait(5000);
43 | }
44 | }
45 |
46 | })()
47 | .catch((e) => {
48 | $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '')
49 | }).finally(() => {
50 | $.done();
51 | })
52 |
53 | async function run() {
54 | try {
55 | //await takePostRequest('beanTaskList')
56 | //await $.wait(500);
57 | await takePostRequest('signBeanAct')
58 | await $.wait(500);
59 | //await getdouble();
60 | } catch (e) {
61 | console.log(e);
62 | }
63 | }
64 |
65 |
66 | async function takePostRequest(type) {
67 | let body = ``;
68 | let myRequest = ``;
69 | switch (type) {
70 | case 'beanTaskList':
71 | body = `{"viewChannel":"AppHome"}`;
72 | myRequest = await getGetRequest(`beanTaskList`, escape(body));
73 | break;
74 | case 'signBeanAct':
75 | body = `{"fp":"-1","shshshfp":"-1","shshshfpa":"-1","referUrl":"-1","userAgent":"-1","jda":"-1","rnVersion":"3.9"}`;
76 | myRequest = await getGetRequest(`signBeanAct`, encodeURIComponent(body));
77 | break;
78 | default:
79 | console.log(`错误${type}`);
80 | }
81 | if (myRequest) {
82 | return new Promise(async resolve => {
83 | $.get(myRequest, (err, resp, data) => {
84 | try {
85 | dealReturn(type, data);
86 | } catch (e) {
87 | $.logErr(e, resp)
88 | } finally {
89 | resolve();
90 | }
91 | })
92 | })
93 | }
94 | }
95 |
96 | async function dealReturn(type, res) {
97 | try {
98 | data = JSON.parse(res);
99 | } catch (e) {
100 | console.log(`返回异常:${res}`);
101 | return;
102 | }
103 | switch (type) {
104 | case 'beanTaskList':
105 | if (data.code == 0 && data.data) {
106 | console.log(`当前等级:${data.data.curLevel || 0} 下一级可领取:${data.data.nextLevelBeanNum || 0}京豆`)
107 | $.taskList = data.data.taskInfos && data.data.taskInfos || [];
108 | $.viewAppHome = data.data.viewAppHome && data.data.viewAppHome || {};
109 | } else if (data.data && data.data.bizMsg) {
110 | console.log(data.data.bizMsg);
111 | } else {
112 | console.log(res);
113 | }
114 | break;
115 | case 'signBeanAct':
116 | if (data.code == 0 && data.data) {
117 | if (data.data?.continuityAward?.beanAward?.beanCount) {
118 | console.log(`${data.data.continuityAward.title || 0}:${data.data.continuityAward.beanAward.beanCount || 0}京豆`);
119 | $.bean += Number(data.data.continuityAward.beanAward.beanCount) || 0;
120 | }
121 | else {
122 | if (data.data?.dailyAward) {
123 | console.log(data.data.dailyAward.title + `获得:${data.data.dailyAward.beanAward.beanCount || 0}京豆`)
124 | $.bean += Number(data.data.dailyAward.beanAward.beanCount) || 0;
125 | } else {
126 | console.log("DEBUG1:" + JSON.stringify(data));
127 | }
128 | }
129 |
130 | } else {
131 | console.log("DEBUG2:" + JSON.stringify(res));
132 | }
133 | break;
134 | default:
135 | console.log(`未判断的异常${type}`);
136 | }
137 | }
138 | async function getGetRequest(type, body) {
139 | let url = `https://api.m.jd.com/client.action?functionId=${type}&body=${body}&appid=ld&client=apple&clientVersion=${UA.split(';')[2]}&networkType=wifi&uuid=${UUID}&openudid=${UUID}`;
140 | const method = `GET`;
141 | const headers = {
142 | "Accept": "*/*",
143 | "Accept-Encoding": "gzip, deflate, br",
144 | "Accept-Language": "zh-cn",
145 | 'Cookie': $.cookie,
146 | "Referer": "https://h5.m.jd.com/",
147 | "User-Agent": UA,
148 | };
149 | return { url: url, method: method, headers: headers };
150 | }
151 |
152 | async function getdouble() {
153 | let opt = {
154 | url: "https://nu.jr.jd.com/gw/generic/jrm/h5/m/process",
155 | headers: {
156 | Cookie: $.cookie,
157 | },
158 | body: `reqData=${encodeURIComponent('{"actCode":"F68B2C3E71","type":"3","frontParam":{"belong":"jingdou"}}')}`
159 | }
160 | return new Promise(async (resolve) => {
161 | $.post(opt, async (err, resp, data) => {
162 | try {
163 | if (err) {
164 | console.log(`${JSON.stringify(err)}`)
165 | console.log(` API请求失败,请检查网路重试`)
166 | } else {
167 | if (data.match(/"京豆.*"/)) {
168 | const count = data.match(/\"count\":\"?(\d.*?)\"?,/)[1];
169 | console.log(`双签成功:${count}京豆`)
170 | } else {
171 | const msg = data.match(/},\"businessMsg\":\"(\S.*)\",\"c/)[1]
172 | console.log("金融双签:" + msg)
173 | }
174 | }
175 | } catch (e) {
176 | $.logErr(e, resp)
177 | } finally {
178 | resolve()
179 | }
180 | })
181 | })
182 | }
183 | function jsonformat(str) {
184 | if (typeof str == "string") {
185 | try {
186 | return JSON.parse(str);
187 | } catch (e) {
188 | console.log(e);
189 | $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie')
190 | return [];
191 | }
192 | }
193 | }
194 |
195 | function randomString(e) {
196 | e = e || 32;
197 | let t = "abcdef0123456789", a = t.length, n = "";
198 | for (i = 0; i < e; i++)
199 | n += t.charAt(Math.floor(Math.random() * a));
200 | return n
201 | }
--------------------------------------------------------------------------------
/jd_wyw.js:
--------------------------------------------------------------------------------
1 | /*
2 |
3 |
4 | cron:1 1 1 1 *
5 | ============Quantumultx===============
6 | [task_local]
7 | #玩一玩成就
8 | 1 1 1 1 * jd_wyw.js, tag=玩一玩成就, enabled=true
9 | */
10 | const Env=require('./utils/Env.js');
11 | const $ = new Env('玩一玩成就');
12 | const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
13 | const notify = $.isNode() ? require('./sendNotify') : '';
14 | //IOS等用户直接用NobyDa的jd cookie
15 | let cookiesArr = [],
16 | cookie = '';
17 | if ($.isNode()) {
18 | Object.keys(jdCookieNode).forEach((item) => {
19 | cookiesArr.push(jdCookieNode[item])
20 | })
21 | if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => { };
22 | } else {
23 | cookiesArr = [$.getdata('CookieJD'), $.getdata('CookieJD2'), ...jsonParse($.getdata('CookiesJD') || "[]").map(item => item.cookie)].filter(item => !!item);
24 | }
25 |
26 | $.invitePinTaskList = []
27 |
28 | message = ""
29 | !(async () => {
30 | console.log('\n【活动入口:京东APP搜索-玩一玩 】\n\n【每次运行活动ID均不同,只增加成长值目前没任何收益 】');
31 | if (!cookiesArr[0]) {
32 | $.msg($.name, '【提示】请先获取cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/', {
33 | "open-url": "https://bean.m.jd.com/"
34 | });
35 | return;
36 | }
37 | for (let i = 0; i < cookiesArr.length; i++) {
38 | cookie = cookiesArr[i];
39 | if (cookie) {
40 | $.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1])
41 | $.index = i + 1;
42 | $.isLogin = true;
43 | $.nickName = '';
44 | console.log(`\n\n******开始【京东账号${$.index}】${$.nickName || $.UserName}*********\n`);
45 | if (!$.isLogin) {
46 | $.msg($.name, `【提示】cookie已失效`, `京东账号${$.index} ${$.nickName || $.UserName}\n请重新登录获取\nhttps://bean.m.jd.com/bean/signIndex.action`, {
47 | "open-url": "https://bean.m.jd.com/bean/signIndex.action"
48 | });
49 | if ($.isNode()) {
50 | await notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`);
51 | }
52 | continue
53 | }
54 | await getUA();
55 | await getPlayTaskCenter();
56 | for (const playTaskCenterListElement of $.playTaskCenterList) {
57 | $.log(`ID:${playTaskCenterListElement.playId} ${playTaskCenterListElement.name} 成就值: ${playTaskCenterListElement.achieve}`)
58 | await $.wait(parseInt(Math.random() * 1500 + 3000, 10))
59 | await doPlayAction(playTaskCenterListElement.playId)
60 | await $.wait(parseInt(Math.random() * 1500 + 3000, 10))
61 | }
62 | await $.wait(parseInt(Math.random() * 1500 + 2000, 10))
63 |
64 | }
65 | }
66 | })()
67 | .catch((e) => $.logErr(e))
68 | .finally(() => $.done())
69 | //获取活动信息
70 |
71 |
72 |
73 | function getPlayTaskCenter() {
74 | //await $.wait(20)
75 | return new Promise(resolve => {
76 | $.post(taskPostClientActionUrl(`body={"client":"app"}&client=wh5&clientVersion=1.0.0`, `playTaskCenter`), async (err, resp, data) => {
77 | try {
78 | if (err) {
79 | console.log(`${JSON.stringify(err)}`)
80 | console.log(`${$.name} API请求失败,请检查网路重试`)
81 | } else {
82 | data = JSON.parse(data);
83 | $.playTaskCenterList = data.data
84 | }
85 | } catch (e) {
86 | $.logErr(e, resp)
87 | } finally {
88 | resolve(data);
89 | }
90 | })
91 | })
92 | }
93 |
94 | function doPlayAction(playId) {
95 | //await $.wait(20)
96 | return new Promise(resolve => {
97 | $.post(taskPostClientActionUrl(`body={"client":"app","playId":"${playId}","type":"1"}&client=wh5&clientVersion=1.0.0`, `playAction`), async (err, resp, data) => {
98 | try {
99 | if (err) {
100 | console.log(`${JSON.stringify(err)}`)
101 | console.log(`${$.name} API请求失败,请检查网路重试`)
102 | } else {
103 | data = JSON.parse(data);
104 | if (data) {
105 | console.log('任务完成,总成长值:' + data?.data?.achieve)
106 | }
107 | debugger
108 | }
109 | } catch (e) {
110 | $.logErr(e, resp)
111 | } finally {
112 | resolve(data);
113 | }
114 | })
115 | })
116 | }
117 |
118 | async function getUA() {
119 | $.UA = `jdapp;iPhone;10.1.4;13.1.2;${randomString(40)};network/wifi;model/iPhone8,1;addressid/2308460611;appBuild/167814;jdSupportDarkMode/0;Mozilla/5.0 (iPhone; CPU iPhone OS 13_1_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1`
120 | }
121 |
122 | function randomString(e) {
123 | e = e || 32;
124 | let t = "abcdef0123456789", a = t.length, n = "";
125 | for (i = 0; i < e; i++)
126 | n += t.charAt(Math.floor(Math.random() * a));
127 | return n
128 | }
129 | function taskPostClientActionUrl(body, functionId) {
130 | return {
131 | url: `https://api.m.jd.com/client.action?${functionId ? `functionId=${functionId}` : ``}`,
132 | body: body,
133 | headers: {
134 | 'User-Agent': $.UA,
135 | 'Content-Type': 'application/x-www-form-urlencoded',
136 | 'Host': 'api.m.jd.com',
137 | 'Origin': 'https://api.m.jd.com',
138 | 'Referer': 'https://funearth.m.jd.com/babelDiy/Zeus/3BB1rymVZUo4XmicATEUSDUgHZND/index.html?source=6&lng=113.388032&lat=22.510956&sid=f9dd95649c5d4f0c0d31876c606b6cew&un_area=19_1657_52093_0',
139 | 'Cookie': cookie,
140 | }
141 | }
142 | }
143 | function jsonParse(str) {
144 | if (typeof str == "string") {
145 | try {
146 | return JSON.parse(str);
147 | } catch (e) {
148 | console.log(e);
149 | $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie')
150 | return [];
151 | }
152 | }
153 | }
154 |
155 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "",
3 | "version": "1.0.0",
4 | "description": "{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**}",
5 | "main": "AlipayManor.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "repository": {
10 | "type": "git",
11 | "url": ""
12 | },
13 | "keywords": [
14 | "京东薅羊毛工具, 京东水果、宠物、种豆等等"
15 | ],
16 | "author": "",
17 | "license": "ISC",
18 | "dependencies": {
19 | "crypto-js": "^4.1.1",
20 | "got": "^11.8.6",
21 | "jsdom": "^17.0.0",
22 | "png-js": "^1.0.0",
23 | "request": "^2.88.2",
24 | "tough-cookie": "^4.0.0",
25 | "tunnel": "0.0.6",
26 | "ws": "^7.5.3"
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/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 | namespace: default
11 | enableRoleAuth: true # 默认会尝试创建 SCF_QcsRole 角色,如果不需要配置成 false 即可
12 | src:
13 | src: ./
14 | exclude:
15 | - '*.!(js|txt|json)'
16 | - 'backUp/**'
17 | - 'icon/**'
18 | handler: index.main_handler #入口
19 | runtime: Nodejs12.16 # 运行环境 默认 Nodejs12.16
20 | region: ap-guangzhou # 函数所在区域
21 | description: This is a function in ${app} application.
22 | memorySize: 64 # 内存大小,单位MB
23 | timeout: 3600 # 超时时间,单位秒
24 | asyncRunEnable: true # 是否启用异步执行
25 | retryNum: 0
26 | events: #触发器
27 | - timer:
28 | parameters:
29 | name: config
30 | cronExpression: "0 0 * * * * *"
31 | enable: true
32 | argument: config
33 | - timer: #宠汪汪积分兑换京豆
34 | parameters:
35 | name: joyreward
36 | cronExpression: "0 59 7,15,23 * * * *"
37 | enable: true
38 | argument: jd_joy_reward
39 | - timer: #汽车兑换
40 | parameters:
41 | name: car_exchange
42 | cronExpression: "30 59 23 * * * *"
43 | enable: false
44 | argument: jd_car_exchange
45 | - timer: #超市蓝币兑换
46 | parameters:
47 | name: blueCoin
48 | cronExpression: "0 59 23 * * * *"
49 | enable: false
50 | argument: jd_blueCoin
51 | - timer:
52 | parameters:
53 | name: cfd
54 | cronExpression: "0 0 0 * * * *"
55 | enable: false
56 | argument: jd_cfd
57 | environment: # 环境变量
58 | variables: # 环境变量对象
--------------------------------------------------------------------------------
/ty_CheckRpeat.js:
--------------------------------------------------------------------------------
1 | /*
2 | cron "10,0 0-23/2 * * *" CheckRpeat.js, tag:脚本重复检测by-TengYu
3 | */
4 | const Env=require('./utils/Env.js');
5 | const $ = new Env('脚本重复检测');
6 | const notify = $.isNode() ? require('./sendNotify') : '';
7 | //Node.js用户请在jdCookie.js处填写京东ck;
8 | /*
9 | 是否删除重复任务 默认"false" export CheckRpeat_DeleteTask="true"
10 | 是否删除重复脚本文件 默认"false" export CheckRpeat_DeleteFile="true"
11 | 如果获取报错请设置QL_URL端口5700是你青龙端口 export QL_URL="http://127.0.0.1:5700"
12 | 根据名称以及脚本路径名称判断重复性!
13 | */
14 |
15 | const got = require('got');
16 | require('dotenv').config();
17 | const { readFile } = require('fs/promises');
18 | const path = require('path');
19 |
20 | const qlDir = process.env.QL_DIR || '/ql';
21 | const fs = require('fs');
22 | let Fileexists = fs.existsSync('/ql/data/config/auth.json');
23 | let authFile = "";
24 | if (Fileexists)
25 | authFile = "/ql/data/config/auth.json"
26 | else
27 | authFile = "/ql/config/auth.json"
28 | //const authFile = path.join(qlDir, 'config/auth.json');
29 |
30 |
31 | var prefixUrl;
32 | if (process.env.QL_URL === "https://github.com/whyour/qinglong.git") {
33 | prefixUrl = "http://127.0.0.1:5700";
34 | } else {
35 | prefixUrl = process.env.QL_URL || 'http://127.0.0.1:5700'
36 | }
37 |
38 | const api = got.extend({
39 | prefixUrl: prefixUrl,
40 | retry: { limit: 0 },
41 | });
42 |
43 | let DeleteTask = "false",
44 | DeleteFile = "false";
45 |
46 | let nyqty = "nyqty";
47 |
48 |
49 | if ($.isNode() && process.env.CheckRpeat_DeleteTask) {
50 | DeleteTask = process.env.CheckRpeat_DeleteTask;
51 | }
52 | if ($.isNode() && process.env.CheckRpeat_DeleteFile) {
53 | DeleteFile = process.env.CheckRpeat_DeleteFile;
54 | }
55 |
56 | async function getToken() {
57 | const authConfig = JSON.parse(await readFile(authFile));
58 | return authConfig.token;
59 | }
60 |
61 |
62 | async function getCrons() {
63 | const token = await getToken();
64 | const body = await api({
65 | url: 'api/crons',
66 | searchParams: {
67 | searchValue: '',
68 | t: Date.now(),
69 | },
70 | headers: {
71 | Accept: 'application/json',
72 | authorization: `Bearer ${token}`,
73 | },
74 | timeout: 3000
75 | }).json();
76 | if (body.data.data) {
77 | return body.data.data;
78 | } else return body.data;
79 |
80 | }
81 |
82 | async function DisableCrons(eid) {
83 | const token = await getToken();
84 | const body = await api({
85 | method: 'put',
86 | url: 'api/crons/disable',
87 | params: { t: Date.now() },
88 | body: JSON.stringify([eid]),
89 | headers: {
90 | Accept: 'application/json',
91 | authorization: `Bearer ${token}`,
92 | 'Content-Type': 'application/json;charset=UTF-8',
93 | },
94 | }).json();
95 | return body;
96 | };
97 |
98 | async function delCrons(eid) {
99 | const token = await getToken();
100 | const body = await api({
101 | method: 'delete',
102 | url: 'api/crons',
103 | params: { t: Date.now() },
104 | body: JSON.stringify([eid]),
105 | headers: {
106 | Accept: 'application/json',
107 | authorization: `Bearer ${token}`,
108 | 'Content-Type': 'application/json;charset=UTF-8',
109 | },
110 | }).json();
111 | return body;
112 | };
113 |
114 | async function delScripts(filename) {
115 | const token = await getToken();
116 | const body = await api({
117 | method: 'delete',
118 | url: 'api/scripts',
119 | params: { t: Date.now() },
120 | body: JSON.stringify({ "filename": filename }),
121 | headers: {
122 | Accept: 'application/json',
123 | authorization: `Bearer ${token}`,
124 | 'Content-Type': 'application/json;charset=UTF-8',
125 | },
126 | }).json();
127 | return body;
128 | };
129 |
130 | !(async () => {
131 | console.log(`是否删除重复任务 默认"false"
132 | export CheckRpeat_DeleteTask="true"
133 | 是否删除重复脚本文件 默认"false"
134 | export CheckRpeat_DeleteFile="true"
135 | 如果获取报错请设置QL_URL端口5700是你青龙端口
136 | export QL_URL="http://127.0.0.1:5700"
137 | 根据名称以及脚本路径名称判断重复性!
138 |
139 | `);
140 |
141 | try {
142 | var crons = await getCrons();
143 | } catch (e) {
144 | console.log(e);//prefixUrl
145 | console.log(`请设置QL_URL 例如:export QL_URL="http://127.0.0.1:5700"`);
146 | return
147 | } finally {
148 | }
149 |
150 | if (!crons[0]) {
151 | $.msg($.name, '【提示】无法定时任务', '【提示】无法定时任务');
152 | return;
153 | }
154 | crons.sort((a, b) => a.name.localeCompare(b.name, 'zh')); //a~z 排序
155 | //console.log(crons);
156 | for (let i = 0, arr = [], arr2 = [], n, filename = [], msg, json = {}; i < crons.length;) {
157 | arr = crons[i].command.split(" ");
158 | filename[i] = arr && arr.length > 1 ? arr[1] : "";
159 | if (!i || crons[i].name != crons[i - 1].name) {
160 | i++
161 | continue
162 | }
163 | msg = `检测到重复任务名称:${crons[i].name}`;
164 | arr = filename[i].split("_");
165 | arr2[0] = arr[arr.length - 1];
166 | arr = filename[i - 1].split("_");
167 | arr2[1] = arr[arr.length - 1];
168 | msg += `\n对比:${arr2[0]}|${arr2[1]}`;
169 | if (arr2[0] != arr2[1]) {
170 | i++
171 | msg += "=不相等,跳过"
172 | continue
173 | }
174 | msg += "=相等"
175 | n = filename[i].substr(0, nyqty.length) == nyqty ? i - 1 : i;
176 | if (crons[n].isDisabled) {
177 | i++
178 | msg += "\n已禁用,跳过"
179 | continue
180 | }
181 | try {
182 | var id = crons[n].id ? crons[n].id : crons[n]._id;
183 | json = DisableCrons(id)
184 | msg += "\n禁用" + filename[n]
185 | //msg+=json.code==DisableCrons(id)?"成功":"失败"
186 | if (DeleteTask == "true") {
187 | json = delCrons(id)
188 | msg += `\n删除任务_id:${id}`;
189 | //msg+=json.code==200?"成功":"失败"
190 | }
191 | if (DeleteFile == "true") {
192 | if (filename[n]) {
193 | json = delScripts(filename[n])
194 | msg += `\n删除脚本:${filename[n]}`;
195 | //msg+=json.code==200?"成功":"失败"
196 | }
197 | }
198 | } catch (e) {
199 | console.log(e);
200 | } finally {
201 | }
202 | console.log(msg);
203 | filename.splice(n, 1)
204 | crons.splice(n, 1)
205 | //console.log(`等待1秒....... \n`);
206 | //await $.wait(1 * 1000)
207 | }
208 | })()
209 | .catch((e) => $.logErr(e))
210 | .finally(() => $.done())
211 |
212 |
--------------------------------------------------------------------------------
/ty_install.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | #依赖安装,运行一次就好
3 | #0 18 * * * jd_indeps.sh
4 | #new Env('依赖安装');
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 --no-cache
17 |
18 | if ! command -v pnpm &> /dev/null; then
19 | echo "请先安装pnpm。"
20 | #exit 1
21 | else
22 | #pnpm config set registry https://registry.npm.taobao.org
23 | #pnpm install -g
24 | echo -e "\n开始检查NodeJs依赖...."
25 | packages=(
26 | "ds" "png-js" "date-fns" "axios" "crypto-js" "request" "jsdom" "moment" "cheerio" \
27 | "xhr2" "tough-cookie" "https-proxy-agent"
28 | )
29 | for package in "${packages[@]}"; do
30 | if ! pnpm list -g --depth=0 "$package" &> /dev/null; then
31 | echo "$package 依赖未安装,正在安装..."
32 | pnpm install -g "$package"
33 | else
34 | echo "$package 依赖已经安装。"
35 | fi
36 | done
37 | #rm -rf /usr/local/pnpm-global/5/node_modules/.pnpm/canvas*
38 | #rm -rf /root/.local/share/pnpm/global/5/.pnpm/canvas*
39 | fi
40 |
41 | if ! command -v pip3 &> /dev/null; then
42 | echo "请先安装pip3。"
43 | #exit 1
44 | else
45 | echo -e "\n开始检查Python3依赖...."
46 | packages=("pycryptodome" "datetime" "requests")
47 | for package in "${packages[@]}"; do
48 | if ! pip3 show "$package" &> /dev/null; then
49 | echo "$package 依赖未安装,正在安装..."
50 | pip3 install "$package"
51 | #pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple/ jieba
52 | else
53 | echo "$package 依赖已经安装。"
54 | fi
55 | done
56 | fi
57 |
58 | echo -e "\n所需依赖安装完成,请检查有没有报错,可尝试再次运行"
--------------------------------------------------------------------------------
/utils/Env.js:
--------------------------------------------------------------------------------
1 | function Env(t, e) { "undefined" != typeof process && JSON.stringify(process.env).indexOf("GITHUB") > -1 && process.exit(0); class s { constructor(t) { this.env = t } send(t, e = "GET") { t = "string" == typeof t ? { url: t } : t; let s = this.get; return "POST" === e && (s = this.post), new Promise((e, i) => { s.call(this, t, (t, s, r) => { t ? i(t) : e(s) }) }) } get(t) { return this.send.call(this.env, t) } post(t) { return this.send.call(this.env, t, "POST") } } return new class { constructor(t, e) { this.name = t, this.http = new s(this), this.data = null, this.dataFile = "box.dat", this.logs = [], this.isMute = !1, this.isNeedRewrite = !1, this.logSeparator = "\n", this.startTime = (new Date).getTime(), Object.assign(this, e), this.log("", `🔔${this.name}, 开始!`) } isNode() { return "undefined" != typeof module && !!module.exports } isQuanX() { return "undefined" != typeof $task } isSurge() { return "undefined" != typeof $httpClient && "undefined" == typeof $loon } isLoon() { return "undefined" != typeof $loon } toObj(t, e = null) { try { return JSON.parse(t) } catch { return e } } toStr(t, e = null) { try { return JSON.stringify(t) } catch { return e } } getjson(t, e) { let s = e; const i = this.getdata(t); if (i) try { s = JSON.parse(this.getdata(t)) } catch { } return s } setjson(t, e) { try { return this.setdata(JSON.stringify(t), e) } catch { return !1 } } getScript(t) { return new Promise(e => { this.get({ url: t }, (t, s, i) => e(i)) }) } runScript(t, e) { return new Promise(s => { let i = this.getdata("@chavy_boxjs_userCfgs.httpapi"); i = i ? i.replace(/\n/g, "").trim() : i; let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); r = r ? 1 * r : 20, r = e && e.timeout ? e.timeout : r; const [o, h] = i.split("@"), n = { url: `http://${h}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": o, Accept: "*/*" } }; this.post(n, (t, e, i) => s(i)) }).catch(t => this.logErr(t)) } loaddata() { if (!this.isNode()) return {}; { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e); if (!s && !i) return {}; { const i = s ? t : e; try { return JSON.parse(this.fs.readFileSync(i)) } catch (t) { return {} } } } } writedata() { if (this.isNode()) { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e), r = JSON.stringify(this.data); s ? this.fs.writeFileSync(t, r) : i ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r) } } lodash_get(t, e, s) { const i = e.replace(/\[(\d+)\]/g, ".$1").split("."); let r = t; for (const t of i) if (r = Object(r)[t], void 0 === r) return s; return r } lodash_set(t, e, s) { return Object(t) !== t ? t : (Array.isArray(e) || (e = e.toString().match(/[^.[\]]+/g) || []), e.slice(0, -1).reduce((t, s, i) => Object(t[s]) === t[s] ? t[s] : t[s] = Math.abs(e[i + 1]) >> 0 == +e[i + 1] ? [] : {}, t)[e[e.length - 1]] = s, t) } getdata(t) { let e = this.getval(t); if (/^@/.test(t)) { const [, s, i] = /^@(.*?)\.(.*?)$/.exec(t), r = s ? this.getval(s) : ""; if (r) try { const t = JSON.parse(r); e = t ? this.lodash_get(t, i, "") : e } catch (t) { e = "" } } return e } setdata(t, e) { let s = !1; if (/^@/.test(e)) { const [, i, r] = /^@(.*?)\.(.*?)$/.exec(e), o = this.getval(i), h = i ? "null" === o ? null : o || "{}" : "{}"; try { const e = JSON.parse(h); this.lodash_set(e, r, t), s = this.setval(JSON.stringify(e), i) } catch (e) { const o = {}; this.lodash_set(o, r, t), s = this.setval(JSON.stringify(o), i) } } else s = this.setval(t, e); return s } getval(t) { return this.isSurge() || this.isLoon() ? $persistentStore.read(t) : this.isQuanX() ? $prefs.valueForKey(t) : this.isNode() ? (this.data = this.loaddata(), this.data[t]) : this.data && this.data[t] || null } setval(t, e) { return this.isSurge() || this.isLoon() ? $persistentStore.write(t, e) : this.isQuanX() ? $prefs.setValueForKey(t, e) : this.isNode() ? (this.data = this.loaddata(), this.data[e] = t, this.writedata(), !0) : this.data && this.data[e] || null } initGotEnv(t) { this.got = this.got ? this.got : require("got"), this.cktough = this.cktough ? this.cktough : require("tough-cookie"), this.ckjar = this.ckjar ? this.ckjar : new this.cktough.CookieJar, t && (t.headers = t.headers ? t.headers : {}, void 0 === t.headers.Cookie && void 0 === t.cookieJar && (t.cookieJar = this.ckjar)) } get(t, e = (() => { })) { t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { try { if (t.headers["set-cookie"]) { const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); s && this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar } } catch (t) { this.logErr(t) } }).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) })) } post(t, e = (() => { })) { if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.post(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) }); else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t)); else if (this.isNode()) { this.initGotEnv(t); const { url: s, ...i } = t; this.got.post(s, i).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) }) } } time(t, e = null) { const s = e ? new Date(e) : new Date; let i = { "M+": s.getMonth() + 1, "d+": s.getDate(), "H+": s.getHours(),"h+": s.getHours(), "m+": s.getMinutes(), "s+": s.getSeconds(), "q+": Math.floor((s.getMonth() + 3) / 3), "S+": s.getMilliseconds() }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, (s.getFullYear() + "").substr(4 - RegExp.$1.length))); for (let e in i) new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? i[e] : ("00" + i[e]).substr(("" + i[e]).length))); return t } msg(e = t, s = "", i = "", r) { const o = t => { if (!t) return t; if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? { "open-url": t } : this.isSurge() ? { url: t } : void 0; if ("object" == typeof t) { if (this.isLoon()) { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } if (this.isQuanX()) { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl; return { "open-url": e, "media-url": s } } if (this.isSurge()) { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } } }; if (this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))), !this.isMuteLog) { let t = ["", "==============📣系统通知📣=============="]; t.push(e), s && t.push(s), i && t.push(i), console.log(t.join("\n")), this.logs = this.logs.concat(t) } } log(...t) { t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator)) } logErr(t, e) { const s = !this.isSurge() && !this.isQuanX() && !this.isLoon(); s ? this.log("", `❗️${this.name}, 错误!`, t.stack) : this.log("", `❗️${this.name}, 错误!`, t) } wait(t) { return new Promise(e => setTimeout(e, t)) } done(t = {}) { const e = (new Date).getTime(), s = (e - this.startTime) / 1e3; this.log("", `🔔${this.name}, 结束! 🕛 ${s} 秒`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) } }(t, e) }
2 |
3 | module.exports = Env
--------------------------------------------------------------------------------
/utils/JDSign.js:
--------------------------------------------------------------------------------
1 | /*
2 | by、TY
3 | 根据Python版本修改而来
4 | 调用方法:
5 | const {get_sign} = require('./utils/JDSign.js');
6 | console.log(get_sign("getCommentList",{"bizType":"1","content":"2","evaAuraVersion":22},"android","11.2.8"));
7 | */
8 | const CryptoJS = require("crypto-js");
9 |
10 | function md5(encryptString) {
11 | return CryptoJS.MD5(encryptString).toString()
12 | }
13 |
14 | function getUUID(x = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", t = 0) {
15 | if (typeof x == "number") x = new Array(x).join('x')
16 | return x.replace(/[xy]/g, function (x) {
17 | var r = (16 * Math.random()) | 0,
18 | n = "x" == x ? r : (3 & r) | 8;
19 | return (uuid = t ? n.toString(36).toUpperCase() : n.toString(36)), uuid;
20 | });
21 | }
22 |
23 | function mt_rand(min, max) {
24 | return Math.min(Math.floor(min + Math.random() * (max - min)), max);
25 | }
26 |
27 | function isset(e) {
28 | return typeof e != "undefined";
29 | }
30 |
31 | function array_rand(e) {
32 | return mt_rand(0, e.length - 1);
33 | }
34 |
35 | function base64_decode(string) {
36 | return Buffer.from(string, 'base64').toString();
37 | }
38 |
39 | function base64_encode(string) {
40 | return Buffer.from(string).toString('base64');
41 | }
42 |
43 | const $maketrans = { 'K': 'A', 'L': 'B', 'M': 'C', 'N': 'D', 'O': 'E', 'P': 'F', 'Q': 'G', 'R': 'H', 'S': 'I', 'T': 'J', 'A': 'K', 'B': 'L', 'C': 'M', 'D': 'N', 'E': 'O', 'F': 'P', 'G': 'Q', 'H': 'R', 'I': 'S', 'J': 'T', 'o': 'e', 'p': 'f', 'q': 'g', 'r': 'h', 's': 'i', 't': 'j', 'u': 'k', 'v': 'l', 'w': 'm', 'x': 'n', 'e': 'o', 'f': 'p', 'g': 'q', 'h': 'r', 'i': 's', 'j': 't', 'k': 'u', 'l': 'v', 'm': 'w', 'n': 'x' };
44 |
45 | function translate(str) {
46 | let $newStr = "";
47 | for (let i = 0, l = str.length, c; i < l; i++) {
48 | c = str.substr(i, 1);
49 | if (isset($maketrans[c])) {
50 | $newStr += $maketrans[c];
51 | } else $newStr += c;
52 | }
53 | return $newStr;
54 | }
55 |
56 | function base64Encode(string) {
57 | return translate(base64_encode(string));
58 | }
59 |
60 | function base64Decode(string) {
61 | return base64_decode(translate(string));
62 | }
63 |
64 | function randomstr(e) {
65 | e = e || 32;
66 | let t = "abcdefghijklmnopqrstuvwxyz0123456789", a = t.length, n = "";
67 | for (let i = 0; i < e; i++)
68 | n += t.charAt(Math.floor(Math.random() * a));
69 | return n
70 | }
71 |
72 | function sign_core(inarg) {
73 | let $key = "80306f4370b39fd5630ad0529f77adb6".split(""),
74 | $mask = [0x37, 0x92, 0x44, 0x68, 0xA5, 0x3D, 0xCC, 0x7F, 0xBB, 0xF, 0xD9, 0x88, 0xEE, 0x9A, 0xE9, 0x5A],
75 | $array = [];
76 | let str = "";
77 | for (let i = 0, l = inarg.length, r0, r1, r2; i < l; i++) {
78 | r0 = inarg.substr(i, 1).charCodeAt();
79 | r1 = $mask[i & 0xf];
80 | r2 = $key[i & 7].charCodeAt();
81 | r0 = r1 ^ r0;
82 | r0 = r0 ^ r2;
83 | r0 = r0 + r1;
84 | r1 = r1 ^ r0;
85 | r1 = r1 ^ r2;
86 | $array[i] = r1 & 0xff
87 | str += String.fromCharCode($array[i]);
88 | }
89 | return str;
90 | }
91 |
92 | function randomeid() {
93 | return "eidAaf8081218as20a2GM" + randomstr(20) + "7FnfQYOecyDYLcd0rfzm3Fy2ePY4UJJOeV0Ub840kG8C7lmIqt3DTlc11fB/s4qsAP8gtPTSoxu";
94 | }
95 |
96 | function get_ep($jduuid = "", $area = "") {//uiid和地区代码
97 | if (!$jduuid) $jduuid = getUUID(16);
98 | let $ts = new Date().getTime(),
99 | $bsjduuid = base64Encode($jduuid);
100 | //$ts=1643792319938
101 | if (!$area) $area = base64Encode([mt_rand(1, 10000), mt_rand(1, 10000), mt_rand(1, 10000), mt_rand(1, 10000)].join('_'));
102 | let $array = ['Mi11Ultra', 'Mi11', 'Mi10'],
103 | $d_model = base64Encode($array[array_rand($array)]);
104 | return [`{"hdid":"JM9F1ywUPwflvMIpYPok0tt5k9kW4ArJEU3lfLhxBqw=","ts":${$ts - mt_rand(100, 1000)},"ridx":-1,"cipher":{"area":"${$area}","d_model":"${$d_model}","wifiBssid":"dW5hbw93bq==","osVersion":"CJS=","d_brand":"WQvrb21f","screen":"CtS1DIenCNqm","uuid":"${$bsjduuid}","aid":"${$bsjduuid}","openudid":"${$bsjduuid}"},"ciphertype":5,"version":"1.2.0","appname":"com.jingdong.app.mall"}`, $jduuid, $ts];
105 | }
106 |
107 | function get_sign($functionId, $body, $client = "android", $clientVersion = '11.2.8', $jduuid = '') {
108 | let $d;
109 | if (typeof $body == 'string') {
110 | $d = JSON.parse($body);
111 | } else {
112 | $body = JSON.stringify($body);
113 | $d = $body;
114 | }
115 | let $eid = isset($d["eid"]) ? $d["eid"] : randomeid();
116 | let [$ep, $suid, $st] = get_ep($jduuid);
117 | //console.log($ep, $suid, $st)
118 | let $svs = ["102", "111", "120"],
119 | $sv = $svs[array_rand($svs)],
120 | $all_arg = `functionId=${$functionId}&body=${$body}&uuid=${$suid}&client=${$client}&clientVersion=${$clientVersion}&st=${$st}&sv=${$sv}`,
121 | $back_bytes = sign_core($all_arg),
122 | $sign = md5(Buffer.from($back_bytes, 'binary').toString('base64'));
123 | //console.log(all_arg)
124 | //console.log(sign)
125 | let $data = { "functionId": $functionId, "body": $body, "clientVersion": $clientVersion, "client": $client, "uuid": $suid, "eid": $eid, "ep": $ep, "st": $st, "sign": $sign, "sv": $sv };
126 | $data["convertUrl"]=`functionId=${$functionId}&body=${escape($body)}&clientVersion=${$clientVersion}&client=${$client}&sdkVersion=31&lang=zh_CN&harmonyOs=0&networkType=wifi&oaid=${$suid}&eid=${$eid}&ef=1&ep=${escape($ep)}&st=${$st}&sign=${$sign}&sv=${$sv}`
127 | $data["url"] = `https://api.m.jd.com?`+$data["convertUrl"]
128 | return $data;
129 | }
130 |
131 | module.exports = {get_sign};
--------------------------------------------------------------------------------
/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 = /