├── GetCookie.conf
├── IP_API.js
├── JD_Task.json
├── LICENSE
├── QX-AD.conf
├── QX.conf
├── README.md
├── Script
├── Backup
│ ├── JD_extra_cookie.conf
│ ├── JD_extra_cookie.js
│ ├── WeChat.js
│ ├── YouTube_Ad.conf
│ ├── wb_ad.js
│ └── wb_launch.js
├── Bili-Regions.conf
├── JD_TB_price.conf
├── JS_Ad.conf
├── JS_Unlock.conf
├── Netflix-rating.conf
├── Q-Search.conf
├── TFDownload.conf
├── TikTok-JP.conf
├── TikTok-TW.conf
└── TikTok-US.conf
├── Task
├── JD New
│ ├── jd_OpenCard_Force.js
│ ├── jd_health.js
│ ├── jd_health_plant.py
│ ├── jd_jdjoypark.js
│ ├── jd_jdkd1.js
│ ├── jd_jdzz_dh.js
│ ├── jd_jj_wwly.js
│ ├── jd_jj_wwly_help.js
│ ├── jd_jjqdtx.js
│ ├── jd_joy_feedPets.js
│ ├── jd_joy_run.js
│ ├── jd_joy_withdraw.js
│ ├── jd_joymatch.js
│ ├── jd_joyopen.js
│ ├── jd_joypark_synthesis.js
│ ├── jd_joypark_task.js
│ ├── jd_joyrunred.js
│ ├── jd_jrsign.js
│ ├── jd_js_cash.js
│ ├── jd_jxzl.js
│ ├── jd_live.js
│ ├── jd_loreal_interact_ljqdysl.js
│ ├── jd_lottery.js
│ ├── jd_lotterys.js
│ ├── jd_luck_draw.js
│ ├── jd_lzaddCart.js
│ ├── jd_lzdz_categoryUnion.js
│ ├── jd_lzkj_daily.js
│ ├── jd_lzkj_interact_yqrhyl.js
│ ├── jd_lzkj_interactsaas_gzspyl.js
│ ├── jd_lzkj_interactsaas_gzyl.js
│ ├── jd_lzkj_interactsaas_jgyl.js
│ ├── jd_lzkj_interactsaas_qrqd.js
│ ├── jd_lzkj_interactsaas_rlqd.js
│ ├── jd_lzkj_interactsaas_yqhyrh.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_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_sevenDay.js
│ ├── jd_lzkj_signActivity2.js
│ ├── jd_lzkj_wxDrawActivity.js
│ ├── jd_lzkj_wxGameActivity.js
│ ├── jd_lzkj_wxShopFollowActivity.js
│ ├── jd_makemoneyshop_getred.js
│ ├── jd_mkredrain.js
│ ├── jd_morningSc.js
│ ├── jd_mpdz_car.js
│ ├── jd_mpdz_car_help.js
│ ├── jd_mpdz_carv.js
│ ├── jd_newYear_party.js
│ ├── jd_openLuckBag.js
│ ├── jd_pdkh.js
│ ├── jd_pigPet.js
│ ├── jd_plantBean.js
│ ├── jd_plantBean_help1.js
│ ├── jd_plus2bean.js
│ ├── jd_pluscore.js
│ ├── jd_pointExgBeans.js
│ ├── jd_ppdt.js
│ ├── jd_price.js
│ ├── jd_qqxing.js
│ ├── jd_qy.js
│ ├── jd_rmvcart.js
│ ├── jd_seckillViewTask.js
│ ├── jd_sevenDay.js
│ ├── jd_share.js
│ ├── jd_share2.js
│ ├── jd_shop.js
│ ├── jd_shopDraw.js
│ ├── jd_shopGifts.js
│ ├── jd_shopSign.js
│ ├── jd_shop_draw.js
│ ├── jd_sign.js
│ ├── jd_signFree.js
│ ├── jd_sign_graphics.js
│ ├── jd_sign_graphics1.js
│ ├── jd_speed_redpocke.js
│ ├── jd_speed_sign.js
│ ├── jd_speed_signfree.js
│ ├── jd_speedtx.js
│ ├── jd_supergz.js
│ ├── jd_syj.js
│ ├── jd_team60.js
│ ├── jd_tenbean.js
│ ├── jd_tj_nnly.js
│ ├── jd_tj_nnly_help.js
│ ├── jd_tj_sign.js
│ ├── jd_token.js
│ ├── jd_try.js
│ ├── jd_try_notify.js
│ ├── jd_try_notify.py
│ ├── jd_ttlhb.js
│ ├── jd_txgzyl.js
│ ├── jd_txgzyl1.js
│ ├── jd_txtotal.js
│ ├── jd_txzj_cart_item.js
│ ├── jd_txzj_collect_item.js
│ ├── jd_txzj_lottery.js
│ ├── jd_txzj_sign_in.js
│ ├── jd_unbind.js
│ ├── jd_unsubscribe.js
│ ├── jd_vipgrowth.js
│ ├── jd_washbeans.js
│ ├── jd_wdzfd.js
│ ├── jd_whx_drawShopGift.js
│ ├── jd_work_price.js
│ ├── jd_wq_wxsign.js
│ ├── jd_wrtred.js
│ ├── jd_wwmanor_merge.js
│ ├── jd_wwpark_merge.js
│ ├── jd_wwpark_task.js
│ ├── jd_wwzy.js
│ ├── jd_wwzy_help.js
│ ├── jd_wxBuildActivity.js
│ ├── jd_wxCartKoi.js
│ ├── jd_wxCollectCard.js
│ ├── jd_wxCollectionActivity.js
│ ├── jd_wxCollectionActivity2.js
│ ├── jd_wxFansInterActionActivity.js
│ ├── jd_wxGameActivity.js
│ ├── jd_wxKnowledgeActivity.js
│ ├── jd_wxMcLevelAndBirthGifts.js
│ ├── jd_wxShareActivity.js
│ ├── jd_wxShopFollowActivity.js
│ ├── jd_wxShopGift.js
│ ├── jd_wxSign.js
│ ├── jd_wxSignRed.js
│ ├── jd_wxTeam.js
│ ├── jd_wxUnPackingActivity.js
│ ├── jd_wyw.js
│ ├── jd_xbhdl.js
│ ├── jd_yqlxj.js
│ ├── jd_yqs.js
│ ├── jd_zjd_new.js
│ ├── jd_zqydj.js
│ ├── jd_zzhb1.js
│ ├── jd_zzhb_draw.js
│ ├── jx_aid_cashback.js
│ ├── jx_cxj_draw.js
│ ├── jx_joypark_task.js
│ └── jx_niuniu_merge.js
├── JD
│ ├── JD_DailyBonus.js
│ ├── backUp
│ │ ├── jd_carnivalcity.js
│ │ └── jd_superBrand.js
│ ├── jd_MMdou.js
│ ├── jd_bean_change.js
│ ├── jd_bean_home.js
│ ├── jd_big_winner.js
│ ├── jd_blueCoin.js
│ ├── jd_car.js
│ ├── jd_car_exchange.js
│ ├── jd_cash.js
│ ├── jd_cash_wx.js
│ ├── jd_cfd.js
│ ├── jd_cfd_loop.js
│ ├── jd_cfd_mooncake.js
│ ├── jd_club_lottery.js
│ ├── jd_connoisseur.js
│ ├── jd_ddly.js
│ ├── jd_ddworld.js
│ ├── jd_ddworld_exchange.js
│ ├── jd_delCoupon.js
│ ├── jd_dreamFactory.js
│ ├── jd_dreamFactory_help.js
│ ├── jd_factory.js
│ ├── jd_fanli.js
│ ├── jd_fruit.js
│ ├── jd_fruit_friend.js
│ ├── jd_gold_creator.js
│ ├── jd_gold_sign.js
│ ├── jd_health.js
│ ├── jd_health_collect.js
│ ├── jd_jdzz.js
│ ├── jd_jintie.js
│ ├── jd_joy.js
│ ├── jd_joy_park_task.js
│ ├── jd_js_cash.js
│ ├── jd_jump.js
│ ├── jd_jxmc.js
│ ├── jd_jxnc.js
│ ├── jd_jxsign.js
│ ├── jd_kd.js
│ ├── jd_live.js
│ ├── jd_lotteryMachine.js
│ ├── jd_lzdz1_customized10.js
│ ├── jd_m_sign.js
│ ├── jd_market_lottery.js
│ ├── jd_mf.js
│ ├── jd_mofang_ex.js
│ ├── jd_moneyTree.js
│ ├── jd_mpdzcar.js
│ ├── jd_mpdzcar_game.js
│ ├── jd_ms.js
│ ├── jd_necklace.js
│ ├── jd_nzmh.js
│ ├── jd_pet.js
│ ├── jd_petrw.js
│ ├── jd_pigPet.js
│ ├── jd_plantBean.js
│ ├── jd_plusLottery.js
│ ├── jd_priceProtect.js
│ ├── jd_redPacket.js
│ ├── jd_redrain.js
│ ├── jd_redrain_half.js
│ ├── jd_rush_lzdz1_nh.js
│ ├── jd_sgmh.js
│ ├── jd_shop.js
│ ├── jd_sign_graphics.js
│ ├── jd_speed.js
│ ├── jd_speed_redpocke.js
│ ├── jd_speed_sign.js
│ ├── jd_speed_signfaker.js
│ ├── jd_split.js
│ ├── jd_superMarket.js
│ ├── jd_sxLottery.js
│ ├── jd_syj.js
│ ├── jd_tewu.js
│ ├── jd_tyt.js
│ ├── jd_unsubscribe.js
│ ├── jd_wealth_island.js
│ ├── jd_wealth_island_help.js
│ ├── jd_wish.js
│ ├── jd_xgyl_wx.js
│ ├── jd_xs_zzl.js
│ ├── jd_xsqjd.js
│ ├── jd_ylyn.js
│ ├── jx_sign.js
│ └── jx_sign_xd.js
├── ali_daily.js
├── dd_daily.js
└── weibo.js
├── UnlockNetease.list
├── Youth
├── README.md
├── Youth_Read.conf
└── Youth_cookie.conf
└── extra_Task.json
/GetCookie.conf:
--------------------------------------------------------------------------------
1 | hostname = api.m.jd.com,ms.jr.jd.com,me-api.jd.com,api.weibo.cn,m.weibo.cn,homepage-api.smzdm.com,haojia-api.smzdm.com,article-api.smzdm.com,user-api.smzdm.com,zhiyou.smzdm.com,m.client.10010.com,h5.ele.me,wapside.189.cn,i.meituan.com,*.v2ex.com
2 |
3 | # 京东 GetCookie by NoByDa
4 | #Safari浏览器打开登录 https://home.m.jd.com/myJd/newhome.action 点击"我的"页面
5 | #或者使用旧版网址 https://bean.m.jd.com/bean/signIndex.action 点击签到并且出现签到日历
6 | #如果通知获取Cookie成功, 则可以使用此签到脚本. 注: 请勿在京东APP内获取!!!
7 | #获取京东金融签到Body说明: 正确添加脚本配置后, 进入"京东金融"APP, 在"首页"点击"签到"并签到一次, 待通知提示成功即可.
8 | #由于cookie的有效性(经测试网页Cookie有效周期最长31天),如果脚本后续弹出cookie无效的通知,则需要重复上述步骤。
9 | https:\/\/api\.m\.jd\.com\/client\.action.*functionId=signBean url script-request-header https://raw.githubusercontent.com/NobyDa/Script/master/JD-DailyBonus/JD_DailyBonus.js
10 | https:\/\/wq\.jd\.com\/user_new\/info\/GetJDUserInfoUnion url script-request-header https://raw.githubusercontent.com/dompling/Script/master/jd/JD_extra_cookie.js
11 | ^https:\/\/(api\.m|me-api)\.jd\.com\/(client\.action\?functionId=signBean|user_new\/info\/GetJDUserInfoUnion\?) url script-request-header https://raw.githubusercontent.com/NobyDa/Script/master/JD-DailyBonus/JD_DailyBonus.js
12 | ^https:\/\/ms\.jr\.jd\.com\/gw\/generic\/hy\/h5\/m\/appSign\? url script-request-body https://raw.githubusercontent.com/NobyDa/Script/master/JD-DailyBonus/JD_DailyBonus.js
13 | # 京东 价保 by ZCY01
14 | https:\/\/api\.m\.jd\.com\/api\?appid=siteppM&functionId=siteppM_priceskusPull url script-request-body https://raw.githubusercontent.com/ZCY01/daily_scripts/main/jd/jd_priceProtectRewrite.js
15 | # 京喜 by moposmall
16 | ^https\:\/\/wq\.jd\.com\/cubeactive\/farm\/dotask url script-request-header https://raw.githubusercontent.com/whyour/hundun/master/quanx/jx_tokens.js
17 | ^https\:\/\/m\.jingxi\.com\/dreamfactory\/generator\/CollectCurrentElectricity url script-request-header https://raw.githubusercontent.com/whyour/hundun/master/quanx/jx_tokens.js
18 | ^https\:\/\/m\.jingxi\.com\/jxcfd\/consume\/CashOut url script-request-header https://raw.githubusercontent.com/whyour/hundun/master/quanx/jx_tokens.js
19 |
20 | # 微博 GetCookie by Sunert
21 | #打开微博App,获取签到Cookie,获取后请注释或禁用Cookie
22 | #稍等或者刷新一下,获取用户信息Cookie(可选,增加显示个人任务红包余额)
23 | https:\/\/api\.weibo\.cn\/\d\/users\/show url script-request-header https://raw.githubusercontent.com/Sunert/Script/master/Task/weibo.js
24 | https:\/\/api\.weibo\.cn\/2\/logservice\/service url script-request-header https://raw.githubusercontent.com/Sunert/Script/master/Task/weibo.js
25 | #https:\/\/newsapi\.sina\.cn\/\?resource=hbpage&newsId=HB-1-sina_gold_center url script-request-header https://raw.githubusercontent.com/Sunert/Script/master/Task/sinanews.js
26 | #https:\/\/newsapi\.sina\.cn\/\?resource=userpoint\/signIn url script-request-header https://raw.githubusercontent.com/Sunert/Script/master/Task/sinanews.js
27 | #https?:\/\/lite\.sina\.cn\/\?resource=hbpage&newsId=HB-1-sina_gold_center - script-request-header https://raw.githubusercontent.com/Sunert/Script/master/Task/sinanews.js
28 | #https?:\/\/lite\.sina\.cn\/\?resource=userpoint\/signIn - script-request-header https://raw.githubusercontent.com/Sunert/Script/master/Task/sinanews.js
29 |
30 | # 中国联通 GetCookie by blackmatrix7
31 | #联通手机营业厅APP经常修改“天天抽奖”入口位置,比较稳定的方法是在联通手机营业厅中搜索“天天抽奖”,直接通过搜索结果进入。
32 | ^https?:\/\/m\.client\.10010\.com\/dailylottery\/static\/(integral|doubleball)\/firstpage url script-request-header https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/script/10010/unicom_signin.min.js
33 |
34 | # 什么值得买 GetCookie by blackmatrix7
35 | #打开什么值得买APP,点击“我的”,进入右上角的签到页面,等待脚本弹出获取Cookie成功的通知即可。
36 | #使用Safari,不要使用第三方浏览器!
37 | #使用手机浏览器访问 https://zhiyou.smzdm.com/ 进行一次登录,通常会显示获取cookie成功。
38 | #可能因为重定向的问题,登录成功后访问的不是https://zhiyou.smzdm.com/user/ ,则重新在浏览器中访问一次https://zhiyou.smzdm.com/user/ 即可。
39 | ^https?:\/\/zhiyou\.smzdm\.com\/user$ url script-request-header https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/script/smzdm/smzdm_signin.js
40 | ^https?:\/\/user-api\.smzdm\.com\/user_login\/normal$ url script-request-body https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/script/smzdm/smzdm_signin.js
41 | ^https?:\/\/user-api\.smzdm\.com\/checkin$ url script-request-header https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/script/smzdm/smzdm_daily.js
42 |
43 |
44 | # 饿了么 GetCookie by blackmatrix7
45 | # 饿了么APP - 我的 - 超级吃货卡
46 | ^https?:\/\/h5\.ele\.me\/restapi\/biz\.svip_scene\/svip\/engine\/queryTrafficSupply url script-request-header https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/script/eleme/eleme_daily.js
47 |
48 | # 电信 GetCookie by Chavyleung
49 | #打开 APP 手动签到一次: 访问下右下角 我 > 签到 (头像下面)
50 | #系统提示: 获取Cookie: 成功
51 | ^https:\/\/wapside.189.cn:9001\/api\/home\/sign url script-request-body https://raw.githubusercontent.com/chavyleung/scripts/master/10000/10000.cookie.js
52 |
53 | # 美团 GetCookie by Chavyleung
54 | #打开 APP , 然后手动签到 1 次, 系统提示: 获取Cookie: 成功 (首页 > 红包签到)
55 | ^https:\/\/i.meituan.com\/evolve\/signin\/signpost\/ url script-request-body https://raw.githubusercontent.com/chavyleung/scripts/master/meituan/meituan.cookie.js
56 |
57 | # v2ex GetCookie by Chavyleung
58 | #浏览器访问并登录: https://www.v2ex.com
59 | #打开浏览器访问: https://www.v2ex.com/mission/daily
60 | ^https:\/\/www\.v2ex\.com\/mission\/daily url script-request-header https://raw.githubusercontent.com/chavyleung/scripts/master/v2ex/quanx/v2ex.cookie.js
61 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/IP_API.js:
--------------------------------------------------------------------------------
1 | if ($response.statusCode != 200) {
2 | $done(null);
3 | }
4 |
5 | const emojis= ['🆘','🈲','⚠️','🔞','📵','🚦','🏖','🖥','📺','🐧','🐬','🦉','🍄','⛳️','🚴','🤑','👽','🤖','🎃', '👺', '👁', '🐶', '🐼','🐌', '👥']
6 | var city0 = "高谭市";
7 | var isp0 = "Cross-GFW.org";
8 | function getRandomInt(max) {
9 | return Math.floor(Math.random() * Math.floor(max));
10 | }
11 |
12 | function City_ValidCheck(para) {
13 | if(para) {
14 | return para
15 | } else
16 | {
17 | return city0
18 | //emojis[getRandomInt(emojis.length)]
19 | }
20 | }
21 |
22 | function ISP_ValidCheck(para) {
23 | if(para) {
24 | return para
25 | } else
26 | {
27 | return isp0
28 | //emojis[getRandomInt(emojis.length)]
29 | }
30 | }
31 |
32 | function Area_check(para) {
33 | if(para=="中华民国"){
34 | return "台湾"
35 | } else
36 | {
37 | return para
38 | }
39 | }
40 |
41 | var flags = new Map([[ "AC" , "🇦🇨" ] ,["AE","🇦🇪"], [ "AF" , "🇦🇫" ] , [ "AI" , "🇦🇮" ] , [ "AL" , "🇦🇱" ] , [ "AM" , "🇦🇲" ] , [ "AQ" , "🇦🇶" ] , [ "AR" , "🇦🇷" ] , [ "AS" , "🇦🇸" ] , [ "AT" , "🇦🇹" ] , [ "AU" , "🇦🇺" ] , [ "AW" , "🇦🇼" ] , [ "AX" , "🇦🇽" ] , [ "AZ" , "🇦🇿" ] , ["BA", "🇧🇦"], [ "BB" , "🇧🇧" ] , [ "BD" , "🇧🇩" ] , [ "BE" , "🇧🇪" ] , [ "BF" , "🇧🇫" ] , [ "BG" , "🇧🇬" ] , [ "BH" , "🇧🇭" ] , [ "BI" , "🇧🇮" ] , [ "BJ" , "🇧🇯" ] , [ "BM" , "🇧🇲" ] , [ "BN" , "🇧🇳" ] , [ "BO" , "🇧🇴" ] , [ "BR" , "🇧🇷" ] , [ "BS" , "🇧🇸" ] , [ "BT" , "🇧🇹" ] , [ "BV" , "🇧🇻" ] , [ "BW" , "🇧🇼" ] , [ "BY" , "🇧🇾" ] , [ "BZ" , "🇧🇿" ] , [ "CA" , "🇨🇦" ] , [ "CF" , "🇨🇫" ] , [ "CH" , "🇨🇭" ] , [ "CK" , "🇨🇰" ] , [ "CL" , "🇨🇱" ] , [ "CM" , "🇨🇲" ] , [ "CN" , "🇨🇳" ] , [ "CO" , "🇨🇴" ] , [ "CP" , "🇨🇵" ] , [ "CR" , "🇨🇷" ] , [ "CU" , "🇨🇺" ] , [ "CV" , "🇨🇻" ] , [ "CW" , "🇨🇼" ] , [ "CX" , "🇨🇽" ] , [ "CY" , "🇨🇾" ] , [ "CZ" , "🇨🇿" ] , [ "DE" , "🇩🇪" ] , [ "DG" , "🇩🇬" ] , [ "DJ" , "🇩🇯" ] , [ "DK" , "🇩🇰" ] , [ "DM" , "🇩🇲" ] , [ "DO" , "🇩🇴" ] , [ "DZ" , "🇩🇿" ] , [ "EA" , "🇪🇦" ] , [ "EC" , "🇪🇨" ] , [ "EE" , "🇪🇪" ] , [ "EG" , "🇪🇬" ] , [ "EH" , "🇪🇭" ] , [ "ER" , "🇪🇷" ] , [ "ES" , "🇪🇸" ] , [ "ET" , "🇪🇹" ] , [ "EU" , "🇪🇺" ] , [ "FI" , "🇫🇮" ] , [ "FJ" , "🇫🇯" ] , [ "FK" , "🇫🇰" ] , [ "FM" , "🇫🇲" ] , [ "FO" , "🇫🇴" ] , [ "FR" , "🇫🇷" ] , [ "GA" , "🇬🇦" ] , [ "GB" , "🇬🇧" ] , [ "HK" , "🇭🇰" ] ,["HU","🇭🇺"], [ "ID" , "🇮🇩" ] , [ "IE" , "🇮🇪" ] , [ "IL" , "🇮🇱" ] , [ "IM" , "🇮🇲" ] , [ "IN" , "🇮🇳" ] , [ "IS" , "🇮🇸" ] , [ "IT" , "🇮🇹" ] , [ "JP" , "🇯🇵" ] , [ "KR" , "🇰🇷" ] , [ "LU" , "🇱🇺" ] , [ "MO" , "🇲🇴" ] , [ "MX" , "🇲🇽" ] , [ "MY" , "🇲🇾" ] , [ "NL" , "🇳🇱" ] , [ "PH" , "🇵🇭" ] , [ "RO" , "🇷🇴" ] , [ "RS" , "🇷🇸" ] , [ "RU" , "🇷🇺" ] , [ "RW" , "🇷🇼" ] , [ "SA" , "🇸🇦" ] , [ "SB" , "🇸🇧" ] , [ "SC" , "🇸🇨" ] , [ "SD" , "🇸🇩" ] , [ "SE" , "🇸🇪" ] , [ "SG" , "🇸🇬" ] , [ "TH" , "🇹🇭" ] , [ "TN" , "🇹🇳" ] , [ "TO" , "🇹🇴" ] , [ "TR" , "🇹🇷" ] , [ "TV" , "🇹🇻" ] , [ "TW" , "🇨🇳" ] , [ "UK" , "🇬🇧" ] , [ "UM" , "🇺🇲" ] , [ "US" , "🇺🇸" ] , [ "UY" , "🇺🇾" ] , [ "UZ" , "🇺🇿" ] , [ "VA" , "🇻🇦" ] , [ "VE" , "🇻🇪" ] , [ "VG" , "🇻🇬" ] , [ "VI" , "🇻🇮" ] , [ "VN" , "🇻🇳" ] , [ "ZA" , "🇿🇦"]])
42 |
43 | var body = $response.body;
44 | var obj = JSON.parse(body);
45 | var title =flags.get(obj['countryCode']) + ' '+ City_ValidCheck(obj['city']);//+Area_check(obj['country']);
46 | var subtitle = ISP_ValidCheck(obj['org']);
47 | var ip = obj['query'];
48 | var description = '服务商:'+obj['isp'] + '\n'+'地区:' +City_ValidCheck(obj['regionName'])+ '\n' + 'IP:'+ obj['query'] + '\n' +'时区:'+ obj['timezone'];
49 | $done({title, subtitle, ip, description});
50 |
--------------------------------------------------------------------------------
/QX-AD.conf:
--------------------------------------------------------------------------------
1 | [general]
2 |
3 | #geo_location_checker用于节点页面的节点信息展示,可完整自定义展示内容与方式
4 | geo_location_checker=http://ip-api.com/json/?lang=zh-CN, https://raw.githubusercontent.com/yyn618/QuantumultX-Script/main/IP_API.js
5 |
6 | #资源解析器,可用于自定义各类远程资源的转换,如节点,规则 filter,复写 rewrite 等,url 地址可远程,可 本地/iCloud(Quantumult X/Scripts目录);
7 | resource_parser_url=https://cdn.jsdelivr.net/gh/KOP-XIAO/QuantumultX@master/Scripts/resource-parser.js
8 |
9 | #dns exclusion list中的域名将不使用fake-ip方式. 其它域名则全部采用 fake-ip 及远程解析的模式
10 | #dns_exclusion_list=*.qq.com, qq.com, *.cmpassport.com, *.jegotrip.com.cn, *.icitymobile.mobi, id6.me, *.pingan.com.cn, *.cmbchina.com
11 |
12 | #下列表中的内容将不经过 QuantumultX的处理
13 | #excluded_routes= 192.168.0.0/16, 172.16.0.0/12, 100.64.0.0/10, 10.0.0.0/8,239.255.255.250/32, 24.105.30.129/32, 185.60.112.157/32, 185.60.112.158/32, 182.162.132.1/32,17.0.0.0/8
14 | #icmp_auto_reply=true
15 |
16 | # 参数 fallback_udp_policy 仅支持 v1.0.19 以及之后的版本
17 | # 参数 fallback_udp_policy 的值仅支持末端策略(末端策略为经由规则模块和策略模块后所命中的策略,例如:direct、reject 以及节点;不支持内置策略 proxy 以及其它自定义策略)。
18 | fallback_udp_policy=direct
19 |
20 | #运行模式切换,running_mode_trigger 设置,即根据网络自动切换 分流/直连/全局代理 等模式。
21 | # 前两个 filter 表示 在 4G 网络跟一般 Wi-Fi 下,走 filter(分流)模式,wifi-1 则切换为全局直连,wifi-2 切换为全局代理
22 | #running_mode_trigger=filter, filter, wifi-1:all_direct, wifi-2: all_proxy
23 |
24 | #暂停工作,ssid_suspended_list设置,让 Quantumult X 在特定 Wi-Fi 网络下暂停工作(仅 task 模块会继续工作),多个Wi-Fi用“,”连接
25 | #ssid_suspended_list=wifi-1, wifi-2
26 |
27 | #Quantumult X 会对 server_check_url 指定的网址进行相应测试,以确认节点的可用性
28 | server_check_url=http://cp.cloudflare.com/generate_204
29 |
30 |
31 | [dns]
32 |
33 | #禁用系统 DNS 以及 ipv6
34 | #no-syetem
35 | no-ipv6
36 |
37 | #指定的 dns服务器
38 | server=114.114.114.114
39 | server=202.141.176.93
40 | server=202.141.178.13
41 | server=117.50.10.10
42 | server=223.5.5.5
43 | server=119.29.29.29
44 | server=119.28.28.28
45 |
46 | #指定域名解析dns
47 | address=/mtalk.google.com/108.177.125.188
48 | server=/dl.google.com/119.29.29.29
49 | server=/dl.l.google.com/119.29.29.29
50 | server=/*.tencent.com/119.28.28.28
51 | server=/*.weixin.com/119.28.28.28
52 | server=/*.jd.com/119.28.28.28
53 | server=/*.alipay.com/223.5.5.5
54 | server=/*.taobao.com/223.5.5.5
55 |
56 |
57 | [policy]
58 | # static 策略组中,你需要手动选择想要的节点/策略组。
59 | # url-latency-benchmark 延迟策略组,选取延迟最优节点。
60 | # ssid 策略组,将根据你所设定的网络来自动切换节点/策略组。
61 | # 默认设置3小时测速一次,当前使用节点延迟和最新测速延迟最低的节点相差100ms以上则切换为最新的最低延迟节点,否则继续延用节点
62 |
63 | static=🚀 节点选择,♻️ 自动选择,🇭🇰 香港,🇨🇳 台湾,🇯🇵 日本,🇸🇬 新加坡,🇺🇸 美国,PROXY,DIRECT, img-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Available.png
64 |
65 | url-latency-benchmark=♻️ 自动选择, server-tag-regex=.*, check-interval=10800, tolerance=50, img-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Auto.png
66 | url-latency-benchmark=🇭🇰 香港, server-tag-regex=(?=.*(港|HK|(?i)Hong))^((?!(台湾|日本|新加坡|美国|韩国|狮城|南朝鲜|US|SG|JP|KR|TW|台灣|美國|韓國|獅城)).)*$, check-interval=10800, tolerance=50, img-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Hong_Kong.png
67 | url-latency-benchmark=🇨🇳 台湾, server-tag-regex=(?=.*(台|TW|(?i)Taiwan))^((?!(港|日|韩|新|美)).)*$, check-interval=10800, tolerance=50, img-url=https://raw.githubusercontent.com/Orz-3/face/master/TW.png
68 | url-latency-benchmark=🇯🇵 日本, server-tag-regex=(?=.*(日|JP|(?i)Japan))^((?!(香港|台湾|新加坡|美国|韩国|狮城|南朝鲜|US|SG|KR|HK|TW|台灣|美國|韓國|獅城)).)*$, check-interval=10800, tolerance=50, img-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Japan.png
69 | url-latency-benchmark=🇸🇬 新加坡, server-tag-regex=(?=.*(新|狮城|SG|(?i)Singapore))^((?!(香港|台湾|日本|美国|韩国|南朝鲜|US|JP|KR|HK|TW|台灣|美國|韓國)).)*$, check-interval=10800, tolerance=50, img-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Singapore.png
70 | url-latency-benchmark=🇺🇸 美国, server-tag-regex=(?=.*(美|美國|US|洛杉矶|西雅图|(?i)States|American))^((?!(香港|台湾|日本|新加坡|韩国|狮城|南朝鲜|SG|JP|KR|HK|TW|台灣|韓國|獅城)).)*$, check-interval=10800, tolerance=50, img-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/United_States.png
71 | static=🐟 漏网之鱼, 🚀 节点选择, ♻️ 自动选择,🇭🇰 香港,🇨🇳 台湾,🇯🇵 日本,🇸🇬 新加坡,🇺🇸 美国, PROXY, DIRECT, img-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Final.png
72 |
73 |
74 | [server_remote]
75 |
76 |
77 |
78 | [filter_remote]
79 |
80 | # blackmatrix7 广告拦截
81 | https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rewrite/QuantumultX/AdvertisingLite/AdvertisingLite.list, tag=blackmatrix7 广告拦截, force-policy=reject, update-interval=172800, opt-parser=true, enabled=true
82 | # 神机 广告拦截
83 | #https://raw.githubusercontent.com/DivineEngine/Profiles/master/Surge/Ruleset/Guard/Advertising.list, tag=神机 广告拦截, force-policy=reject, update-interval=172800, opt-parser=true, enabled=true
84 | # NobyDa 广告拦截
85 | #https://raw.githubusercontent.com/NobyDa/Script/master/Surge/AdRule.list, tag=NobyDa 广告拦截, force-policy=reject, update-interval=172800, opt-parser=true, enabled=true
86 |
87 | # Unbreak 后续规则修正
88 | https://raw.githubusercontent.com/DivineEngine/Profiles/master/Surge/Ruleset/Unbreak.list, tag=规则修正, force-policy=direct, update-interval=172800, opt-parser=true, enabled=true
89 | # 运营劫持
90 | https://raw.githubusercontent.com/DivineEngine/Profiles/master/Quantumult/Filter/Guard/Hijacking.list, tag=运营劫持, force-policy=reject, update-interval=172800, opt-parser=true, enabled=true
91 | # BlockHttpDNS
92 | https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/AdGuard/BlockHttpDNS/BlockHttpDNS.txt, tag=BlockHttpDNS, force-policy=reject, update-interval=172800, opt-parser=true, enabled=true
93 |
94 | # 神机 隐私保护
95 | https://raw.githubusercontent.com/DivineEngine/Profiles/master/Quantumult/Filter/Guard/Privacy.list, tag=隐私保护, force-policy=reject, update-interval=172800, opt-parser=true, enabled=true
96 |
97 | # 流媒体HK
98 | https://raw.githubusercontent.com/DivineEngine/Profiles/master/Surge/Ruleset/StreamingMedia/Region/HK.list, tag=流媒体HK, force-policy=🇭🇰 香港, update-interval=172800, opt-parser=true, enabled=true
99 | # 流媒体TW
100 | https://raw.githubusercontent.com/DivineEngine/Profiles/master/Surge/Ruleset/StreamingMedia/Region/TW.list, tag=流媒体TW, force-policy=🇨🇳 台湾, update-interval=172800, opt-parser=true, enabled=true
101 | # 流媒体JP
102 | https://raw.githubusercontent.com/DivineEngine/Profiles/master/Surge/Ruleset/StreamingMedia/Region/JP.list, tag=流媒体JP, force-policy=🇯🇵 日本, update-interval=172800, opt-parser=true, enabled=true
103 | # 流媒体US
104 | https://raw.githubusercontent.com/DivineEngine/Profiles/master/Surge/Ruleset/StreamingMedia/Region/US.list, tag=流媒体US, force-policy=🇺🇸 美国, update-interval=172800, opt-parser=true, enabled=true
105 | # 苹果服务
106 | https://raw.githubusercontent.com/DivineEngine/Profiles/master/Surge/Ruleset/Extra/Apple/AppStore.list, tag=苹果服务, force-policy=🍎 苹果服务, update-interval=172800, opt-parser=true, enabled=true
107 | https://raw.githubusercontent.com/DivineEngine/Profiles/master/Surge/Ruleset/Extra/Apple/AppStoreConnect.list, tag=苹果服务, force-policy=🍎 苹果服务, update-interval=172800, opt-parser=true, enabled=true
108 | https://raw.githubusercontent.com/DivineEngine/Profiles/master/Surge/Ruleset/Extra/Apple/TestFlight.list, tag=Testflight, force-policy=🍎 苹果服务, update-interval=172800, opt-parser=true, enabled=true
109 | # 屏蔽系统更新(默认关闭,可开启)
110 | https://raw.githubusercontent.com/DivineEngine/Profiles/master/Quantumult/Filter/Extra/Apple/BlockiOSUpdate.list, tag=🍎 屏蔽系统更新,enabled=false
111 |
112 | # 国外视频
113 | https://raw.githubusercontent.com/DivineEngine/Profiles/master/Quantumult/Filter/StreamingMedia/Streaming.list, tag=国外视频, force-policy=🚀 节点选择, update-interval=172800, opt-parser=true , enabled=true
114 | # 全球加速
115 | https://raw.githubusercontent.com/DivineEngine/Profiles/master/Quantumult/Filter/Global.list, tag=全球加速, force-policy=🚀 节点选择, update-interval=172800, opt-parser=true , enabled=true
116 |
117 | # 国内网站
118 | https://raw.githubusercontent.com/DivineEngine/Profiles/master/Quantumult/Filter/StreamingMedia/StreamingCN.list, tag=🎯国内网站-直连, force-policy=direct, update-interval=172800, opt-parser=true , enabled=true
119 | # 国内网站
120 | https://raw.githubusercontent.com/DivineEngine/Profiles/master/Quantumult/Filter/China.list, tag=🎯国内网站-直连, force-policy=direct, update-interval=172800, opt-parser=true, enabled=true
121 | #ChinaIPv4
122 | https://cdn.jsdelivr.net/gh/17mon/china_ip_list@master/china_ip_list.txt#type=rule, tag=ChinaIPv4, force-policy=direct, update-interval=172800, opt-parser=true, enabled=true
123 | #ChinaIPv6
124 | https://gaoyifan.github.io/china-operator-ip/chinanet6.txt#type=rule, tag=ChinaIPv6, force-policy=direct, update-interval=172800, opt-parser=true, enabled=true
125 |
126 | [rewrite_remote]
127 | 去开屏广告(部分
128 | https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/script/startup/startup.snippet, tag=去开屏, update-interval=172800, opt-parser=true, enabled=true
129 | #去广告
130 | #https://raw.githubusercontent.com/DivineEngine/Profiles/master/Quantumult/Rewrite/Block/Advertising.conf, tag=神机 去广告, update-interval=172800, opt-parser=true, enabled=true
131 | #https://raw.githubusercontent.com/NobyDa/Script/master/QuantumultX/Rewrite_lhie1.conf, tag=NobyDa 去广告, update-interval=172800, opt-parser=true, enabled=true
132 | https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rewrite/QuantumultX/AdvertisingLite/AdvertisingLite.conf, tag=blackmatrix7 去广告, update-interval=172800, opt-parser=true, enabled=true
133 | https://raw.githubusercontent.com/yyn618/QuantumultX-Script/master/Script/JS_Ad.conf, tag=西宁 去广告, update-interval=172800, opt-parser=true, enabled=true
134 |
135 |
136 | [server_local]
137 |
138 |
139 |
140 | [filter_local]
141 |
142 | host-suffix, local, direct
143 | ip-cidr, 192.168.0.0/16, direct
144 | ip-cidr, 10.0.0.0/8, direct
145 | ip-cidr, 172.16.0.0/12, direct
146 | ip-cidr, 127.0.0.0/8, direct
147 | ip-cidr, 100.64.0.0/10, direct
148 | ip-cidr, 224.0.0.0/4, direct
149 | ip6-cidr, fe80::/10, direct
150 | #geoip, cn, direct
151 | FINAL,🐟 漏网之鱼
152 |
153 |
154 | [rewrite_local]
155 | # 本地重写规则
156 |
157 |
158 |
159 | [task_local]
160 |
161 |
162 |
163 | [http_backend]
164 |
165 |
166 |
167 | [mitm]
168 | #以下模块去掉;才生效
169 | #请自行在 APP 的UI中生成证书 并安装&信任
170 | #skip_validating_cert = false
171 | #force_sni_domain_name = false
172 | #hostname = *.example.com, *.sample.com
173 | #passphrase和p12代为证书&主机名部分, 更新配置前可把旧的配置中passphrase和p12代码拷贝下来, 导入新的配置文件把内容粘贴在对应位置就不用重装证书了
174 | #passphrase =
175 | #p12 =
176 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | 
2 |
3 | ### 说明:
4 |
5 | * 自用脚本,参考各位大佬。
6 | * 只测试和更新,不负责维护脚本。
7 | * TG群组:https://t.me/Xininga
8 |
9 |
10 |
11 | ### 配置:
12 |
13 | * [QX.conf](https://raw.githubusercontent.com/yyn618/QuantumultX-Script/main/QX.conf)为全配置地址。
14 | * [QX-AD.conf](https://raw.githubusercontent.com/yyn618/QuantumultX-Script/main/QX-AD.conf)为去广告专用配置地址。
15 |
16 |
17 |
18 | ### 使用方法:
19 |
20 | 1. 选择需要配置[QX.conf](https://raw.githubusercontent.com/yyn618/QuantumultX-Script/main/QX.conf)、[QX-AD.conf](https://raw.githubusercontent.com/yyn618/QuantumultX-Script/main/QX-AD.conf),复制地址备用。
21 | 2. QX主界面,点击右下角按钮,下拉点击**配置文件-下载**,将复制的地址粘贴确定。
22 | 3. QX主界面,点击右下角按钮,下拉至**Mitm**,点击**生成证书**。
23 | 4. 继续点击**配置证书**,根据提示安装证书。
24 | 5. 安装成功后,到系统的**设置-通用-关于本机**信任证书。
25 | 6. 回到QX,打开**重写**和**Mitm**
26 | 7. 添加节点/订阅,在QX主界面点击右下角按钮,点击**节点-引用(订阅)**,填写标签和资源路径(重要,不添加标签是无法筛选的)
27 | 8. 使用愉快
28 |
29 |
30 |
31 | ### 策略组与分流规则:
32 |
33 | 1. 可根据延迟选择节点,6个延迟策略组,包含自动选择,香港,台湾,日本,新加坡,美国节点。
34 | 2. TikTok、Netflix、B站、苹果服务可自定义节点。
35 | 3. 解锁网易云节点
36 | 4. 屏蔽系统更新,默认关闭需开启
37 | 5. 全球加速默认走自动选择节点。
38 | 6. 国外视频优先走各地区节点,若无地区限制走自动选择节点。
39 | 7. 国内网站、网站默认直连。
40 |
41 |
42 |
43 | ### 重写:
44 |
45 | - B站换区(默认关闭,关闭通知需订阅作者[boxjs](https://raw.githubusercontent.com/NobyDa/Script/master/NobyDa_BoxJs.json))
46 | - TF区域解锁
47 | - Netflix评分
48 | - Q-Search搜索
49 | - Notability解锁
50 | - 解锁各类VIP
51 | - TikTok 解锁(V21.1.0):JP(默认)、TW、US地区解锁,最新支持版本V21.1.0
52 | - 京东/淘宝购物比价:淘宝比价在商品保障里,不生效或失效的需要卸载重装
53 | - 获取Cookie:Task脚本获取Cookie用的,使用时启用,获取后可关闭。获取cookie方法在脚本中查看
54 |
55 |
56 |
57 | ### 任务脚本:
58 |
59 | > 仅保留个人自用任务脚本,需要其他脚本可自行前往作者主页
60 |
61 | 京东类任务脚本(已搬运至本地仓库,🔗链接为原地址):
62 |
63 | 🔗脚本仓库地址:[Xining JD_Task](https://raw.githubusercontent.com/yyn618/QuantumultX-Script/main/JD_Task.json)
64 | ##### 使用方法:
65 |
66 | 添加京东任务仓库:https://raw.githubusercontent.com/yyn618/QuantumultX-Script/main/JD_Task.json
67 |
68 | 
69 |
70 |
71 |
72 | ---
73 |
74 | 其他任务脚本:
75 |
76 | 🔗脚本仓库地址:[Xining extra_Task](https://raw.githubusercontent.com/yyn618/QuantumultX-Script/main/extra_Task.json)
77 |
78 |
79 |
80 | ### BoxJs订阅:
81 |
82 | > 部分脚本请搭配作者BoxJs使用
83 | > BoxJS访问地址设定为
84 |
85 | - NobyDa
86 | - ChuheGit
87 | - Sunert
88 | - blackmatrix7
89 | - chavyleung
90 | - lxk0301
91 |
92 |
93 |
94 | ### 特别感谢:
95 |
96 | >感谢大佬们的无私分享,排名不分先后
97 |
98 | [Orz-3](https://github.com/Orz-3/QuantumultX)
99 |
100 | [KOP-XIAO](https://github.com/KOP-XIAO/QuantumultX)
101 |
102 | [zw9314](https://github.com/nzw9314/QuantumultX/tree/master)
103 |
104 | [w37fhy](https://github.com/w37fhy/QuantumultX/edit/master)
105 |
106 | [DivineEngine](https://github.com/DivineEngine/Profiles/tree/master)
107 |
108 | [blackmatrix7](https://github.com/blackmatrix7/ios_rule_script)
109 |
110 | [NobyDa](https://github.com/NobyDa/Script)
111 |
112 | [lhie1](https://github.com/lhie1/Rules/tree/master/QuantumultX)
113 |
114 | [faker](https://github.com/shufflewzc/faker2)
115 |
116 | [JDHelloWorld](https://github.com/JDHelloWorld/jd_scripts)
117 |
118 | [smiek2121](https://github.com/smiek2121/scripts)
119 |
120 | [chavyleung](https://github.com/chavyleung/scripts)
121 |
122 | [Chuhe](https://github.com/ChuheGit/1)
123 |
124 | [Sunert](https://gitee.com/Sunert/Scripts/tree/master)
125 |
126 | [yichahucha](https://github.com/yichahucha/surge)
127 |
128 | [Semporia](https://github.com/Semporia/TikTok-Unlock)
129 |
130 | [StimeKe](https://github.com/StimeKe?tab=repositories)
131 |
132 | [Neurogram-R](https://github.com/Neurogram-R/Surge)
133 |
134 |
135 |
136 | ### 声明:
137 |
138 | * **yyn618**发布的**QuantumultX Script**项目中涉及的任何脚本仅用于资源共享和学习研究,不能保证其合法性,准确性,完整性和有效性,请根据情况自行判断。
139 |
140 | * 间接使用脚本的任何用户,包括但不限于建立VPS或在某些行为违反国家/地区法律或相关法规的情况下进行传播, **yyn618**对于由此引起的任何隐私泄漏或其他后果概不负责。
141 |
142 | * 请勿将**QuantumultX Script**项目的任何内容用于商业或非法目的,否则后果自负。
143 |
144 | * 如果任何单位或个人认为该项目的脚本可能涉嫌侵犯其权利,则应及时通知并提供身份证明,所有权证明,我将在收到认证文件后删除相关脚本。
145 |
146 | * **yyn618**对任何脚本问题概不负责,包括但不限于由任何脚本错误导致的任何损失或损害。
147 |
148 | * 您必须在下载后的24小时内从计算机或手机中完全删除以上内容。
149 |
150 | * 任何以任何方式查看此项目的人或直接或间接使用该Script项目的任何脚本的使用者都应仔细阅读此声明。**yyn618**保留随时更改或补充此免责声明的权利。一旦使用并复制了任何相关脚本或**QuantumultX Script**项目的规则,则视为您已接受此免责声明。
151 |
--------------------------------------------------------------------------------
/Script/Backup/JD_extra_cookie.conf:
--------------------------------------------------------------------------------
1 | hostname = me-api.jd.com
2 | #使用方式:在代理软件配置好下方配置后,复制 https://home.m.jd.com/myJd/newhome.action 到浏览器打开 ,在个人中心自动获取 cookie,
3 | 若弹出成功则正常使用。否则继续再此页面继续刷新一下试试。
4 | # 获取多账号京东Cookie
5 | https:\/\/me-api\.jd\.com\/user_new\/info\/GetJDUserInfoUnion url script-request-header https://raw.githubusercontent.com/yyn618/QuantumultX-Script/master/Script/Files/JD_extra_cookie.js
6 |
--------------------------------------------------------------------------------
/Script/Backup/JD_extra_cookie.js:
--------------------------------------------------------------------------------
1 | /*
2 | 获取多个京东cookie的脚本,不和NobyDa的京东cookie冲突。注:如与NobyDa的京东cookie重复,建议在BoxJs处删除重复的cookie
3 | ===================
4 | ===================
5 | 使用方式:在代理软件配置好下方配置后,复制 https://home.m.jd.com/myJd/newhome.action 到浏览器打开 ,在个人中心自动获取 cookie,
6 | 若弹出成功则正常使用。否则继续再此页面继续刷新一下试试。
7 |
8 | [MITM]
9 | hostname = me-api.jd.com
10 | */
11 |
12 | const APIKey = "CookiesJD";
13 | $ = new API(APIKey, true);
14 | const CacheKey = `#${APIKey}`;
15 | if ($request) GetCookie();
16 |
17 | function getCache() {
18 | var cache = $.read(CacheKey) || "[]";
19 | $.log(cache);
20 | return JSON.parse(cache);
21 | }
22 |
23 | function GetCookie() {
24 | try {
25 | if ($request.headers && $request.url.indexOf("GetJDUserInfoUnion") > -1) {
26 | var CV = $request.headers["Cookie"] || $request.headers["cookie"];
27 | if (CV.match(/(pt_key=.+?pt_pin=|pt_pin=.+?pt_key=)/)) {
28 | var CookieValue = CV.match(/pt_key=.+?;/) + CV.match(/pt_pin=.+?;/);
29 | var UserName = CookieValue.match(/pt_pin=([^; ]+)(?=;?)/)[1];
30 | var DecodeName = decodeURIComponent(UserName);
31 | var CookiesData = getCache();
32 | var updateCookiesData = [...CookiesData];
33 | var updateIndex;
34 | var CookieName = "【账号】";
35 | var updateCodkie = CookiesData.find((item, index) => {
36 | var ck = item.cookie;
37 | var Account = ck
38 | ? ck.match(/pt_pin=.+?;/)
39 | ? ck.match(/pt_pin=([^; ]+)(?=;?)/)[1]
40 | : null
41 | : null;
42 | const verify = UserName === Account;
43 | if (verify) {
44 | updateIndex = index;
45 | }
46 | return verify;
47 | });
48 | var tipPrefix = "";
49 | if (updateCodkie) {
50 | updateCookiesData[updateIndex].cookie = CookieValue;
51 | CookieName = `【账号${updateIndex + 1}】`;
52 | tipPrefix = "更新京东";
53 | } else {
54 | updateCookiesData.push({
55 | userName: DecodeName,
56 | cookie: CookieValue,
57 | });
58 | CookieName = "【账号" + updateCookiesData.length + "】";
59 | tipPrefix = "首次写入京东";
60 | }
61 | const cacheValue = JSON.stringify(updateCookiesData, null, "\t");
62 | $.write(cacheValue, CacheKey);
63 | $.notify(
64 | "用户名: " + DecodeName,
65 | "",
66 | tipPrefix + CookieName + "Cookie成功 🎉"
67 | );
68 | } else {
69 | $.notify("写入京东Cookie失败", "", "请查看脚本内说明, 登录网页获取 ‼️");
70 | }
71 | $.done();
72 | return;
73 | } else {
74 | $.notify("写入京东Cookie失败", "", "请检查匹配URL或配置内脚本类型 ‼️");
75 | }
76 | } catch (eor) {
77 | $.write("", CacheKey);
78 | $.notify("写入京东Cookie失败", "", "已尝试清空历史Cookie, 请重试 ⚠️");
79 | console.log(
80 | `\n写入京东Cookie出现错误 ‼️\n${JSON.stringify(
81 | eor
82 | )}\n\n${eor}\n\n${JSON.stringify($request.headers)}\n`
83 | );
84 | }
85 | $.done();
86 | }
87 |
88 | // prettier-ignore
89 | function ENV(){const isQX=typeof $task!=="undefined";const isLoon=typeof $loon!=="undefined";const isSurge=typeof $httpClient!=="undefined"&&!isLoon;const isJSBox=typeof require=="function"&&typeof $jsbox!="undefined";const isNode=typeof require=="function"&&!isJSBox;const isRequest=typeof $request!=="undefined";const isScriptable=typeof importModule!=="undefined";return{isQX,isLoon,isSurge,isNode,isJSBox,isRequest,isScriptable}}
90 | // prettier-ignore
91 | function HTTP(baseURL,defaultOptions={}){const{isQX,isLoon,isSurge,isScriptable,isNode}=ENV();const methods=["GET","POST","PUT","DELETE","HEAD","OPTIONS","PATCH"];function send(method,options){options=typeof options==="string"?{url:options}:options;options.url=baseURL?baseURL+options.url:options.url;options={...defaultOptions,...options};const timeout=options.timeout;const events={...{onRequest:()=>{},onResponse:(resp)=>resp,onTimeout:()=>{},},...options.events,};events.onRequest(method,options);let worker;if(isQX){worker=$task.fetch({method,...options})}else if(isLoon||isSurge||isNode){worker=new Promise((resolve,reject)=>{const request=isNode?require("request"):$httpClient;request[method.toLowerCase()](options,(err,response,body)=>{if(err)reject(err);else resolve({statusCode:response.status||response.statusCode,headers:response.headers,body,})})})}else if(isScriptable){const request=new Request(options.url);request.method=method;request.headers=options.headers;request.body=options.body;worker=new Promise((resolve,reject)=>{request.loadString().then((body)=>{resolve({statusCode:request.response.statusCode,headers:request.response.headers,body,})}).catch((err)=>reject(err))})}let timeoutid;const timer=timeout?new Promise((_,reject)=>{timeoutid=setTimeout(()=>{events.onTimeout();return reject(`${method}URL:${options.url}exceeds the timeout ${timeout}ms`)},timeout)}):null;return(timer?Promise.race([timer,worker]).then((res)=>{clearTimeout(timeoutid);return res}):worker).then((resp)=>events.onResponse(resp))}const http={};methods.forEach((method)=>(http[method.toLowerCase()]=(options)=>send(method,options)));return http}
92 | // prettier-ignore
93 | function API(name="untitled",debug=false){const{isQX,isLoon,isSurge,isNode,isJSBox,isScriptable}=ENV();return new(class{constructor(name,debug){this.name=name;this.debug=debug;this.http=HTTP();this.env=ENV();this.node=(()=>{if(isNode){const fs=require("fs");return{fs}}else{return null}})();this.initCache();const delay=(t,v)=>new Promise(function(resolve){setTimeout(resolve.bind(null,v),t)});Promise.prototype.delay=function(t){return this.then(function(v){return delay(t,v)})}}initCache(){if(isQX)this.cache=JSON.parse($prefs.valueForKey(this.name)||"{}");if(isLoon||isSurge)this.cache=JSON.parse($persistentStore.read(this.name)||"{}");if(isNode){let fpath="root.json";if(!this.node.fs.existsSync(fpath)){this.node.fs.writeFileSync(fpath,JSON.stringify({}),{flag:"wx"},(err)=>console.log(err))}this.root={};fpath=`${this.name}.json`;if(!this.node.fs.existsSync(fpath)){this.node.fs.writeFileSync(fpath,JSON.stringify({}),{flag:"wx"},(err)=>console.log(err));this.cache={}}else{this.cache=JSON.parse(this.node.fs.readFileSync(`${this.name}.json`))}}}persistCache(){const data=JSON.stringify(this.cache);if(isQX)$prefs.setValueForKey(data,this.name);if(isLoon||isSurge)$persistentStore.write(data,this.name);if(isNode){this.node.fs.writeFileSync(`${this.name}.json`,data,{flag:"w"},(err)=>console.log(err));this.node.fs.writeFileSync("root.json",JSON.stringify(this.root),{flag:"w"},(err)=>console.log(err))}}write(data,key){this.log(`SET ${key}`);if(key.indexOf("#")!==-1){key=key.substr(1);if(isSurge||isLoon){return $persistentStore.write(data,key)}if(isQX){return $prefs.setValueForKey(data,key)}if(isNode){this.root[key]=data}}else{this.cache[key]=data}this.persistCache()}read(key){this.log(`READ ${key}`);if(key.indexOf("#")!==-1){key=key.substr(1);if(isSurge||isLoon){return $persistentStore.read(key)}if(isQX){return $prefs.valueForKey(key)}if(isNode){return this.root[key]}}else{return this.cache[key]}}delete(key){this.log(`DELETE ${key}`);if(key.indexOf("#")!==-1){key=key.substr(1);if(isSurge||isLoon){$persistentStore.write(null,key)}if(isQX){$prefs.removeValueForKey(key)}if(isNode){delete this.root[key]}}else{delete this.cache[key]}this.persistCache()}notify(title,subtitle="",content="",options={}){const openURL=options["open-url"];const mediaURL=options["media-url"];if(isQX)$notify(title,subtitle,content,options);if(isSurge){$notification.post(title,subtitle,content+`${mediaURL?"\n多媒体:"+mediaURL:""}`,{url:openURL})}if(isLoon){let opts={};if(openURL)opts["openUrl"]=openURL;if(mediaURL)opts["mediaUrl"]=mediaURL;if(JSON.stringify(opts)=="{}"){$notification.post(title,subtitle,content)}else{$notification.post(title,subtitle,content,opts)}}if(isNode||isScriptable){const content_=content+(openURL?`\n点击跳转:${openURL}`:"")+(mediaURL?`\n多媒体:${mediaURL}`:"");if(isJSBox){const push=require("push");push.schedule({title:title,body:(subtitle?subtitle+"\n":"")+content_,})}else{console.log(`${title}\n${subtitle}\n${content_}\n\n`)}}}log(msg){if(this.debug)console.log(msg)}info(msg){console.log(msg)}error(msg){console.log("ERROR: "+msg)}wait(millisec){return new Promise((resolve)=>setTimeout(resolve,millisec))}done(value={}){if(isQX||isLoon||isSurge){$done(value)}else if(isNode&&!isJSBox){if(typeof $context!=="undefined"){$context.headers=value.headers;$context.statusCode=value.statusCode;$context.body=value.body}}}})(name,debug)}
94 |
--------------------------------------------------------------------------------
/Script/Backup/WeChat.js:
--------------------------------------------------------------------------------
1 | /*
2 | [Script]
3 | http-request ^https://mp\.weixin\.qq\.com/mp/getappmsgad script-path=https://Choler.github.io/Surge/Script/WeChat.js
4 |
5 | [MITM]
6 | hostname = mp.weixin.qq.com
7 | */
8 |
9 | var data = {
10 | body: "{}",
11 | headers: {
12 | "Content-Type": "application/json"
13 | }
14 | };
15 | $done({response: data});
16 |
--------------------------------------------------------------------------------
/Script/Backup/YouTube_Ad.conf:
--------------------------------------------------------------------------------
1 | #by DivineEngine
2 |
3 | hostname = -redirector*.googlevideo.com,*.googlevideo.com,www.youtube.com,s.youtube.com
4 |
5 | (^https?:\/\/[\w-]+\.googlevideo\.com\/(?!dclk_video_ads).+)&ctier=L(&.+) url 302 $1&ctier=A$2
6 | ^https?:\/\/[\w-]+\.googlevideo\.com\/(?!(dclk_video_ads|videoplayback\?)).+&oad url reject
7 |
8 | ^https?:\/\/(www|s)\.youtube\.com\/api\/stats\/ads url reject
9 | ^https?:\/\/(www|s)\.youtube\.com\/(pagead|ptracking) url reject
10 | ^https?:\/\/s\.youtube\.com\/api\/stats\/qoe\?adcontext url reject
11 |
--------------------------------------------------------------------------------
/Script/Backup/wb_ad.js:
--------------------------------------------------------------------------------
1 | const path1 = "/groups/timeline";
2 | const path2 = "/statuses/unread";
3 | const path3 = "/statuses/extend";
4 | const path4 = "/comments/build_comments";
5 | const path5 = "/photo/recommend_list";
6 | const path6 = "/stories/video_stream";
7 | const path7 = "/statuses/positives/get";
8 | const path8 = "/stories/home_list";
9 | const path9 = "/profile/statuses";
10 | const path10 = "/statuses/friends/timeline";
11 | const path11 = "/service/picfeed";
12 | const path12 = "/fangle/timeline";
13 | const path13 = "/searchall";
14 | const path14 = "/cardlist";
15 | const path15 = "/statuses/video_timeline";
16 | const path16 = "/page";
17 | const path17 = "/statuses/friends_timeline";
18 | const path18 = "/!/photos/pic_recommend_status";
19 | const path19 = "/statuses/video_mixtimeline";
20 | const path20 = "/video/tiny_stream_video_list";
21 | const path21 = "/photo/info";
22 | const path22 = "/live/media_homelist";
23 | const path23 = "/remind/unread_count";
24 |
25 | const url = $request.url;
26 | let body = $response.body;
27 |
28 | if (
29 | url.indexOf(path1) != -1 ||
30 | url.indexOf(path2) != -1 ||
31 | url.indexOf(path10) != -1 ||
32 | url.indexOf(path15) != -1 ||
33 | url.indexOf(path17) != -1 ||
34 | url.indexOf(path20) != -1
35 | ) {
36 | let obj = JSON.parse(body);
37 | if (obj.statuses) obj.statuses = filter_timeline_statuses(obj.statuses);
38 | if (obj.advertises) obj.advertises = [];
39 | if (obj.ad) obj.ad = [];
40 | if (obj.num) obj.num = obj.original_num;
41 | if (obj.trends) obj.trends = [];
42 | body = JSON.stringify(obj);
43 | } else if (url.indexOf(path3) != -1) {
44 | let obj = JSON.parse(body);
45 | if (obj.trend) delete obj.trend;
46 | body = JSON.stringify(obj);
47 | } else if (url.indexOf(path4) != -1) {
48 | let obj = JSON.parse(body);
49 | obj.recommend_max_id = 0;
50 | if (obj.status) {
51 | if (obj.top_hot_structs) {
52 | obj.max_id = obj.top_hot_structs.call_back_struct.max_id;
53 | delete obj.top_hot_structs;
54 | }
55 | if (obj.datas) obj.datas = filter_comments(obj.datas);
56 | } else {
57 | obj.datas = [];
58 | }
59 | body = JSON.stringify(obj);
60 | } else if (url.indexOf(path5) != -1 || url.indexOf(path18) != -1) {
61 | let obj = JSON.parse(body);
62 | obj.data = {};
63 | body = JSON.stringify(obj);
64 | } else if (url.indexOf(path6) != -1) {
65 | let obj = JSON.parse(body);
66 | let segments = obj.segments;
67 | if (segments && segments.length > 0) {
68 | let i = segments.length;
69 | while (i--) {
70 | const element = segments[i];
71 | let is_ad = element.is_ad;
72 | if (is_ad && is_ad == true) segments.splice(i, 1);
73 | }
74 | }
75 | body = JSON.stringify(obj);
76 | } else if (url.indexOf(path7) != -1) {
77 | let obj = JSON.parse(body);
78 | obj.datas = [];
79 | body = JSON.stringify(obj);
80 | } else if (url.indexOf(path8) != -1) {
81 | let obj = JSON.parse(body);
82 | obj.story_list = [];
83 | body = JSON.stringify(obj);
84 | } else if (url.indexOf(path11) != -1 || url.indexOf(path22) != -1) {
85 | let obj = JSON.parse(body);
86 | obj.data = [];
87 | body = JSON.stringify(obj);
88 | } else if (
89 | url.indexOf(path9) != -1 ||
90 | url.indexOf(path12) != -1 ||
91 | url.indexOf(path13) != -1 ||
92 | url.indexOf(path14) != -1 ||
93 | url.indexOf(path16) != -1
94 | ) {
95 | let obj = JSON.parse(body);
96 | if (obj.cards) obj.cards = filter_timeline_cards(obj.cards);
97 | body = JSON.stringify(obj);
98 | } else if (url.indexOf(path19) != -1) {
99 | let obj = JSON.parse(body);
100 | delete obj.expandable_view;
101 | if (obj.hasOwnProperty("expandable_views")) delete obj.expandable_views;
102 | body = JSON.stringify(obj);
103 | } else if (url.indexOf(path21) != -1) {
104 | if (body.indexOf("ad_params") != -1) {
105 | body = JSON.stringify({});
106 | }
107 | } else if (url.indexOf(path23) != -1) {
108 | let obj = JSON.parse(body);
109 | obj.video = {};
110 | body = JSON.stringify(obj);
111 | }
112 | $done({ body });
113 |
114 | function filter_timeline_statuses(statuses) {
115 | if (statuses && statuses.length > 0) {
116 | let i = statuses.length;
117 | while (i--) {
118 | let element = statuses[i];
119 | if (
120 | is_timeline_likerecommend(element.title) ||
121 | is_timeline_ad(element) ||
122 | is_stream_video_ad(element)
123 | ) {
124 | statuses.splice(i, 1);
125 | }
126 | }
127 | }
128 | return statuses;
129 | }
130 |
131 | function filter_comments(datas) {
132 | if (datas && datas.length > 0) {
133 | let i = datas.length;
134 | while (i--) {
135 | const element = datas[i];
136 | const type = element.type;
137 | if (type == 5 || type == 1 || type == 6) datas.splice(i, 1);
138 | }
139 | }
140 | return datas;
141 | }
142 |
143 | function filter_timeline_cards(cards) {
144 | if (cards && cards.length > 0) {
145 | let j = cards.length;
146 | while (j--) {
147 | let item = cards[j];
148 | let card_group = item.card_group;
149 | if (card_group && card_group.length > 0) {
150 | if (item.itemid && item.itemid == "hotword") {
151 | filter_top_search(card_group);
152 | } else {
153 | let i = card_group.length;
154 | while (i--) {
155 | let card_group_item = card_group[i];
156 | let card_type = card_group_item.card_type;
157 | if (card_type) {
158 | if (card_type == 9) {
159 | if (is_timeline_ad(card_group_item.mblog))
160 | card_group.splice(i, 1);
161 | } else if (card_type == 118 || card_type == 89) {
162 | card_group.splice(i, 1);
163 | } else if (card_type == 42) {
164 | if (
165 | card_group_item.desc ==
166 | "\u53ef\u80fd\u611f\u5174\u8da3\u7684\u4eba"
167 | ) {
168 | cards.splice(j, 1);
169 | break;
170 | }
171 | } else if (card_type == 17) {
172 | filter_top_search(card_group_item.group);
173 | }
174 | }
175 | }
176 | }
177 | } else {
178 | let card_type = item.card_type;
179 | if (card_type && card_type == 9) {
180 | if (is_timeline_ad(item.mblog)) cards.splice(j, 1);
181 | }
182 | }
183 | }
184 | }
185 | return cards;
186 | }
187 |
188 | function filter_top_search(group) {
189 | if (group && group.length > 0) {
190 | let k = group.length;
191 | while (k--) {
192 | let group_item = group[k];
193 | if (group_item.hasOwnProperty("promotion")) {
194 | group.splice(k, 1);
195 | }
196 | }
197 | }
198 | }
199 |
200 | function is_timeline_ad(mblog) {
201 | if (!mblog) return false;
202 | let promotiontype =
203 | mblog.promotion && mblog.promotion.type && mblog.promotion.type == "ad";
204 | let mblogtype = mblog.mblogtype && mblog.mblogtype == 1;
205 | return promotiontype || mblogtype ? true : false;
206 | }
207 |
208 | function is_timeline_likerecommend(title) {
209 | return title && title.type && title.type == "likerecommend" ? true : false;
210 | }
211 |
212 | function is_stream_video_ad(item) {
213 | return item.ad_state && item.ad_state == 1;
214 | }
215 |
--------------------------------------------------------------------------------
/Script/Backup/wb_launch.js:
--------------------------------------------------------------------------------
1 | /*
2 | README:https://github.com/yichahucha/surge/tree/master
3 | */
4 |
5 | const path1 = "/interface/sdk/sdkad.php";
6 | const path2 = "/wbapplua/wbpullad.lua";
7 |
8 | const url = $request.url;
9 | var body = $response.body;
10 |
11 | if (url.indexOf(path1) != -1) {
12 | let re = /\{.*\}/;
13 | body = body.match(re);
14 | var obj = JSON.parse(body);
15 | if (obj.background_delay_display_time) obj.background_delay_display_time = 60*60*24*365;
16 | if (obj.show_push_splash_ad) obj.show_push_splash_ad = false;
17 | if (obj.ads) obj.ads = [];
18 | body = JSON.stringify(obj) + 'OK';
19 | }
20 |
21 | if (url.indexOf(path2) != -1) {
22 | var obj = JSON.parse(body);
23 | if (obj.cached_ad && obj.cached_ad.ads) obj.cached_ad.ads = [];
24 | body = JSON.stringify(obj);
25 | }
26 |
27 | $done({body});
28 |
--------------------------------------------------------------------------------
/Script/Bili-Regions.conf:
--------------------------------------------------------------------------------
1 | hostname = ap?.bilibili.com
2 |
3 | #哔哩哔哩, 港澳台番剧自动切换地区 & 显示豆瓣评分
4 | ^https:\/\/ap(p|i)\.bilibili\.com\/(pgc\/view\/(v\d\/)?app|x(\/v\d)?\/view\/video)\/(season|online)\?access_key url script-response-body https://raw.githubusercontent.com/Orz-3/QuantumultX/master/Bili_Auto_Regions.js
5 | #可选, 适用于搜索指定地区的番剧
6 | ^https:\/\/app\.bilibili\.com\/x\/v\d\/search(\/type)?\?.+?%20(%E6%B8%AF|%E5%8F%B0|%E4%B8%AD)& url script-request-header https://raw.githubusercontent.com/Orz-3/QuantumultX/master/Bili_Auto_Regions.js
--------------------------------------------------------------------------------
/Script/JD_TB_price.conf:
--------------------------------------------------------------------------------
1 | hostname = api.m.jd.com, trade-acs.m.taobao.com
2 |
3 | #京东历史比价 (by Orz-3)
4 | ^https?://api\.m\.jd\.com/client\.action\?functionId=(wareBusiness|serverConfig|basicConfig) url script-response-body https://service.2ti.st/QuanX/Script/jd_tb_price/main.js
5 |
6 | #淘宝历史比价 (by yichahucha)
7 | ^http://.+/amdc/mobileDispatch url script-response-body https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/source/script/6e15bb0cadb8e75062bf44df91e4814a.js
8 | ^https?://trade-acs\.m\.taobao\.com/gw/mtop\.taobao\.detail\.getdetail url script-response-body https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/source/script/6e15bb0cadb8e75062bf44df91e4814a.js
9 |
--------------------------------------------------------------------------------
/Script/JS_Unlock.conf:
--------------------------------------------------------------------------------
1 | hostname = pan.baidu.com, account.wps.cn, *.kuwo.cn, vsco.co, api.revenuecat.com, bilibili.com
2 | # 百度网盘解锁VIP,视频倍速播放 (By zwf234)
3 | https:\/\/pan\.baidu\.com\/rest\/2\.0\/membership\/user url script-response-body https://raw.githubusercontent.com/zwf234/rules/master/js/BaiduCloud.js
4 |
5 | # WPS解锁VIP-超级会员、wps会员、稻壳会员 (By eHpo)
6 | # hostname = account.wps.cn
7 | ^https://account.wps.cn/api/users/ url script-response-body https://raw.githubusercontent.com/litieyin/AD_VIP/main/Script/wps.js
8 |
9 | # 酷我音乐解锁VIP(by nobyda)
10 | # hostname = *.kuwo.cn
11 | ^https?:\/\/vip1\.kuwo\.cn\/(vip\/v2\/user\/vip|vip\/spi/mservice) url script-response-body https://raw.githubusercontent.com/litieyin/AD_VIP/main/Script/kuwo.js
12 | ^https?:\/\/vip1\.kuwo\.cn\/(vip\/v2\/user\/vip|vip\/spi/mservice) url script-response-body https://raw.githubusercontent.com/NobyDa/Script/master/Surge/JS/Kuwo.js
13 | ^https?:\/\/musicpay\.kuwo\.cn\/music\.pay\?uid\=\d+ url 302 http://musicpay.kuwo.cn/music.pay?uid=2
14 |
15 | # VSCO解锁VIP(by nobyda)
16 | # hostname = vsco.co, api.revenuecat.com
17 | ^https?:\/\/vsco\.co\/api\/subscriptions\/2.1\/user-subscriptions\/ url script-response-body https://raw.githubusercontent.com/NobyDa/Script/master/QuantumultX/File/vsco.js
18 | ^https:\/\/(api\.revenuecat\.com\/v\d\/subscribers|vsco\.co\/api\/subscriptions\/\d\.\d\/user-subscriptions)\/ url script-response-body https://raw.githubusercontent.com/litieyin/AD_VIP/main/Script/vsco.js
19 |
20 | # 哔哩哔哩番剧解锁1080P+ (by NobyDa)
21 | # hostname = bilibili.com
22 | ^https:\/\/ap(p|i)\.bilibili\.com\/((pgc\/player\/api\/playurl)|(x\/v2\/account\/myinfo\?)|(x\/v2\/account/mine\?)) url script-response-body https://raw.githubusercontent.com/zqzess/rule_for_quantumultX/master/js/backup/bilifj.js
23 |
--------------------------------------------------------------------------------
/Script/Netflix-rating.conf:
--------------------------------------------------------------------------------
1 | # yichahucha
2 |
3 | hostname = ios-*.prod.ftl.netflix.com,ios.prod.ftl.netflix.com
4 |
5 | ^https?://ios\.prod\.ftl\.netflix\.com/iosui/user/.+path=%5B%22videos%22%2C%\d+%22%2C%22summary%22%5D url script-request-header https://raw.githubusercontent.com/yichahucha/surge/master/nf_rating.js
6 | ^https?://ios\.prod\.ftl\.netflix\.com/iosui/user/.+path=%5B%22videos%22%2C%\d+%22%2C%22summary%22%5D url script-response-body https://raw.githubusercontent.com/yichahucha/surge/master/nf_rating.js
7 | # 单集评分
8 | ^https?://ios\.prod\.ftl\.netflix\.com/iosui/warmer/.+type=show-ath url script-response-body https://raw.githubusercontent.com/yichahucha/surge/master/nf_rating_season.js
9 |
--------------------------------------------------------------------------------
/Script/Q-Search.conf:
--------------------------------------------------------------------------------
1 | # Q-Search
2 | # From Neurogram (https://raw.githubusercontent.com/Neurogram-R/Surge/master/module/Q-Search.sgmodule)
3 | # - Safari 内输入 命令 + 空格 + 关键词 快速指定搜索引擎搜索
4 | # 注:先进入设置更改 Safari 默认搜索为 DuckDuckGO
5 | # 可自行修改指令或者添加搜索引擎
6 |
7 | hostname = duckduckgo.com
8 |
9 | # 翻译
10 | # fy:有道
11 | ^https:\/\/duckduckgo.com\/\?q=yd\+([^&]+).+ url 302 http://dict.youdao.com/search?q=$1
12 |
13 | # 社区
14 | # db:豆瓣
15 | ^https:\/\/duckduckgo.com\/\?q=db\+([^&]+).+ url 302 https://m.douban.com/search/?query=$1
16 | # zh: 知乎
17 | ^https:\/\/duckduckgo.com\/\?q=zh\+([^&]+).+ url 302 https://www.zhihu.com/search?type=content&q=$1
18 | # wb: 微博
19 | ^https:\/\/duckduckgo.com\/\?q=wb\+([^&]+).+ url 302 https://s.weibo.com/weibo/$1
20 | # wx: 微信
21 | ^https:\/\/duckduckgo.com\/\?q=wx\+([^&]+).+ url 302 https://weixin.sogou.com/weixinwap?query=$1
22 | # tw:Twitter
23 | ^https:\/\/duckduckgo.com\/\?q=tw\+([^&]+).+ url 302 https://twitter.com/search?q=$1
24 | # gh:GitHub
25 | ^https:\/\/duckduckgo.com\/\?q=gh\+([^&]+).+ url 302 https://github.com/search?q=$1
26 |
27 | # > 购物
28 | # zdm:什么值得买
29 | ^https:\/\/duckduckgo.com\/\?q=zdm\+([^&]+).+ url 302 https://search.m.smzdm.com/?v=b&s=$1
30 | # jd:京东
31 | ^https:\/\/duckduckgo.com\/\?q=jd\+([^&]+).+ url 302 https://so.m.jd.com/ware/search.action?keyword=$1
32 | # tb:淘宝
33 | ^https:\/\/duckduckgo.com\/\?q=tb\+([^&]+).+ url 302 https://s.m.taobao.com/h5?q=$1
34 |
35 | # 视频资源
36 | # bl:哔哩哔哩
37 | ^https:\/\/duckduckgo.com\/\?q=bli\+([^&]+).+ url 302 https://m.bilibili.com/search?keyword=$1
38 | # ytb:YouTube
39 | ^https:\/\/duckduckgo.com\/\?q=ytb\+([^&]+).+ url 302 https://www.youtube.com/results?search_query=$1
40 | # ph:PornHub
41 | ^https:\/\/duckduckgo.com\/\?q=ph\+([^&]+).+ url 302 https://cn.pornhub.com/video/search?search=$1
42 |
43 | # 默认搜索
44 | # bi:必应
45 | ^https:\/\/duckduckgo.com\/\?q=bi\+([^&]+).+ url 302 https://cn.bing.com/search?q=$1
46 | # bd:百度
47 | ^https:\/\/duckduckgo.com\/\?q=bd\+([^&]+).+ url 302 https://www.baidu.com/s?wd=$1
48 | # 无指令:谷歌
49 | ^https:\/\/duckduckgo.com\/\?q=([^&]+).+ url 302 https://www.google.com/search?q=$1
50 |
--------------------------------------------------------------------------------
/Script/TFDownload.conf:
--------------------------------------------------------------------------------
1 | #by NobyDa
2 | # 该订阅仅适用于QuantumultX, 用于更新TestFlight App时, 提示"APP不可用"问题. 解除区域限制.
3 |
4 | hostname = testflight.apple.com
5 |
6 | ^https?:\/\/testflight\.apple\.com\/v\d\/accounts\/.+?\/install$ url script-request-body https://gist.githubusercontent.com/NobyDa/9be418b93afc5e9c8a8f4d28ae403cf2/raw/TF_Download.js
--------------------------------------------------------------------------------
/Script/TikTok-JP.conf:
--------------------------------------------------------------------------------
1 | # bySemporia
2 |
3 | hostname = *.tiktokv.com, *.byteoversea.com, *.tik-tokapi.com
4 |
5 | (?<=_region=)CN(?=&) url 307 JP
6 | (?<=&mcc_mnc=)4 url 307 2
7 | ^(https?:\/\/(tnc|dm)[\w-]+\.\w+\.com\/.+)(\?)(.+) url 302 $1$3
8 | (?<=\d\/\?\w{7}_\w{4}=)1[6-9]..(?=.?.?&) url 307 17
--------------------------------------------------------------------------------
/Script/TikTok-TW.conf:
--------------------------------------------------------------------------------
1 | # bySemporia
2 |
3 | hostname = *.tiktokv.com, *.byteoversea.com, *.tik-tokapi.com
4 |
5 | (?<=_region=)CN(?=&) url 307 TW
6 | (?<=&mcc_mnc=)4 url 307 2
7 | ^(https?:\/\/(tnc|dm)[\w-]+\.\w+\.com\/.+)(\?)(.+) url 302 $1$3
8 | (?<=\d\/\?\w{7}_\w{4}=)1[6-9]..(?=.?.?&) url 307 17
--------------------------------------------------------------------------------
/Script/TikTok-US.conf:
--------------------------------------------------------------------------------
1 | # bySemporia
2 |
3 | hostname = *.tiktokv.com, *.byteoversea.com, *.tik-tokapi.com
4 |
5 | (?<=_region=)CN(?=&) url 307 US
6 | (?<=&mcc_mnc=)4 url 307 2
7 | ^(https?:\/\/(tnc|dm)[\w-]+\.\w+\.com\/.+)(\?)(.+) url 302 $1$3
8 | (?<=\d\/\?\w{7}_\w{4}=)1[6-9]..(?=.?.?&) url 307 17
9 |
--------------------------------------------------------------------------------
/Task/JD New/jd_jdkd1.js:
--------------------------------------------------------------------------------
1 | /*
2 | 京东快递
3 | @Leaf
4 |
5 | 30 16 * * * jd_jdkd1.js
6 |
7 | */
8 | const $ = new Env('京东快递');
9 | const got = require('got');
10 |
11 | const envSplitor = ['&','\n','@']
12 | const ckNames = ['JD_COOKIE']
13 |
14 | const MAX_THREAD = parseInt(process.env['jd_jdkd_thread']) || 5
15 | const DEFAULT_TIMEOUT=8000, DEFAULT_RETRY=3;
16 |
17 | const default_UA = 'Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.31(0x18001f2f) NetType/WIFI Language/zh_CN miniProgram/wx73247c7819d61796'
18 | const Referer = 'https://jingcai-h5.jd.com/'
19 | const Origin = 'https://jingcai-h5.jd.com'
20 |
21 | const client = got.extend({
22 | headers:{
23 | Connection:'keep-alive',
24 | 'User-Agent': default_UA,
25 | Referer,
26 | Origin,
27 | AppParams: JSON.stringify({"appid":158,"ticket_type":"m"}),
28 | ClientInfo: JSON.stringify({"appName":"jingcai","client":"m"}),
29 | 'LOP-DN': 'jingcai.jd.com',
30 | 'X-Requested-With': 'XMLHttpRequest',
31 | },
32 | retry: {limit:0},
33 | timeout: DEFAULT_TIMEOUT,
34 | followRedirect: false,
35 | })
36 |
37 | class BasicClass{constructor(){this.index=$.userIdx++;this.name='';} log(msg,opt={}){var m='',n=$.userCount.toString().length;;if(this.index)m+=`账号[${$.padStr(this.index,n)}]`;if(this.name)m+=`[${this.name}]`;$.log(m+msg,opt);} async request(opt){var resp=null,count=0;var fn=opt.fn||opt.url;opt.method=opt?.method?.toUpperCase()||'GET';while(count++{resp=t},e=>{resp=e.response});if(((resp?.statusCode/100)|0)<=4)break;}catch(e){if(e.name=='TimeoutError'){this.log(`[${fn}]请求超时,重试第${count}次`);}else{this.log(`[${fn}]请求错误(${e.message}),重试第${count}次`);}};} if(resp==null)return Promise.resolve({statusCode:-1,headers:null,result:null});let{statusCode,headers,body}=resp;if(body)try{body=JSON.parse(body);}catch{};return Promise.resolve({statusCode,headers,result:body})}}
38 | let http = new BasicClass();
39 |
40 | class UserClass extends BasicClass {
41 | constructor(ck) {
42 | super()
43 | this.cookie = ck
44 | this.pt_pin = ck.match(/pin=([\w\-\%]+)/) ? ck.match(/pin=([\w\-\%]+)/)[1] : ''
45 | this.name = decodeURIComponent(this.pt_pin)
46 | }
47 |
48 | async queryTaskList() {
49 | try {
50 | let options = {
51 | fn: 'queryTaskList',
52 | method: 'post',
53 | url: 'https://lop-proxy.jd.com/ESGApi/queryTaskList',
54 | headers: {Cookie:this.cookie,'event-id':$.randomPattern('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx')},
55 | json: [{"pin":"$cooMrdGatewayUid$"}],
56 | }
57 | let {result} = await this.request(options)
58 | let code = result?.code
59 | if(code == 1) {
60 | for(let task of (result?.content?.taskInfoList||[]).filter(x => x.taskReachNum < x.taskNeedReachNum && x.triggerType==1)) {
61 | await this.reachTaskInfo(task);
62 | await $.wait(1000);
63 | break;
64 | }
65 | } else {
66 | let errCode = code || result?.error_response?.code
67 | let errMsg = result?.msg || result?.error_response?.zh_desc
68 | this.log(`查询任务列表出错[${errCode}]: ${errMsg}`)
69 | }
70 | } catch (e) {
71 | $.log(e)
72 | } finally {
73 | return Promise.resolve()
74 | }
75 | }
76 |
77 | async reachTaskInfo(task) {
78 | try {
79 | let options = {
80 | fn: 'reachTaskInfo',
81 | method: 'post',
82 | url: 'https://lop-proxy.jd.com/ESGApi/reachTaskInfo',
83 | headers: {Cookie:this.cookie,'event-id':$.randomPattern('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx')},
84 | json: [{
85 | taskNo: task.taskNo,
86 | childTaskId: task.childTaskId,
87 | pin: "$cooMrdGatewayUid$",
88 | }],
89 | }
90 | let {result} = await this.request(options)
91 | let code = result?.code
92 | if(code == 1) {
93 | this.log(`完成任务[${task.taskTitle}]成功`);
94 | await $.wait(1000);
95 | await this.queryTaskList();
96 | } else {
97 | let errCode = code || result?.error_response?.code
98 | let errMsg = result?.msg || result?.error_response?.zh_desc
99 | this.log(`完成任务[${task.taskTitle}]失败[${errCode}]: ${errMsg}`)
100 | }
101 | } catch (e) {
102 | $.log(e)
103 | } finally {
104 | return Promise.resolve()
105 | }
106 | }
107 |
108 | async queryCanGetRewardTaskList() {
109 | try {
110 | let options = {
111 | fn: 'queryCanGetRewardTaskList',
112 | method: 'post',
113 | url: 'https://lop-proxy.jd.com/ESGApi/queryCanGetRewardTaskList',
114 | headers: {Cookie:this.cookie,'event-id':$.randomPattern('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx')},
115 | json: [{"pin":"$cooMrdGatewayUid$"}],
116 | }
117 | let {result} = await this.request(options)
118 | let code = result?.code
119 | if(code == 1) {
120 | for(let item of (result?.content?.personalCarbonRewardRespDtoList||[])) {
121 | await this.operationPersonalCarbonIntegral(item)
122 | }
123 | } else {
124 | let errCode = code || result?.error_response?.code
125 | let errMsg = result?.msg || result?.error_response?.zh_desc
126 | this.log(`查询可领取奖励出错[${errCode}]: ${errMsg}`)
127 | }
128 | } catch (e) {
129 | $.log(e)
130 | } finally {
131 | return Promise.resolve()
132 | }
133 | }
134 |
135 | async operationPersonalCarbonIntegral(item) {
136 | try {
137 | let options = {
138 | fn: 'operationPersonalCarbonIntegral',
139 | method: 'post',
140 | url: 'https://lop-proxy.jd.com/ESGApi/operationPersonalCarbonIntegral',
141 | headers: {Cookie:this.cookie,'event-id':$.randomPattern('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx')},
142 | json: [{
143 | type: 2,
144 | operationType: 1,
145 | rewardNo: item.rewardNo,
146 | taskNo: item.taskNo,
147 | pin: "$cooMrdGatewayUid$",
148 | }],
149 | }
150 | let {result} = await this.request(options)
151 | let code = result?.code
152 | if(code == 1) {
153 | this.log(`收取[${item.taskTitle}]奖励成功, 现在有${result?.content?.carbonIntegral}g能量`)
154 | } else {
155 | let errCode = code || result?.error_response?.code
156 | let errMsg = result?.msg || result?.error_response?.zh_desc
157 | this.log(`收取[${item.taskTitle}]奖励失败[${errCode}]: ${errMsg}`)
158 | }
159 | } catch (e) {
160 | $.log(e)
161 | } finally {
162 | return Promise.resolve()
163 | }
164 | }
165 |
166 | async userTask() {
167 | await this.queryTaskList();
168 | await this.queryCanGetRewardTaskList();
169 | }
170 | }
171 |
172 | !(async () => {
173 | $.read_env(UserClass);
174 |
175 | await $.threadTask('userTask',MAX_THREAD)
176 | })()
177 | .catch((e) => $.log(e))
178 | .finally(() => $.exitNow())
179 |
180 | function Env(name){return new class{constructor(name){this.name=name;this.startTime=Date.now();this.log(`[${this.name}]开始运行\n`,{time:true});this.notifyStr=[];this.notifyFlag=true;this.userIdx=0;this.userList=[];this.userCount=0;} log(msg,options={}){let opt={console:true};Object.assign(opt,options);if(opt.time){let fmt=opt.fmt||'hh:mm:ss';msg=`[${this.time(fmt)}]`+msg;} if(opt.notify)this.notifyStr.push(msg);if(opt.console)console.log(msg);} read_env(Class){let envStrList=ckNames.map(x=>process.env[x]);for(let env_str of envStrList.filter(x=>!!x)){let sp=envSplitor.filter(x=>env_str.includes(x));let splitor=sp.length>0?sp[0]:envSplitor[0];for(let ck of env_str.split(splitor).filter(x=>!!x)){this.userList.push(new Class(ck));}} this.userCount=this.userList.length;if(!this.userCount){this.log(`未找到变量,请检查变量${ckNames.map(x => '['+x+']').join('或')}`,{notify:true});return false;} this.log(`共找到${this.userCount}个账号`);return true;} async threads(taskName,conf,opt={}){while(conf.idx<$.userList.length){let user=$.userList[conf.idx++];await user[taskName](opt);}} async threadTask(taskName,thread){let taskAll=[];let taskConf={idx:0};while(thread--)taskAll.push(this.threads(taskName,taskConf));await Promise.all(taskAll);} time(t,x=null){let xt=x?new Date(x):new Date;let e={"M+":xt.getMonth()+1,"d+":xt.getDate(),"h+":xt.getHours(),"m+":xt.getMinutes(),"s+":xt.getSeconds(),"q+":Math.floor((xt.getMonth()+3)/3),S:this.padStr(xt.getMilliseconds(),3)};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(xt.getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).length)));return t;} async showmsg(){if(!this.notifyFlag)return;if(!this.notifyStr.length)return;var notify=require('./sendNotify');this.log('\n============== 推送 ==============');await notify.sendNotify(this.name,this.notifyStr.join('\n'));} padStr(num,length,opt={}){let padding=opt.padding||'0';let mode=opt.mode||'l';let numStr=String(num);let numPad=(length>numStr.length)?(length-numStr.length):0;let pads='';for(let i=0;isetTimeout(e,t));} async exitNow(){await this.showmsg();let e=Date.now();let s=(e-this.startTime)/1000;this.log('');this.log(`[${this.name}]运行结束,共运行了${s}秒`,{time:true});process.exit(0);}} (name)}
--------------------------------------------------------------------------------
/Task/JD New/jd_plus2bean.js:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | 9 8 * * * jd_plus2bean.js
4 | */
5 |
6 | const $ = new Env('plus专属礼');
7 | const notify = $.isNode() ? require('./sendNotify') : '';
8 | const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
9 | let jdNotify = true;
10 | //IOS等用户直接用NobyDa的jd cookie
11 | let cookiesArr = [], cookie = '', message = '';
12 | if ($.isNode()) {
13 | Object.keys(jdCookieNode).forEach((item) => {
14 | cookiesArr.push(jdCookieNode[item])
15 | })
16 | if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => { };
17 | } else {
18 | cookiesArr = [$.getdata('CookieJD'), $.getdata('CookieJD2'), ...jsonParse($.getdata('CookiesJD') || "[]").map(item => item.cookie)].filter(item => !!item);
19 | }
20 | !(async () => {
21 | if (!cookiesArr[0]) {
22 | $.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', { "open-url": "https://bean.m.jd.com/bean/signIndex.action" });
23 | return;
24 | }
25 | for (let i = 0; i < cookiesArr.length; i++) {
26 | if (cookiesArr[i]) {
27 | cookie = cookiesArr[i];
28 | $.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1])
29 | $.index = i + 1;
30 | $.isLogin = true;
31 | $.nickName = '';
32 | //await TotalBean();
33 | console.log(`\n******开始【京东账号${$.index}】${$.nickName || $.UserName}*********\n`);
34 | if (!$.isLogin) {
35 | $.msg($.name, `【提示】cookie已失效`, `京东账号${$.index} ${$.nickName || $.UserName}\n请重新登录获取\nhttps://bean.m.jd.com/bean/signIndex.action`, { "open-url": "https://bean.m.jd.com/bean/signIndex.action" });
36 | if ($.isNode()) {
37 | await notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`);
38 | }
39 | continue
40 | }
41 | await jingBeanReceive();
42 | await $.wait(2000)
43 | }
44 | }
45 | })()
46 | .catch((e) => {
47 | $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '')
48 | })
49 | .finally(() => {
50 | $.done();
51 | })
52 |
53 |
54 |
55 | function jingBeanReceive() {
56 | let opt = {
57 | url: `https://api.m.jd.com/client.action?functionId=jingBeanReceive&body={"encryptAssignmentId":"6bzcu8ZNPHFhuWZC55MhLgJCPiW","firstType":-100,"plugin_version":90556}&clientVersion=11.0.2&client=android&ef=1&ep=%7B%22ts%22%3A1658155958775%2C%22ridx%22%3A-1%2C%22cipher%22%3A%7B%22uuid%22%3A%22EJc4ENY0CJLrYzLwDQZsZq%3D%3D%22%2C%22aid%22%3A%22EJc4ENY0CJLrYzLwDQZsZq%3D%3D%22%7D%2C%22ciphertype%22%3A5%2C%22version%22%3A%221.2.0%22%7D&st=1658155977625&sign=354bbcb59bdc53276a62fb21c9d1f3df&sv=110`,
58 | headers: {
59 | 'Host': 'api.m.jd.com',
60 | 'accept-encoding': 'gzip,deflate',
61 | 'content-type': 'application/x-www-form-urlencoded; charset=UTF-8',
62 | 'User-Agent': 'okhttp/3.12.1;jdmall;android;version/11.0.2;build/97565;',
63 | 'Cookie': cookie
64 | }
65 | }
66 | return new Promise(async (resolve) => {
67 | $.post(opt, async (err, resp, data) => {
68 | try {
69 | if (err) {
70 | console.log(`${JSON.stringify(err)}`)
71 | console.log(`jingBeanReceive请求失败,请检查网路重试`)
72 | } else {
73 | data = JSON.parse(data)
74 | if (data.isSuccess) {
75 | console.log(data.data.windowsContent)
76 | } else {
77 | console.log('已领取过!')
78 | }
79 | }
80 | } catch (e) {
81 | $.logErr(e, resp)
82 | } finally {
83 | resolve(data)
84 | }
85 | })
86 | })
87 | }
88 |
89 |
90 | function TotalBean() {
91 | return new Promise(async resolve => {
92 | const options = {
93 | url: "https://wq.jd.com/user_new/info/GetJDUserInfoUnion?sceneval=2",
94 | headers: {
95 | Host: "wq.jd.com",
96 | Accept: "*/*",
97 | Connection: "keep-alive",
98 | Cookie: cookie,
99 | "User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.4.4;14.3;network/4g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1"),
100 | "Accept-Language": "zh-cn",
101 | "Referer": "https://home.m.jd.com/myJd/newhome.action?sceneval=2&ufc=&",
102 | "Accept-Encoding": "gzip, deflate, br"
103 | }
104 | }
105 | $.get(options, (err, resp, data) => {
106 | try {
107 | if (err) {
108 | $.logErr(err)
109 | } else {
110 | if (data) {
111 | data = JSON.parse(data);
112 | if (data['retcode'] === 1001) {
113 | $.isLogin = false;
114 | return;
115 | }
116 | if (data['retcode'] === 0 && data.data && data.data.hasOwnProperty("userInfo")) {
117 | $.nickName = data.data.userInfo.baseInfo.nickname;
118 | }
119 | } else {
120 | console.log('京东服务器返回空数据');
121 | }
122 | }
123 | } catch (e) {
124 | $.logErr(e)
125 | } finally {
126 | resolve();
127 | }
128 | })
129 | })
130 | }
131 | function showMsg() {
132 | return new Promise(resolve => {
133 | if (!jdNotify) {
134 | $.msg($.name, '', `${message}`);
135 | } else {
136 | $.log(`京东账号${$.index}${$.nickName}\n${message}`);
137 | }
138 | resolve()
139 | })
140 | }
141 | function safeGet(data) {
142 | try {
143 | if (typeof JSON.parse(data) == "object") {
144 | return true;
145 | }
146 | } catch (e) {
147 | console.log(e);
148 | console.log(`京东服务器访问数据为空,请检查自身设备网络情况`);
149 | return false;
150 | }
151 | }
152 | function jsonParse(str) {
153 | if (typeof str == "string") {
154 | try {
155 | return JSON.parse(str);
156 | } catch (e) {
157 | console.log(e);
158 | $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie')
159 | return [];
160 | }
161 | }
162 | }
163 | // prettier-ignore
164 | function Env(t, e) { "undefined" != typeof process && JSON.stringify(process.env).indexOf("GITHUB") > -1 && process.exit(0); class s { constructor(t) { this.env = t } send(t, e = "GET") { t = "string" == typeof t ? { url: t } : t; let s = this.get; return "POST" === e && (s = this.post), new Promise((e, i) => { s.call(this, t, (t, s, r) => { t ? i(t) : e(s) }) }) } get(t) { return this.send.call(this.env, t) } post(t) { return this.send.call(this.env, t, "POST") } } return new class { constructor(t, e) { this.name = t, this.http = new s(this), this.data = null, this.dataFile = "box.dat", this.logs = [], this.isMute = !1, this.isNeedRewrite = !1, this.logSeparator = "\n", this.startTime = (new Date).getTime(), Object.assign(this, e), this.log("", `🔔${this.name}, 开始!`) } isNode() { return "undefined" != typeof module && !!module.exports } isQuanX() { return "undefined" != typeof $task } isSurge() { return "undefined" != typeof $httpClient && "undefined" == typeof $loon } isLoon() { return "undefined" != typeof $loon } toObj(t, e = null) { try { return JSON.parse(t) } catch { return e } } toStr(t, e = null) { try { return JSON.stringify(t) } catch { return e } } getjson(t, e) { let s = e; const i = this.getdata(t); if (i) try { s = JSON.parse(this.getdata(t)) } catch { } return s } setjson(t, e) { try { return this.setdata(JSON.stringify(t), e) } catch { return !1 } } getScript(t) { return new Promise(e => { this.get({ url: t }, (t, s, i) => e(i)) }) } runScript(t, e) { return new Promise(s => { let i = this.getdata("@chavy_boxjs_userCfgs.httpapi"); i = i ? i.replace(/\n/g, "").trim() : i; let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); r = r ? 1 * r : 20, r = e && e.timeout ? e.timeout : r; const [o, h] = i.split("@"), n = { url: `http://${h}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": o, Accept: "*/*" } }; this.post(n, (t, e, i) => s(i)) }).catch(t => this.logErr(t)) } loaddata() { if (!this.isNode()) return {}; { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e); if (!s && !i) return {}; { const i = s ? t : e; try { return JSON.parse(this.fs.readFileSync(i)) } catch (t) { return {} } } } } writedata() { if (this.isNode()) { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e), r = JSON.stringify(this.data); s ? this.fs.writeFileSync(t, r) : i ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r) } } lodash_get(t, e, s) { const i = e.replace(/\[(\d+)\]/g, ".$1").split("."); let r = t; for (const t of i) if (r = Object(r)[t], void 0 === r) return s; return r } lodash_set(t, e, s) { return Object(t) !== t ? t : (Array.isArray(e) || (e = e.toString().match(/[^.[\]]+/g) || []), e.slice(0, -1).reduce((t, s, i) => Object(t[s]) === t[s] ? t[s] : t[s] = Math.abs(e[i + 1]) >> 0 == +e[i + 1] ? [] : {}, t)[e[e.length - 1]] = s, t) } getdata(t) { let e = this.getval(t); if (/^@/.test(t)) { const [, s, i] = /^@(.*?)\.(.*?)$/.exec(t), r = s ? this.getval(s) : ""; if (r) try { const t = JSON.parse(r); e = t ? this.lodash_get(t, i, "") : e } catch (t) { e = "" } } return e } setdata(t, e) { let s = !1; if (/^@/.test(e)) { const [, i, r] = /^@(.*?)\.(.*?)$/.exec(e), o = this.getval(i), h = i ? "null" === o ? null : o || "{}" : "{}"; try { const e = JSON.parse(h); this.lodash_set(e, r, t), s = this.setval(JSON.stringify(e), i) } catch (e) { const o = {}; this.lodash_set(o, r, t), s = this.setval(JSON.stringify(o), i) } } else s = this.setval(t, e); return s } getval(t) { return this.isSurge() || this.isLoon() ? $persistentStore.read(t) : this.isQuanX() ? $prefs.valueForKey(t) : this.isNode() ? (this.data = this.loaddata(), this.data[t]) : this.data && this.data[t] || null } setval(t, e) { return this.isSurge() || this.isLoon() ? $persistentStore.write(t, e) : this.isQuanX() ? $prefs.setValueForKey(t, e) : this.isNode() ? (this.data = this.loaddata(), this.data[e] = t, this.writedata(), !0) : this.data && this.data[e] || null } initGotEnv(t) { this.got = this.got ? this.got : require("got"), this.cktough = this.cktough ? this.cktough : require("tough-cookie"), this.ckjar = this.ckjar ? this.ckjar : new this.cktough.CookieJar, t && (t.headers = t.headers ? t.headers : {}, void 0 === t.headers.Cookie && void 0 === t.cookieJar && (t.cookieJar = this.ckjar)) } get(t, e = (() => { })) { t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { try { if (t.headers["set-cookie"]) { const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); s && this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar } } catch (t) { this.logErr(t) } }).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) })) } post(t, e = (() => { })) { if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.post(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) }); else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t)); else if (this.isNode()) { this.initGotEnv(t); const { url: s, ...i } = t; this.got.post(s, i).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) }) } } time(t, e = null) { const s = e ? new Date(e) : new Date; let i = { "M+": s.getMonth() + 1, "d+": s.getDate(), "H+": s.getHours(), "m+": s.getMinutes(), "s+": s.getSeconds(), "q+": Math.floor((s.getMonth() + 3) / 3), S: s.getMilliseconds() }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, (s.getFullYear() + "").substr(4 - RegExp.$1.length))); for (let e in i) new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? i[e] : ("00" + i[e]).substr(("" + i[e]).length))); return t } msg(e = t, s = "", i = "", r) { const o = t => { if (!t) return t; if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? { "open-url": t } : this.isSurge() ? { url: t } : void 0; if ("object" == typeof t) { if (this.isLoon()) { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } if (this.isQuanX()) { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl; return { "open-url": e, "media-url": s } } if (this.isSurge()) { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } } }; if (this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))), !this.isMuteLog) { let t = ["", "==============📣系统通知📣=============="]; t.push(e), s && t.push(s), i && t.push(i), console.log(t.join("\n")), this.logs = this.logs.concat(t) } } log(...t) { t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator)) } logErr(t, e) { const s = !this.isSurge() && !this.isQuanX() && !this.isLoon(); s ? this.log("", `❗️${this.name}, 错误!`, t.stack) : this.log("", `❗️${this.name}, 错误!`, t) } wait(t) { return new Promise(e => setTimeout(e, t)) } done(t = {}) { const e = (new Date).getTime(), s = (e - this.startTime) / 1e3; this.log("", `🔔${this.name}, 结束! 🕛 ${s} 秒`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) } }(t, e) }
--------------------------------------------------------------------------------
/Task/JD New/jd_pluscore.js:
--------------------------------------------------------------------------------
1 | /**
2 | 11 11 11 11 * jd_pluscore.js
3 | */
4 | const $ = new Env('plus分查询');
5 | const notify = $.isNode() ? require('./sendNotify') : '';
6 | const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
7 |
8 |
9 | let cookiesArr = [], cookie = '', message;
10 | if ($.isNode()) {
11 | Object.keys(jdCookieNode).forEach((item) => {
12 | cookiesArr.push(jdCookieNode[item])
13 | })
14 | if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {};
15 | } else {
16 | cookiesArr = [$.getdata('CookieJD'), $.getdata('CookieJD2'), ...jsonParse($.getdata('CookiesJD') || "[]").map(item => item.cookie)].filter(item => !!item);
17 | }
18 |
19 | !(async () => {
20 | if (!cookiesArr[0]) {
21 | $.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', {"open-url": "https://bean.m.jd.com/bean/signIndex.action"});
22 | return;
23 | }
24 | for (let i = 0; i < cookiesArr.length; i++) {
25 | getUA();
26 | cookie = cookiesArr[i];
27 | $.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1]);
28 | $.index = i + 1;
29 | $.nickName = '';
30 | $.isLogin = true;
31 |
32 | console.log(`******开始【京东账号${$.index}】${$.nickName || $.UserName}*********`);
33 |
34 | await isWhite();
35 | await $.wait(parseInt(Math.random() * 1500 + 500, 10));
36 | }
37 |
38 | })()
39 | .catch((e) => {
40 | $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '')
41 | })
42 | .finally(() => {
43 | $.done();
44 | })
45 |
46 |
47 | function safeGet(data) {
48 | try {
49 | if (typeof JSON.parse(data) == "object") {
50 | return true;
51 | }
52 | } catch (e) {
53 | return false;
54 | }
55 | }
56 |
57 | function isWhite() {
58 | return new Promise(resolve => {
59 | let get = {
60 | url: `https://rsp.jd.com/windControl/queryScore/v1?lt=m&an=plus.mobile&stamp=${Date.now()}`,
61 | headers: {
62 | "User-Agent": $.UA,
63 | "X-Requested-With": "com.jingdong.app.mall",
64 | 'Referer': 'https://plus.m.jd.com/rights/windControl',
65 | "Cookie": cookie,
66 | },
67 | timeout: 30000
68 | }
69 | $.get(get, async (err, resp, data) => {
70 | try {
71 | if (err) {
72 | console.log(`${$.toStr(err)}`)
73 | console.log(`API请求失败,请检查网路重试`)
74 | } else {
75 | if (typeof data == 'string') {
76 | data = JSON.parse(data);
77 | if (data.code == 1000) {
78 | $.totalScore = data.rs.userSynthesizeScore.totalScore;
79 | console.log(`PLUS分: ${$.totalScore}\n`);
80 | } else {
81 | console.log(JSON.stringify(data));
82 | }
83 | }
84 | }
85 | } catch (e) {
86 | $.logErr(e, resp)
87 | } finally {
88 | resolve();
89 | }
90 | })
91 | })
92 |
93 | }
94 |
95 | function jsonParse(str) {
96 | if (typeof str == "string") {
97 | try {
98 | return JSON.parse(str);
99 | } catch (e) {
100 | console.log(e);
101 | $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie')
102 | return [];
103 | }
104 | }
105 | }
106 |
107 | async function getUA() {
108 | $.UA = `jdapp;iPhone;10.4.6;13.1.2;${randomString(40)};network/wifi;model/iPhone8,1;addressid/2308460611;appBuild/167814;jdSupportDarkMode/0;Mozilla/5.0 (iPhone; CPU iPhone OS 13_1_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1`
109 | return $.UA;
110 | }
111 |
112 | function randomString(e) {
113 | e = e || 32;
114 | let t = "abcdef0123456789", a = t.length, n = "";
115 | for (i = 0; i < e; i++)
116 | n += t.charAt(Math.floor(Math.random() * a));
117 | return n
118 | }
119 |
120 | function random(min, max) {
121 | return Math.floor(Math.random() * (max - min)) + min;
122 | }
123 |
124 |
125 | function Env(t,e){"undefined"!=typeof process&&JSON.stringify(process.env).indexOf("GITHUB")>-1&&process.exit(0);class s{constructor(t){this.env=t}send(t,e="GET"){t="string"==typeof t?{url:t}:t;let s=this.get;return"POST"===e&&(s=this.post),new Promise((e,i)=>{s.call(this,t,(t,s,r)=>{t?i(t):e(s)})})}get(t){return this.send.call(this.env,t)}post(t){return this.send.call(this.env,t,"POST")}}return new class{constructor(t,e){this.name=t,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.isNeedRewrite=!1,this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`🔔${this.name}, 开始!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null){try{return JSON.stringify(t)}catch{return e}}getjson(t,e){let s=e;const i=this.getdata(t);if(i)try{s=JSON.parse(this.getdata(t))}catch{}return s}setjson(t,e){try{return this.setdata(JSON.stringify(t),e)}catch{return!1}}getScript(t){return new Promise(e=>{this.get({url:t},(t,s,i)=>e(i))})}runScript(t,e){return new Promise(s=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let r=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");r=r?1*r:20,r=e&&e.timeout?e.timeout:r;const[o,h]=i.split("@"),n={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(n,(t,e,i)=>s(i))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e);if(!s&&!i)return{};{const i=s?t:e;try{return JSON.parse(this.fs.readFileSync(i))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e),r=JSON.stringify(this.data);s?this.fs.writeFileSync(t,r):i?this.fs.writeFileSync(e,r):this.fs.writeFileSync(t,r)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let r=t;for(const t of i)if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,e,s){return Object(t)!==t?t:(Array.isArray(e)||(e=e.toString().match(/[^.[\]]+/g)||[]),e.slice(0,-1).reduce((t,s,i)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[i+1])>>0==+e[i+1]?[]:{},t)[e[e.length-1]]=s,t)}getdata(t){let e=this.getval(t);if(/^@/.test(t)){const[,s,i]=/^@(.*?)\.(.*?)$/.exec(t),r=s?this.getval(s):"";if(r)try{const t=JSON.parse(r);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,r]=/^@(.*?)\.(.*?)$/.exec(e),o=this.getval(i),h=i?"null"===o?null:o||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,r,t),s=this.setval(JSON.stringify(e),i)}catch(e){const o={};this.lodash_set(o,r,t),s=this.setval(JSON.stringify(o),i)}}else s=this.setval(t,e);return s}getval(t){return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)})):this.isQuanX()?(this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t))):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();s&&this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)}))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)})}}time(t,e=null){const s=e?new Date(e):new Date;let i={"M+":s.getMonth()+1,"d+":s.getDate(),"H+":s.getHours(),"m+":s.getMinutes(),"s+":s.getSeconds(),"q+":Math.floor((s.getMonth()+3)/3),S:s.getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(s.getFullYear()+"").substr(4-RegExp.$1.length)));for(let e in i)new RegExp("("+e+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?i[e]:("00"+i[e]).substr((""+i[e]).length)));return t}msg(e=t,s="",i="",r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};if(this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r))),!this.isMuteLog){let t=["","==============📣系统通知📣=============="];t.push(e),s&&t.push(s),i&&t.push(i),console.log(t.join("\n")),this.logs=this.logs.concat(t)}}log(...t){t.length>0&&(this.logs=[...this.logs,...t]),console.log(t.join(this.logSeparator))}logErr(t,e){const s=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();s?this.log("",`❗️${this.name}, 错误!`,t.stack):this.log("",`❗️${this.name}, 错误!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`🔔${this.name}, 结束! 🕛 ${s} 秒`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)}
--------------------------------------------------------------------------------
/Task/JD New/jd_supergz.js:
--------------------------------------------------------------------------------
1 | /*
2 | 一次性脚本
3 | 频道关注
4 | cron "11 21 25 10 *" jd_supergz.js
5 | */
6 |
7 | const $ = new Env('频道关注');
8 | const notify = $.isNode() ? require('./sendNotify') : '';
9 | const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
10 |
11 |
12 | let jdNotify = true;//是否关闭通知,false打开通知推送,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 | };
21 | } else {
22 | cookiesArr = [$.getdata('CookieJD'), $.getdata('CookieJD2'), ...jsonParse($.getdata('CookiesJD') || "[]").map(item => item.cookie)].filter(item => !!item);
23 | }
24 | const JD_API_HOST = 'https://api.m.jd.com/client.action';
25 | !(async () => {
26 | if (!cookiesArr[0]) {
27 | $.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', {"open-url": "https://bean.m.jd.com/bean/signIndex.action"});
28 | return;
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 | $.isLogin = true;
36 | $.nickName = '';
37 | message = '';
38 | await TotalBean();
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`, {"open-url": "https://bean.m.jd.com/bean/signIndex.action"});
42 |
43 | if ($.isNode()) {
44 | await notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`);
45 | }
46 | continue
47 | }
48 |
49 | await userFollow2();
50 | await $.wait(parseInt(Math.random()*2500+200, 10));
51 |
52 | }
53 | }
54 | })()
55 | .catch((e) => {
56 | $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '')
57 | })
58 | .finally(() => {
59 | $.done();
60 | })
61 |
62 | function userFollow2() {
63 | return new Promise(resolve => {
64 | $.post({
65 | url: `https://api.m.jd.com//client.action?functionId=userFollow&avifSupport=0&body=%7B%22businessId%22%3A%221%22%2C%22type%22%3A%221%22%2C%22themeId%22%3A%22571%22%2C%22uuid%22%3A%22%22%7D&build=168341&client=apple&clientVersion=11.3.0&d_brand=apple&d_model=iPhone9%2C2&ef=1&eid=QMVSKEWT77VAWK4HGCBDVYUU24PL45XVUKZLQVYD3EVIQU5NGL5JZQCG5UBOFKEB5NWSTOUMJXZ6UBHI3XZ7I5T6GVNVOGKHUM6XD27JRWUAYLKLURIA&ep=%7B%22ciphertype%22%3A5%2C%22cipher%22%3A%7B%22screen%22%3A%22CJS0CseyCtK4%22%2C%22area%22%3A%22DP8nCzDpDJq1CzLpCK%3D%3D%22%2C%22wifiBssid%22%3A%22CNZtEJKnCNC5EQHsCzuyZtG1YzuyZQG1CWVuDNC1YzC%3D%22%2C%22osVersion%22%3A%22CJCkDq%3D%3D%22%2C%22uuid%22%3A%22aQf1ZRdxb2r4ovZ1EJZhcxYlVNZSZz09%22%2C%22adid%22%3A%22EOCzDuVPEJujDzO1HI00HuVPBJqyENYjCOU3DUU5DUOmCNcn%22%2C%22openudid%22%3A%22DwOmZtK5EWYyD2HuEQPvEWS4DNK2CzPuYzc1YJKzYtS2Czq5ZJO5Yq%3D%3D%22%7D%2C%22ts%22%3A1666542683%2C%22hdid%22%3A%22JM9F1ywUPwflvMIpYPok0tt5k9kW4ArJEU3lfLhxBqw%3D%22%2C%22version%22%3A%221.0.3%22%2C%22appname%22%3A%22com.360buy.jdmobile%22%2C%22ridx%22%3A-1%7D&ext=%7B%22prstate%22%3A%220%22%2C%22pvcStu%22%3A%221%22%7D&isBackground=N&joycious=135&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&partner=apple&rfs=0000&scope=01&sign=a4d0d150f9ed5f5987b9f0f7827e9d55&st=1666699449627&sv=110&uemps=0-0&uts=0f31TVRjBSsFdsTKwK309IAz7V/uii17zYk75KAxzZD31Y/I4osmN11MHUKOPHIiGIvkRfL%2Bzkmu3XrLlPl6dwZOnLBZxizAbKRGeCx62SbcqFfmxh0wf4kYuIecZxWwB4jCL%2B/GIfqeOSULNY1df3vqPpd/i1rSoz7eO4N2YT6nDR2HtAPhIBVuHeZoiCx/kBwR6l6sRCopTmIJ05QRUA%3D%3D`,
66 | body: 'body=%7B%22businessId%22%3A%221%22%2C%22themeId%22%3A%22858%22%2C%22type%22%3A%221%22%7D&',
67 | headers: {
68 | 'Content-Type': 'application/x-www-form-urlencoded',
69 | 'Cookie': cookie,
70 | 'Host': 'api.m.jd.com',
71 | 'User-Agent': 'okhttp/3.12.1;jdmall;android;version/10.1.3;build/90017;',
72 | }
73 | }, async (err, resp, data) => {
74 | try {
75 | if (err) {
76 | console.log(`${$.toStr(err)}`)
77 | console.log(`userFollow API请求失败,请检查网路重试`)
78 | } else {
79 | data = JSON.parse(data);
80 | if (data && data.activityType == "2") {
81 | console.log(data.resultMsg);
82 | // console.log(data);
83 | } else {
84 | console.log("你已经关注过啦");
85 | }
86 | }
87 | } catch (e) {
88 | $.logErr(e, resp)
89 | } finally {
90 | resolve();
91 | }
92 | })
93 | })
94 | }
95 |
96 | function TotalBean() {
97 | return new Promise(async resolve => {
98 | const options = {
99 | "url": `https://wq.jd.com/user/info/QueryJDUserInfo?sceneval=2`,
100 | "headers": {
101 | "Accept": "application/json,text/plain, */*",
102 | "Content-Type": "application/x-www-form-urlencoded",
103 | "Accept-Encoding": "gzip, deflate, br",
104 | "Accept-Language": "zh-cn",
105 | "Connection": "keep-alive",
106 | "Cookie": cookie,
107 | "Referer": "https://wqs.jd.com/my/jingdou/my.shtml?sceneval=2",
108 | "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")
109 | }
110 | }
111 | $.post(options, (err, resp, data) => {
112 | try {
113 | if (err) {
114 | console.log(`${JSON.stringify(err)}`)
115 | console.log(`${$.name} API请求失败,请检查网路重试`)
116 | } else {
117 | if (data) {
118 | data = JSON.parse(data);
119 | if (data['retcode'] === 13) {
120 | $.isLogin = false; //cookie过期
121 | return
122 | }
123 | if (data['retcode'] === 0) {
124 | $.nickName = (data['base'] && data['base'].nickname) || $.UserName;
125 | } else {
126 | $.nickName = $.UserName
127 | }
128 | } else {
129 | console.log(`京东服务器返回空数据`)
130 | }
131 | }
132 | } catch (e) {
133 | $.logErr(e, resp)
134 | } finally {
135 | resolve();
136 | }
137 | })
138 | })
139 | }
140 |
141 | function safeGet(data) {
142 | try {
143 | if (typeof JSON.parse(data) == "object") {
144 | return true;
145 | }
146 | } catch (e) {
147 | console.log(e);
148 | console.log(`京东服务器访问数据为空,请检查自身设备网络情况`);
149 | return false;
150 | }
151 | }
152 |
153 | function jsonParse(str) {
154 | if (typeof str == "string") {
155 | try {
156 | return JSON.parse(str);
157 | } catch (e) {
158 | console.log(e);
159 | $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie')
160 | return [];
161 | }
162 | }
163 | }
164 |
165 |
166 | // prettier-ignore
167 | function Env(t,e){"undefined"!=typeof process&&JSON.stringify(process.env).indexOf("GITHUB")>-1&&process.exit(0);class s{constructor(t){this.env=t}send(t,e="GET"){t="string"==typeof t?{url:t}:t;let s=this.get;return"POST"===e&&(s=this.post),new Promise((e,i)=>{s.call(this,t,(t,s,r)=>{t?i(t):e(s)})})}get(t){return this.send.call(this.env,t)}post(t){return this.send.call(this.env,t,"POST")}}return new class{constructor(t,e){this.name=t,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.isNeedRewrite=!1,this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`🔔${this.name}, 开始!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null){try{return JSON.stringify(t)}catch{return e}}getjson(t,e){let s=e;const i=this.getdata(t);if(i)try{s=JSON.parse(this.getdata(t))}catch{}return s}setjson(t,e){try{return this.setdata(JSON.stringify(t),e)}catch{return!1}}getScript(t){return new Promise(e=>{this.get({url:t},(t,s,i)=>e(i))})}runScript(t,e){return new Promise(s=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let r=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");r=r?1*r:20,r=e&&e.timeout?e.timeout:r;const[o,h]=i.split("@"),n={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(n,(t,e,i)=>s(i))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e);if(!s&&!i)return{};{const i=s?t:e;try{return JSON.parse(this.fs.readFileSync(i))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e),r=JSON.stringify(this.data);s?this.fs.writeFileSync(t,r):i?this.fs.writeFileSync(e,r):this.fs.writeFileSync(t,r)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let r=t;for(const t of i)if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,e,s){return Object(t)!==t?t:(Array.isArray(e)||(e=e.toString().match(/[^.[\]]+/g)||[]),e.slice(0,-1).reduce((t,s,i)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[i+1])>>0==+e[i+1]?[]:{},t)[e[e.length-1]]=s,t)}getdata(t){let e=this.getval(t);if(/^@/.test(t)){const[,s,i]=/^@(.*?)\.(.*?)$/.exec(t),r=s?this.getval(s):"";if(r)try{const t=JSON.parse(r);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,r]=/^@(.*?)\.(.*?)$/.exec(e),o=this.getval(i),h=i?"null"===o?null:o||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,r,t),s=this.setval(JSON.stringify(e),i)}catch(e){const o={};this.lodash_set(o,r,t),s=this.setval(JSON.stringify(o),i)}}else s=this.setval(t,e);return s}getval(t){return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)})):this.isQuanX()?(this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t))):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();s&&this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)}))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)})}}time(t,e=null){const s=e?new Date(e):new Date;let i={"M+":s.getMonth()+1,"d+":s.getDate(),"H+":s.getHours(),"m+":s.getMinutes(),"s+":s.getSeconds(),"q+":Math.floor((s.getMonth()+3)/3),S:s.getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(s.getFullYear()+"").substr(4-RegExp.$1.length)));for(let e in i)new RegExp("("+e+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?i[e]:("00"+i[e]).substr((""+i[e]).length)));return t}msg(e=t,s="",i="",r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};if(this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r))),!this.isMuteLog){let t=["","==============📣系统通知📣=============="];t.push(e),s&&t.push(s),i&&t.push(i),console.log(t.join("\n")),this.logs=this.logs.concat(t)}}log(...t){t.length>0&&(this.logs=[...this.logs,...t]),console.log(t.join(this.logSeparator))}logErr(t,e){const s=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();s?this.log("",`❗️${this.name}, 错误!`,t.stack):this.log("",`❗️${this.name}, 错误!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`🔔${this.name}, 结束! 🕛 ${s} 秒`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)}
--------------------------------------------------------------------------------
/Task/JD New/jd_try_notify.py:
--------------------------------------------------------------------------------
1 | #Source::https://github.com/Hyper-Beast/JD_Scripts
2 |
3 | """
4 | cron: 20 20 * * *
5 | new Env('京东试用成功通知');
6 | """
7 |
8 |
9 | import requests
10 | import json
11 | import time
12 | import os
13 | import re
14 | import sys
15 | import random
16 | import string
17 | import urllib
18 |
19 |
20 |
21 | #以下部分参考Curtin的脚本:https://github.com/curtinlv/JD-Script
22 |
23 | UserAgent = ''
24 | uuid=''.join(random.sample(['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9','a','b','c','z'], 40))
25 | addressid = ''.join(random.sample('1234567898647', 10))
26 | iosVer = ''.join(random.sample(["14.5.1", "14.4", "14.3", "14.2", "14.1", "14.0.1", "13.7", "13.1.2", "13.1.1"], 1))
27 | iosV = iosVer.replace('.', '_')
28 | clientVersion=''.join(random.sample(["10.3.0", "10.2.7", "10.2.4", "10.2.2", "10.2.0", "10.1.6"], 1))
29 | iPhone = ''.join(random.sample(["8", "9", "10", "11", "12", "13"], 1))
30 | area=''.join(random.sample('0123456789', 2)) + '_' + ''.join(random.sample('0123456789', 4)) + '_' + ''.join(random.sample('0123456789', 5)) + '_' + ''.join(random.sample('0123456789', 4))
31 | ADID = ''.join(random.sample('0987654321ABCDEF', 8)) + '-' + ''.join(random.sample('0987654321ABCDEF', 4)) + '-' + ''.join(random.sample('0987654321ABCDEF', 4)) + '-' + ''.join(random.sample('0987654321ABCDEF', 4)) + '-' + ''.join(random.sample('0987654321ABCDEF', 12))
32 |
33 | def userAgent():
34 | """
35 | 随机生成一个UA
36 | jdapp;iPhone;10.0.4;14.2;9fb54498b32e17dfc5717744b5eaecda8366223c;network/wifi;ADID/2CF597D0-10D8-4DF8-C5A2-61FD79AC8035;model/iPhone11,1;addressid/7785283669;appBuild/167707;jdSupportDarkMode/0;Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/null;supportJDSHWK/1
37 | :return: ua
38 | """
39 | if not UserAgent:
40 | return f'jdapp;iPhone;10.0.4;{iosVer};{uuid};network/wifi;ADID/{ADID};model/iPhone{iPhone},1;addressid/{addressid};appBuild/167707;jdSupportDarkMode/0;Mozilla/5.0 (iPhone; CPU iPhone OS {iosV} like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/null;supportJDSHWK/1'
41 | else:
42 | return UserAgent
43 |
44 | #以上部分参考Curtin的脚本:https://github.com/curtinlv/JD-Script
45 |
46 | def load_send():
47 | global send
48 | cur_path = os.path.abspath(os.path.dirname(__file__))
49 | sys.path.append(cur_path)
50 | if os.path.exists(cur_path + "/sendNotify.py"):
51 | try:
52 | from sendNotify import send
53 | except:
54 | send=False
55 | print("加载通知服务失败~")
56 | else:
57 | send=False
58 | print("加载通知服务失败~")
59 | load_send()
60 |
61 |
62 | def printf(text):
63 | print(text)
64 | sys.stdout.flush()
65 |
66 | def get_remarkinfo():
67 | url='http://127.0.0.1:5600/api/envs'
68 | try:
69 | with open('/ql/config/auth.json', 'r') as f:
70 | token=json.loads(f.read())['token']
71 | headers={
72 | 'Accept':'application/json',
73 | 'authorization':'Bearer '+token,
74 | }
75 | response=requests.get(url=url,headers=headers)
76 |
77 | for i in range(len(json.loads(response.text)['data'])):
78 | if json.loads(response.text)['data'][i]['name']=='JD_COOKIE':
79 | try:
80 | if json.loads(response.text)['data'][i]['remarks'].find('@@')==-1:
81 | remarkinfos[json.loads(response.text)['data'][i]['value'].split(';')[1].replace('pt_pin=','')]=json.loads(response.text)['data'][i]['remarks'].replace('remark=','')
82 | else:
83 | remarkinfos[json.loads(response.text)['data'][i]['value'].split(';')[1].replace('pt_pin=','')]=json.loads(response.text)['data'][i]['remarks'].split("@@")[0].replace('remark=','').replace(';','')
84 | except:
85 | pass
86 | except:
87 | print('读取auth.json文件出错,跳过获取备注')
88 |
89 | def get_succeedinfo(ck):
90 | url='https://api.m.jd.com/client.action'
91 | headers={
92 | 'accept':'application/json, text/plain, */*',
93 | 'content-type':'application/x-www-form-urlencoded',
94 | 'origin':'https://prodev.m.jd.com',
95 | 'content-length':'249',
96 | 'accept-language':'zh-CN,zh-Hans;q=0.9',
97 | 'User-Agent':userAgent(),
98 | 'referer':'https://prodev.m.jd.com/',
99 | 'accept-encoding':'gzip, deflate, br',
100 | 'cookie':ck
101 | }
102 | data=f'appid=newtry&functionId=try_MyTrials&uuid={uuid}&clientVersion={clientVersion}&client=wh5&osVersion={iosVer}&area={area}&networkType=wifi&body=%7B%22page%22%3A1%2C%22selected%22%3A2%2C%22previewTime%22%3A%22%22%7D'
103 | response=requests.post(url=url,headers=headers,data=data)
104 | isnull=True
105 | try:
106 | for i in range(len(json.loads(response.text)['data']['list'])):
107 | if(json.loads(response.text)['data']['list'][i]['text']['text']).find('试用资格将保留')!=-1:
108 | print(json.loads(response.text)['data']['list'][i]['trialName'])
109 | try:
110 | if remarkinfos[ptpin]!='':
111 | send("京东试用待领取物品通知",'账号名称:'+remarkinfos[ptpin]+'\n'+'商品名称:'+json.loads(response.text)['data']['list'][i]['trialName']+"\n"+"商品链接:https://item.jd.com/"+json.loads(response.text)['data']['list'][i]['skuId']+".html")
112 | isnull=False
113 | else:
114 | send("京东试用待领取物品通知",'账号名称:'+urllib.parse.unquote(ptpin)+'\n'+'商品名称:'+json.loads(response.text)['data']['list'][i]['trialName']+"\n"+"商品链接:https://item.jd.com/"+json.loads(response.text)['data']['list'][i]['skuId']+".html")
115 | isnull=False
116 | except Exception as e:
117 | printf(str(e))
118 | if isnull==True:
119 | print("没有在有效期内待领取的试用品\n\n")
120 | except:
121 | print('获取信息出错,可能是账号已过期')
122 | pass
123 | if __name__ == '__main__':
124 | remarkinfos={}
125 | try:
126 | get_remarkinfo()
127 | except:
128 | pass
129 | try:
130 | cks = os.environ["JD_COOKIE"].split("&")
131 | except:
132 | f = open("/jd/config/config.sh", "r", encoding='utf-8')
133 | cks = re.findall(r'Cookie[0-9]*="(pt_key=.*?;pt_pin=.*?;)"', f.read())
134 | f.close()
135 | for ck in cks:
136 | ck = ck.strip()
137 | if ck[-1] != ';':
138 | ck += ';'
139 | ptpin = re.findall(r"pt_pin=(.*?);", ck)[0]
140 | try:
141 | if remarkinfos[ptpin]!='':
142 | printf("--账号:" + remarkinfos[ptpin] + "--")
143 | else:
144 | printf("--无备注账号:" + urllib.parse.unquote(ptpin) + "--")
145 | except Exception as e:
146 | printf("--账号:" + urllib.parse.unquote(ptpin) + "--")
147 | get_succeedinfo(ck)
148 |
--------------------------------------------------------------------------------
/Task/JD New/jd_work_price.js:
--------------------------------------------------------------------------------
1 | let common = require("./function/common");
2 | let jsdom = require("jsdom");
3 | let $ = new common.env('京东保价');
4 | let min = 1,
5 | help = $.config[$.filename(__filename)] || Math.min(min, $.config.JdMain) || min;
6 | $.setOptions({
7 | headers: {
8 | 'content-type': 'application/json',
9 | 'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Firefox/91.0',
10 | 'referer': 'https://msitepp-fm.jd.com/rest/priceprophone/priceProPhoneMenu?sid=0b5a9d5564059f36ed16a8967c37e24w',
11 | }
12 | });
13 | $.readme = `
14 | 48 */8 * * * task ${$.runfile}
15 | export ${$.runfile}=1 #输出购买订单保价内容,没什么用
16 | `
17 | eval(common.eval.mainEval($));
18 | async function prepare() {}
19 | async function main(id) {
20 | try {
21 | await jstoken()
22 | // 一键保价
23 | p = {
24 | 'url': `https://api.m.jd.com/api?appid=siteppM&functionId=siteppM_skuOnceApply&forcebot=&t=${$.timestamp}`,
25 | "form": {
26 | "body": JSON.stringify({
27 | sid: '',
28 | type: 3,
29 | forcebot: '',
30 | token: $.token,
31 | feSt: 's'
32 | })
33 | }
34 | };
35 | h = await $.curl(p)
36 | console.log(h)
37 | console.log("等待20s获取保价信息")
38 | await $.wait(20000)
39 | // 获取保价信息
40 | let p2 = {
41 | 'url': `https://api.m.jd.com/api?appid=siteppM&functionId=siteppM_appliedSuccAmount&forcebot=&t=${$.timestamp}`,
42 | // 'form': {
43 | // 'body': `"{\"sid\":\"\",\"type\":\"3\",\"forcebot\":\"\"}"`
44 | // }
45 | 'form': 'body={"sid":"","type":"3","forcebot":"","num":15}'
46 | }
47 | await $.curl(p2)
48 | if ($.source.flag) {
49 | text = `本次保价金额: ${$.source.succAmount}`
50 | } else {
51 | text = "本次无保价订单"
52 | }
53 | console.log(text)
54 | $.notice(text)
55 | if ($.config[$.runfile]) {
56 | // 单个商品检测,没什么用处
57 | console.log("\n手动保价前25个订单")
58 | html = ''
59 | for (let i = 1; i < 6; i++) {
60 | await jstoken()
61 | p3 = {
62 | 'url': `https://api.m.jd.com/api?appid=siteppM&functionId=siteppM_priceskusPull&forcebot=&t=${$.timestamp}`,
63 | 'form': {
64 | 'body': JSON.stringify({
65 | "page": i,
66 | "pageSize": 5,
67 | "keyWords": "",
68 | "sid": "",
69 | "type": "3",
70 | "forcebot": "",
71 | "token": $.token,
72 | "feSt": "s"
73 | })
74 | }
75 | }
76 | html += await $.curl(p3)
77 | }
78 | amount = $.matchall(/class="name"\>\s*([^\<]+).*?orderId="(\d+)"\s*skuId="(\d+)"/g, html.replace(/\n/g, ''))
79 | for (let i of amount) {
80 | // 获取有无申请按钮
81 | p4 = {
82 | 'url': `https://api.m.jd.com/api?appid=siteppM&functionId=siteppM_skuProResultPin&forcebot=&t=${$.timestamp}`,
83 | 'form': {
84 | 'body': JSON.stringify({
85 | "orderId": i[1],
86 | "skuId": i[2],
87 | "sequence": "1",
88 | "sid": "",
89 | "type": "3",
90 | "forcebot": ""
91 | })
92 | }
93 | }
94 | h = await $.curl(p4)
95 | if (h.includes("hidden")) {
96 | console.log(`商品: ${i[0]} 不支持保价或无降价`)
97 | } else {
98 | await jstoken()
99 | // 申请请求
100 | p5 = {
101 | 'url': `https://api.m.jd.com/api?appid=siteppM&functionId=siteppM_proApply&forcebot=&t=${$.timestamp}`,
102 | 'form': {
103 | 'body': JSON.stringify({
104 | "orderId": i[1],
105 | "orderCategory": "Others",
106 | "skuId": i[2],
107 | "sid": "",
108 | "type": "3",
109 | "refundtype": "1",
110 | "forcebot": "",
111 | "token": $.token,
112 | "feSt": "s"
113 | })
114 | }
115 | }
116 | await $.curl(p5)
117 | if ($.source.proSkuApplyId) {
118 | // 申请结果
119 | p6 = {
120 | 'url': `https://api.m.jd.com/api?appid=siteppM&functionId=siteppM_moreApplyResult&forcebot=&t=${$.timestamp}`,
121 | 'form': `body={"proSkuApplyIds":"${$.source.proSkuApplyId[0]}","type":"3"}`
122 | }
123 | await $.curl(p6)
124 | console.log(`商品: ${i[0]} `, $.haskey($.source, 'applyResults.0.applyResultVo.failTypeStr'))
125 | } else {
126 | console.log(`商品: ${i[0]} ${$.source.errorMessage}`)
127 | }
128 | }
129 | }
130 | }
131 | } catch (e) {}
132 | }
133 | async function jstoken() {
134 | let {
135 | JSDOM
136 | } = jsdom;
137 | let resourceLoader = new jsdom.ResourceLoader({
138 | userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Firefox/91.0',
139 | referrer: "https://msitepp-fm.jd.com/rest/priceprophone/priceProPhoneMenu?sid=0b5a9d5564059f36ed16a8967c37e24w",
140 | });
141 | let virtualConsole = new jsdom.VirtualConsole();
142 | var options = {
143 | referrer: "https://msitepp-fm.jd.com/rest/priceprophone/priceProPhoneMenu?sid=0b5a9d5564059f36ed16a8967c37e24w",
144 | userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Firefox/91.0',
145 | runScripts: "dangerously",
146 | resources: resourceLoader,
147 | // cookieJar,
148 | includeNodeLocations: true,
149 | storageQuota: 10000000,
150 | pretendToBeVisual: true,
151 | virtualConsole
152 | };
153 | $.dom = new JSDOM(``, options);
154 | await $.wait(1000)
155 | try {
156 | feSt = 's'
157 | jab = new $.dom.window.JAB({
158 | bizId: 'jdjiabao',
159 | initCaptcha: false
160 | })
161 | $.token = jab.getToken()
162 | } catch (e) {}
163 | }
164 |
--------------------------------------------------------------------------------
/Task/JD New/jd_wq_wxsign.js:
--------------------------------------------------------------------------------
1 | /*
2 | 微信签到领红包
3 | by:小手冰凉 tg:@chianPLA
4 | 交流群:https://t.me/jdPLA2
5 | 脚本更新时间:2022-01-01
6 | 脚本兼容: Node.js
7 | 新手写脚本,难免有bug,能用且用。
8 | ===========================
9 | */
10 | const $ = new Env("微信签到领红包");
11 | const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
12 | const notify = $.isNode() ? require('./sendNotify') : '';
13 | const request = require('request');
14 | let cookiesArr = [], cookie = ''
15 |
16 | if ($.isNode()) {
17 | Object.keys(jdCookieNode).forEach((item) => {
18 | cookiesArr.push(jdCookieNode[item])
19 | })
20 | if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => { };
21 | } else {
22 | let cookiesData = $.getdata('CookiesJD') || "[]";
23 | cookiesData = JSON.parse(cookiesData);
24 | cookiesArr = cookiesData.map(item => item.cookie);
25 | cookiesArr.reverse();
26 | cookiesArr.push(...[$.getdata('CookieJD2'), $.getdata('CookieJD')]);
27 | cookiesArr.reverse();
28 | cookiesArr = cookiesArr.filter(item => !!item);
29 | }
30 | !(async () => {
31 | if (!cookiesArr[0]) {
32 | $.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', { "open-url": "https://bean.m.jd.com/bean/signIndex.action" });
33 | return;
34 | }
35 | for (let i = 0; i < cookiesArr.length; i++) {
36 | if (cookiesArr[i]) {
37 | cookie = cookiesArr[i];
38 | $.UserName = decodeURIComponent(cookie.match(/pt_pin=(.+?);/) && cookie.match(/pt_pin=(.+?);/)[1])
39 | $.index = i + 1;
40 | $.isLogin = true;
41 | $.nickName = '';
42 | await TotalBean();
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`, { "open-url": "https://bean.m.jd.com/bean/signIndex.action" });
46 | if ($.isNode()) {
47 | await notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`);
48 | }
49 | continue
50 | }
51 | await main();
52 | }
53 | }
54 |
55 | })().catch((e) => { $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '') }).finally(() => { $.done(); })
56 |
57 | async function main() {
58 | await signTask(); //京东超市
59 | }
60 |
61 | //京东超市
62 | function signTask() {
63 | return new Promise(async resolve => {
64 | const options = {
65 | url: `https://api.m.jd.com/signTask/doSignTask?functionId=SignComponent_doSignTask&appid=hot_channel&loginWQBiz=signcomponent&loginType=2&body={"activityId":"10002"}&g_ty=ls&g_tk=1294369933`,
66 | headers: {
67 | "Host": "api.m.jd.com",
68 | "charset": "utf-8",
69 | "Connection": "keep-alive",
70 | 'content-type': 'application/json',
71 | 'user-agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15F79 MicroMessenger/8.0.15(0x18000f2e) NetType/WIFI Language/zh_CN',
72 | 'referer': 'https://servicewechat.com/wx91d27dbf599dff74/581/page-frame.html',
73 | "User-Agent": 'Mozilla/5.0 (Linux; Android 10; HarmonyOS; WLZ-AN00; HMSCore 6.1.0.314) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.105 HuaweiBrowser/11.1.5.320 Mobile Safari/537.36',
74 | "cookie": "wxapp_type=15;wxapp_version=7.10.140;wxapp_scene=1001;pinStatus=0;" + cookie,
75 | "Accept-Encoding": "gzip,compress,br,deflate",
76 | }
77 | }
78 | $.get(options, (err, resp, data) => {
79 | try {
80 | if (err) {
81 | $.logErr(err)
82 | console.log(`signTask api请求失败,请检查网路重试`)
83 | } else {
84 | if (data) {
85 | data = JSON.parse(data);
86 | if (data.subCode == 0) {
87 | console.log(`签到: ${data?.data?.signDays}天, 获得红包: ${data?.data?.rewardValue}元`);
88 | } else {
89 | console.log(data.message);
90 | }
91 | }
92 | }
93 | } catch (e) {
94 | $.logErr(e)
95 | } finally {
96 | resolve();
97 | }
98 | })
99 | })
100 | }
101 |
102 |
103 | // prettier-ignore
104 | function TotalBean() { return new Promise(async e => { const n = { url: "https://wq.jd.com/user_new/info/GetJDUserInfoUnion?sceneval=2", headers: { Host: "wq.jd.com", Accept: "*/*", Connection: "keep-alive", Cookie: cookie, "User-Agent": 'Mozilla/5.0 (Linux; Android 10; WLZ-AN00 Build/HUAWEIWLZ-AN00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/89.0.4389.72 MQQBrowser/6.2 TBS/045811 Mobile Safari/537.36 MMWEBID/2874 MicroMessenger/8.0.15.2020(0x28000F39) Process/tools WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64', "Accept-Language": "zh-cn", Referer: "https://home.m.jd.com/myJd/newhome.action?sceneval=2&ufc=&", "Accept-Encoding": "gzip, deflate, br" } }; $.get(n, (n, o, a) => { try { if (n) $.logErr(n); else if (a) { if (1001 === (a = JSON.parse(a))["retcode"]) return void ($.isLogin = !1); 0 === a["retcode"] && a.data && a.data.hasOwnProperty("userInfo") && ($.nickName = a.data.userInfo.baseInfo.nickname), 0 === a["retcode"] && a.data && a.data["assetInfo"] && ($.beanCount = a.data && a.data["assetInfo"]["beanNum"]) } else console.log("京东服务器返回空数据") } catch (e) { $.logErr(e) } finally { e() } }) }) }
105 | function Env(t, e) { "undefined" != typeof process && JSON.stringify(process.env).indexOf("GITHUB") > -1 && process.exit(0); class s { constructor(t) { this.env = t } send(t, e = "GET") { t = "string" == typeof t ? { url: t } : t; let s = this.get; return "POST" === e && (s = this.post), new Promise((e, i) => { s.call(this, t, (t, s, r) => { t ? i(t) : e(s) }) }) } get(t) { return this.send.call(this.env, t) } post(t) { return this.send.call(this.env, t, "POST") } } return new class { constructor(t, e) { this.name = t, this.http = new s(this), this.data = null, this.dataFile = "box.dat", this.logs = [], this.isMute = !1, this.isNeedRewrite = !1, this.logSeparator = "\n", this.startTime = (new Date).getTime(), Object.assign(this, e), this.log("", `🔔${this.name}, 开始!`) } isNode() { return "undefined" != typeof module && !!module.exports } isQuanX() { return "undefined" != typeof $task } isSurge() { return "undefined" != typeof $httpClient && "undefined" == typeof $loon } isLoon() { return "undefined" != typeof $loon } toObj(t, e = null) { try { return JSON.parse(t) } catch { return e } } toStr(t, e = null) { try { return JSON.stringify(t) } catch { return e } } getjson(t, e) { let s = e; const i = this.getdata(t); if (i) try { s = JSON.parse(this.getdata(t)) } catch { } return s } setjson(t, e) { try { return this.setdata(JSON.stringify(t), e) } catch { return !1 } } getScript(t) { return new Promise(e => { this.get({ url: t }, (t, s, i) => e(i)) }) } runScript(t, e) { return new Promise(s => { let i = this.getdata("@chavy_boxjs_userCfgs.httpapi"); i = i ? i.replace(/\n/g, "").trim() : i; let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); r = r ? 1 * r : 20, r = e && e.timeout ? e.timeout : r; const [o, h] = i.split("@"), n = { url: `http://${h}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": o, Accept: "*/*" } }; this.post(n, (t, e, i) => s(i)) }).catch(t => this.logErr(t)) } loaddata() { if (!this.isNode()) return {}; { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e); if (!s && !i) return {}; { const i = s ? t : e; try { return JSON.parse(this.fs.readFileSync(i)) } catch (t) { return {} } } } } writedata() { if (this.isNode()) { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e), r = JSON.stringify(this.data); s ? this.fs.writeFileSync(t, r) : i ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r) } } lodash_get(t, e, s) { const i = e.replace(/\[(\d+)\]/g, ".$1").split("."); let r = t; for (const t of i) if (r = Object(r)[t], void 0 === r) return s; return r } lodash_set(t, e, s) { return Object(t) !== t ? t : (Array.isArray(e) || (e = e.toString().match(/[^.[\]]+/g) || []), e.slice(0, -1).reduce((t, s, i) => Object(t[s]) === t[s] ? t[s] : t[s] = Math.abs(e[i + 1]) >> 0 == +e[i + 1] ? [] : {}, t)[e[e.length - 1]] = s, t) } getdata(t) { let e = this.getval(t); if (/^@/.test(t)) { const [, s, i] = /^@(.*?)\.(.*?)$/.exec(t), r = s ? this.getval(s) : ""; if (r) try { const t = JSON.parse(r); e = t ? this.lodash_get(t, i, "") : e } catch (t) { e = "" } } return e } setdata(t, e) { let s = !1; if (/^@/.test(e)) { const [, i, r] = /^@(.*?)\.(.*?)$/.exec(e), o = this.getval(i), h = i ? "null" === o ? null : o || "{}" : "{}"; try { const e = JSON.parse(h); this.lodash_set(e, r, t), s = this.setval(JSON.stringify(e), i) } catch (e) { const o = {}; this.lodash_set(o, r, t), s = this.setval(JSON.stringify(o), i) } } else s = this.setval(t, e); return s } getval(t) { return this.isSurge() || this.isLoon() ? $persistentStore.read(t) : this.isQuanX() ? $prefs.valueForKey(t) : this.isNode() ? (this.data = this.loaddata(), this.data[t]) : this.data && this.data[t] || null } setval(t, e) { return this.isSurge() || this.isLoon() ? $persistentStore.write(t, e) : this.isQuanX() ? $prefs.setValueForKey(t, e) : this.isNode() ? (this.data = this.loaddata(), this.data[e] = t, this.writedata(), !0) : this.data && this.data[e] || null } initGotEnv(t) { this.got = this.got ? this.got : require("got"), this.cktough = this.cktough ? this.cktough : require("tough-cookie"), this.ckjar = this.ckjar ? this.ckjar : new this.cktough.CookieJar, t && (t.headers = t.headers ? t.headers : {}, void 0 === t.headers.Cookie && void 0 === t.cookieJar && (t.cookieJar = this.ckjar)) } get(t, e = (() => { })) { t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { try { if (t.headers["set-cookie"]) { const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); s && this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar } } catch (t) { this.logErr(t) } }).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) })) } post(t, e = (() => { })) { if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.post(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) }); else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t)); else if (this.isNode()) { this.initGotEnv(t); const { url: s, ...i } = t; this.got.post(s, i).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) }) } } time(t, e = null) { const s = e ? new Date(e) : new Date; let i = { "M+": s.getMonth() + 1, "d+": s.getDate(), "H+": s.getHours(), "m+": s.getMinutes(), "s+": s.getSeconds(), "q+": Math.floor((s.getMonth() + 3) / 3), S: s.getMilliseconds() }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, (s.getFullYear() + "").substr(4 - RegExp.$1.length))); for (let e in i) new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? i[e] : ("00" + i[e]).substr(("" + i[e]).length))); return t } msg(e = t, s = "", i = "", r) { const o = t => { if (!t) return t; if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? { "open-url": t } : this.isSurge() ? { url: t } : void 0; if ("object" == typeof t) { if (this.isLoon()) { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } if (this.isQuanX()) { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl; return { "open-url": e, "media-url": s } } if (this.isSurge()) { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } } }; if (this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))), !this.isMuteLog) { let t = ["", "==============📣系统通知📣=============="]; t.push(e), s && t.push(s), i && t.push(i), console.log(t.join("\n")), this.logs = this.logs.concat(t) } } log(...t) { t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator)) } logErr(t, e) { const s = !this.isSurge() && !this.isQuanX() && !this.isLoon(); s ? this.log("", `❗️${this.name}, 错误!`, t.stack) : this.log("", `❗️${this.name}, 错误!`, t) } wait(t) { return new Promise(e => setTimeout(e, t)) } done(t = {}) { const e = (new Date).getTime(), s = (e - this.startTime) / 1e3; this.log("", `🔔${this.name}, 结束! 🕛 ${s} 秒`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) } }(t, e) }
106 |
--------------------------------------------------------------------------------
/Task/JD New/jd_wrtred.js:
--------------------------------------------------------------------------------
1 | /*
2 | 29 3 * * * https://raw.githubusercontent.com/6dylan6/jdpro/main/jd_wrtred.js
3 | updatetime:2022/11/23
4 | */
5 |
6 | const $ = new Env('万人团红包');
7 | const notify = $.isNode() ? require('./sendNotify') : '';
8 | const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
9 | let jdNotify = true;
10 | //IOS等用户直接用NobyDa的jd cookie
11 | let cookiesArr = [], cookie = '', message = '';
12 | if ($.isNode()) {
13 | Object.keys(jdCookieNode).forEach((item) => {
14 | cookiesArr.push(jdCookieNode[item])
15 | })
16 | if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => { };
17 | } else {
18 | cookiesArr = [$.getdata('CookieJD'), $.getdata('CookieJD2'), ...jsonParse($.getdata('CookiesJD') || "[]").map(item => item.cookie)].filter(item => !!item);
19 | }
20 | !(async () => {
21 | if (!cookiesArr[0]) {
22 | $.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', { "open-url": "https://bean.m.jd.com/bean/signIndex.action" });
23 | return;
24 | }
25 | for (let i = 0; i < cookiesArr.length; i++) {
26 | if (cookiesArr[i]) {
27 | cookie = cookiesArr[i];
28 | $.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1])
29 | $.index = i + 1;
30 | $.isLogin = true;
31 | $.nickName = '';
32 | $.UA=require('./USER_AGENTS').UARAM();
33 | await TotalBean();
34 | console.log(`\n******开始【京东账号${$.index}】${$.nickName || $.UserName}*********\n`);
35 | if (!$.isLogin) {
36 | $.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" });
37 | if ($.isNode()) {
38 | await notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`);
39 | }
40 | continue
41 | }
42 | await WRT();
43 | await $.wait(2000)
44 | }
45 | }
46 | })()
47 | .catch((e) => {
48 | $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '')
49 | })
50 | .finally(() => {
51 | $.done();
52 | })
53 |
54 |
55 |
56 | async function WRT() {
57 | return new Promise(async (resolve) => {
58 | $.post(getUrl(), async (err, resp, data) => {
59 | try {
60 | if (err) {
61 | console.log(`${JSON.stringify(err)}`)
62 | console.log(` API请求失败,请检查网路重试`)
63 | } else {
64 | data = JSON.parse(data)
65 | if (data.code == 0) {
66 | if (data.data.bizCode == 0) {
67 | console.log(` 恭喜获得 ${data.data?.result?.hongBaoResult.hongBao.disCount} 红包`);
68 | }else{
69 | console.log(data.data.bizMsg);
70 | }
71 | } else {
72 | console.log(data.msg)
73 | }
74 | }
75 | } catch (e) {
76 | $.logErr(e, resp)
77 | } finally {
78 | resolve(data)
79 | }
80 | })
81 | })
82 | }
83 |
84 | function getUrl() {
85 | return {
86 | url: `https://api.m.jd.com`,
87 | body: `appid=wh5&clientVersion=1.0.0&functionId=wanrentuan_superise_send&body={"channel":2}&area=2_2813_61130_0`,
88 | headers: {
89 | 'Host': 'api.m.jd.com',
90 | 'Origin': 'https://h5.m.jd.com',
91 | 'Content-Type': 'application/x-www-form-urlencoded',
92 | 'User-Agent':$.UA,
93 | 'Cookie': cookie
94 | }
95 | }
96 | }
97 |
98 | function TotalBean() {
99 | return new Promise((resolve) => {
100 | const options = {
101 | url: 'https://plogin.m.jd.com/cgi-bin/ml/islogin',
102 | headers: {
103 | "Cookie": cookie,
104 | "referer": "https://h5.m.jd.com/",
105 | "User-Agent": $.UA,
106 | },
107 | timeout: 10000
108 | }
109 | $.get(options, (err, resp, data) => {
110 | try {
111 | if (data) {
112 | data = JSON.parse(data);
113 | if (data.islogin === "1") {
114 | } else if (data.islogin === "0") {
115 | $.isLogin = false;
116 | }
117 | }
118 | } catch (e) {
119 | console.log(e);
120 | }
121 | finally {
122 | resolve();
123 | }
124 | });
125 | });
126 | }
127 | function showMsg() {
128 | return new Promise(resolve => {
129 | if (!jdNotify) {
130 | $.msg($.name, '', `${message}`);
131 | } else {
132 | $.log(`京东账号${$.index}${$.nickName}\n${message}`);
133 | }
134 | resolve()
135 | })
136 | }
137 | function safeGet(data) {
138 | try {
139 | if (typeof JSON.parse(data) == "object") {
140 | return true;
141 | }
142 | } catch (e) {
143 | console.log(e);
144 | console.log(`京东服务器访问数据为空,请检查自身设备网络情况`);
145 | return false;
146 | }
147 | }
148 | function jsonParse(str) {
149 | if (typeof str == "string") {
150 | try {
151 | return JSON.parse(str);
152 | } catch (e) {
153 | console.log(e);
154 | $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie')
155 | return [];
156 | }
157 | }
158 | }
159 | // prettier-ignore
160 | function Env(t, e) { "undefined" != typeof process && JSON.stringify(process.env).indexOf("GITHUB") > -1 && process.exit(0); class s { constructor(t) { this.env = t } send(t, e = "GET") { t = "string" == typeof t ? { url: t } : t; let s = this.get; return "POST" === e && (s = this.post), new Promise((e, i) => { s.call(this, t, (t, s, r) => { t ? i(t) : e(s) }) }) } get(t) { return this.send.call(this.env, t) } post(t) { return this.send.call(this.env, t, "POST") } } return new class { constructor(t, e) { this.name = t, this.http = new s(this), this.data = null, this.dataFile = "box.dat", this.logs = [], this.isMute = !1, this.isNeedRewrite = !1, this.logSeparator = "\n", this.startTime = (new Date).getTime(), Object.assign(this, e), this.log("", `🔔${this.name}, 开始!`) } isNode() { return "undefined" != typeof module && !!module.exports } isQuanX() { return "undefined" != typeof $task } isSurge() { return "undefined" != typeof $httpClient && "undefined" == typeof $loon } isLoon() { return "undefined" != typeof $loon } toObj(t, e = null) { try { return JSON.parse(t) } catch { return e } } toStr(t, e = null) { try { return JSON.stringify(t) } catch { return e } } getjson(t, e) { let s = e; const i = this.getdata(t); if (i) try { s = JSON.parse(this.getdata(t)) } catch { } return s } setjson(t, e) { try { return this.setdata(JSON.stringify(t), e) } catch { return !1 } } getScript(t) { return new Promise(e => { this.get({ url: t }, (t, s, i) => e(i)) }) } runScript(t, e) { return new Promise(s => { let i = this.getdata("@chavy_boxjs_userCfgs.httpapi"); i = i ? i.replace(/\n/g, "").trim() : i; let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); r = r ? 1 * r : 20, r = e && e.timeout ? e.timeout : r; const [o, h] = i.split("@"), n = { url: `http://${h}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": o, Accept: "*/*" } }; this.post(n, (t, e, i) => s(i)) }).catch(t => this.logErr(t)) } loaddata() { if (!this.isNode()) return {}; { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e); if (!s && !i) return {}; { const i = s ? t : e; try { return JSON.parse(this.fs.readFileSync(i)) } catch (t) { return {} } } } } writedata() { if (this.isNode()) { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e), r = JSON.stringify(this.data); s ? this.fs.writeFileSync(t, r) : i ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r) } } lodash_get(t, e, s) { const i = e.replace(/\[(\d+)\]/g, ".$1").split("."); let r = t; for (const t of i) if (r = Object(r)[t], void 0 === r) return s; return r } lodash_set(t, e, s) { return Object(t) !== t ? t : (Array.isArray(e) || (e = e.toString().match(/[^.[\]]+/g) || []), e.slice(0, -1).reduce((t, s, i) => Object(t[s]) === t[s] ? t[s] : t[s] = Math.abs(e[i + 1]) >> 0 == +e[i + 1] ? [] : {}, t)[e[e.length - 1]] = s, t) } getdata(t) { let e = this.getval(t); if (/^@/.test(t)) { const [, s, i] = /^@(.*?)\.(.*?)$/.exec(t), r = s ? this.getval(s) : ""; if (r) try { const t = JSON.parse(r); e = t ? this.lodash_get(t, i, "") : e } catch (t) { e = "" } } return e } setdata(t, e) { let s = !1; if (/^@/.test(e)) { const [, i, r] = /^@(.*?)\.(.*?)$/.exec(e), o = this.getval(i), h = i ? "null" === o ? null : o || "{}" : "{}"; try { const e = JSON.parse(h); this.lodash_set(e, r, t), s = this.setval(JSON.stringify(e), i) } catch (e) { const o = {}; this.lodash_set(o, r, t), s = this.setval(JSON.stringify(o), i) } } else s = this.setval(t, e); return s } getval(t) { return this.isSurge() || this.isLoon() ? $persistentStore.read(t) : this.isQuanX() ? $prefs.valueForKey(t) : this.isNode() ? (this.data = this.loaddata(), this.data[t]) : this.data && this.data[t] || null } setval(t, e) { return this.isSurge() || this.isLoon() ? $persistentStore.write(t, e) : this.isQuanX() ? $prefs.setValueForKey(t, e) : this.isNode() ? (this.data = this.loaddata(), this.data[e] = t, this.writedata(), !0) : this.data && this.data[e] || null } initGotEnv(t) { this.got = this.got ? this.got : require("got"), this.cktough = this.cktough ? this.cktough : require("tough-cookie"), this.ckjar = this.ckjar ? this.ckjar : new this.cktough.CookieJar, t && (t.headers = t.headers ? t.headers : {}, void 0 === t.headers.Cookie && void 0 === t.cookieJar && (t.cookieJar = this.ckjar)) } get(t, e = (() => { })) { t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { try { if (t.headers["set-cookie"]) { const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); s && this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar } } catch (t) { this.logErr(t) } }).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) })) } post(t, e = (() => { })) { if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.post(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) }); else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t)); else if (this.isNode()) { this.initGotEnv(t); const { url: s, ...i } = t; this.got.post(s, i).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) }) } } time(t, e = null) { const s = e ? new Date(e) : new Date; let i = { "M+": s.getMonth() + 1, "d+": s.getDate(), "H+": s.getHours(), "m+": s.getMinutes(), "s+": s.getSeconds(), "q+": Math.floor((s.getMonth() + 3) / 3), S: s.getMilliseconds() }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, (s.getFullYear() + "").substr(4 - RegExp.$1.length))); for (let e in i) new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? i[e] : ("00" + i[e]).substr(("" + i[e]).length))); return t } msg(e = t, s = "", i = "", r) { const o = t => { if (!t) return t; if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? { "open-url": t } : this.isSurge() ? { url: t } : void 0; if ("object" == typeof t) { if (this.isLoon()) { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } if (this.isQuanX()) { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl; return { "open-url": e, "media-url": s } } if (this.isSurge()) { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } } }; if (this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))), !this.isMuteLog) { let t = ["", "==============📣系统通知📣=============="]; t.push(e), s && t.push(s), i && t.push(i), console.log(t.join("\n")), this.logs = this.logs.concat(t) } } log(...t) { t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator)) } logErr(t, e) { const s = !this.isSurge() && !this.isQuanX() && !this.isLoon(); s ? this.log("", `❗️${this.name}, 错误!`, t.stack) : this.log("", `❗️${this.name}, 错误!`, t) } wait(t) { return new Promise(e => setTimeout(e, t)) } done(t = {}) { const e = (new Date).getTime(), s = (e - this.startTime) / 1e3; this.log("", `🔔${this.name}, 结束! 🕛 ${s} 秒`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) } }(t, e) }
--------------------------------------------------------------------------------
/Task/JD New/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 $ = new Env('玩一玩成就');
11 | const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
12 | const notify = $.isNode() ? require('./sendNotify') : '';
13 | //IOS等用户直接用NobyDa的jd cookie
14 | let cookiesArr = [],
15 | cookie = '';
16 | if ($.isNode()) {
17 | Object.keys(jdCookieNode).forEach((item) => {
18 | cookiesArr.push(jdCookieNode[item])
19 | })
20 | if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => { };
21 | } else {
22 | cookiesArr = [$.getdata('CookieJD'), $.getdata('CookieJD2'), ...jsonParse($.getdata('CookiesJD') || "[]").map(item => item.cookie)].filter(item => !!item);
23 | }
24 |
25 | $.invitePinTaskList = []
26 |
27 | message = ""
28 | !(async () => {
29 | console.log('\n【活动入口:京东APP搜索-玩一玩 】\n\n【每次运行活动ID均不同,只增加成长值目前没任何收益 】');
30 | if (!cookiesArr[0]) {
31 | $.msg($.name, '【提示】请先获取cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/', {
32 | "open-url": "https://bean.m.jd.com/"
33 | });
34 | return;
35 | }
36 | for (let i = 0; i < cookiesArr.length; i++) {
37 | cookie = cookiesArr[i];
38 | if (cookie) {
39 | $.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1])
40 | $.index = i + 1;
41 | $.isLogin = true;
42 | $.nickName = '';
43 | console.log(`\n\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 notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`);
50 | }
51 | continue
52 | }
53 | await getUA();
54 | await getPlayTaskCenter();
55 | for (const playTaskCenterListElement of $.playTaskCenterList) {
56 | $.log(`ID:${playTaskCenterListElement.playId} ${playTaskCenterListElement.name} 成就值: ${playTaskCenterListElement.achieve}`)
57 | await $.wait(parseInt(Math.random() * 1500 + 3000, 10))
58 | await doPlayAction(playTaskCenterListElement.playId)
59 | await $.wait(parseInt(Math.random() * 1500 + 3000, 10))
60 | }
61 | await $.wait(parseInt(Math.random() * 1500 + 2000, 10))
62 |
63 | }
64 | }
65 | })()
66 | .catch((e) => $.logErr(e))
67 | .finally(() => $.done())
68 | //获取活动信息
69 |
70 |
71 |
72 | function getPlayTaskCenter() {
73 | //await $.wait(20)
74 | return new Promise(resolve => {
75 | $.post(taskPostClientActionUrl(`body={"client":"app"}&client=wh5&clientVersion=1.0.0`, `playTaskCenter`), async (err, resp, data) => {
76 | try {
77 | if (err) {
78 | console.log(`${JSON.stringify(err)}`)
79 | console.log(`${$.name} API请求失败,请检查网路重试`)
80 | } else {
81 | data = JSON.parse(data);
82 | $.playTaskCenterList = data.data
83 | }
84 | } catch (e) {
85 | $.logErr(e, resp)
86 | } finally {
87 | resolve(data);
88 | }
89 | })
90 | })
91 | }
92 |
93 | function doPlayAction(playId) {
94 | //await $.wait(20)
95 | return new Promise(resolve => {
96 | $.post(taskPostClientActionUrl(`body={"client":"app","playId":"${playId}","type":"1"}&client=wh5&clientVersion=1.0.0`, `playAction`), async (err, resp, data) => {
97 | try {
98 | if (err) {
99 | console.log(`${JSON.stringify(err)}`)
100 | console.log(`${$.name} API请求失败,请检查网路重试`)
101 | } else {
102 | data = JSON.parse(data);
103 | if (data) {
104 | console.log('任务完成,总成长值:' + data?.data?.achieve)
105 | }
106 | debugger
107 | }
108 | } catch (e) {
109 | $.logErr(e, resp)
110 | } finally {
111 | resolve(data);
112 | }
113 | })
114 | })
115 | }
116 |
117 | async function getUA() {
118 | $.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`
119 | }
120 |
121 | function randomString(e) {
122 | e = e || 32;
123 | let t = "abcdef0123456789", a = t.length, n = "";
124 | for (i = 0; i < e; i++)
125 | n += t.charAt(Math.floor(Math.random() * a));
126 | return n
127 | }
128 | function taskPostClientActionUrl(body, functionId) {
129 | return {
130 | url: `https://api.m.jd.com/client.action?${functionId ? `functionId=${functionId}` : ``}`,
131 | body: body,
132 | headers: {
133 | 'User-Agent': $.UA,
134 | 'Content-Type': 'application/x-www-form-urlencoded',
135 | 'Host': 'api.m.jd.com',
136 | 'Origin': 'https://api.m.jd.com',
137 | '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',
138 | 'Cookie': cookie,
139 | }
140 | }
141 | }
142 | function jsonParse(str) {
143 | if (typeof str == "string") {
144 | try {
145 | return JSON.parse(str);
146 | } catch (e) {
147 | console.log(e);
148 | $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie')
149 | return [];
150 | }
151 | }
152 | }
153 | // prettier-ignore
154 | function Env(t, e) { "undefined" != typeof process && JSON.stringify(process.env).indexOf("GITHUB") > -1 && process.exit(0); class s { constructor(t) { this.env = t } send(t, e = "GET") { t = "string" == typeof t ? { url: t } : t; let s = this.get; return "POST" === e && (s = this.post), new Promise((e, i) => { s.call(this, t, (t, s, r) => { t ? i(t) : e(s) }) }) } get(t) { return this.send.call(this.env, t) } post(t) { return this.send.call(this.env, t, "POST") } } return new class { constructor(t, e) { this.name = t, this.http = new s(this), this.data = null, this.dataFile = "box.dat", this.logs = [], this.isMute = !1, this.isNeedRewrite = !1, this.logSeparator = "\n", this.startTime = (new Date).getTime(), Object.assign(this, e), this.log("", `🔔${this.name}, 开始!`) } isNode() { return "undefined" != typeof module && !!module.exports } isQuanX() { return "undefined" != typeof $task } isSurge() { return "undefined" != typeof $httpClient && "undefined" == typeof $loon } isLoon() { return "undefined" != typeof $loon } toObj(t, e = null) { try { return JSON.parse(t) } catch { return e } } toStr(t, e = null) { try { return JSON.stringify(t) } catch { return e } } getjson(t, e) { let s = e; const i = this.getdata(t); if (i) try { s = JSON.parse(this.getdata(t)) } catch { } return s } setjson(t, e) { try { return this.setdata(JSON.stringify(t), e) } catch { return !1 } } getScript(t) { return new Promise(e => { this.get({ url: t }, (t, s, i) => e(i)) }) } runScript(t, e) { return new Promise(s => { let i = this.getdata("@chavy_boxjs_userCfgs.httpapi"); i = i ? i.replace(/\n/g, "").trim() : i; let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); r = r ? 1 * r : 20, r = e && e.timeout ? e.timeout : r; const [o, h] = i.split("@"), n = { url: `http://${h}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": o, Accept: "*/*" } }; this.post(n, (t, e, i) => s(i)) }).catch(t => this.logErr(t)) } loaddata() { if (!this.isNode()) return {}; { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e); if (!s && !i) return {}; { const i = s ? t : e; try { return JSON.parse(this.fs.readFileSync(i)) } catch (t) { return {} } } } } writedata() { if (this.isNode()) { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e), r = JSON.stringify(this.data); s ? this.fs.writeFileSync(t, r) : i ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r) } } lodash_get(t, e, s) { const i = e.replace(/\[(\d+)\]/g, ".$1").split("."); let r = t; for (const t of i) if (r = Object(r)[t], void 0 === r) return s; return r } lodash_set(t, e, s) { return Object(t) !== t ? t : (Array.isArray(e) || (e = e.toString().match(/[^.[\]]+/g) || []), e.slice(0, -1).reduce((t, s, i) => Object(t[s]) === t[s] ? t[s] : t[s] = Math.abs(e[i + 1]) >> 0 == +e[i + 1] ? [] : {}, t)[e[e.length - 1]] = s, t) } getdata(t) { let e = this.getval(t); if (/^@/.test(t)) { const [, s, i] = /^@(.*?)\.(.*?)$/.exec(t), r = s ? this.getval(s) : ""; if (r) try { const t = JSON.parse(r); e = t ? this.lodash_get(t, i, "") : e } catch (t) { e = "" } } return e } setdata(t, e) { let s = !1; if (/^@/.test(e)) { const [, i, r] = /^@(.*?)\.(.*?)$/.exec(e), o = this.getval(i), h = i ? "null" === o ? null : o || "{}" : "{}"; try { const e = JSON.parse(h); this.lodash_set(e, r, t), s = this.setval(JSON.stringify(e), i) } catch (e) { const o = {}; this.lodash_set(o, r, t), s = this.setval(JSON.stringify(o), i) } } else s = this.setval(t, e); return s } getval(t) { return this.isSurge() || this.isLoon() ? $persistentStore.read(t) : this.isQuanX() ? $prefs.valueForKey(t) : this.isNode() ? (this.data = this.loaddata(), this.data[t]) : this.data && this.data[t] || null } setval(t, e) { return this.isSurge() || this.isLoon() ? $persistentStore.write(t, e) : this.isQuanX() ? $prefs.setValueForKey(t, e) : this.isNode() ? (this.data = this.loaddata(), this.data[e] = t, this.writedata(), !0) : this.data && this.data[e] || null } initGotEnv(t) { this.got = this.got ? this.got : require("got"), this.cktough = this.cktough ? this.cktough : require("tough-cookie"), this.ckjar = this.ckjar ? this.ckjar : new this.cktough.CookieJar, t && (t.headers = t.headers ? t.headers : {}, void 0 === t.headers.Cookie && void 0 === t.cookieJar && (t.cookieJar = this.ckjar)) } get(t, e = (() => { })) { t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { try { if (t.headers["set-cookie"]) { const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); s && this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar } } catch (t) { this.logErr(t) } }).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) })) } post(t, e = (() => { })) { if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.post(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) }); else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t)); else if (this.isNode()) { this.initGotEnv(t); const { url: s, ...i } = t; this.got.post(s, i).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) }) } } time(t, e = null) { const s = e ? new Date(e) : new Date; let i = { "M+": s.getMonth() + 1, "d+": s.getDate(), "H+": s.getHours(), "m+": s.getMinutes(), "s+": s.getSeconds(), "q+": Math.floor((s.getMonth() + 3) / 3), S: s.getMilliseconds() }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, (s.getFullYear() + "").substr(4 - RegExp.$1.length))); for (let e in i) new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? i[e] : ("00" + i[e]).substr(("" + i[e]).length))); return t } msg(e = t, s = "", i = "", r) { const o = t => { if (!t) return t; if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? { "open-url": t } : this.isSurge() ? { url: t } : void 0; if ("object" == typeof t) { if (this.isLoon()) { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } if (this.isQuanX()) { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl; return { "open-url": e, "media-url": s } } if (this.isSurge()) { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } } }; if (this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))), !this.isMuteLog) { let t = ["", "==============📣系统通知📣=============="]; t.push(e), s && t.push(s), i && t.push(i), console.log(t.join("\n")), this.logs = this.logs.concat(t) } } log(...t) { t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator)) } logErr(t, e) { const s = !this.isSurge() && !this.isQuanX() && !this.isLoon(); s ? this.log("", `❗️${this.name}, 错误!`, t.stack) : this.log("", `❗️${this.name}, 错误!`, t) } wait(t) { return new Promise(e => setTimeout(e, t)) } done(t = {}) { const e = (new Date).getTime(), s = (e - this.startTime) / 1e3; this.log("", `🔔${this.name}, 结束! 🕛 ${s} 秒`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) } }(t, e) }
155 |
156 |
157 |
--------------------------------------------------------------------------------
/Task/JD New/jx_aid_cashback.js:
--------------------------------------------------------------------------------
1 | let common = require("./function/common");
2 | let $ = new common.env('京喜购物返红包助力');
3 | let min = 5,
4 | help = $.config[$.filename(__filename)] || Math.min(min, $.config.JdMain) || min;
5 | $.setOptions({
6 | headers: {
7 | 'content-type': 'application/json',
8 | 'user-agent': 'jdapp;iPhone;9.4.6;14.2;965af808880443e4c1306a54afdd5d5ae771de46;network/wifi;supportApplePay/0;hasUPPay/0;hasOCPay/0;model/iPhone8,4;addressid/;supportBestPay/0;appBuild/167618;jdSupportDarkMode/0;Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
9 | 'referer': 'https://happy.m.jd.com/babelDiy/Zeus/3ugedFa7yA6NhxLN5gw2L3PF9sQC/index.html?asid=287215626&un_area=12_904_905_57901&lng=117.612969135975&lat=23.94014745198865',
10 | }
11 | });
12 | $.readme = `
13 | 在京喜下单,如订单有购物返现,脚本会自动查询返现groupid并予以助力,目前每个账号每天能助力3次
14 | 44 */6 * * * task ${$.runfile}
15 | export ${$.runfile}=2 #如需增加被助力账号,在这边修改人数
16 | `
17 | eval(common.eval.mainEval($));
18 | async function prepare() {
19 | let url = `https://wq.jd.com/bases/orderlist/list?order_type=3&start_page=1&last_page=0&page_size=10&callersource=newbiz&t=${$.timestamp}&traceid=&g_ty=ls&g_tk=606717070`
20 | for (let j of cookies['help']) {
21 | $.setCookie(j);
22 | await $.curl(url)
23 | try {
24 | for (let k of $.source.orderList) {
25 | try {
26 | let orderid = k.parentId != '0' ? k.parentId : k.orderId
27 | let url = `https://wq.jd.com/fanxianzl/zhuli/QueryGroupDetail?isquerydraw=1&orderid=${orderid}&groupid=&sceneval=2&g_login_type=1&g_ty=ls`
28 | let dec = await jxAlgo.dec(url)
29 | await $.curl(dec.url)
30 | let now = parseInt(new Date() / 1000)
31 | let end = $.source.data.groupinfo.end_time
32 | if (end > now && $.source.data.groupinfo.openhongbaosum != $.source.data.groupinfo.totalhongbaosum) {
33 | let groupid = $.source.data.groupinfo.groupid;
34 | $.sharecode.push({
35 | 'groupid': groupid
36 | })
37 | }
38 | } catch (e) {}
39 | }
40 | } catch (e) {}
41 | }
42 | }
43 | async function main(id) {
44 | common.assert(id.groupid, '没有可助力ID')
45 | let url = `http://wq.jd.com/fanxianzl/zhuli/Help?groupid=${id.groupid}&_stk=groupid&_ste=2&g_ty=ls&g_tk=1710198667&sceneval=2&g_login_type=1`
46 | let dec = await jxAlgo.dec(url)
47 | await $.curl(dec.url)
48 | console.log($.source.data.prize.discount)
49 | }
50 |
--------------------------------------------------------------------------------
/Task/JD/jd_car_exchange.js:
--------------------------------------------------------------------------------
1 | /*
2 | by JDHelloWorld 20210902
3 |
4 | 0 0 * * * https://raw.githubusercontent.com/yyn618/QuantumultX-Script/master/Script/Files/JD/jd_car_exchange.js, tag=京东汽车兑换, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_car.png, enabled=true
5 |
6 | 京东汽车兑换,500赛点兑换500京豆
7 |
8 | 活动入口:京东APP首页-京东汽车-屏幕右中部,车主福利
9 | 地址:https://h5.m.jd.com/babelDiy/Zeus/44bjzCpzH9GpspWeBzYSqBA7jEtP/index.html#/journey
10 | */
11 |
12 | const $ = new Env('京东汽车兑换');
13 |
14 | const notify = $.isNode() ? require('./sendNotify') : '';
15 | //Node.js用户请在jdCookie.js处填写京东ck;
16 | const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
17 | let jdNotify = true;//是否关闭通知,false打开通知推送,true关闭通知推送
18 | const randomCount = $.isNode() ? 20 : 5;
19 | //IOS等用户直接用NobyDa的jd cookie
20 | let cookiesArr = [], cookie = '', message;
21 | if ($.isNode()) {
22 | Object.keys(jdCookieNode).forEach((item) => {
23 | cookiesArr.push(jdCookieNode[item])
24 | })
25 | if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {
26 | };
27 | } else {
28 | cookiesArr = [$.getdata('CookieJD'), $.getdata('CookieJD2'), ...jsonParse($.getdata('CookiesJD') || "[]").map(item => item.cookie)].filter(item => !!item);
29 | }
30 | const JD_API_HOST = 'https://car-member.jd.com/api/';
31 | !(async () => {
32 | if (!cookiesArr[0]) {
33 | $.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', {"open-url": "https://bean.m.jd.com/bean/signIndex.action"});
34 | return;
35 | }
36 | for (let j = 0; j < 20; ++j)
37 | for (let i = 0; i < cookiesArr.length; i++) {
38 | if (cookiesArr[i]) {
39 | cookie = cookiesArr[i];
40 | $.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1])
41 | $.index = i + 1;
42 | console.log(`*********京东账号${$.index} ${$.UserName}*********`)
43 | $.isLogin = true;
44 | $.nickName = $.UserName;
45 | message = '';
46 | await jdCar();
47 | }
48 | }
49 | })()
50 | .catch((e) => {
51 | $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '')
52 | })
53 | .finally(() => {
54 | $.done();
55 | })
56 |
57 | async function jdCar() {
58 | await exchange()
59 | }
60 |
61 | function showMsg() {
62 | return new Promise(resolve => {
63 | $.msg($.name, '', `【京东账号${$.index}】${$.nickName}\n${message}`);
64 | resolve()
65 | })
66 | }
67 |
68 | function exchange() {
69 | return new Promise(resolve => {
70 | $.post(taskUrl('v1/user/exchange/bean'), (err, resp, data) => {
71 | try {
72 | if (err) {
73 | console.log(`${JSON.stringify(err)}`)
74 | console.log(`${$.name} user/exchange/bean API请求失败,请检查网路重试\n`)
75 | } else {
76 | if (safeGet(data)) {
77 | data = JSON.parse(data);
78 | console.log(`兑换结果:${JSON.stringify(data)}\n`)
79 | }
80 | }
81 | } catch (e) {
82 | $.logErr(e, resp)
83 | } finally {
84 | resolve();
85 | }
86 | })
87 | })
88 | }
89 |
90 | function taskUrl(function_id, body = {}) {
91 | return {
92 | url: `${JD_API_HOST}${function_id}?timestamp=${new Date().getTime() + new Date().getTimezoneOffset() * 60 * 1000 + 8 * 60 * 60 * 1000}`,
93 | headers: {
94 | "Accept": "*/*",
95 | "Accept-Encoding": "gzip, deflate, br",
96 | "Accept-Language": "zh-cn",
97 | "Connection": "keep-alive",
98 | "Content-Type": "application/x-www-form-urlencoded",
99 | "Host": "car-member.jd.com",
100 | 'activityid': '39443aee3ff74fcb806a6f755240d127',
101 | 'origin': 'https://h5.m.jd.com',
102 | "Referer": "https://h5.m.jd.com/babelDiy/Zeus/44bjzCpzH9GpspWeBzYSqBA7jEtP/index.html",
103 | "Cookie": cookie,
104 | "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"),
105 | }
106 | }
107 | }
108 | function safeGet(data) {
109 | try {
110 | if (typeof JSON.parse(data) == "object") {
111 | return true;
112 | }
113 | } catch (e) {
114 | console.log(e);
115 | console.log(`京东服务器访问数据为空,请检查自身设备网络情况`);
116 | return false;
117 | }
118 | }
119 | function jsonParse(str) {
120 | if (typeof str == "string") {
121 | try {
122 | return JSON.parse(str);
123 | } catch (e) {
124 | console.log(e);
125 | $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie')
126 | return [];
127 | }
128 | }
129 | }
130 | // prettier-ignore
131 | function Env(t,e){"undefined"!=typeof process&&JSON.stringify(process.env).indexOf("GITHUB")>-1&&process.exit(0);class s{constructor(t){this.env=t}send(t,e="GET"){t="string"==typeof t?{url:t}:t;let s=this.get;return"POST"===e&&(s=this.post),new Promise((e,i)=>{s.call(this,t,(t,s,r)=>{t?i(t):e(s)})})}get(t){return this.send.call(this.env,t)}post(t){return this.send.call(this.env,t,"POST")}}return new class{constructor(t,e){this.name=t,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.isNeedRewrite=!1,this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`🔔${this.name}, 开始!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null){try{return JSON.stringify(t)}catch{return e}}getjson(t,e){let s=e;const i=this.getdata(t);if(i)try{s=JSON.parse(this.getdata(t))}catch{}return s}setjson(t,e){try{return this.setdata(JSON.stringify(t),e)}catch{return!1}}getScript(t){return new Promise(e=>{this.get({url:t},(t,s,i)=>e(i))})}runScript(t,e){return new Promise(s=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let r=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");r=r?1*r:20,r=e&&e.timeout?e.timeout:r;const[o,h]=i.split("@"),n={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(n,(t,e,i)=>s(i))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e);if(!s&&!i)return{};{const i=s?t:e;try{return JSON.parse(this.fs.readFileSync(i))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e),r=JSON.stringify(this.data);s?this.fs.writeFileSync(t,r):i?this.fs.writeFileSync(e,r):this.fs.writeFileSync(t,r)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let r=t;for(const t of i)if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,e,s){return Object(t)!==t?t:(Array.isArray(e)||(e=e.toString().match(/[^.[\]]+/g)||[]),e.slice(0,-1).reduce((t,s,i)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[i+1])>>0==+e[i+1]?[]:{},t)[e[e.length-1]]=s,t)}getdata(t){let e=this.getval(t);if(/^@/.test(t)){const[,s,i]=/^@(.*?)\.(.*?)$/.exec(t),r=s?this.getval(s):"";if(r)try{const t=JSON.parse(r);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,r]=/^@(.*?)\.(.*?)$/.exec(e),o=this.getval(i),h=i?"null"===o?null:o||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,r,t),s=this.setval(JSON.stringify(e),i)}catch(e){const o={};this.lodash_set(o,r,t),s=this.setval(JSON.stringify(o),i)}}else s=this.setval(t,e);return s}getval(t){return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)})):this.isQuanX()?(this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t))):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();s&&this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)}))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)})}}time(t,e=null){const s=e?new Date(e):new Date;let i={"M+":s.getMonth()+1,"d+":s.getDate(),"H+":s.getHours(),"m+":s.getMinutes(),"s+":s.getSeconds(),"q+":Math.floor((s.getMonth()+3)/3),S:s.getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(s.getFullYear()+"").substr(4-RegExp.$1.length)));for(let e in i)new RegExp("("+e+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?i[e]:("00"+i[e]).substr((""+i[e]).length)));return t}msg(e=t,s="",i="",r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};if(this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r))),!this.isMuteLog){let t=["","==============📣系统通知📣=============="];t.push(e),s&&t.push(s),i&&t.push(i),console.log(t.join("\n")),this.logs=this.logs.concat(t)}}log(...t){t.length>0&&(this.logs=[...this.logs,...t]),console.log(t.join(this.logSeparator))}logErr(t,e){const s=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();s?this.log("",`❗️${this.name}, 错误!`,t.stack):this.log("",`❗️${this.name}, 错误!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`🔔${this.name}, 结束! 🕛 ${s} 秒`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)}
132 |
--------------------------------------------------------------------------------
/Task/JD/jd_kd.js:
--------------------------------------------------------------------------------
1 | /*
2 | by faker 20210930
3 | 10 0 * * * https://raw.githubusercontent.com/yyn618/QuantumultX-Script/master/Task/JD/jd_kd.js, tag=京东快递签到, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_kd.png, enabled=true
4 |
5 | 签到领豆,14天内满4次和7次享额外奖励,每天运行一次即可
6 |
7 | 地址:https://jingcai-h5.jd.com/#/
8 | */
9 |
10 | const $ = new Env('京东快递签到');
11 |
12 | const notify = $.isNode() ? require('./sendNotify') : '';
13 | //Node.js用户请在jdCookie.js处填写京东ck;
14 | const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
15 | let jdNotify = true;//是否关闭通知,false打开通知推送,true关闭通知推送
16 | const randomCount = $.isNode() ? 20 : 5;
17 | //IOS等用户直接用NobyDa的jd cookie
18 | let cookiesArr = [], cookie = '', message, allMsg = '';
19 | if ($.isNode()) {
20 | Object.keys(jdCookieNode).forEach((item) => {
21 | cookiesArr.push(jdCookieNode[item])
22 | })
23 | if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {};
24 | } else {
25 | cookiesArr = [$.getdata('CookieJD'), $.getdata('CookieJD2'), ...jsonParse($.getdata('CookiesJD') || "[]").map(item => item.cookie)].filter(item => !!item);
26 | }
27 | const JD_API_HOST = 'https://api.m.jd.com/api';
28 | !(async () => {
29 | if (!cookiesArr[0]) {
30 | $.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', {"open-url": "https://bean.m.jd.com/bean/signIndex.action"});
31 | return;
32 | }
33 | for (let i = 0; i < cookiesArr.length; i++) {
34 | if (cookiesArr[i]) {
35 | cookie = cookiesArr[i];
36 | $.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1])
37 | $.index = i + 1;
38 | $.isLogin = true;
39 | $.nickName = '';
40 | message = '';
41 | await TotalBean();
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`, {"open-url": "https://bean.m.jd.com/bean/signIndex.action"});
45 |
46 | if ($.isNode()) {
47 | await notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`);
48 | }
49 | continue
50 | }
51 | await userSignIn();
52 | // await showMsg();
53 | }
54 | }
55 | if (allMsg) {
56 | $.msg($.name, '', allMsg);
57 | }
58 | })()
59 | .catch((e) => {
60 | $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '')
61 | })
62 | .finally(() => {
63 | $.done();
64 | })
65 |
66 | function showMsg() {
67 | return new Promise(resolve => {
68 | $.msg($.name, '', `【京东账号${$.index}】${$.nickName}\n${message}`);
69 | resolve()
70 | })
71 | }
72 | function userSignIn() {
73 | return new Promise(resolve => {
74 | $.post(taskUrl(), (err, resp, data) => {
75 | try {
76 | if (err) {
77 | console.log(`${JSON.stringify(err)}`)
78 | console.log(resp)
79 | console.log(`${$.name} API请求失败,请检查网路重试`)
80 | } else {
81 | if (safeGet(data)) {
82 | data = JSON.parse(data);
83 | if (data.code === 1) {
84 | console.log(`今日签到成功,获得${data.content[0].title}`)
85 | message += `京东账号${$.index}${$.nickName}\n今日签到成功,获得${data.content[0].title} 🐶\n`;
86 | allMsg += message;
87 | } else if (data.code === -1) {
88 | console.log(`今日已签到`)
89 | // message += `【签到】失败,今日已签到`;
90 | } else {
91 | console.log(`异常:${JSON.stringify(data)}`)
92 | }
93 | }
94 | }
95 | } catch (e) {
96 | $.logErr(e, resp)
97 | } finally {
98 | resolve();
99 | }
100 | })
101 | })
102 | }
103 | function taskUrl() {
104 | let t = +new Date()
105 | return {
106 | url: `https://lop-proxy.jd.com/jiFenApi/signInAndGetReward`,
107 | body: '[{"userNo":"$cooMrdGatewayUid$"}]',
108 | headers: {
109 | 'uuid': `${t}${t * 2}`,
110 | 'Host': 'lop-proxy.jd.com',
111 | 'lop-dn': 'jingcai.jd.com',
112 | 'biz-type': 'service-monitor',
113 | 'app-key': 'jexpress',
114 | 'access': 'H5',
115 | 'content-type': 'application/json;charset=utf-8',
116 | 'accept-encoding': 'gzip, deflate, br',
117 | 'clientinfo': '{"appName":"jingcai","client":"m"}',
118 | 'accept': 'application/json, text/plain, */*',
119 | 'jexpress-report-time': t,
120 | 'x-requested-with': 'XMLHttpRequest',
121 | 'source-client': '2',
122 | 'appparams': '{"appid":158,"ticket_type":"m"}',
123 | 'version': '1.0.0',
124 | 'origin': 'https://jingcai-h5.jd.com',
125 | 'sec-fetch-site': 'same-site',
126 | 'sec-fetch-mode': 'cors',
127 | 'sec-fetch-dest': 'empty',
128 | 'referer': 'https://jingcai-h5.jd.com/',
129 | 'accept-language': 'zh-CN,zh-Hans;q=0.9',
130 | "Cookie": cookie,
131 | 'app-key': 'jexpress',
132 | "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"),
133 | }
134 | }
135 | }
136 | function TotalBean() {
137 | return new Promise(async resolve => {
138 | const options = {
139 | "url": `https://wq.jd.com/user/info/QueryJDUserInfo?sceneval=2`,
140 | "headers": {
141 | "Accept": "application/json,text/plain, */*",
142 | "Content-Type": "application/x-www-form-urlencoded",
143 | "Accept-Encoding": "gzip, deflate, br",
144 | "Accept-Language": "zh-cn",
145 | "Connection": "keep-alive",
146 | "Cookie": cookie,
147 | "Referer": "https://wqs.jd.com/my/jingdou/my.shtml?sceneval=2",
148 | "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")
149 | }
150 | }
151 | $.post(options, (err, resp, data) => {
152 | try {
153 | if (err) {
154 | console.log(`${JSON.stringify(err)}`)
155 | console.log(`${$.name} API请求失败,请检查网路重试`)
156 | } else {
157 | if (data) {
158 | data = JSON.parse(data);
159 | if (data['retcode'] === 13) {
160 | $.isLogin = false; //cookie过期
161 | return
162 | }
163 | if (data['retcode'] === 0) {
164 | $.nickName = (data['base'] && data['base'].nickname) || $.UserName;
165 | } else {
166 | $.nickName = $.UserName
167 | }
168 | } else {
169 | console.log(`京东服务器返回空数据`)
170 | }
171 | }
172 | } catch (e) {
173 | $.logErr(e, resp)
174 | } finally {
175 | resolve();
176 | }
177 | })
178 | })
179 | }
180 | function safeGet(data) {
181 | try {
182 | if (typeof JSON.parse(data) == "object") {
183 | return true;
184 | }
185 | } catch (e) {
186 | console.log(e);
187 | console.log(`京东服务器访问数据为空,请检查自身设备网络情况`);
188 | return false;
189 | }
190 | }
191 | function jsonParse(str) {
192 | if (typeof str == "string") {
193 | try {
194 | return JSON.parse(str);
195 | } catch (e) {
196 | console.log(e);
197 | $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie')
198 | return [];
199 | }
200 | }
201 | }
202 | // prettier-ignore
203 | function Env(t,e){"undefined"!=typeof process&&JSON.stringify(process.env).indexOf("GITHUB")>-1&&process.exit(0);class s{constructor(t){this.env=t}send(t,e="GET"){t="string"==typeof t?{url:t}:t;let s=this.get;return"POST"===e&&(s=this.post),new Promise((e,i)=>{s.call(this,t,(t,s,r)=>{t?i(t):e(s)})})}get(t){return this.send.call(this.env,t)}post(t){return this.send.call(this.env,t,"POST")}}return new class{constructor(t,e){this.name=t,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.isNeedRewrite=!1,this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`🔔${this.name}, 开始!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null){try{return JSON.stringify(t)}catch{return e}}getjson(t,e){let s=e;const i=this.getdata(t);if(i)try{s=JSON.parse(this.getdata(t))}catch{}return s}setjson(t,e){try{return this.setdata(JSON.stringify(t),e)}catch{return!1}}getScript(t){return new Promise(e=>{this.get({url:t},(t,s,i)=>e(i))})}runScript(t,e){return new Promise(s=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let r=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");r=r?1*r:20,r=e&&e.timeout?e.timeout:r;const[o,h]=i.split("@"),n={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(n,(t,e,i)=>s(i))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e);if(!s&&!i)return{};{const i=s?t:e;try{return JSON.parse(this.fs.readFileSync(i))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e),r=JSON.stringify(this.data);s?this.fs.writeFileSync(t,r):i?this.fs.writeFileSync(e,r):this.fs.writeFileSync(t,r)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let r=t;for(const t of i)if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,e,s){return Object(t)!==t?t:(Array.isArray(e)||(e=e.toString().match(/[^.[\]]+/g)||[]),e.slice(0,-1).reduce((t,s,i)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[i+1])>>0==+e[i+1]?[]:{},t)[e[e.length-1]]=s,t)}getdata(t){let e=this.getval(t);if(/^@/.test(t)){const[,s,i]=/^@(.*?)\.(.*?)$/.exec(t),r=s?this.getval(s):"";if(r)try{const t=JSON.parse(r);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,r]=/^@(.*?)\.(.*?)$/.exec(e),o=this.getval(i),h=i?"null"===o?null:o||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,r,t),s=this.setval(JSON.stringify(e),i)}catch(e){const o={};this.lodash_set(o,r,t),s=this.setval(JSON.stringify(o),i)}}else s=this.setval(t,e);return s}getval(t){return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)})):this.isQuanX()?(this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t))):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();s&&this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)}))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)})}}time(t,e=null){const s=e?new Date(e):new Date;let i={"M+":s.getMonth()+1,"d+":s.getDate(),"H+":s.getHours(),"m+":s.getMinutes(),"s+":s.getSeconds(),"q+":Math.floor((s.getMonth()+3)/3),S:s.getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(s.getFullYear()+"").substr(4-RegExp.$1.length)));for(let e in i)new RegExp("("+e+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?i[e]:("00"+i[e]).substr((""+i[e]).length)));return t}msg(e=t,s="",i="",r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};if(this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r))),!this.isMuteLog){let t=["","==============📣系统通知📣=============="];t.push(e),s&&t.push(s),i&&t.push(i),console.log(t.join("\n")),this.logs=this.logs.concat(t)}}log(...t){t.length>0&&(this.logs=[...this.logs,...t]),console.log(t.join(this.logSeparator))}logErr(t,e){const s=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();s?this.log("",`❗️${this.name}, 错误!`,t.stack):this.log("",`❗️${this.name}, 错误!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`🔔${this.name}, 结束! 🕛 ${s} 秒`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)}
204 |
--------------------------------------------------------------------------------
/Task/JD/jd_market_lottery.js:
--------------------------------------------------------------------------------
1 | /*
2 | by JDHelloWorld 20210611
3 | 4 10 * * * https://raw.githubusercontent.com/yyn618/QuantumultX-Script/master/Script/Files/JD/jd_market_lottery.js, tag=幸运大转盘, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/jd.png, enabled=true
4 |
5 | 地址:https://pro.m.jd.com/mall/active/3ryu78eKuLyY5YipWWVSeRQEpLQP/index.html
6 | */
7 |
8 | const $ = new Env("幸运大转盘");
9 | const jdCookieNode = $.isNode() ? require("./jdCookie.js") : "";
10 | let cookiesArr = [],
11 | cookie = "",
12 | allMsg = '';
13 |
14 | if ($.isNode()) {
15 | Object.keys(jdCookieNode).forEach((item) => {
16 | cookiesArr.push(jdCookieNode[item]);
17 | });
18 | console.log(`如果出现提示 ?.data. 错误,请升级nodejs版本(进入容器后,apk add nodejs-current)`)
19 | if (process.env.JD_DEBUG && process.env.JD_DEBUG === "false") console.log = () => {};
20 | } else {
21 | cookiesArr = [
22 | $.getdata("CookieJD"),
23 | $.getdata("CookieJD2"),
24 | ...$.toObj($.getdata("CookiesJD") || "[]").map((item) => item.cookie)].filter((item) => !!item);
25 | }
26 | const JD_API_HOST = "https://api.m.jd.com/client.action";
27 | !(async () => {
28 | if (!cookiesArr[0]) {
29 | $.msg(
30 | $.name,
31 | "【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取",
32 | "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 | if (cookiesArr[i]) {
39 | cookie = cookiesArr[i];
40 | $.UserName = decodeURIComponent(
41 | cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1]
42 | );
43 | $.index = i + 1;
44 | console.log(`\n******开始【京东账号${$.index}】${$.UserName}*********\n`);
45 | await main()
46 | }
47 | }
48 | await showMsg()
49 | })()
50 | .catch((e) => {
51 | $.log("", `❌ ${$.name}, 失败! 原因: ${e}!`, "");
52 | })
53 | .finally(() => {
54 | $.done();
55 | });
56 | function showMsg() {
57 | return new Promise(async resolve => {
58 | if (allMsg) $.msg($.name, '', allMsg);
59 | resolve();
60 | })
61 | }
62 | async function main() {
63 | await getInfo('https://pro.m.jd.com/mall/active/3ryu78eKuLyY5YipWWVSeRQEpLQP/index.html')
64 | await getInfo('https://pro.m.jd.com/mall/active/3ryu78eKuLyY5YipWWVSeRQEpLQP/index.html')
65 | }
66 | async function getInfo(url) {
67 | return new Promise(resolve=>{
68 | $.get({
69 | url,
70 | headers:{
71 | "Cookie": cookie,
72 | "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")
73 | }
74 | },async (err,resp,data)=>{
75 | try{
76 | if(err){
77 |
78 | }else{
79 | data = $.toObj(data.match(/window.__react_data__ = (\{.*\})/)[1])
80 | let taskList = data?.activityData?.floorList?.filter(vo=>vo.template==='score_task')[0]
81 | //console.log(data?.activityData?.floorList)
82 | for(let vo of taskList['taskItemList']){
83 | for(let i = vo.joinTimes; i< vo.taskLimit;++i){
84 | console.log(`去完成${vo?.flexibleData?.taskName ?? vo.enAwardK}任务,第${i+1}次`)
85 | await doTask(vo.enAwardK)
86 | await $.wait(500)
87 | }
88 | }
89 | let lottery = data?.activityData?.floorList?.filter(vo=>vo.template==='choujiang_wheel')[0]
90 | //console.log(lottery)
91 | const {userScore,lotteryScore} = lottery.lotteryGuaGuaLe
92 | if(lotteryScore<=userScore) {
93 | console.log(`抽奖需要${lotteryScore},当前${userScore}分,去抽奖`)
94 | await doLottery("a84f9428da0bb36a6a11884c54300582")
95 | } else {
96 | console.log(`当前积分已不足去抽奖`)
97 | }
98 | }
99 | }catch (e) {
100 |
101 | }finally {
102 | resolve()
103 | }
104 |
105 | })
106 | })
107 | }
108 | function doTask(enAwardK) {
109 | return new Promise(resolve => {
110 | $.post(taskUrl('babelDoScoreTask',{enAwardK,"isQueryResult":0,"siteClient":"apple","mitemAddrId":"","geo":{"lng":"","lat":""},"addressId":"","posLng":"","posLat":"","homeLng":"","homeLat":"","focus":"","innerAnchor":"","cv":"2.0"}),
111 | (err,resp,data)=>{
112 | try{
113 | if(err){
114 |
115 | }else{
116 | data = $.toObj(data)
117 | console.log(data.promptMsg)
118 | }
119 | }catch (e) {
120 |
121 | }finally {
122 | resolve()
123 | }
124 | })
125 | })
126 | }
127 | function doLottery(enAwardK,authType="2") {
128 | return new Promise(resolve => {
129 | $.post(taskUrl('babelGetLottery',{enAwardK,authType}),
130 | (err,resp,data)=>{
131 | try{
132 | if(err){
133 |
134 | }else{
135 | data = $.toObj(data)
136 | console.log(data.promptMsg)
137 | allMsg += `【京东账号${$.index}】${$.UserName}:${data.promptMsg}\n`
138 | }
139 | }catch (e) {
140 |
141 | }finally {
142 | resolve()
143 | }
144 | })
145 | })
146 | }
147 | function taskUrl(function_id, body = {}) {
148 | return {
149 | url: `${JD_API_HOST}/client.action?functionId=${function_id}`,
150 | body: `body=${escape(JSON.stringify(body))}&client=wh5&clientVersion=1.0.0`,
151 | headers: {
152 | "Cookie": cookie,
153 | "origin": "https://h5.m.jd.com",
154 | "referer": "https://h5.m.jd.com/",
155 | 'Content-Type': 'application/x-www-form-urlencoded',
156 | "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")
157 | }
158 | }
159 | }
160 |
161 | function safeGet(data) {
162 | try {
163 | if (typeof JSON.parse(data) == "object") {
164 | return true;
165 | }
166 | } catch (e) {
167 | console.log(e);
168 | console.log(`京东服务器访问数据为空,请检查自身设备网络情况`);
169 | return false;
170 | }
171 | }
172 |
173 | // prettier-ignore
174 | function Env(t,e){"undefined"!=typeof process&&JSON.stringify(process.env).indexOf("GITHUB")>-1&&process.exit(0);class s{constructor(t){this.env=t}send(t,e="GET"){t="string"==typeof t?{url:t}:t;let s=this.get;return"POST"===e&&(s=this.post),new Promise((e,i)=>{s.call(this,t,(t,s,r)=>{t?i(t):e(s)})})}get(t){return this.send.call(this.env,t)}post(t){return this.send.call(this.env,t,"POST")}}return new class{constructor(t,e){this.name=t,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.isNeedRewrite=!1,this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`🔔${this.name}, 开始!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null){try{return JSON.stringify(t)}catch{return e}}getjson(t,e){let s=e;const i=this.getdata(t);if(i)try{s=JSON.parse(this.getdata(t))}catch{}return s}setjson(t,e){try{return this.setdata(JSON.stringify(t),e)}catch{return!1}}getScript(t){return new Promise(e=>{this.get({url:t},(t,s,i)=>e(i))})}runScript(t,e){return new Promise(s=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let r=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");r=r?1*r:20,r=e&&e.timeout?e.timeout:r;const[o,h]=i.split("@"),n={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(n,(t,e,i)=>s(i))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e);if(!s&&!i)return{};{const i=s?t:e;try{return JSON.parse(this.fs.readFileSync(i))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e),r=JSON.stringify(this.data);s?this.fs.writeFileSync(t,r):i?this.fs.writeFileSync(e,r):this.fs.writeFileSync(t,r)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let r=t;for(const t of i)if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,e,s){return Object(t)!==t?t:(Array.isArray(e)||(e=e.toString().match(/[^.[\]]+/g)||[]),e.slice(0,-1).reduce((t,s,i)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[i+1])>>0==+e[i+1]?[]:{},t)[e[e.length-1]]=s,t)}getdata(t){let e=this.getval(t);if(/^@/.test(t)){const[,s,i]=/^@(.*?)\.(.*?)$/.exec(t),r=s?this.getval(s):"";if(r)try{const t=JSON.parse(r);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,r]=/^@(.*?)\.(.*?)$/.exec(e),o=this.getval(i),h=i?"null"===o?null:o||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,r,t),s=this.setval(JSON.stringify(e),i)}catch(e){const o={};this.lodash_set(o,r,t),s=this.setval(JSON.stringify(o),i)}}else s=this.setval(t,e);return s}getval(t){return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)})):this.isQuanX()?(this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t))):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();s&&this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)}))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)})}}time(t,e=null){const s=e?new Date(e):new Date;let i={"M+":s.getMonth()+1,"d+":s.getDate(),"H+":s.getHours(),"m+":s.getMinutes(),"s+":s.getSeconds(),"q+":Math.floor((s.getMonth()+3)/3),S:s.getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(s.getFullYear()+"").substr(4-RegExp.$1.length)));for(let e in i)new RegExp("("+e+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?i[e]:("00"+i[e]).substr((""+i[e]).length)));return t}msg(e=t,s="",i="",r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};if(this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r))),!this.isMuteLog){let t=["","==============📣系统通知📣=============="];t.push(e),s&&t.push(s),i&&t.push(i),console.log(t.join("\n")),this.logs=this.logs.concat(t)}}log(...t){t.length>0&&(this.logs=[...this.logs,...t]),console.log(t.join(this.logSeparator))}logErr(t,e){const s=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();s?this.log("",`❗️${this.name}, 错误!`,t.stack):this.log("",`❗️${this.name}, 错误!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`🔔${this.name}, 结束! 🕛 ${s} 秒`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)}
--------------------------------------------------------------------------------
/Task/JD/jd_shop.js:
--------------------------------------------------------------------------------
1 | /*
2 | by JDHelloWorld 20210902
3 | 10 0 * * * https://raw.githubusercontent.com/yyn618/QuantumultX-Script/master/Script/Files/JD/jd_shop.js, tag=进店领豆, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_shop.png, enabled=true
4 |
5 | 一键开完所有的宝箱功能。耗时70秒
6 | 大转盘抽奖
7 | 喂食
8 | 每日签到
9 | 完成分享任务得猪粮
10 |
11 | 活动入口:京东APP首页-领京豆-进店领豆
12 | */
13 |
14 | const $ = new Env('进店领豆');
15 | const notify = $.isNode() ? require('./sendNotify') : '';
16 | //Node.js用户请在jdCookie.js处填写京东ck;
17 | const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
18 |
19 | //IOS等用户直接用NobyDa的jd cookie
20 | let cookiesArr = [], cookie = '';
21 | if ($.isNode()) {
22 | Object.keys(jdCookieNode).forEach((item) => {
23 | cookiesArr.push(jdCookieNode[item])
24 | })
25 | if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {};
26 | } else {
27 | cookiesArr = [$.getdata('CookieJD'), $.getdata('CookieJD2'), ...jsonParse($.getdata('CookiesJD') || "[]").map(item => item.cookie)].filter(item => !!item);
28 | }
29 | let message = '', subTitle = '';
30 |
31 | const JD_API_HOST = 'https://api.m.jd.com/client.action';
32 | !(async () => {
33 | if (!cookiesArr[0]) {
34 | $.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', {"open-url": "https://bean.m.jd.com/bean/signIndex.action"});
35 | return;
36 | }
37 | for (let i = 0; i < cookiesArr.length; i++) {
38 | if (cookiesArr[i]) {
39 | cookie = cookiesArr[i];
40 | $.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1])
41 | $.index = i + 1;
42 | $.isLogin = true;
43 | $.nickName = '';
44 | await TotalBean();
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`, {"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 | message = '';
55 | subTitle = '';
56 | await jdShop();
57 | }
58 | }
59 | })()
60 | .catch((e) => {
61 | $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '')
62 | })
63 | .finally(() => {
64 | $.done();
65 | })
66 | async function jdShop() {
67 | const taskData = await getTask();
68 | if (taskData.code === '0') {
69 | if (!taskData.data.taskList) {
70 | console.log(`${taskData.data.taskErrorTips}\n`);
71 | $.msg($.name, '', `京东账号 ${$.index} ${$.nickName}\n${taskData.data.taskErrorTips}`);
72 | } else {
73 | const { taskList } = taskData.data;
74 | let beanCount = 0;
75 | for (let item of taskList) {
76 | if (item.taskStatus === 3) {
77 | console.log(`${item.shopName} 已拿到2京豆\n`)
78 | } else {
79 | console.log(`taskId::${item.taskId}`)
80 | const doTaskRes = await doTask(item.taskId);
81 | if (doTaskRes.code === '0') {
82 | beanCount += 2;
83 | }
84 | }
85 | }
86 | console.log(`beanCount::${beanCount}`);
87 | if (beanCount > 0) {
88 | $.msg($.name, '', `京东账号 ${$.index} ${$.nickName}\n成功领取${beanCount}京豆`);
89 | // if ($.isNode()) {
90 | // await notify.sendNotify(`${$.name} - 账号${$.index} - ${$.nickName}`, `京东账号${$.index} ${UserName}\n成功领取${beanCount}京豆`);
91 | // }
92 | // if ($.isNode()) {
93 | // await notify.BarkNotify(`${$.name}`, `京东账号${$.index} ${UserName}\n成功领取${beanCount}京豆`);
94 | // }
95 | }
96 | }
97 | }
98 | }
99 | function doTask(taskId) {
100 | console.log(`doTask-taskId::${taskId}`)
101 | return new Promise(resolve => {
102 | const body = { 'taskId': `${taskId}` };
103 | const options = {
104 | url: `${JD_API_HOST}`,
105 | body: `functionId=takeTask&body=${escape(JSON.stringify(body))}&appid=ld`,
106 | headers: {
107 | '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"),
108 | 'Host': 'api.m.jd.com',
109 | 'Content-Type': 'application/x-www-form-urlencoded',
110 | 'Cookie': cookie,
111 | }
112 | }
113 | $.post(options, (err, resp, data) => {
114 | try {
115 | if (err) {
116 | console.log('\n进店领豆: API查询请求失败 ‼️‼️')
117 | $.logErr(err);
118 | } else {
119 | // console.log(data)
120 | data = JSON.parse(data);
121 | }
122 | } catch (e) {
123 | $.logErr(e, resp);
124 | } finally {
125 | resolve(data);
126 | }
127 | })
128 | })
129 | }
130 | function getTask(body = {}) {
131 | return new Promise(resolve => {
132 | const options = {
133 | url: `${JD_API_HOST}`,
134 | body: `functionId=queryTaskIndex&body=${escape(JSON.stringify(body))}&appid=ld`,
135 | headers: {
136 | '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"),
137 | 'Host': 'api.m.jd.com',
138 | 'Content-Type': 'application/x-www-form-urlencoded',
139 | 'Cookie': cookie,
140 | }
141 | }
142 | $.post(options, (err, resp, data) => {
143 | try {
144 | if (err) {
145 | console.log('\n进店领豆: API查询请求失败 ‼️‼️')
146 | $.logErr(err);
147 | } else {
148 | // console.log(data)
149 | data = JSON.parse(data);
150 | }
151 | } catch (e) {
152 | $.logErr(e, resp);
153 | } finally {
154 | resolve(data);
155 | }
156 | })
157 | })
158 | }
159 | function TotalBean() {
160 | return new Promise(async resolve => {
161 | const options = {
162 | "url": `https://wq.jd.com/user/info/QueryJDUserInfo?sceneval=2`,
163 | "headers": {
164 | "Accept": "application/json,text/plain, */*",
165 | "Content-Type": "application/x-www-form-urlencoded",
166 | "Accept-Encoding": "gzip, deflate, br",
167 | "Accept-Language": "zh-cn",
168 | "Connection": "keep-alive",
169 | "Cookie": cookie,
170 | "Referer": "https://wqs.jd.com/my/jingdou/my.shtml?sceneval=2",
171 | "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")
172 | }
173 | }
174 | $.post(options, (err, resp, data) => {
175 | try {
176 | if (err) {
177 | console.log(`${JSON.stringify(err)}`)
178 | console.log(`${$.name} API请求失败,请检查网路重试`)
179 | } else {
180 | if (data) {
181 | data = JSON.parse(data);
182 | if (data['retcode'] === 13) {
183 | $.isLogin = false; //cookie过期
184 | return
185 | }
186 | if (data['retcode'] === 0) {
187 | $.nickName = (data['base'] && data['base'].nickname) || $.UserName;
188 | } else {
189 | $.nickName = $.UserName
190 | }
191 | } else {
192 | console.log(`京东服务器返回空数据`)
193 | }
194 | }
195 | } catch (e) {
196 | $.logErr(e, resp)
197 | } finally {
198 | resolve();
199 | }
200 | })
201 | })
202 | }
203 | function jsonParse(str) {
204 | if (typeof str == "string") {
205 | try {
206 | return JSON.parse(str);
207 | } catch (e) {
208 | console.log(e);
209 | $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie')
210 | return [];
211 | }
212 | }
213 | }
214 | // prettier-ignore
215 | function Env(t,e){"undefined"!=typeof process&&JSON.stringify(process.env).indexOf("GITHUB")>-1&&process.exit(0);class s{constructor(t){this.env=t}send(t,e="GET"){t="string"==typeof t?{url:t}:t;let s=this.get;return"POST"===e&&(s=this.post),new Promise((e,i)=>{s.call(this,t,(t,s,r)=>{t?i(t):e(s)})})}get(t){return this.send.call(this.env,t)}post(t){return this.send.call(this.env,t,"POST")}}return new class{constructor(t,e){this.name=t,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.isNeedRewrite=!1,this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`🔔${this.name}, 开始!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null){try{return JSON.stringify(t)}catch{return e}}getjson(t,e){let s=e;const i=this.getdata(t);if(i)try{s=JSON.parse(this.getdata(t))}catch{}return s}setjson(t,e){try{return this.setdata(JSON.stringify(t),e)}catch{return!1}}getScript(t){return new Promise(e=>{this.get({url:t},(t,s,i)=>e(i))})}runScript(t,e){return new Promise(s=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let r=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");r=r?1*r:20,r=e&&e.timeout?e.timeout:r;const[o,h]=i.split("@"),n={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(n,(t,e,i)=>s(i))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e);if(!s&&!i)return{};{const i=s?t:e;try{return JSON.parse(this.fs.readFileSync(i))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e),r=JSON.stringify(this.data);s?this.fs.writeFileSync(t,r):i?this.fs.writeFileSync(e,r):this.fs.writeFileSync(t,r)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let r=t;for(const t of i)if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,e,s){return Object(t)!==t?t:(Array.isArray(e)||(e=e.toString().match(/[^.[\]]+/g)||[]),e.slice(0,-1).reduce((t,s,i)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[i+1])>>0==+e[i+1]?[]:{},t)[e[e.length-1]]=s,t)}getdata(t){let e=this.getval(t);if(/^@/.test(t)){const[,s,i]=/^@(.*?)\.(.*?)$/.exec(t),r=s?this.getval(s):"";if(r)try{const t=JSON.parse(r);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,r]=/^@(.*?)\.(.*?)$/.exec(e),o=this.getval(i),h=i?"null"===o?null:o||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,r,t),s=this.setval(JSON.stringify(e),i)}catch(e){const o={};this.lodash_set(o,r,t),s=this.setval(JSON.stringify(o),i)}}else s=this.setval(t,e);return s}getval(t){return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)})):this.isQuanX()?(this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t))):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();s&&this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)}))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)})}}time(t,e=null){const s=e?new Date(e):new Date;let i={"M+":s.getMonth()+1,"d+":s.getDate(),"H+":s.getHours(),"m+":s.getMinutes(),"s+":s.getSeconds(),"q+":Math.floor((s.getMonth()+3)/3),S:s.getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(s.getFullYear()+"").substr(4-RegExp.$1.length)));for(let e in i)new RegExp("("+e+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?i[e]:("00"+i[e]).substr((""+i[e]).length)));return t}msg(e=t,s="",i="",r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};if(this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r))),!this.isMuteLog){let t=["","==============📣系统通知📣=============="];t.push(e),s&&t.push(s),i&&t.push(i),console.log(t.join("\n")),this.logs=this.logs.concat(t)}}log(...t){t.length>0&&(this.logs=[...this.logs,...t]),console.log(t.join(this.logSeparator))}logErr(t,e){const s=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();s?this.log("",`❗️${this.name}, 错误!`,t.stack):this.log("",`❗️${this.name}, 错误!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`🔔${this.name}, 结束! 🕛 ${s} 秒`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)}
216 |
--------------------------------------------------------------------------------
/Task/ali_daily.js:
--------------------------------------------------------------------------------
1 | /*
2 | 每日蚂蚁收能量提醒(每日壹句(有道词典)+ 点击通知跳转支付宝蚂蚁森林页面
3 | */
4 |
5 | const $tool = new Tool()
6 | $tool.get('https://dict.youdao.com/infoline/style/cardList?mode=publish&client=mobile&style=daily&size=2', function (error, response, data) {
7 | let obj = JSON.parse(data);
8 | let date = new Date();
9 | let isAM = date.getHours() < 12 ? true : false;
10 | let title = '每日' + (isAM ? ' 壹句' : ' 壹句') + (isAM ? ' ☀️' : ' 🌙');
11 | let subtitle = '';
12 | let scheme = 'alipay://platformapi/startapp?appId=60000002';
13 | let content = "该放保护罩了👉"+scheme;
14 | let option = {"open-url" : scheme};
15 | if (!error) {
16 | if (obj && obj.length > 1) {
17 | let yi = obj[1];
18 | content = yi.title + '\n' + yi.summary + '\n\n' + content;
19 | option["media-url"] = yi.image[0];
20 | }
21 | }
22 | $tool.notify(title, subtitle, content, option);
23 | $done();
24 | })
25 |
26 | function Tool() {
27 | _node = (() => {
28 | if (typeof require == "function") {
29 | const request = require('request')
30 | return ({ request })
31 | } else {
32 | return (null)
33 | }
34 | })()
35 | _isQuanX = typeof $task != "undefined"
36 | this.isQuanX = _isQuanX
37 | this.isResponse = typeof $response != "undefined"
38 | this.notify = (title, subtitle, message, option) => {
39 | if (_isQuanX) $notify(title, subtitle, message, option)
40 | if (_node) console.log(JSON.stringify({ title, subtitle, message }));
41 | }
42 | this.write = (value, key) => {
43 | if (_isQuanX) return $prefs.setValueForKey(value, key)
44 | }
45 | this.read = (key) => {
46 | if (_isQuanX) return $prefs.valueForKey(key)
47 | }
48 | this.get = (options, callback) => {
49 | if (_isQuanX) {
50 | if (typeof options == "string") options = { url: options }
51 | options["method"] = "GET"
52 | $task.fetch(options).then(response => { callback(null, _status(response), response.body) }, reason => callback(reason.error, null, null))
53 | }
54 | if (_node) _node.request(options, (error, response, body) => { callback(error, _status(response), body) })
55 | }
56 | this.post = (options, callback) => {
57 | if (_isQuanX) {
58 | if (typeof options == "string") options = { url: options }
59 | options["method"] = "POST"
60 | $task.fetch(options).then(response => { callback(null, _status(response), response.body) }, reason => callback(reason.error, null, null))
61 | }
62 | if (_node) _node.request.post(options, (error, response, body) => { callback(error, _status(response), body) })
63 | }
64 | _status = (response) => {
65 | if (response) {
66 | if (response.status) {
67 | response["statusCode"] = response.status
68 | } else if (response.statusCode) {
69 | response["status"] = response.statusCode
70 | }
71 | }
72 | return response
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/Task/dd_daily.js:
--------------------------------------------------------------------------------
1 | /*
2 | 每日打卡提醒(每日壹句(有道词典)+ 跳转钉钉打卡页面
3 | */
4 | const $tool = new Tool()
5 | $tool.get('https://dict.youdao.com/infoline/style/cardList?mode=publish&client=mobile&style=daily&size=2', function (error, response, data) {
6 | let obj = JSON.parse(data);
7 | let date = new Date();
8 | let isAM = date.getHours() < 12 ? true : false;
9 | let title = 'Clock' + (isAM ? ' in' : ' out') + (isAM ? ' ☀️' : ' 🌙');
10 | let subtitle = '';
11 | let scheme = 'dingtalk://dingtalkclient/page/link?url=https://attend.dingtalk.com/attend/index.html';
12 | let content = "该打卡了👉"+scheme;
13 | let option = {"open-url" : scheme};
14 | if (!error) {
15 | if (obj && obj.length > 1) {
16 | let yi = obj[1];
17 | content = yi.title + '\n' + yi.summary + '\n\n' + content;
18 | option["media-url"] = yi.image[0];
19 | }
20 | }
21 | $tool.notify(title, subtitle, content, option);
22 | $done();
23 | })
24 |
25 | function Tool() {
26 | _node = (() => {
27 | if (typeof require == "function") {
28 | const request = require('request')
29 | return ({ request })
30 | } else {
31 | return (null)
32 | }
33 | })()
34 | _isSurge = typeof $httpClient != "undefined"
35 | _isQuanX = typeof $task != "undefined"
36 | this.isQuanX = _isQuanX
37 | this.isResponse = typeof $response != "undefined"
38 | this.notify = (title, subtitle, message, option) => {
39 | if (_isQuanX) $notify(title, subtitle, message, option)
40 | if (_node) console.log(JSON.stringify({ title, subtitle, message }));
41 | }
42 | this.write = (value, key) => {
43 | if (_isQuanX) return $prefs.setValueForKey(value, key)
44 | }
45 | this.read = (key) => {
46 | if (_isQuanX) return $prefs.valueForKey(key)
47 | }
48 | this.get = (options, callback) => {
49 | if (_isQuanX) {
50 | if (typeof options == "string") options = { url: options }
51 | options["method"] = "GET"
52 | $task.fetch(options).then(response => { callback(null, _status(response), response.body) }, reason => callback(reason.error, null, null))
53 | }
54 | if (_node) _node.request(options, (error, response, body) => { callback(error, _status(response), body) })
55 | }
56 | this.post = (options, callback) => {
57 | if (_isQuanX) {
58 | if (typeof options == "string") options = { url: options }
59 | options["method"] = "POST"
60 | $task.fetch(options).then(response => { callback(null, _status(response), response.body) }, reason => callback(reason.error, null, null))
61 | }
62 | if (_node) _node.request.post(options, (error, response, body) => { callback(error, _status(response), body) })
63 | }
64 | _status = (response) => {
65 | if (response) {
66 | if (response.status) {
67 | response["statusCode"] = response.status
68 | } else if (response.statusCode) {
69 | response["status"] = response.statusCode
70 | }
71 | }
72 | return response
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/UnlockNetease.list:
--------------------------------------------------------------------------------
1 | http=ivapp.cn/wyy.txt, fast-open=false, udp-relay=false, tag=🎶 Music1
2 | http=music.lolico.me:39000, fast-open=false, udp-relay=false, tag=🎶 Music2
3 | http=LOLICO.ME:443, fast-open=false, udp-relay=false, tag=🎶 Music3
4 | http=SALVAN.ICU:19980, fast-open=false, udp-relay=false, tag=🎶 Music4
5 | http=1.116.214.16:19980, fast-open=false, udp-relay=false, tag=🎶 Music5
6 | http=106.52.127.72:19951, fast-open=false, udp-relay=false, tag=🎶 Music6
7 | http=101.132.79.113:23333, fast-open=false, udp-relay=false, tag=🎶 Music7
8 | http=MUSIC.LOLICO.ME:39000, fast-open=false, udp-relay=false, tag=🎶 Music8
9 | http=MUSIC.GRIOUGES.CN:39000, fast-open=false, udp-relay=false, tag=🎶 Music9
10 | shadowsocks=music.desperadoj.com:30001, method=aes-128-gcm, password=desperadoj.com_free_proxy_d39m, fast-open=false, udp-relay=false, tag=🎶 Music10
11 | shadowsocks=music.desperadoj.com:30003, method=aes-128-gcm, password=desperadoj.com_free_proxy_d39m, fast-open=false, udp-relay=false, tag=🎶 Music11
12 |
--------------------------------------------------------------------------------
/Youth/README.md:
--------------------------------------------------------------------------------
1 | 需要抓包安装中青看点-2.0.2,低版本APP安装自行研究
2 |
3 | 下载注册后填写邀请码,可获得500-10000青豆
4 |
5 | 西宁邀请码:60244910
6 |
7 | 感谢作者 Sunert 邀请码:46308484
8 |
9 | ### 使用方法:
10 | 1.添加重写
11 |
12 | 编辑配置文件,在[rewrite_remote]粘贴以下代码
13 |
14 | #中青Cookie获取
15 |
16 | https://raw.githubusercontent.com/yyn618/QuantumultX-Script/main/Youth/Youth_cookie.conf, tag=中青Cookie获取, update-interval=172800, opt-parser=true, enabled=true
17 |
18 | #中青Body获取
19 |
20 | https://raw.githubusercontent.com/yyn618/QuantumultX-Script/main/Youth/Youth_Read.conf, tag=中青Body获取, update-interval=172800, opt-parser=true, enabled=false
21 |
22 |
23 |
24 | 2.添加定时任务
25 |
26 | 编辑配置文件,在[task_local]下粘贴以下代码
27 |
28 | #中青签到&转盘宝箱
29 |
30 | */10 5-23 * * * https://gitee.com/Sunert/Scripts/raw/master/Task/youth.js, tag= 中青签到&转盘宝箱, img-url=https://raw.githubusercontent.com/erdongchanyo/icon/main/taskicon/Youth.png, enabled=true
31 |
32 | #中青自动阅读
33 |
34 | 10 */2 * * * https://gitee.com/Sunert/Scripts/raw/master/Task/Youth_Read.js, tag=中青自动阅读, img-url=https://raw.githubusercontent.com/erdongchanyo/icon/main/taskicon/Youth.png, enabled=true
35 |
36 | #中青浏览赚
37 |
38 | 20 5 10 * * * https://gitee.com/Sunert/Scripts/raw/master/Task/youth_gain.js, tag=中青浏览赚, img-url=https://raw.githubusercontent.com/erdongchanyo/icon/main/taskicon/Youth.png, enabled=true
39 |
40 |
41 |
42 | 3.获取Cookie
43 |
44 | 进入[重写]-[引用] ———— 启用[中青Cookie获取],禁用[中青阅读Body获取](默认)
45 |
46 | a.进入app-我的-任务中心 ———— 提示:获取cookie成功
47 |
48 | b.进入app-我的-任务中心-看看赚-去完成 ———— 提示:获取看看转请求成功
49 |
50 | c.进入app-我的-任务中心-看看赚-浏览赚-去白拿 ———— 提示:浏览赚获取开始请求成功
51 |
52 | d.阅读文章或者视频,等待红包转圈结束 ———— 提示:获取阅读请求成功
53 |
54 | e.继续阅读另一篇文章或视频 ———— 提示:获取阅读时长成功
55 |
56 |
57 |
58 | 4.获取Body
59 |
60 | 进入[重写]-[引用] ———— 禁用[中青cookie获取],启用[中青阅读Body获取]
61 |
62 | 阅读文章或视频,快速获取body ———— 提示:获取第1个阅读请求成功
63 |
64 |
65 |
66 | 5.手动执行脚本,看脚本是否运行正常
67 |
--------------------------------------------------------------------------------
/Youth/Youth_Read.conf:
--------------------------------------------------------------------------------
1 | #by erdongchanyo
2 |
3 | hostname = ios.baertt.com
4 |
5 | https:\/\/ios\.baertt\.com\/v5\/article\/info\/get\.json url script-request-header https://raw.githubusercontent.com/Sunert/Script/master/Task/Youth_Read.js
6 |
7 | https:\/\/ios\.baertt\.com\/v5\/user\/stay\.json url script-request-body https://raw.githubusercontent.com/Sunert/Script/master/Task/Youth_Read.js
--------------------------------------------------------------------------------
/Youth/Youth_cookie.conf:
--------------------------------------------------------------------------------
1 | #by erdongchanyo
2 |
3 | hostname = kd.youth.cn, ios.baertt.com
4 |
5 | #中青cookie获取
6 | https:\/\/kd\.youth\.cn\/WebApi\/NewTaskIos\/getTaskList url script-request-header https://raw.githubusercontent.com/Sunert/Script/master/Task/youth.js
7 | https:\/\/ios\.baertt\.com\/v5\/article\/info\/get\.json url script-request-header https://raw.githubusercontent.com/Sunert/Script/master/Task/youth.js
8 | https:\/\/ios\.baertt\.com\/v5\/user\/stay\.json url script-request-body https://raw.githubusercontent.com/Sunert/Script/master/Task/youth.js
9 | https:\/\/ios\.baertt\.com\/v5\/task\/browse_start\.json url script-request-body https://raw.githubusercontent.com/Sunert/Script/master/Task/youth_gain.js
10 | https:\/\/ios\.baertt\.com\/v5\/Nameless\/adlickstart\.json url script-request-body https://raw.githubusercontent.com/Sunert/Script/master/Task/youth_gain.js
11 | https:\/\/ios\.baertt\.com\/v5\/\w+\/withdraw\d?\.json url script-request-body https://raw.githubusercontent.com/Sunert/Script/master/Task/youth.js
--------------------------------------------------------------------------------
/extra_Task.json:
--------------------------------------------------------------------------------
1 | {
2 | "name":"Xining extra_Task",
3 | "description":"https://raw.githubusercontent.com/yyn618/QuantumultX-Script/main/extra_Task.json",
4 | "task":[
5 | "*/10 5-23 * * * https://gitee.com/Sunert/Scripts/raw/master/Task/youth.js, tag= 中青签到&转盘宝箱, img-url=https://raw.githubusercontent.com/erdongchanyo/icon/main/taskicon/Youth.png",
6 | "10 */2 * * * https://gitee.com/Sunert/Scripts/raw/master/Task/Youth_Read.js, tag=中青自动阅读, img-url=https://raw.githubusercontent.com/erdongchanyo/icon/main/taskicon/Youth.png",
7 | "20 5 10 * * * https://gitee.com/Sunert/Scripts/raw/master/Task/youth_gain.js, tag=中青浏览赚, img-url=https://raw.githubusercontent.com/erdongchanyo/icon/main/taskicon/Youth.png",
8 | "45 18 * * 1-5 https://raw.githubusercontent.com/yyn618/QuantumultX-Script/master/Task/dd_daily.js, tag=钉钉 下班打卡, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/dingtalk.png, enabled=true",
9 | "28 9 * * 1-5 https://raw.githubusercontent.com/yyn618/QuantumultX-Script/master/Task/dd_daily.js, tag=钉钉 上班打卡, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/dingtalk.png, enabled=true",
10 | "30 8 * * * https://raw.githubusercontent.com/yyn618/QuantumultX-Script/master/Task/ali_daily.js, tag=支付宝 蚂蚁森林, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/alipay.png, enabled=true",
11 | "53 7 * * * https://raw.githubusercontent.com/Sunert/Script/master/Task/weibo.js, tag=新浪微博, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/weibo.png, enabled=true",
12 | "52 7 * * * https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/script/eleme/eleme_daily.js, tag=领取吃货豆, img-url=https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/script/eleme/elem.png, enabled=true",
13 | "51 7 * * * https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/script/eleme/eleme_mission.js, tag=领取会员任务, img-url=https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/script/eleme/elem.png, enabled=true",
14 | "50 7 * * * https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/script/10010/unicom_signin.js, tag=中国联通, img-url=https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/script/10010/10010.png, enabled=true",
15 | "49 7 * * * https://raw.githubusercontent.com/chavyleung/scripts/master/v2ex/quanx/v2ex.js, tag=V2EX, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/v2ex.png, enabled=true",
16 | "48 7 * * * https://raw.githubusercontent.com/chavyleung/scripts/master/meituan/meituan.js, tag=美团, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/meituan.png, enabled=true",
17 | "47 7 * * * https://raw.githubusercontent.com/chavyleung/scripts/master/wmmeituan/wmmeituan.js, tag=美团外卖, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/meituan.png, enabled=true",
18 | "46 7 * * * https://raw.githubusercontent.com/chavyleung/scripts/master/10000/10000.js, tag=中国电信, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/10000.png, enabled=true",
19 | "45 7 * * * https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/script/smzdm/smzdm_signin.js, tag=每日签到, img-url=https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/script/smzdm/smzdm.png, enabled=true",
20 | "44 7 * * * https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/script/smzdm/smzdm_mission.js, tag=每日任务, img-url=https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/script/smzdm/smzdm.png, enabled=true",
21 | "5 10 * * * https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/script/smzdm/smzdm_daily.js, tag=什么值得买每日签到, enabled=true",
22 |
23 | ]
24 | }
25 |
--------------------------------------------------------------------------------