├── JDJRValidator_Pure.js
├── JDSignValidator.js
├── JS_USER_AGENTS.js
├── README.md
├── USER_AGENTS.js
├── backUp
├── kill_ck.js
└── kill_wskey.js
├── config
└── CK_WxPusherUid.json
├── docker
├── README.md
├── docker-compose.yml
├── extra.sh
├── ql1key.sh
└── task_before.sh
├── function
├── JDJRValidator_Pure_smiek.js
├── assets
│ ├── index_1.js
│ ├── index_2.js
│ ├── index_3.js
│ ├── index_4.js
│ ├── index_5.js
│ ├── index_6.js
│ └── index_7.js
├── cache
│ └── index.js
├── common.js
├── config.js
├── dylank.js
├── dylano.js
├── dylans.js
├── dylanv.js
├── dylanw.js
├── dylanx.js
├── dylany.js
├── dylanz.js
├── dylib.js
├── eval.js
├── getH5st3_0.js
├── getToken.js
├── h5source
│ └── 47.js
├── h5st41.js
├── jdCommon.js
├── jdCommon1.js
├── jdCrypto.js
├── jdValidate.js
├── jdcookie.js
├── jxAlgo.js
├── krgetH5st.js
├── krgetSign.js
├── krgetToken.js
├── krgetua.js
├── krh5st.js
├── krsavePrize.js
├── krwxSavePrize.js
├── magic.js
├── proxy.js
├── ql.js
├── savePrize.js
├── sendJDNotify.js
├── sendNotify.js
└── sign_graphics_validate.js
├── jdCookie.js
├── jd_AutoEval.js
├── jd_CheckCK.js
├── jd_OnceApply.js
├── jd_baglx.js
├── jd_bean_change.js
├── jd_bean_home.js
├── jd_bean_info.js
├── jd_beans_7days.py
├── jd_bgcity.js
├── jd_book_draw.js
├── jd_by_sign.js
├── jd_cjzzj.js
├── jd_code2url.js
├── jd_dailysign.js
├── jd_daka_bean.js
├── jd_delLjq.js
├── jd_deliverySign_sign.js
├── jd_dplh0524.js
├── jd_dplh052402.js
├── jd_dplh0525.js
├── jd_dplh0601.js
├── jd_dplhbshop.js
├── jd_dpqd_main.js
├── jd_dpqd_sign.js
├── jd_dpqd_single.js
├── jd_dwapp.js
├── jd_dyf_draw.js
├── jd_dygetbeans_.js
├── jd_farmnew_ck_help.js
├── jd_farmnew_code_help.js
├── jd_fcwb_auto.js
├── jd_fcwb_help.js
├── jd_fish_help.js
├── jd_fl_draw.js
├── jd_fruit_new.js
├── jd_gRed.js
├── jd_global_task_.js
├── jd_gwfd.js
├── jd_health.js
├── jd_health_collect.js
├── jd_health_draw.js
├── jd_health_task.js
├── jd_hssign.js
├── jd_indeps.sh
├── jd_jiaju_draw.js
├── jd_jiaz_draw.js
├── jd_jipiao_draw.js
├── jd_jjg.js
├── jd_joypark_leave.js
├── jd_joypark_task.js
├── jd_jrsign.js
├── jd_kjsign.js
├── jd_luckyDraw.js
├── jd_market_exchange.js
├── jd_mk_game.js
├── jd_mkt_answer.js
├── jd_mohe.js
├── jd_msDraw.js
├── jd_newfarmlottery.js
├── jd_opencard0603.js
├── jd_ouguan.js
├── jd_pkabeans.js
├── jd_plantBean.js
├── jd_plantBean_help.js
├── jd_proxy_check.js
├── jd_pullfix.py
├── jd_qqxing.js
├── jd_red_Task.js
├── jd_rmvcart.js
├── jd_sevenDay.js
├── jd_sharecode.sh
├── jd_signbeanact_.js
├── jd_sq_draw.js
├── jd_taskgBean.js
├── jd_taskop.py
├── jd_tjfb_help.js
├── jd_tuitui_bhz.js
├── jd_tuitui_red_task.js
├── jd_unsubscribe.js
├── jd_video_task.js
├── jd_video_view.js
├── jd_vu50.js
├── jd_vxFans.js
├── jd_water_new.js
├── jd_wbDraw.js
├── jd_wduoyu.js
├── jd_wsck.py
├── jd_wskey.py
├── jd_wwmanor_merge.js
├── jd_wxsign_jf.js
├── jd_wxtoken_m.js
├── jd_wyw_check.js
├── jd_wyw_ffl_.js
├── jd_y1y.js
├── jd_yb_draw.js
├── jd_yc_draw.js
├── jd_yssign.js
├── jd_zzhb_draw_new.js
├── jd_zzhb_new.js
├── notify.md
├── package-lock.json
├── package.json
├── sendNotify.js
├── sendNotify.py
└── utils
├── Rebels
├── 3_1.js
├── 4.js
├── 4_1.js
├── 4_2.js
├── 4_3.js
├── 4_7.js
├── rebelsa.js
├── rebelsb.js
├── rebelsc.js
├── rebelsm.js
├── rebelsn.js
├── rebelsv.js
├── rebelsx.js
└── rebelsz.js
├── Rebels_3_0.js
├── Rebels_H.js
├── Rebels_Token.js
├── Rebels_jdCommon.js
├── Rebels_proxy.js
├── Rebels_savePrize.js
├── Rebels_sendJDNotify.js
└── cache
└── index.js
/README.md:
--------------------------------------------------------------------------------
1 |
2 | ## 6dy
3 |
4 | 声明: 此库所有内容仅用于个人学习!!!
5 |
6 | ### [TG CHANEL](https://t.me/dylan_jdpro)
7 |
8 |
9 | 国内机(带代理):
10 |
11 | ```
12 | ql repo https://js.okyago.com/https://github.com/6dylan6/jdpro.git "jd_|jx_|jddj_" "backUp" "^jd[^_]|USER|JD|function|sendNotify|utils"
13 |
14 | ```
15 |
16 |
17 | 国外机(国外ip有限制可能有些任务不能正常运行):
18 |
19 | ```
20 | ql repo https://github.com/6dylan6/jdpro.git "jd_|jx_|jddj_" "backUp" "^jd[^_]|USER|JD|function|sendNotify|utils"
21 |
22 | ```
23 |
24 |
25 | 线报监控类,[入口](https://github.com/6dylan6/jdm.git)
26 |
27 |
28 |
29 | ## 简要流程
30 |
31 | 1、部署青龙并登陆,版本不用追新,稳定才好,推荐whyour/qinglong:2.17.9镜像部署。
32 |
33 | 2、到订阅管理创建订阅并运行;正确配置[参考](https://github.com/6dylan6/jdpro/issues/22)
34 |
35 | 3、订阅执行完,到定时任务搜索依赖安装(jd_indeps.sh)任务执行;
36 |
37 | 4、到环境变量,创建变量,名称: JD_COOKIE,值:抓的CK(要安全就手抓),多个每行建一个,不要全写在一个;
38 |
39 | 5、配置通知,通知的key填写到配置管理config.sh文件;
40 |
41 |
42 |
43 | 笔记
44 |
45 |
46 | 1、任务并发和分组
47 |
48 | 并发配置方法:
49 |
50 | 在任务后面加conc JD_COOKIE
51 |
52 | 如 task XXXXX.js conc JD_COOKIE
53 |
54 | 任务分组运行方法:
55 |
56 | 在任务后面加desi JD_COOKIE 需要运行的ck序号
57 |
58 | 如 task XXXX.js desi JD_COOKIE 1-10 前10个一组运行,2 8 9就是第2/8/9序号的ck执行,以此类推。
59 |
60 | 2、通知支持一对一推送和显示备注(需用本库sendnotify文件),还有分组通知等用法参考[notify.md](./notify.md)
61 |
62 | 备注显示变量如下
63 |
64 | export NOTIFY_SHOWNAMETYPE="1" 不做任何变动
65 |
66 | export NOTIFY_SHOWNAMETYPE="2" 效果是 : 账号名称:别名(备注)
67 |
68 | export NOTIFY_SHOWNAMETYPE="3" 效果是 : 账号名称:pin(备注)
69 |
70 | export NOTIFY_SHOWNAMETYPE="4" 效果是 : 账号名称:备注
71 |
72 | 3、因为青龙有随机延时(可以在配置文件设置为0,默认300秒),所以涉及准点运行的任务,最后加now,如果是desi或conc不用加也会准时跑。
73 |
74 | 4、青龙系统通知(新增删除任务、登录等通知),需把通知变量写到config.sh文件,在环境变量里只发脚本运行通知哈。
75 |
76 | 5、建议调整任务运行超时时间,青龙默认1小时有些跑不完就被强制结束,config.sh里配置。CommandTimeoutTime="3h" 即改为3小时,根据自己ck数量调整。
77 |
78 | 6、如需禁止某些CK参加所有活动或某些活动功能,实现重组CK顺序功能,包括随机、优先、轮换、组队、分段等功能,把[task_before](./docker/task_before.sh)文件内容复制到配置管理task_before.sh保存
79 |
80 | 常用变量举例:
81 |
82 | Recombin_CK_Mode="1" 全部顺序随机
83 |
84 | Recombin_CK_Mode="2" Recombin_CK_ARG1="15" 假设有100个CK,前15个CK按正常顺序靠前,其余CK随机乱序
85 |
86 | Recombin_CK_Mode="3" Recombin_CK_ARG1="5" Recombin_CK_ARG2="5" 假设有100个CK,希望前5个账号始终保持在前部,剩余95个账号按照轮换模式每天轮换5个
87 |
88 | 其他用法具体参考[文档](https://docs.qq.com/doc/DTXh6QUVjRXJ1TFdN)
89 |
90 |
91 |
92 |
93 | ## 通用环境变量(到配置管理-config.sh里添加变量,export xxx='xxx'格式)
94 |
95 | AUTOCFG='true' 自动配置sendNotify文件到deps目录
96 |
97 | 代理API模式部分支持
98 |
99 | DY_PROXY='URL1#URL2' 多个#分割
100 |
101 | PERMIT_API='test' 需要走API代理的js关键词,多个&分割,可不设置,支持的js都会走
102 |
103 | DY_PROXY_RENUM='5' 获取IP失败重试次数
104 |
105 | DY_PROXY_REDELAY='3' 获取失败重试间隔 单位秒
106 |
107 | ****API代理的意思就是通过url得到随机可用代理,response的格式就是:xxx.xxx.xxx.xxx:xxxx**
108 |
109 | 代理池模式支持全部js
110 |
111 | DP_POOL='http://xxx' 代理池url
112 |
113 | PERMIT_JS='farm&plant&opencard' 需要走代理池的js关键词,多个&分割(可不设置,如果不设置就是所有的js都会走)
114 |
115 | **代理池是一个固定不变的地址,通过这个地址服务,服务会自动转发请求到可用代理,本质上代理池就是一个代理服务器**
116 |
117 | 禁止指定的pin执行任务:
118 |
119 | 多个任务同pin:BANPIN='任务1|任务2@pin1,pin2'
120 |
121 | 多个任务不同pin:BANPIN='任务1@pin,pin2&任务2@pin2,pin3'
122 |
123 | 不指定任务只写pin 全部任务都不执行该pin:BANPIN='pin1,pin2'
124 |
125 |
126 | ## 支持的通知方式
127 |
128 | server酱,go-cqhttp,pushdeer,Bark App,tg bot,钉钉bot,企业微信bot,企业微信应用消息,飞书,iGot,push plus,WxPusher,gotify
129 |
130 | 请在配置管理config文件里填写对应key
131 |
--------------------------------------------------------------------------------
/backUp/kill_ck.js:
--------------------------------------------------------------------------------
1 | /*
2 | CK作废,不时之需,希望大家用不到!!!
3 | 最好改密码!!!
4 | */
5 | const $ = new Env('作废CK');
6 | const notify = $.isNode() ? require('./sendNotify') : '';
7 | //Node.js用户请在jdCookie.js处填写京东ck;
8 | const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
9 |
10 | //IOS等用户直接用NobyDa的jd cookie
11 | let cookiesArr = [], cookie = '';
12 | let flg = process.env.killck?process.env.killck:false;
13 | if ($.isNode()) {
14 | Object.keys(jdCookieNode).forEach((item) => {
15 | cookiesArr.push(jdCookieNode[item])
16 | })
17 | if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {};
18 | } else {
19 | cookiesArr = [$.getdata('CookieJD'), $.getdata('CookieJD2'), ...jsonParse($.getdata('CookiesJD') || "[]").map(item => item.cookie)].filter(item => !!item);
20 | }
21 |
22 | !(async () => {
23 | if (!cookiesArr[0]) {
24 | $.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', {"open-url": "https://bean.m.jd.com/bean/signIndex.action"});
25 | return;
26 | }
27 | if (!flg){
28 | console.log(`请设置变量killck='true'来运行!!!`);
29 | return;
30 | }
31 | for (let i = 0; i < cookiesArr.length; i++) {
32 | if (cookiesArr[i]) {
33 | cookie = cookiesArr[i];
34 | $.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1])
35 | $.index = i + 1;
36 | $.isLogin = true;
37 | $.nickName = '';
38 | await TotalBean();
39 | console.log(`\n开始【京东账号${$.index}】${$.nickName || $.UserName}\n`);
40 | if (!$.isLogin) {
41 | $.msg('', `【提示】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 | await killck();
49 | }
50 | }
51 | })()
52 | .catch((e) => {
53 | $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '')
54 | })
55 | .finally(() => {
56 | $.done();
57 | })
58 |
59 | function killck() {
60 | return new Promise(resolve => {
61 | const options = {
62 | url: `https://plogin.m.jd.com/cgi-bin/ml/mlogout?appid=300&returnurl=https%3A%2F%2Fm.jd.com%2F`,
63 | headers: {
64 | 'authority': 'plogin.m.jd.com',
65 | "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"),
66 | 'cookie': cookie
67 | }
68 | }
69 | $.get(options, (err, resp, data) => {
70 | try {
71 | console.log('此CK成功作废,重新获取CK吧!\n')
72 | } catch (e) {
73 | $.logErr(e, resp);
74 | } finally {
75 | resolve();
76 | }
77 | })
78 | })
79 | }
80 | function TotalBean () {
81 | return new Promise( async resolve => {
82 | const options = {
83 | url: "https://me-api.jd.com/user_new/info/GetJDUserInfoUnion",
84 | headers: {
85 | Host: "me-api.jd.com",
86 | Accept: "*/*",
87 | Connection: "keep-alive",
88 | Cookie: cookie,
89 | "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" ),
90 | "Accept-Language": "zh-cn",
91 | "Referer": "https://home.m.jd.com/myJd/newhome.action?sceneval=2&ufc=&",
92 | "Accept-Encoding": "gzip, deflate, br"
93 | }
94 | }
95 | $.get( options, ( err, resp, data ) => {
96 | try {
97 | if ( err ) {
98 | $.logErr( err )
99 | } else {
100 | if ( data ) {
101 | data = JSON.parse( data );
102 | if ( data[ 'retcode' ] === "1001" ) {
103 | $.isLogin = false; //cookie过期
104 | return;
105 | }
106 | if ( data[ 'retcode' ] === "0" && data.data && data.data.hasOwnProperty( "userInfo" ) ) {
107 | $.nickName = data.data.userInfo.baseInfo.nickname;
108 | }
109 | if ( data[ 'retcode' ] === '0' && data.data && data.data[ 'assetInfo' ] ) {
110 | $.beanCount = data.data && data.data[ 'assetInfo' ][ 'beanNum' ];
111 | }
112 | } else {
113 | $.log( '京东服务器返回空数据' );
114 | }
115 | }
116 | } catch ( e ) {
117 | $.logErr( e )
118 | } finally {
119 | resolve();
120 | }
121 | } )
122 | } )
123 | }
124 |
125 | function jsonParse(str) {
126 | if (typeof str == "string") {
127 | try {
128 | return JSON.parse(str);
129 | } catch (e) {
130 | console.log(e);
131 | $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie')
132 | return [];
133 | }
134 | }
135 | }
136 | // prettier-ignore
137 | function Env(t, e) {
138 | "undefined" != typeof process && JSON.stringify(process.env).indexOf("GITHUB") > -1 && process.exit(0);
139 |
140 | class s {
141 | constructor(t) {
142 | this.env = t
143 | }
144 |
145 | send(t, e = "GET") {
146 | t = "string" == typeof t ? {url: t} : t;
147 | let s = this.get;
148 | return "POST" === e && (s = this.post), new Promise((e, i) => {
149 | s.call(this, t, (t, s, r) => {
150 | t ? i(t) : e(s)
151 | })
152 | })
153 | }
154 |
155 | get(t) {
156 | return this.send.call(this.env, t)
157 | }
158 |
159 | post(t) {
160 | return this.send.call(this.env, t, "POST")
161 | }
162 | }
163 |
164 | return new class {
165 | constructor(t, e) {
166 | 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}, 开始!`)
167 | }
168 |
169 | isNode() {
170 | return "undefined" != typeof module && !!module.exports
171 | }
172 |
173 | isQuanX() {
174 | return "undefined" != typeof $task
175 | }
176 |
177 | isSurge() {
178 | return "undefined" != typeof $httpClient && "undefined" == typeof $loon
179 | }
180 |
181 | isLoon() {
182 | return "undefined" != typeof $loon
183 | }
184 |
185 | toObj(t, e = null) {
186 | try {
187 | return JSON.parse(t)
188 | } catch {
189 | return e
190 | }
191 | }
192 |
193 | toStr(t, e = null) {
194 | try {
195 | return JSON.stringify(t)
196 | } catch {
197 | return e
198 | }
199 | }
200 |
201 | getjson(t, e) {
202 | let s = e;
203 | const i = this.getdata(t);
204 | if (i) try {
205 | s = JSON.parse(this.getdata(t))
206 | } catch {
207 | }
208 | return s
209 | }
210 |
211 | setjson(t, e) {
212 | try {
213 | return this.setdata(JSON.stringify(t), e)
214 | } catch {
215 | return !1
216 | }
217 | }
218 |
219 | getScript(t) {
220 | return new Promise(e => {
221 | this.get({url: t}, (t, s, i) => e(i))
222 | })
223 | }
224 |
225 | runScript(t, e) {
226 | return new Promise(s => {
227 | let i = this.getdata("@chavy_boxjs_userCfgs.httpapi");
228 | i = i ? i.replace(/\n/g, "").trim() : i;
229 | let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");
230 | r = r ? 1 * r : 20, r = e && e.timeout ? e.timeout : r;
231 | const [o, h] = i.split("@"), n = {
232 | url: `http://${h}/v1/scripting/evaluate`,
233 | body: {script_text: t, mock_type: "cron", timeout: r},
234 | headers: {"X-Key": o, Accept: "*/*"}
235 | };
236 | this.post(n, (t, e, i) => s(i))
237 | }).catch(t => this.logErr(t))
238 | }
239 |
240 | loaddata() {
241 | if (!this.isNode()) return {};
242 | {
243 | this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path");
244 | const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile),
245 | s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e);
246 | if (!s && !i) return {};
247 | {
248 | const i = s ? t : e;
249 | try {
250 | return JSON.parse(this.fs.readFileSync(i))
251 | } catch (t) {
252 | return {}
253 | }
254 | }
255 | }
256 | }
257 |
258 | writedata() {
259 | if (this.isNode()) {
260 | this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path");
261 | const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile),
262 | s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e), r = JSON.stringify(this.data);
263 | s ? this.fs.writeFileSync(t, r) : i ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r)
264 | }
265 | }
266 |
267 | lodash_get(t, e, s) {
268 | const i = e.replace(/\[(\d+)\]/g, ".$1").split(".");
269 | let r = t;
270 | for (const t of i) if (r = Object(r)[t], void 0 === r) return s;
271 | return r
272 | }
273 |
274 | lodash_set(t, e, s) {
275 | 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)
276 | }
277 |
278 | getdata(t) {
279 | let e = this.getval(t);
280 | if (/^@/.test(t)) {
281 | const [, s, i] = /^@(.*?)\.(.*?)$/.exec(t), r = s ? this.getval(s) : "";
282 | if (r) try {
283 | const t = JSON.parse(r);
284 | e = t ? this.lodash_get(t, i, "") : e
285 | } catch (t) {
286 | e = ""
287 | }
288 | }
289 | return e
290 | }
291 |
292 | setdata(t, e) {
293 | let s = !1;
294 | if (/^@/.test(e)) {
295 | const [, i, r] = /^@(.*?)\.(.*?)$/.exec(e), o = this.getval(i), h = i ? "null" === o ? null : o || "{}" : "{}";
296 | try {
297 | const e = JSON.parse(h);
298 | this.lodash_set(e, r, t), s = this.setval(JSON.stringify(e), i)
299 | } catch (e) {
300 | const o = {};
301 | this.lodash_set(o, r, t), s = this.setval(JSON.stringify(o), i)
302 | }
303 | } else s = this.setval(t, e);
304 | return s
305 | }
306 |
307 | getval(t) {
308 | 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
309 | }
310 |
311 | setval(t, e) {
312 | 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
313 | }
314 |
315 | initGotEnv(t) {
316 | 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))
317 | }
318 |
319 | get(t, e = (() => {
320 | })) {
321 | 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) => {
322 | !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i)
323 | })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, {hints: !1})), $task.fetch(t).then(t => {
324 | const {statusCode: s, statusCode: i, headers: r, body: o} = t;
325 | e(null, {status: s, statusCode: i, headers: r, body: o}, o)
326 | }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => {
327 | try {
328 | if (t.headers["set-cookie"]) {
329 | const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();
330 | s && this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar
331 | }
332 | } catch (t) {
333 | this.logErr(t)
334 | }
335 | }).then(t => {
336 | const {statusCode: s, statusCode: i, headers: r, body: o} = t;
337 | e(null, {status: s, statusCode: i, headers: r, body: o}, o)
338 | }, t => {
339 | const {message: s, response: i} = t;
340 | e(s, i, i && i.body)
341 | }))
342 | }
343 |
344 | post(t, e = (() => {
345 | })) {
346 | 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) => {
347 | !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i)
348 | }); else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, {hints: !1})), $task.fetch(t).then(t => {
349 | const {statusCode: s, statusCode: i, headers: r, body: o} = t;
350 | e(null, {status: s, statusCode: i, headers: r, body: o}, o)
351 | }, t => e(t)); else if (this.isNode()) {
352 | this.initGotEnv(t);
353 | const {url: s, ...i} = t;
354 | this.got.post(s, i).then(t => {
355 | const {statusCode: s, statusCode: i, headers: r, body: o} = t;
356 | e(null, {status: s, statusCode: i, headers: r, body: o}, o)
357 | }, t => {
358 | const {message: s, response: i} = t;
359 | e(s, i, i && i.body)
360 | })
361 | }
362 | }
363 |
364 | time(t, e = null) {
365 | const s = e ? new Date(e) : new Date;
366 | let i = {
367 | "M+": s.getMonth() + 1,
368 | "d+": s.getDate(),
369 | "H+": s.getHours(),
370 | "m+": s.getMinutes(),
371 | "s+": s.getSeconds(),
372 | "q+": Math.floor((s.getMonth() + 3) / 3),
373 | S: s.getMilliseconds()
374 | };
375 | /(y+)/.test(t) && (t = t.replace(RegExp.$1, (s.getFullYear() + "").substr(4 - RegExp.$1.length)));
376 | 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)));
377 | return t
378 | }
379 |
380 | msg(e = t, s = "", i = "", r) {
381 | const o = t => {
382 | if (!t) return t;
383 | if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? {"open-url": t} : this.isSurge() ? {url: t} : void 0;
384 | if ("object" == typeof t) {
385 | if (this.isLoon()) {
386 | let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"];
387 | return {openUrl: e, mediaUrl: s}
388 | }
389 | if (this.isQuanX()) {
390 | let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl;
391 | return {"open-url": e, "media-url": s}
392 | }
393 | if (this.isSurge()) {
394 | let e = t.url || t.openUrl || t["open-url"];
395 | return {url: e}
396 | }
397 | }
398 | };
399 | if (this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))), !this.isMuteLog) {
400 | let t = ["", "==============📣系统通知📣=============="];
401 | t.push(e), s && t.push(s), i && t.push(i), console.log(t.join("\n")), this.logs = this.logs.concat(t)
402 | }
403 | }
404 |
405 | log(...t) {
406 | t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator))
407 | }
408 |
409 | logErr(t, e) {
410 | const s = !this.isSurge() && !this.isQuanX() && !this.isLoon();
411 | }
412 |
413 | wait(t) {
414 | return new Promise(e => setTimeout(e, t))
415 | }
416 |
417 | done(t = {}) {
418 | const e = (new Date).getTime(), s = (e - this.startTime) / 1e3;
419 | this.log("", `🔔${this.name}, 结束! 🕛 ${s} 秒`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t)
420 | }
421 | }(t, e)
422 | }
--------------------------------------------------------------------------------
/backUp/kill_wskey.js:
--------------------------------------------------------------------------------
1 | /*
2 | * 注销所有 WSKEY
3 | * 默认不开启,如需启用请添加变量:
4 | * JD_WSCK_LOGOUT=pin 退出指定账户
5 | * JD_WSCK_LOGOUT=ALL 退出所有 CK 有效的账户(必须大写)
6 | */
7 |
8 | const $ = new Env("作废WSKEY")
9 | const WSKEY_LOGOUT = class {
10 | ck = null
11 | key = null
12 | constructor(ck) {
13 | this.ck = ck
14 | const matches = ck.match(/pt_key=([^;]+)/)
15 | if (matches) {
16 | this.key = matches[1]
17 | }
18 | }
19 | getDevices() {
20 | return new Promise((resolve) => {
21 | const opts = {
22 | url: `https://plogin.m.jd.com/cgi-bin/login/devicemanagement_getdevices?appid=100&_=${(new Date()).getTime()}`,
23 | headers: {
24 | "Host": "plogin.m.jd.com",
25 | "Accept": "*/*",
26 | "Accept-Encoding": "gzip, deflate, br",
27 | "User-Agent": 'jdapp',
28 | "Accept-Language": "zh-CN,zh-Hans;q=0.9",
29 | "Cookie": this.ck
30 | }
31 | }
32 | $.get(opts, (error, response, data) => {
33 | try {
34 | if (error) {
35 | console.log(`${JSON.stringify(error)}`)
36 | console.log(`${$.name} getdevices API请求失败`)
37 | resolve('failed')
38 | } else {
39 | const devices = []
40 | let guid = undefined
41 | let matches = data.match(/
]+>[\s\S]+?<\/li>/g)
42 | if (matches) {
43 | if (response.headers['set-cookie']) {
44 | response.headers['set-cookie'].forEach((item) => {
45 | let matches2 = item.match(/guid=([^;]+)/)
46 | if (matches2) {
47 | guid = matches2[1]
48 | }
49 | })
50 | }
51 | matches.forEach((item) => {
52 | let matches2, uuid, ticket, deviceName, id, loginTime
53 | matches2 = item.match(/data-uid=['"]([^'"]+)['"]/)
54 | if (matches2) {
55 | uuid = matches2[1]
56 | }
57 | matches2 = item.match(/data-tiket=['"]([^'"]+)['"]/)
58 | if (matches2) {
59 | ticket = matches2[1]
60 | }
61 | matches2 = item.match(/data-name=['"]([^'"]+)['"]/)
62 | if (matches2) {
63 | deviceName = matches2[1]
64 | }
65 | matches2 = item.match(/data-index=['"]([^'"]+)['"]/)
66 | if (matches2) {
67 | id = matches2[1]
68 | }
69 | matches2 = item.match(/([\s\S]+?)<\/p>/)
70 | if (matches2) {
71 | loginTime = this.htmlDecode(matches2[1])
72 | }
73 | devices.push({
74 | deviceName,
75 | loginTime,
76 | config: {
77 | uuid,
78 | ticket,
79 | deviceName: this.htmlEncode(deviceName),
80 | id,
81 | appid: '100',
82 | pt_key: this.key,
83 | guid,
84 | }
85 | })
86 | })
87 | }
88 | resolve(devices)
89 | }
90 | } catch (e) {
91 | $.logErr(e, response);
92 | resolve('failed')
93 | }
94 | })
95 | })
96 | }
97 | deleteDevice(config) {
98 | return new Promise((resolve) => {
99 | const body = Object.keys(config).map((key) => {
100 | return `${encodeURIComponent(key)}=${encodeURIComponent(config[key])}`
101 | }).join('&')
102 | const opts = {
103 | url: `https://plogin.m.jd.com/cgi-bin/login/devicemanagement_deletedevice`,
104 | headers: {
105 | "Host": "plogin.m.jd.com",
106 | "Accept": "*/*",
107 | "Accept-Encoding": "gzip, deflate, br",
108 | "User-Agent": 'jdapp',
109 | "Accept-Language": "zh-CN,zh-Hans;q=0.9",
110 | "Cookie": `guid=${config.guid}; ${this.ck}`,
111 | "Content-Type": "application/x-www-form-urlencoded",
112 | "Content-Length": body.length,
113 | "Origin": "https://plogin.m.jd.com",
114 | "Referer": "https://plogin.m.jd.com/cgi-bin/login/devicemanagement_getdevices?appid=100"
115 | },
116 | body
117 | }
118 | $.post(opts, (error, response, data) => {
119 | try {
120 | if (error) {
121 | console.log(`${JSON.stringify(error)}`)
122 | console.log(`${$.name} deletedevice API请求失败`)
123 | resolve('failed')
124 | } else {
125 | resolve(JSON.parse(data))
126 | }
127 | } catch (e) {
128 | $.logErr(e, response);
129 | resolve('failed')
130 | }
131 | })
132 | })
133 | }
134 | htmlEncode(str) {
135 | str = str.replaceAll('&', '&')
136 | str = str.replaceAll('<', '<')
137 | str = str.replaceAll('>', '>')
138 | str = str.replaceAll('"', '"')
139 | str = str.replaceAll("'", ''')
140 | str = str.replaceAll(" ", ' ')
141 | return str
142 | }
143 | htmlDecode(str) {
144 | str = str.replaceAll(' ', " ")
145 | str = str.replaceAll(''', "'")
146 | str = str.replaceAll('"', '"')
147 | str = str.replaceAll('>', '>')
148 | str = str.replaceAll('<', '<')
149 | str = str.replaceAll('&', '&')
150 | return str
151 | }
152 | }
153 |
154 | !(async () => {
155 | if (!process.env) {
156 | process.env = {}
157 | }
158 | if (!process.env['JD_WSCK_LOGOUT']) {
159 | process.env['JD_WSCK_LOGOUT'] = ''
160 | }
161 | if (process.env['JD_WSCK_LOGOUT'] !== 'ALL') {
162 | if (process.env['JD_WSCK_LOGOUT'].indexOf('&') !== -1) {
163 | process.env['JD_WSCK_LOGOUT'] = process.env['JD_WSCK_LOGOUT'].split('&')
164 | } else if (process.env['JD_WSCK_LOGOUT'].indexOf("\n") !== -1) {
165 | process.env['JD_WSCK_LOGOUT'] = process.env['JD_WSCK_LOGOUT'].split("\n")
166 | } else if (process.env['JD_WSCK_LOGOUT']) {
167 | process.env['JD_WSCK_LOGOUT'] = [process.env['JD_WSCK_LOGOUT']]
168 | } else {
169 | process.env['JD_WSCK_LOGOUT'] = []
170 | }
171 | }
172 | if (!process.env['JD_WSCK_LOGOUT'] || !process.env['JD_WSCK_LOGOUT'].length) {
173 | console.log(`当前不开启,如需启用请添加变量:\nJD_WSCK_LOGOUT=pin 退出指定账户\nJD_WSCK_LOGOUT=ALL 退出所有 CK 有效的账户(必须大写)`)
174 | return
175 | }
176 |
177 | let cookies = []
178 | if (process.env['JD_COOKIE']) {
179 | if (process.env['JD_COOKIE'].indexOf('&') !== -1) {
180 | cookies = process.env['JD_COOKIE'].split('&')
181 | } else if (process.env['JD_COOKIE'].indexOf("\n") !== -1) {
182 | cookies = process.env['JD_COOKIE'].split("\n")
183 | } else {
184 | cookies = [process.env['JD_COOKIE']]
185 | }
186 | }
187 | if (typeof cookies[0] === "undefined") {
188 | console.log(`未添加任何京东账户`)
189 | return
190 | }
191 | console.log(`=========== 共 ${cookies.length} 个京东账号 Cookie ===========\n`)
192 | for (let i = 0; i < cookies.length; i++) {
193 | let matches = cookies[i].match(/pt_pin=([^;\s]+)/)
194 | if (!matches) {
195 | console.log(`*********【京东账户${i + 1}】*********\nCookie 格式错误,请检查\n${cookies[i]}\n`)
196 | continue
197 | }
198 | let pin = matches[1]
199 | console.log(`*********【京东账户${i + 1}】${decodeURIComponent(pin)}*********\n`)
200 | if (process.env['JD_WSCK_LOGOUT'] !== 'ALL' && process.env['JD_WSCK_LOGOUT'].indexOf(pin) === -1) {
201 | console.log(`不注销该账户任何 WSKEY\n`)
202 | continue
203 | }
204 | let logout = new WSKEY_LOGOUT(cookies[i])
205 | let devices = await logout.getDevices()
206 | if (devices === 'failed') {
207 | console.log(`获取设备列表失败,可能为 Cookie 或脚本失效\n`)
208 | continue
209 | }
210 | if (!devices.length) {
211 | console.log(`获取设备列表失败,可能为脚本失效\n`)
212 | continue
213 | }
214 | for (let j = 0; j < devices.length; j++) {
215 | console.log(`${devices[j].deviceName} (${devices[j].loginTime})`)
216 | const result = await logout.deleteDevice(devices[j].config)
217 | if (result.errcode === 0) {
218 | console.log(`0 => 已注销\n`)
219 | } else {
220 | console.log(`${result.errcode} => ${result.message}\n`)
221 | }
222 | await $.wait(1000)
223 | }
224 | await $.wait(3000)
225 | }
226 | })()
227 | .catch((e) => $.logErr(e))
228 | .finally(() => $.done());
229 |
230 | function Env(t,e){"undefined"!=typeof process&&JSON.stringify(process.env).indexOf("GITHUB")>-1&&process.exit(0);class s{constructor(t){this.env=t}send(t,e="GET"){t="string"==typeof t?{url:t}:t;let s=this.get;return"POST"===e&&(s=this.post),new Promise((e,i)=>{s.call(this,t,(t,s,r)=>{t?i(t):e(s)})})}get(t){return this.send.call(this.env,t)}post(t){return this.send.call(this.env,t,"POST")}}return new class{constructor(t,e){this.name=t,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.isNeedRewrite=!1,this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`🔔${this.name}, 开始!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null){try{return JSON.stringify(t)}catch{return e}}getjson(t,e){let s=e;const i=this.getdata(t);if(i)try{s=JSON.parse(this.getdata(t))}catch{}return s}setjson(t,e){try{return this.setdata(JSON.stringify(t),e)}catch{return!1}}getScript(t){return new Promise(e=>{this.get({url:t},(t,s,i)=>e(i))})}runScript(t,e){return new Promise(s=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let r=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");r=r?1*r:20,r=e&&e.timeout?e.timeout:r;const[o,h]=i.split("@"),n={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(n,(t,e,i)=>s(i))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e);if(!s&&!i)return{};{const i=s?t:e;try{return JSON.parse(this.fs.readFileSync(i))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e),r=JSON.stringify(this.data);s?this.fs.writeFileSync(t,r):i?this.fs.writeFileSync(e,r):this.fs.writeFileSync(t,r)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let r=t;for(const t of i)if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,e,s){return Object(t)!==t?t:(Array.isArray(e)||(e=e.toString().match(/[^.[\]]+/g)||[]),e.slice(0,-1).reduce((t,s,i)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[i+1])>>0==+e[i+1]?[]:{},t)[e[e.length-1]]=s,t)}getdata(t){let e=this.getval(t);if(/^@/.test(t)){const[,s,i]=/^@(.*?)\.(.*?)$/.exec(t),r=s?this.getval(s):"";if(r)try{const t=JSON.parse(r);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,r]=/^@(.*?)\.(.*?)$/.exec(e),o=this.getval(i),h=i?"null"===o?null:o||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,r,t),s=this.setval(JSON.stringify(e),i)}catch(e){const o={};this.lodash_set(o,r,t),s=this.setval(JSON.stringify(o),i)}}else s=this.setval(t,e);return s}getval(t){return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)})):this.isQuanX()?(this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t))):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();s&&this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)}))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)})}}time(t,e=null){const s=e?new Date(e):new Date;let i={"M+":s.getMonth()+1,"d+":s.getDate(),"H+":s.getHours(),"m+":s.getMinutes(),"s+":s.getSeconds(),"q+":Math.floor((s.getMonth()+3)/3),S:s.getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(s.getFullYear()+"").substr(4-RegExp.$1.length)));for(let e in i)new RegExp("("+e+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?i[e]:("00"+i[e]).substr((""+i[e]).length)));return t}msg(e=t,s="",i="",r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};if(this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r))),!this.isMuteLog){let t=["","==============📣系统通知📣=============="];t.push(e),s&&t.push(s),i&&t.push(i),console.log(t.join("\n")),this.logs=this.logs.concat(t)}}log(...t){t.length>0&&(this.logs=[...this.logs,...t]),console.log(t.join(this.logSeparator))}logErr(t,e){const s=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();s?this.log("",`❗️${this.name}, 错误!`,t.stack):this.log("",`❗️${this.name}, 错误!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`🔔${this.name}, 结束! 🕛 ${s} 秒`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)}
231 |
--------------------------------------------------------------------------------
/config/CK_WxPusherUid.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "pt_pin": "中文账号名",
4 | "Uid": "UID_XXXXXXXXXXXXXXXXXXX"
5 | },
6 | {
7 | "pt_pin": "XXXXXXX",
8 | "Uid": "UID_XXXXXXXXXXXXXXXXXXX"
9 | },
10 | {
11 | "pt_pin": "XXXXXXX",
12 | "Uid": "UID_XXXXXXXXXXXXXXXXXXX"
13 | },
14 | {
15 | "pt_pin": "XXXXXXX",
16 | "Uid": "UID_XXXXXXXXXXXXXXXXXXX"
17 | }
18 | ]
19 |
--------------------------------------------------------------------------------
/docker/README.md:
--------------------------------------------------------------------------------
1 | # Usage
2 |
3 | > 推荐使用`docker-compose`所以这里只介绍`docker-compose`使用方式
4 |
5 |
6 |
7 | ## Docker安装
8 |
9 |
10 |
11 | - 国内一键安装 `sudo curl -sSL https://get.daocloud.io/docker | sh`
12 | - 国外一键安装 `sudo curl -sSL get.docker.com | sh`
13 | - 北京外国语大学开源软件镜像站 `https://mirrors.bfsu.edu.cn/help/docker-ce/`
14 |
15 |
16 | docker-compose 安装(群晖`nas docker`自带安装了`docker-compose`)
17 |
18 | ```
19 | curl -L https://get.daocloud.io/docker/compose/releases/download/v2.1.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
20 | chmod +x /usr/local/bin/docker-compose
21 | ```
22 | `Ubuntu`用户快速安装`docker-compose`
23 | ```
24 | sudo apt-get update && sudo apt-get install -y python3-pip curl vim git moreutils
25 | pip3 install --upgrade pip
26 | pip install docker-compose
27 | ```
28 |
29 | ## win10用户安装[docker desktop](https://www.docker.com/products/docker-desktop)
30 |
31 | 通过`docker-compose version`查看`docker-compose`版本,确认是否安装成功。
32 |
33 |
34 |
35 | ## 常用命令
36 |
37 | `docker-compose up -d` 启动(修改docker-compose.yml后需要使用此命令使更改生效);
38 | `docker-compose logs` 打印日志;
39 | `docker-compose logs -f` 打印日志,-f表示跟随日志;
40 | `docker logs -f qinglong` 和上面两条相比可以显示汉字;
41 | `docker-compose pull` 更新镜像;
42 | `docker-compose stop` 停止容器;
43 | `docker-compose restart` 重启容器;
44 | `docker-compose down` 停止并删除容器;
45 |
46 | ## 青龙一键部署(2.11.3版本)
47 |
48 | 1. 新建一个文件夹,用于存放相关数据
49 | 2. 下载本仓库中的`docker-compose.yml`至本地,或是复制文件内容后在本地自行建立并粘贴内容
50 | 3. 使用docker-compose启动
51 | 4. 浏览器输入ip:5700即可进入面板
52 |
53 | ###新建数据文件夹
54 |
55 | ```bash
56 | mkdir qinglong
57 | cd qinglong
58 | ```
59 |
60 | ###下载或复制docker-compose.yml文件
61 |
62 | ```bash
63 | wget https://ghproxy.com/https://raw.githubusercontent.com/whyour/qinglong/develop/docker-compose.yml
64 | ```
65 |
66 | ###启动
67 |
68 | ```bash
69 | docker-compose up -d
70 | ```
71 |
--------------------------------------------------------------------------------
/docker/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: '2'
2 | services:
3 | ql_web:
4 | image: whyour/qinglong:2.17.9
5 | container_name: ql
6 | volumes:
7 | - ./qinglong/data:/ql/data
8 | - ./qinglong/deps/pnpm:/root/.local/share/pnpm
9 | - ./qinglong/deps/pip3:/usr/local/lib/python3.11/site-packages
10 | ports:
11 | - "5700:5700"
12 | restart: unless-stopped
13 |
--------------------------------------------------------------------------------
/docker/extra.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ## 添加你需要重启自动执行的任意命令,比如 ql repo
4 | ## 安装node依赖使用 pnpm install -g xxx xxx
5 | ## 安装python依赖使用 pip3 install xxx
6 | pnpm install -g png-js
7 | pnpm install -g date-fns
8 | pnpm install -g axios
9 | pnpm install -g crypto-js
10 | pnpm install -g ts-md5
11 | pnpm install -g tslib
12 | pnpm install -g @types/node
13 | pnpm install -g requests
14 | pnpm install -g jsdom
--------------------------------------------------------------------------------
/docker/ql1key.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | #2.11.3版本青龙一键安装并添加拉库任务
3 | #端口5500
4 | #modify 2022-10-12
5 |
6 | Green="\033[32;1m"
7 | Red="\033[31m"
8 | Yellow="\033[33;1m"
9 | Blue="\033[36;1m"
10 | Font="\033[0m"
11 | GreenBG="\033[42;37m"
12 | RedBG="\033[41;37m"
13 | OK="${Green}[OK]${Font}"
14 | ERROR="${Red}[ERROR]${Font}"
15 |
16 | ok() {
17 | echo
18 | echo -e " ${OK} ${Green} $1 ${Font}"
19 | echo
20 | }
21 | error() {
22 | echo
23 | echo -e "${ERROR} ${RedBG} $1 ${Font}"
24 | echo
25 | }
26 |
27 | ing () {
28 | echo
29 | echo -e "${Yellow} $1 ${Font}"
30 | echo
31 | }
32 |
33 |
34 | if [[ ! "$USER" == "root" ]]; then
35 | error "警告:请使用root用户操作!~~"
36 | exit 1
37 | fi
38 |
39 | datav=/root/ql$(date +%Y%m%d)
40 | mkdir -p $datav && ql_path=$datav
41 |
42 |
43 | ql_run() {
44 | if [ -z "$(docker ps -a |awk '{print $NF}'| grep qinglong 2> /dev/null)" ]; then
45 | cd $ql_path
46 | cat > docker-compose.yml < /etc/docker/daemon.json < /usr/local/bin/docker-compose
115 | chmod +x /usr/local/bin/docker-compose
116 | ok "安装docker-compose...完成"
117 | fi
118 | }
119 |
120 |
121 | add_repo() {
122 | if [ "$(grep -c "6dylan6/jdpro" $ql_path/data/config/crontab.list)" != 0 ]; then
123 | error "您的任务列表中已存在拉库任务,刷新浏览器去执行拉库任务吧!"
124 | else
125 | ing "开始添加6dylan6/jdpro拉库任务"
126 | sed -i 's/RepoFileExtensions.*/RepoFileExtensions=\"js py sh ts\"/g' $ql_path/data/config/config.sh
127 | if [ "$(grep -c "token" $ql_path/data/config/auth.json)" != 0 ]; then
128 | docker exec -it qinglong /bin/bash -c "token=\$(cat /ql/config/auth.json | jq --raw-output .token) && curl -s -H 'Accept: application/json' -H \"Authorization: Bearer \$token\" -H 'Content-Type: application/json;charset=UTF-8' -H 'Accept-Language: zh-CN,zh;q=0.9' --data-binary '{\"name\":\"拉库\",\"command\":\"ql repo https://ghproxy.com/https://github.com/6dylan6/jdpro.git \\\"jd_|jx_|jddj_\\\" \\\"backUp\\\" \\\"^jd[^_]|USER|JD|function|sendNotify\\\"\",\"schedule\":\"45 7-23/2 * * *\"}' --compressed 'http://127.0.0.1:5700/api/crons?t=1627380635389'"
129 | ok "已添加拉库任务,刷新浏览器后去执行拉库任务吧!"
130 | else
131 | error "未检测到 token,请访问web完成初始化并登陆进去后,在运行一次脚本"
132 | fi
133 | fi
134 | }
135 |
136 | ql_fix() {
137 | docker exec -it qinglong /bin/bash -c "grep -lr 'cdn.jsde' /ql/dist/|xargs sed -i 's#cdn.*.net/npm/#unpkg.com/#g'"
138 | docker exec -it qinglong /bin/bash -c "grep -lr 'unpkg.com' /ql/dist/ | xargs -I {} sh -c \"gzip -c {} > {}.gz\""
139 | docker exec -it qinglong bash -c "curl -so /ql/deps/sendNotify.js https://js.dayplus.xyz/https://raw.githubusercontent.com/6dylan6/jdpro/main/sendNotify.js"
140 | }
141 |
142 | ing "开始部署青龙并创建拉库任务,速度根据您的网速决定,请耐心等待....."
143 | read -p "按任意键开始部署。。。"
144 | docker_install
145 | docker_compose
146 | ing "开始创建容器,如果长时间卡住 ctrl+c终止后重试!!!"
147 | ql_run
148 | ql_fix
149 | read -p "已初在浏览器始化并登陆青龙了?,那就按任意键继续!"
150 | add_repo
151 | sleep 2
152 | ok "已部署完成,2.11.3版本青龙,数据保存路径为$datav,容器名qinglong,访问地址http://ip:5500"
153 |
154 |
--------------------------------------------------------------------------------
/function/JDJRValidator_Pure_smiek.js:
--------------------------------------------------------------------------------
1 | const https = require('https');
2 | const http = require('http');
3 | const stream = require('stream');
4 | const zlib = require('zlib');
5 | const vm = require('vm');
6 | const PNG = require('png-js');
7 | let UA = `jdapp;iPhone;10.1.0;14.3;${randomString(40)};network/wifi;model/iPhone12,1;addressid/4199175193;appBuild/167774;jdSupportDarkMode/0;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1`;
8 | const validatorCount = process.env.JDJR_validator_Count ? process.env.JDJR_validator_Count : 100
9 |
10 | function randomString(e) {
11 | e = e || 32;
12 | let t = "abcdef0123456789", a = t.length, n = "";
13 | for (i = 0; i < e; i++)
14 | n += t.charAt(Math.floor(Math.random() * a));
15 | return n
16 | }
17 |
18 | Math.avg = function average() {
19 | var sum = 0;
20 | var len = this.length;
21 | for (var i = 0; i < len; i++) {
22 | sum += this[i];
23 | }
24 | return sum / len;
25 | };
26 |
27 | function sleep(timeout) {
28 | return new Promise((resolve) => setTimeout(resolve, timeout));
29 | }
30 |
31 | class PNGDecoder extends PNG {
32 | constructor(args) {
33 | super(args);
34 | this.pixels = [];
35 | }
36 |
37 | decodeToPixels() {
38 | return new Promise((resolve) => {
39 | this.decode((pixels) => {
40 | this.pixels = pixels;
41 | resolve();
42 | });
43 | });
44 | }
45 |
46 | getImageData(x, y, w, h) {
47 | const {pixels} = this;
48 | const len = w * h * 4;
49 | const startIndex = x * 4 + y * (w * 4);
50 |
51 | return {data: pixels.slice(startIndex, startIndex + len)};
52 | }
53 | }
54 |
55 | const PUZZLE_GAP = 8;
56 | const PUZZLE_PAD = 10;
57 |
58 | class PuzzleRecognizer {
59 | constructor(bg, patch, y) {
60 | // console.log(bg);
61 | const imgBg = new PNGDecoder(Buffer.from(bg, 'base64'));
62 | const imgPatch = new PNGDecoder(Buffer.from(patch, 'base64'));
63 |
64 | // console.log(imgBg);
65 |
66 | this.bg = imgBg;
67 | this.patch = imgPatch;
68 | this.rawBg = bg;
69 | this.rawPatch = patch;
70 | this.y = y;
71 | this.w = imgBg.width;
72 | this.h = imgBg.height;
73 | }
74 |
75 | async run() {
76 | await this.bg.decodeToPixels();
77 | await this.patch.decodeToPixels();
78 |
79 | return this.recognize();
80 | }
81 |
82 | recognize() {
83 | const {ctx, w: width, bg} = this;
84 | const {width: patchWidth, height: patchHeight} = this.patch;
85 | const posY = this.y + PUZZLE_PAD + ((patchHeight - PUZZLE_PAD) / 2) - (PUZZLE_GAP / 2);
86 | // const cData = ctx.getImageData(0, a.y + 10 + 20 - 4, 360, 8).data;
87 | const cData = bg.getImageData(0, posY, width, PUZZLE_GAP).data;
88 | const lumas = [];
89 |
90 | for (let x = 0; x < width; x++) {
91 | var sum = 0;
92 |
93 | // y xais
94 | for (let y = 0; y < PUZZLE_GAP; y++) {
95 | var idx = x * 4 + y * (width * 4);
96 | var r = cData[idx];
97 | var g = cData[idx + 1];
98 | var b = cData[idx + 2];
99 | var luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;
100 |
101 | sum += luma;
102 | }
103 |
104 | lumas.push(sum / PUZZLE_GAP);
105 | }
106 |
107 | const n = 2; // minium macroscopic image width (px)
108 | const margin = patchWidth - PUZZLE_PAD;
109 | const diff = 20; // macroscopic brightness difference
110 | const radius = PUZZLE_PAD;
111 | for (let i = 0, len = lumas.length - 2 * 4; i < len; i++) {
112 | const left = (lumas[i] + lumas[i + 1]) / n;
113 | const right = (lumas[i + 2] + lumas[i + 3]) / n;
114 | const mi = margin + i;
115 | const mLeft = (lumas[mi] + lumas[mi + 1]) / n;
116 | const mRigth = (lumas[mi + 2] + lumas[mi + 3]) / n;
117 |
118 | if (left - right > diff && mLeft - mRigth < -diff) {
119 | const pieces = lumas.slice(i + 2, margin + i + 2);
120 | const median = pieces.sort((x1, x2) => x1 - x2)[20];
121 | const avg = Math.avg(pieces);
122 |
123 | // noise reducation
124 | if (median > left || median > mRigth) return;
125 | if (avg > 100) return;
126 | // console.table({left,right,mLeft,mRigth,median});
127 | // ctx.fillRect(i+n-radius, 0, 1, 360);
128 | // console.log(i+n-radius);
129 | return i + n - radius;
130 | }
131 | }
132 |
133 | // not found
134 | return -1;
135 | }
136 |
137 | runWithCanvas() {
138 | const {createCanvas, Image} = require('canvas');
139 | const canvas = createCanvas();
140 | const ctx = canvas.getContext('2d');
141 | const imgBg = new Image();
142 | const imgPatch = new Image();
143 | const prefix = 'data:image/png;base64,';
144 |
145 | imgBg.src = prefix + this.rawBg;
146 | imgPatch.src = prefix + this.rawPatch;
147 | const {naturalWidth: w, naturalHeight: h} = imgBg;
148 | canvas.width = w;
149 | canvas.height = h;
150 | ctx.clearRect(0, 0, w, h);
151 | ctx.drawImage(imgBg, 0, 0, w, h);
152 |
153 | const width = w;
154 | const {naturalWidth, naturalHeight} = imgPatch;
155 | const posY = this.y + PUZZLE_PAD + ((naturalHeight - PUZZLE_PAD) / 2) - (PUZZLE_GAP / 2);
156 | // const cData = ctx.getImageData(0, a.y + 10 + 20 - 4, 360, 8).data;
157 | const cData = ctx.getImageData(0, posY, width, PUZZLE_GAP).data;
158 | const lumas = [];
159 |
160 | for (let x = 0; x < width; x++) {
161 | var sum = 0;
162 |
163 | // y xais
164 | for (let y = 0; y < PUZZLE_GAP; y++) {
165 | var idx = x * 4 + y * (width * 4);
166 | var r = cData[idx];
167 | var g = cData[idx + 1];
168 | var b = cData[idx + 2];
169 | var luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;
170 |
171 | sum += luma;
172 | }
173 |
174 | lumas.push(sum / PUZZLE_GAP);
175 | }
176 |
177 | const n = 2; // minium macroscopic image width (px)
178 | const margin = naturalWidth - PUZZLE_PAD;
179 | const diff = 20; // macroscopic brightness difference
180 | const radius = PUZZLE_PAD;
181 | for (let i = 0, len = lumas.length - 2 * 4; i < len; i++) {
182 | const left = (lumas[i] + lumas[i + 1]) / n;
183 | const right = (lumas[i + 2] + lumas[i + 3]) / n;
184 | const mi = margin + i;
185 | const mLeft = (lumas[mi] + lumas[mi + 1]) / n;
186 | const mRigth = (lumas[mi + 2] + lumas[mi + 3]) / n;
187 |
188 | if (left - right > diff && mLeft - mRigth < -diff) {
189 | const pieces = lumas.slice(i + 2, margin + i + 2);
190 | const median = pieces.sort((x1, x2) => x1 - x2)[20];
191 | const avg = Math.avg(pieces);
192 |
193 | // noise reducation
194 | if (median > left || median > mRigth) return;
195 | if (avg > 100) return;
196 | // console.table({left,right,mLeft,mRigth,median});
197 | // ctx.fillRect(i+n-radius, 0, 1, 360);
198 | // console.log(i+n-radius);
199 | return i + n - radius;
200 | }
201 | }
202 |
203 | // not found
204 | return -1;
205 | }
206 | }
207 |
208 | const DATA = {
209 | "appId": "17839d5db83",
210 | "product": "embed",
211 | "lang": "zh_CN",
212 | };
213 | const SERVER = 'iv.jd.com';
214 |
215 | class JDJRValidator {
216 | constructor() {
217 | this.data = {};
218 | this.x = 0;
219 | this.t = Date.now();
220 | this.count = 0;
221 | }
222 |
223 | async run(scene = 'cww', eid='') {
224 | const tryRecognize = async () => {
225 | const x = await this.recognize(scene, eid);
226 |
227 | if (x > 0) {
228 | return x;
229 | }
230 | // retry
231 | return await tryRecognize();
232 | };
233 | const puzzleX = await tryRecognize();
234 | // console.log(puzzleX);
235 | const pos = new MousePosFaker(puzzleX).run();
236 | const d = getCoordinate(pos);
237 |
238 | // console.log(pos[pos.length-1][2] -Date.now());
239 | // await sleep(4500);
240 | await sleep(pos[pos.length - 1][2] - Date.now());
241 | this.count++;
242 | const result = await JDJRValidator.jsonp('/slide/s.html', {d, ...this.data}, scene);
243 |
244 | if (result.message === 'success') {
245 | // console.log(result);
246 | console.log('JDJR验证用时: %fs', (Date.now() - this.t) / 1000);
247 | return result;
248 | } else {
249 | console.log(`验证失败: ${this.count}/${validatorCount}`);
250 | // console.log(JSON.stringify(result));
251 | if(this.count >= validatorCount){
252 | console.log("JDJR验证次数已达上限,退出验证");
253 | return result;
254 | }else{
255 | await sleep(300);
256 | return await this.run(scene, eid);
257 | }
258 | }
259 | }
260 |
261 | async recognize(scene, eid) {
262 | const data = await JDJRValidator.jsonp('/slide/g.html', {e: eid}, scene);
263 | const {bg, patch, y} = data;
264 | // const uri = 'data:image/png;base64,';
265 | // const re = new PuzzleRecognizer(uri+bg, uri+patch, y);
266 | const re = new PuzzleRecognizer(bg, patch, y);
267 | // console.log(JSON.stringify(re))
268 | const puzzleX = await re.run();
269 |
270 | if (puzzleX > 0) {
271 | this.data = {
272 | c: data.challenge,
273 | w: re.w,
274 | e: eid,
275 | s: '',
276 | o: '',
277 | };
278 | this.x = puzzleX;
279 | }
280 | return puzzleX;
281 | }
282 |
283 | async report(n) {
284 | console.time('PuzzleRecognizer');
285 | let count = 0;
286 |
287 | for (let i = 0; i < n; i++) {
288 | const x = await this.recognize();
289 |
290 | if (x > 0) count++;
291 | if (i % 50 === 0) {
292 | // console.log('%f\%', (i / n) * 100);
293 | }
294 | }
295 |
296 | console.log('验证成功: %f\%', (count / n) * 100);
297 | console.clear()
298 | console.timeEnd('PuzzleRecognizer');
299 | }
300 |
301 | static jsonp(api, data = {}, scene) {
302 | return new Promise((resolve, reject) => {
303 | const fnId = `jsonp_${String(Math.random()).replace('.', '')}`;
304 | const extraData = {callback: fnId};
305 | const query = new URLSearchParams({...DATA,...{"scene": scene}, ...extraData, ...data}).toString();
306 | const url = `https://${SERVER}${api}?${query}`;
307 | const headers = {
308 | 'Accept': '*/*',
309 | 'Accept-Encoding': 'gzip,deflate,br',
310 | 'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8',
311 | 'Connection': 'keep-alive',
312 | 'Host': "iv.jd.com",
313 | 'Proxy-Connection': 'keep-alive',
314 | 'Referer': 'https://h5.m.jd.com/',
315 | 'User-Agent': UA,
316 | };
317 |
318 | const req = https.get(url, {headers}, (response) => {
319 | let res = response;
320 | if (res.headers['content-encoding'] === 'gzip') {
321 | const unzipStream = new stream.PassThrough();
322 | stream.pipeline(
323 | response,
324 | zlib.createGunzip(),
325 | unzipStream,
326 | reject,
327 | );
328 | res = unzipStream;
329 | }
330 | res.setEncoding('utf8');
331 |
332 | let rawData = '';
333 |
334 | res.on('data', (chunk) => rawData += chunk);
335 | res.on('end', () => {
336 | try {
337 | const ctx = {
338 | [fnId]: (data) => ctx.data = data,
339 | data: {},
340 | };
341 |
342 | vm.createContext(ctx);
343 | vm.runInContext(rawData, ctx);
344 |
345 | // console.log(ctx.data);
346 | res.resume();
347 | resolve(ctx.data);
348 | } catch (e) {
349 | reject(e);
350 | }
351 | });
352 | });
353 |
354 | req.on('error', reject);
355 | req.end();
356 | });
357 | }
358 | }
359 |
360 | function getCoordinate(c) {
361 | function string10to64(d) {
362 | var c = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-~".split("")
363 | , b = c.length
364 | , e = +d
365 | , a = [];
366 | do {
367 | mod = e % b;
368 | e = (e - mod) / b;
369 | a.unshift(c[mod])
370 | } while (e);
371 | return a.join("")
372 | }
373 |
374 | function prefixInteger(a, b) {
375 | return (Array(b).join(0) + a).slice(-b)
376 | }
377 |
378 | function pretreatment(d, c, b) {
379 | var e = string10to64(Math.abs(d));
380 | var a = "";
381 | if (!b) {
382 | a += (d > 0 ? "1" : "0")
383 | }
384 | a += prefixInteger(e, c);
385 | return a
386 | }
387 |
388 | var b = new Array();
389 | for (var e = 0; e < c.length; e++) {
390 | if (e == 0) {
391 | b.push(pretreatment(c[e][0] < 262143 ? c[e][0] : 262143, 3, true));
392 | b.push(pretreatment(c[e][1] < 16777215 ? c[e][1] : 16777215, 4, true));
393 | b.push(pretreatment(c[e][2] < 4398046511103 ? c[e][2] : 4398046511103, 7, true))
394 | } else {
395 | var a = c[e][0] - c[e - 1][0];
396 | var f = c[e][1] - c[e - 1][1];
397 | var d = c[e][2] - c[e - 1][2];
398 | b.push(pretreatment(a < 4095 ? a : 4095, 2, false));
399 | b.push(pretreatment(f < 4095 ? f : 4095, 2, false));
400 | b.push(pretreatment(d < 16777215 ? d : 16777215, 4, true))
401 | }
402 | }
403 | return b.join("")
404 | }
405 |
406 | const HZ = 20;
407 |
408 | class MousePosFaker {
409 | constructor(puzzleX) {
410 | this.x = parseInt(Math.random() * 20 + 20, 10);
411 | this.y = parseInt(Math.random() * 80 + 80, 10);
412 | this.t = Date.now();
413 | this.pos = [[this.x, this.y, this.t]];
414 | this.minDuration = parseInt(1000 / HZ, 10);
415 | // this.puzzleX = puzzleX;
416 | this.puzzleX = puzzleX + parseInt(Math.random() * 2 - 1, 10);
417 |
418 | this.STEP = parseInt(Math.random() * 6 + 5, 10);
419 | this.DURATION = parseInt(Math.random() * 7 + 14, 10) * 100;
420 | // [9,1600] [10,1400]
421 | this.STEP = 9;
422 | // this.DURATION = 2000;
423 | // console.log(this.STEP, this.DURATION);
424 | }
425 |
426 | run() {
427 | const perX = this.puzzleX / this.STEP;
428 | const perDuration = this.DURATION / this.STEP;
429 | const firstPos = [this.x - parseInt(Math.random() * 6, 10), this.y + parseInt(Math.random() * 11, 10), this.t];
430 |
431 | this.pos.unshift(firstPos);
432 | this.stepPos(perX, perDuration);
433 | this.fixPos();
434 |
435 | const reactTime = parseInt(60 + Math.random() * 100, 10);
436 | const lastIdx = this.pos.length - 1;
437 | const lastPos = [this.pos[lastIdx][0], this.pos[lastIdx][1], this.pos[lastIdx][2] + reactTime];
438 |
439 | this.pos.push(lastPos);
440 | return this.pos;
441 | }
442 |
443 | stepPos(x, duration) {
444 | let n = 0;
445 | const sqrt2 = Math.sqrt(2);
446 | for (let i = 1; i <= this.STEP; i++) {
447 | n += 1 / i;
448 | }
449 | for (let i = 0; i < this.STEP; i++) {
450 | x = this.puzzleX / (n * (i + 1));
451 | const currX = parseInt((Math.random() * 30 - 15) + x, 10);
452 | const currY = parseInt(Math.random() * 7 - 3, 10);
453 | const currDuration = parseInt((Math.random() * 0.4 + 0.8) * duration, 10);
454 |
455 | this.moveToAndCollect({
456 | x: currX,
457 | y: currY,
458 | duration: currDuration,
459 | });
460 | }
461 | }
462 |
463 | fixPos() {
464 | const actualX = this.pos[this.pos.length - 1][0] - this.pos[1][0];
465 | const deviation = this.puzzleX - actualX;
466 |
467 | if (Math.abs(deviation) > 4) {
468 | this.moveToAndCollect({
469 | x: deviation,
470 | y: parseInt(Math.random() * 8 - 3, 10),
471 | duration: 250,
472 | });
473 | }
474 | }
475 |
476 | moveToAndCollect({x, y, duration}) {
477 | let movedX = 0;
478 | let movedY = 0;
479 | let movedT = 0;
480 | const times = duration / this.minDuration;
481 | let perX = x / times;
482 | let perY = y / times;
483 | let padDuration = 0;
484 |
485 | if (Math.abs(perX) < 1) {
486 | padDuration = duration / Math.abs(x) - this.minDuration;
487 | perX = 1;
488 | perY = y / Math.abs(x);
489 | }
490 |
491 | while (Math.abs(movedX) < Math.abs(x)) {
492 | const rDuration = parseInt(padDuration + Math.random() * 16 - 4, 10);
493 |
494 | movedX += perX + Math.random() * 2 - 1;
495 | movedY += perY;
496 | movedT += this.minDuration + rDuration;
497 |
498 | const currX = parseInt(this.x + movedX, 10);
499 | const currY = parseInt(this.y + movedY, 10);
500 | const currT = this.t + movedT;
501 |
502 | this.pos.push([currX, currY, currT]);
503 | }
504 |
505 | this.x += x;
506 | this.y += y;
507 | this.t += Math.max(duration, movedT);
508 | }
509 | }
510 |
511 | function injectToRequest(fn,scene = 'cww', ua = '') {
512 | if(ua) UA = ua
513 | return (opts, cb) => {
514 | fn(opts, async (err, resp, data) => {
515 | if (err) {
516 | console.error(JSON.stringify(err));
517 | return;
518 | }
519 | if (data.search('验证') > -1) {
520 | console.log('JDJR验证中......');
521 | let arr = opts.url.split("&")
522 | let eid = ''
523 | for(let i of arr){
524 | if(i.indexOf("eid=")>-1){
525 | eid = i.split("=") && i.split("=")[1] || ''
526 | }
527 | }
528 | const res = await new JDJRValidator().run(scene, eid);
529 |
530 | opts.url += `&validate=${res.validate}`;
531 | fn(opts, cb);
532 | } else {
533 | cb(err, resp, data);
534 | }
535 | });
536 | };
537 | }
538 |
539 | exports.injectToRequest = injectToRequest;
--------------------------------------------------------------------------------
/function/cache/index.js:
--------------------------------------------------------------------------------
1 | var version_='jsjiami.com.v7';const II1lli=iii1II;function iii1II(_0x354836,_0x2024fe){const _0x4f858b=Iii11l();return iii1II=function(_0x1c5838,_0x42d6e2){_0x1c5838=_0x1c5838-0x17f;let _0x15bc2d=_0x4f858b[_0x1c5838];if(iii1II['WpYZPZ']===undefined){var _0x268d9b=function(_0x351083){const _0x537ef9='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x3e9ed3='',_0x12cef8='';for(let _0x4629b1=0x0,_0x4651eb,_0x1b0c2d,_0x210db3=0x0;_0x1b0c2d=_0x351083['charAt'](_0x210db3++);~_0x1b0c2d&&(_0x4651eb=_0x4629b1%0x4?_0x4651eb*0x40+_0x1b0c2d:_0x1b0c2d,_0x4629b1++%0x4)?_0x3e9ed3+=String['fromCharCode'](0xff&_0x4651eb>>(-0x2*_0x4629b1&0x6)):0x0){_0x1b0c2d=_0x537ef9['indexOf'](_0x1b0c2d);}for(let _0x1ae192=0x0,_0x314d3b=_0x3e9ed3['length'];_0x1ae192<_0x314d3b;_0x1ae192++){_0x12cef8+='%'+('00'+_0x3e9ed3['charCodeAt'](_0x1ae192)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x12cef8);};const _0x1fcdc8=function(_0x24fac8,_0x5a8acd){let _0x593fd2=[],_0x1a148c=0x0,_0x296725,_0x466baa='';_0x24fac8=_0x268d9b(_0x24fac8);let _0x4247af;for(_0x4247af=0x0;_0x4247af<0x100;_0x4247af++){_0x593fd2[_0x4247af]=_0x4247af;}for(_0x4247af=0x0;_0x4247af<0x100;_0x4247af++){_0x1a148c=(_0x1a148c+_0x593fd2[_0x4247af]+_0x5a8acd['charCodeAt'](_0x4247af%_0x5a8acd['length']))%0x100,_0x296725=_0x593fd2[_0x4247af],_0x593fd2[_0x4247af]=_0x593fd2[_0x1a148c],_0x593fd2[_0x1a148c]=_0x296725;}_0x4247af=0x0,_0x1a148c=0x0;for(let _0x299a4e=0x0;_0x299a4e<_0x24fac8['length'];_0x299a4e++){_0x4247af=(_0x4247af+0x1)%0x100,_0x1a148c=(_0x1a148c+_0x593fd2[_0x4247af])%0x100,_0x296725=_0x593fd2[_0x4247af],_0x593fd2[_0x4247af]=_0x593fd2[_0x1a148c],_0x593fd2[_0x1a148c]=_0x296725,_0x466baa+=String['fromCharCode'](_0x24fac8['charCodeAt'](_0x299a4e)^_0x593fd2[(_0x593fd2[_0x4247af]+_0x593fd2[_0x1a148c])%0x100]);}return _0x466baa;};iii1II['JPuIrT']=_0x1fcdc8,_0x354836=arguments,iii1II['WpYZPZ']=!![];}const _0xb6e53a=_0x4f858b[0x0],_0x54960e=_0x1c5838+_0xb6e53a,_0x17b01e=_0x354836[_0x54960e];return!_0x17b01e?(iii1II['XgaxWq']===undefined&&(iii1II['XgaxWq']=!![]),_0x15bc2d=iii1II['JPuIrT'](_0x15bc2d,_0x42d6e2),_0x354836[_0x54960e]=_0x15bc2d):_0x15bc2d=_0x17b01e,_0x15bc2d;},iii1II(_0x354836,_0x2024fe);}(function(IiI1,liI,illIli,l11i1l,lIII11,IiilI,ii1I11){return IiI1=IiI1>>0x5,IiilI='hs',ii1I11='hs',function(liIi1,lI11II,l1llI1,llIIll,IillIi){const II1lll=iii1II;llIIll='tfi',IiilI=llIIll+IiilI,IillIi='up',ii1I11+=IillIi,IiilI=l1llI1(IiilI),ii1I11=l1llI1(ii1I11),l1llI1=0x0;const lii=liIi1();while(!![]&&--l11i1l+lI11II){try{llIIll=parseInt(II1lll(0x1ab,'lHMB'))/0x1+parseInt(II1lll(0x1a9,'o]eN'))/0x2+-parseInt(II1lll(0x1a2,'VTjE'))/0x3*(-parseInt(II1lll(0x1b1,'@fD!'))/0x4)+parseInt(II1lll(0x1c7,'ypMa'))/0x5+-parseInt(II1lll(0x1be,'CeB2'))/0x6+parseInt(II1lll(0x182,'sr!D'))/0x7*(-parseInt(II1lll(0x197,'#AMY'))/0x8)+-parseInt(II1lll(0x1a8,'MoBi'))/0x9*(parseInt(II1lll(0x1b3,'lHMB'))/0xa);}catch(IllI1i){llIIll=l1llI1;}finally{IillIi=lii[IiilI]();if(IiI1<=l11i1l)l1llI1?lIII11?llIIll=IillIi:lIII11=IillIi:l1llI1=IillIi;else{if(l1llI1==lIII11['replace'](/[wYkCIHgKtfxLVqdOAyb=]/g,'')){if(llIIll===lI11II){lii['un'+IiilI](IillIi);break;}lii[ii1I11](IillIi);}}}}}(illIli,liI,function(i11I1l,lil,IllI1l,i11I1i,IillIl,llliil,liIl1){return lil='\x73\x70\x6c\x69\x74',i11I1l=arguments[0x0],i11I1l=i11I1l[lil](''),IllI1l=`\x72\x65\x76\x65\x72\x73\x65`,i11I1l=i11I1l[IllI1l]('\x76'),i11I1i=`\x6a\x6f\x69\x6e`,(0x14787d,i11I1l[i11I1i](''));});}(0x1940,0xf11a7,Iii11l,0xcc),Iii11l)&&(version_=II1lli(0x187,'xcy4'));let IllIII=require('ds');try{IllIII['toString']()===II1lli(0x188,'*!qA')&&(IllIII=IllIII['DS']);}catch{}function ii1li(IIll1=0x0,ll1il=null){const ii1I1I=II1lli,IiiIiI={'hiRlh':function(Illl1I,lliiiI){return Illl1I===lliiiI;},'wuhor':'kiVkS','XbuhZ':function(lilil,ll1ll){return lilil==ll1ll;},'LZNVn':function(Illl11,ii1lI){return Illl11 setTimeout(e, t))
49 | }
50 | setOptions(params) {
51 | this.options = params;
52 | }
53 | setCookie(cookie) {
54 | this.options.headers.cookie = cookie
55 | }
56 | jsonParse(str) {
57 | try {
58 | return JSON.parse(str);
59 | } catch (e) {
60 | try {
61 | let data = this.match([/try\s*\{\w+\s*\(([^\)]+)/, /\w+\s*\(([^\)]+)/], str)
62 | return JSON.parse(data);
63 | } catch (ee) {
64 | try {
65 | let cb = this.match(/try\s*\{\s*(\w+)/, str)
66 | if (cb) {
67 | let func = "";
68 | let data = str.replace(cb, `func=`)
69 | eval(data);
70 | return func
71 | }
72 | } catch (eee) {
73 | return str
74 | }
75 | }
76 | }
77 | }
78 | curl(params, extra = '') {
79 | if (typeof(params) != 'object') {
80 | params = {
81 | 'url': params
82 | }
83 | }
84 | params = Object.assign({ ...this.options
85 | }, params);
86 | params.method = params.body ? 'POST' : 'GET';
87 | if (params.hasOwnProperty('cookie')) {
88 | params.headers.cookie = params.cookie
89 | }
90 | if (params.hasOwnProperty('ua') || params.hasOwnProperty('useragent')) {
91 | params.headers['user-agent'] = params.ua
92 | }
93 | if (params.hasOwnProperty('referer')) {
94 | params.headers.referer = params.referer
95 | }
96 | if (params.hasOwnProperty('params')) {
97 | params.url += '?' + qs.stringify(params.params)
98 | }
99 | if (params.hasOwnProperty('form')) {
100 | params.method = 'POST'
101 | }
102 | return new Promise(resolve => {
103 | request(params, async (err, resp, data) => {
104 | try {
105 | if (params.console) {
106 | console.log(data)
107 | }
108 | this.source = this.jsonParse(data);
109 | if (extra) {
110 | this[extra] = this.source
111 | }
112 | } catch (e) {
113 | console.log(e, resp)
114 | } finally {
115 | resolve(data);
116 | }
117 | })
118 | })
119 | }
120 | dumps(dict) {
121 | return JSON.stringify(dict)
122 | }
123 | loads(str) {
124 | return JSON.parse(str)
125 | }
126 | notice(msg) {
127 | this.message.push({
128 | 'index': this.index,
129 | 'user': this.user,
130 | 'msg': msg
131 | })
132 | }
133 | notices(msg, user, index = '') {
134 | this.message.push({
135 | 'user': user,
136 | 'msg': msg,
137 | 'index': index
138 | })
139 | }
140 | urlparse(url) {
141 | return urls.parse(url, true, true)
142 | }
143 | md5(encryptString) {
144 | return CryptoJS.MD5(encryptString).toString()
145 | }
146 | haskey(data, key, value) {
147 | value = typeof value !== 'undefined' ? value : '';
148 | var spl = key.split('.');
149 | for (var i of spl) {
150 | i = !isNaN(i) ? parseInt(i) : i;
151 | try {
152 | data = data[i];
153 | } catch (error) {
154 | return '';
155 | }
156 | }
157 | if (data == undefined) {
158 | return ''
159 | }
160 | if (value !== '') {
161 | return data === value ? true : false;
162 | } else {
163 | return data
164 | }
165 | }
166 | match(pattern, string) {
167 | pattern = (pattern instanceof Array) ? pattern : [pattern];
168 | for (let pat of pattern) {
169 | // var match = string.match(pat);
170 | var match = pat.exec(string)
171 | if (match) {
172 | var len = match.length;
173 | if (len == 1) {
174 | return match;
175 | } else if (len == 2) {
176 | return match[1];
177 | } else {
178 | var r = [];
179 | for (let i = 1; i < len; i++) {
180 | r.push(match[i])
181 | }
182 | return r;
183 | }
184 | break;
185 | }
186 | // console.log(pat.exec(string))
187 | }
188 | return '';
189 | }
190 | matchall(pattern, string) {
191 | pattern = (pattern instanceof Array) ? pattern : [pattern];
192 | var match;
193 | var result = [];
194 | for (var pat of pattern) {
195 | while ((match = pat.exec(string)) != null) {
196 | var len = match.length;
197 | if (len == 1) {
198 | result.push(match);
199 | } else if (len == 2) {
200 | result.push(match[1]);
201 | } else {
202 | var r = [];
203 | for (let i = 1; i < len; i++) {
204 | r.push(match[i])
205 | }
206 | result.push(r);
207 | }
208 | }
209 | }
210 | return result;
211 | }
212 | compare(property) {
213 | return function(a, b) {
214 | var value1 = a[property];
215 | var value2 = b[property];
216 | return value1 - value2;
217 | }
218 | }
219 | filename(file, rename = '') {
220 | if (!this.runfile) {
221 | this.runfile = path.basename(file).replace(".js", '').replace(/-/g, '_')
222 | }
223 | if (rename) {
224 | rename = `_${rename}`;
225 | }
226 | return path.basename(file).replace(".js", rename).replace(/-/g, '_');
227 | }
228 | rand(n, m) {
229 | var random = Math.floor(Math.random() * (m - n + 1) + n);
230 | return random;
231 | }
232 | random(arr, num) {
233 | var temp_array = new Array();
234 | for (var index in arr) {
235 | temp_array.push(arr[index]);
236 | }
237 | var return_array = new Array();
238 | for (var i = 0; i < num; i++) {
239 | if (temp_array.length > 0) {
240 | var arrIndex = Math.floor(Math.random() * temp_array.length);
241 | return_array[i] = temp_array[arrIndex];
242 | temp_array.splice(arrIndex, 1);
243 | } else {
244 | break;
245 | }
246 | }
247 | return return_array;
248 | }
249 | compact(lists, keys) {
250 | let array = {};
251 | for (let i of keys) {
252 | if (lists[i]) {
253 | array[i] = lists[i];
254 | }
255 | }
256 | return array;
257 | }
258 | unique(arr) {
259 | return Array.from(new Set(arr));
260 | }
261 | end(args) {
262 | return args[args.length - 1]
263 | }
264 | }
265 | module.exports = {
266 | env,
267 | eval: mainEval,
268 | assert,
269 | jxAlgo,
270 | }
271 |
--------------------------------------------------------------------------------
/function/config.js:
--------------------------------------------------------------------------------
1 | module.exports = {"ThreadJs":[],"invokeKey":"RtKLB8euDo7KwsO0"}
--------------------------------------------------------------------------------
/function/eval.js:
--------------------------------------------------------------------------------
1 | function mainEval($) {
2 | return `
3 | !(async () => {
4 | jdcookie = process.env.JD_COOKIE ? process.env.JD_COOKIE.split("&") : require("./function/jdcookie").cookie;
5 | cookies={
6 | 'all':jdcookie,
7 | 'help': typeof(help) != 'undefined' ? [...jdcookie].splice(0,parseInt(help)):[]
8 | }
9 | $.sleep=cookies['all'].length * 500
10 | taskCookie=cookies['all']
11 | jxAlgo = new common.jxAlgo();
12 | if ($.readme) {
13 | console.log(\`使用说明:\\n\${$.readme}\\n以上内容仅供参考,有需求自行添加\\n\`,)
14 | }
15 | console.log(\`======================本次任务共\${taskCookie.length}个京东账户Cookie======================\\n\`)
16 | try{
17 | await prepare();
18 |
19 | if ($.sharecode.length > 0) {
20 | $.sharecode = $.sharecode.filter(d=>d && JSON.stringify(d)!='{}')
21 | console.log('助力码', $.sharecode )
22 | }
23 | }catch(e1){console.log("初始函数不存在,将继续执行主函数Main\\n")}
24 | if (typeof(main) != 'undefined') {
25 | try{
26 | for (let i = 0; i < taskCookie.filter(d => d).length; i++) {
27 | $.cookie = taskCookie[i];
28 | $.user = decodeURIComponent($.cookie.match(/pt_pin=([^;]+)/)[1])
29 | $.index = parseInt(i) + 1;
30 | let info = {
31 | 'index': $.index,
32 | 'user': $.user,
33 | 'cookie': $.cookie
34 | }
35 | if (!$.thread) {
36 | console.log(\`\n******开始【京东账号\${$.index}】\${$.user} 任务*********\n\`);
37 | }
38 | if ($.config[\`\${$.runfile}_except\`] && $.config[\`\${$.runfile}_except\`].includes(\$.user)) {
39 | console.log(\`全局变量\${$.runfile}_except中配置了该账号pt_pin,跳过此次任务\`)
40 | }else{
41 | $.setCookie($.cookie)
42 | try{
43 | if ($.sharecode.length > 0) {
44 | for (let smp of $.sharecode) {
45 | smp = Object.assign({ ...info}, smp);
46 | $.thread ? main(smp) : await main(smp);
47 | }
48 | }else{
49 | $.thread ? main(info) : await main(info);
50 | }
51 | }
52 | catch(em){
53 | console.log(em.message)
54 | }
55 | }
56 |
57 |
58 | }
59 | }catch(em){console.log(em.message)}
60 | if ($.thread) {
61 | await $.wait($.sleep)
62 | }
63 | }
64 | if (typeof(extra) != 'undefined') {
65 | console.log(\`============================开始运行额外任务============================\`)
66 | try{
67 | await extra();
68 | }catch(e4){console.log(e4.message)}
69 | }
70 | })().catch((e) => {
71 | console.log(e.message)
72 | }).finally(() => {
73 | if ($.message.length > 0) {
74 | $.notify($.message)
75 | }
76 | $.done();
77 | });
78 |
79 | `
80 | }
81 | module.exports = {
82 | mainEval
83 | }
84 |
--------------------------------------------------------------------------------
/function/getH5st3_0.js:
--------------------------------------------------------------------------------
1 | var iil='jsjiami.com.v7';const lIIl11l1=IIii1IlI;(function(IiilIlil,llIi1iii,lIIiiIil,ll1IiiII,illIli1l,l1liIliI,iI1li1I){return IiilIlil=IiilIlil>>0x8,l1liIliI='hs',iI1li1I='hs',function(lliii1I,liIIillI,lIl1i1li,iI1i1iIl,I1IIIlll){const i1lIll1i=IIii1IlI;iI1i1iIl='tfi',l1liIliI=iI1i1iIl+l1liIliI,I1IIIlll='up',iI1li1I+=I1IIIlll,l1liIliI=lIl1i1li(l1liIliI),iI1li1I=lIl1i1li(iI1li1I),lIl1i1li=0x0;const ii1iII1l=lliii1I();while(!![]&&--ll1IiiII+liIIillI){try{iI1i1iIl=parseInt(i1lIll1i(0xb2,'5C4['))/0x1+parseInt(i1lIll1i(0xb4,'UgCK'))/0x2+-parseInt(i1lIll1i(0xa0,'Mtzj'))/0x3*(parseInt(i1lIll1i(0xa6,'Kx83'))/0x4)+parseInt(i1lIll1i(0xb0,'MU[H'))/0x5*(parseInt(i1lIll1i(0xae,'rJx$'))/0x6)+parseInt(i1lIll1i(0xa1,'A#cN'))/0x7*(parseInt(i1lIll1i(0xac,'Elur'))/0x8)+parseInt(i1lIll1i(0xad,'Ud90'))/0x9+-parseInt(i1lIll1i(0xa9,')SXP'))/0xa;}catch(II1liIl1){iI1i1iIl=lIl1i1li;}finally{I1IIIlll=ii1iII1l[l1liIliI]();if(IiilIlil<=ll1IiiII)lIl1i1li?illIli1l?iI1i1iIl=I1IIIlll:illIli1l=I1IIIlll:lIl1i1li=I1IIIlll;else{if(lIl1i1li==illIli1l['replace'](/[UKJAISyMDurRdTQqCEWV=]/g,'')){if(iI1i1iIl===liIIillI){ii1iII1l['un'+l1liIliI](I1IIIlll);break;}ii1iII1l[iI1li1I](I1IIIlll);}}}}}(lIIiiIil,llIi1iii,function(IiIli1lI,ilII1l,IIIIil1,IIIi111i,l1III1Il,l1iiIII,IiiliIl){return ilII1l='\x73\x70\x6c\x69\x74',IiIli1lI=arguments[0x0],IiIli1lI=IiIli1lI[ilII1l](''),IIIIil1=`\x72\x65\x76\x65\x72\x73\x65`,IiIli1lI=IiIli1lI[IIIIil1]('\x76'),IIIi111i=`\x6a\x6f\x69\x6e`,(0x15b906,IiIli1lI[IIIi111i](''));});}(0xbe00,0x4f0f2,iIIIlil1,0xc0),iIIIlil1)&&(iil=0x230e);function IIii1IlI(_0x1ec280,_0x300e6e){const _0x5c54c9=iIIIlil1();return IIii1IlI=function(_0x725f54,_0x41e333){_0x725f54=_0x725f54-0x9c;let _0x1fc311=_0x5c54c9[_0x725f54];if(IIii1IlI['YUFSvd']===undefined){var _0x5a0984=function(_0x50c1b0){const _0x19ff44='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2f2a33='',_0x3542ef='';for(let _0x12300f=0x0,_0x51fe7d,_0x5b7af0,_0x4ee540=0x0;_0x5b7af0=_0x50c1b0['charAt'](_0x4ee540++);~_0x5b7af0&&(_0x51fe7d=_0x12300f%0x4?_0x51fe7d*0x40+_0x5b7af0:_0x5b7af0,_0x12300f++%0x4)?_0x2f2a33+=String['fromCharCode'](0xff&_0x51fe7d>>(-0x2*_0x12300f&0x6)):0x0){_0x5b7af0=_0x19ff44['indexOf'](_0x5b7af0);}for(let _0x15def8=0x0,_0x7998fd=_0x2f2a33['length'];_0x15def8<_0x7998fd;_0x15def8++){_0x3542ef+='%'+('00'+_0x2f2a33['charCodeAt'](_0x15def8)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x3542ef);};const _0x2907f7=function(_0xda0c54,_0x28f503){let _0x14a5ba=[],_0x17b980=0x0,_0x43a8c6,_0x4d4762='';_0xda0c54=_0x5a0984(_0xda0c54);let _0x23c696;for(_0x23c696=0x0;_0x23c696<0x100;_0x23c696++){_0x14a5ba[_0x23c696]=_0x23c696;}for(_0x23c696=0x0;_0x23c696<0x100;_0x23c696++){_0x17b980=(_0x17b980+_0x14a5ba[_0x23c696]+_0x28f503['charCodeAt'](_0x23c696%_0x28f503['length']))%0x100,_0x43a8c6=_0x14a5ba[_0x23c696],_0x14a5ba[_0x23c696]=_0x14a5ba[_0x17b980],_0x14a5ba[_0x17b980]=_0x43a8c6;}_0x23c696=0x0,_0x17b980=0x0;for(let _0x3711a3=0x0;_0x3711a3<_0xda0c54['length'];_0x3711a3++){_0x23c696=(_0x23c696+0x1)%0x100,_0x17b980=(_0x17b980+_0x14a5ba[_0x23c696])%0x100,_0x43a8c6=_0x14a5ba[_0x23c696],_0x14a5ba[_0x23c696]=_0x14a5ba[_0x17b980],_0x14a5ba[_0x17b980]=_0x43a8c6,_0x4d4762+=String['fromCharCode'](_0xda0c54['charCodeAt'](_0x3711a3)^_0x14a5ba[(_0x14a5ba[_0x23c696]+_0x14a5ba[_0x17b980])%0x100]);}return _0x4d4762;};IIii1IlI['vnCAfj']=_0x2907f7,_0x1ec280=arguments,IIii1IlI['YUFSvd']=!![];}const _0x3baa53=_0x5c54c9[0x0],_0x17bc77=_0x725f54+_0x3baa53,_0x490163=_0x1ec280[_0x17bc77];return!_0x490163?(IIii1IlI['bnDExB']===undefined&&(IIii1IlI['bnDExB']=!![]),_0x1fc311=IIii1IlI['vnCAfj'](_0x1fc311,_0x41e333),_0x1ec280[_0x17bc77]=_0x1fc311):_0x1fc311=_0x490163,_0x1fc311;},IIii1IlI(_0x1ec280,_0x300e6e);}function iIIIlil1(){const iIilli11=(function(){return[...[iil,'RUKjrsjViDaCdmSiAd.qcQMouCumIqD.TvJ7WJEy==','FmopWRZcKSkxsde','WPi9qve8jCoazLxdPq','WPNdN8kjW4lcJ8kHW4etWQhcN8kfcGy','WPhcQaNcJ1RcQGe','rxldIG','WPNdMmkmW4tcISkLWPajWQNcP8kxaG','gq7cNtFdTSk8WRS+WQekmmoYW7u','qq0+W6W'],...(function(){return[...['WPNdNmkjW4FcISolWOWjWPpcS8kO','mG7cLXOGeqm','W58ZWPXVo8oonv8gW7f7W7RcOG','WQeTW6hdOSozWPxdJ39UWPdcLa','eSk7W4hcMbVcGaG','AmkkW7GowSozWR0yW5a','xez/W4yhnG','W75GWPpdM2ZcS8oGmNxdMMX2','xafwbeRcUJ1RWRxdO8oBWOlcKa','W7m9W77dHSo3zZZcQmk8pXPW'],...(function(){return['dam8WP1sBxT9pSkbfmk8wG','WP3cS8kuwCkmpCkx','FSk/W7ddSSkhWRdcMG','W43dJCorW5dcNCohW4D1na','WPBdTNBcICowBCkvWRxcUfm2xq','bWVdRZZcQh9PFtaYnmkctW','oSkmvMBcRCktWQP9fxCudW'];}())];}())];}());iIIIlil1=function(){return iIilli11;};return iIIIlil1();};const {H5st}=require(lIIl11l1(0xa4,'wwG^'));async function getH5st(iIiIl1i1,iIIIi111,Il1l1ili=lIIl11l1(0xa7,'J*Zq')){const iIIi1i11=lIIl11l1,l11lilI=Object[iIIi1i11(0xb1,'edxX')]({'appId':iIiIl1i1,'version':Il1l1ili},iIIIi111),l1lllil1=await H5st[iIIi1i11(0x9e,'Nkmp')](l11lilI);return l1lllil1?.[iIIi1i11(0xaa,'FHZ3')];}module[lIIl11l1(0xaf,'8byO')]=getH5st;var version_ = 'jsjiami.com.v7';
--------------------------------------------------------------------------------
/function/jdcookie.js:
--------------------------------------------------------------------------------
1 | /*
2 | 此文件为Node.js专用。其他用户请忽略
3 | */
4 | //此处填写京东账号cookie。
5 | let CookieJDs = [
6 | '',//账号一ck,例:pt_key=XXX;pt_pin=XXX;
7 | '',//账号二ck,例:pt_key=XXX;pt_pin=XXX;如有更多,依次类推
8 | ]
9 | // 判断环境变量里面是否有京东ck
10 | if (process.env.JD_COOKIE) {
11 | if (process.env.JD_COOKIE.indexOf('&') > -1) {
12 | CookieJDs = process.env.JD_COOKIE.split('&');
13 | } else if (process.env.JD_COOKIE.indexOf('\n') > -1) {
14 | CookieJDs = process.env.JD_COOKIE.split('\n');
15 | } else {
16 | CookieJDs = [process.env.JD_COOKIE];
17 | }
18 | }
19 | if (JSON.stringify(process.env).indexOf('GITHUB')>-1) {
20 | console.log(`请勿使用github action运行此脚本,无论你是从你自己的私库还是其他哪里拉取的源代码,都会导致我被封号\n`);
21 | !(async () => {
22 | await require('./sendNotify').sendNotify('提醒', `请勿使用github action、滥用github资源会封我仓库以及账号`)
23 | await process.exit(0);
24 | })()
25 | }
26 | CookieJDs = [...new Set(CookieJDs.filter(item => !!item))]
27 | console.log(`\n====================共${CookieJDs.length}个京东账号Cookie=================\n`);
28 | console.log(`============脚本执行时间:${new Date(new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000).toLocaleString('chinese',{hour12:false})}=============\n`)
29 | if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {};
30 | for (let i = 0; i < CookieJDs.length; i++) {
31 | if (!CookieJDs[i].match(/pt_pin=(.+?);/) || !CookieJDs[i].match(/pt_key=(.+?);/)) console.log(`\n提示:京东cookie 【${CookieJDs[i]}】填写不规范,可能会影响部分脚本正常使用。正确格式为: pt_key=xxx;pt_pin=xxx;(分号;不可少)\n`);
32 | const index = (i + 1 === 1) ? '' : (i + 1);
33 | exports['CookieJD' + index] = CookieJDs[i].trim();
34 | }
35 | console.log('>>>>>>>>>>>>>>6Dylan6 提示:任务正常运行中>>>>>>>>>>>>>>>\n')
--------------------------------------------------------------------------------
/function/jxAlgo.js:
--------------------------------------------------------------------------------
1 | let request = require("request");
2 | let CryptoJS = require('crypto-js');
3 | let qs = require("querystring");
4 | Date.prototype.Format = function(fmt) {
5 | var e,
6 | n = this,
7 | d = fmt,
8 | l = {
9 | "M+": n.getMonth() + 1,
10 | "d+": n.getDate(),
11 | "D+": n.getDate(),
12 | "h+": n.getHours(),
13 | "H+": n.getHours(),
14 | "m+": n.getMinutes(),
15 | "s+": n.getSeconds(),
16 | "w+": n.getDay(),
17 | "q+": Math.floor((n.getMonth() + 3) / 3),
18 | "S+": n.getMilliseconds()
19 | };
20 | /(y+)/i.test(d) && (d = d.replace(RegExp.$1, "".concat(n.getFullYear()).substr(4 - RegExp.$1.length)));
21 | for (var k in l) {
22 | if (new RegExp("(".concat(k, ")")).test(d)) {
23 | var t, a = "S+" === k ? "000" : "00";
24 | d = d.replace(RegExp.$1, 1 == RegExp.$1.length ? l[k] : ("".concat(a) + l[k]).substr("".concat(l[k]).length))
25 | }
26 | }
27 | return d;
28 | }
29 |
30 | function generateFp() {
31 | let e = "0123456789";
32 | let a = 13;
33 | let i = '';
34 | for (; a--;) i += e[Math.random() * e.length | 0];
35 | return (i + Date.now()).slice(0, 16)
36 | }
37 |
38 | function getUrlData(url, name) {
39 | if (typeof URL !== "undefined") {
40 | let urls = new URL(url);
41 | let data = urls.searchParams.get(name);
42 | return data ? data : '';
43 | } else {
44 | const query = url.match(/\?.*/)[0].substring(1)
45 | const vars = query.split('&')
46 | for (let i = 0; i < vars.length; i++) {
47 | const pair = vars[i].split('=')
48 | if (pair[0] === name) {
49 | return vars[i].substr(vars[i].indexOf('=') + 1);
50 | }
51 | }
52 | return ''
53 | }
54 | }
55 | class jxAlgo {
56 | constructor(params = {}) {
57 | this.appId = 10001
58 | this.result = {}
59 | this.timestamp = Date.now();
60 | for (let i in params) {
61 | this[i] = params[i]
62 | }
63 | }
64 | set(params = {}) {
65 | for (let i in params) {
66 | this[i] = params[i]
67 | }
68 | }
69 | get(key) {
70 | return this[key]
71 | }
72 | async dec(url) {
73 | if (!this.tk) {
74 | this.fingerprint = generateFp();
75 | await this.requestAlgo()
76 | }
77 | let obj = qs.parse(url.split("?")[1]);
78 | let stk = obj['_stk'];
79 | return this.h5st(this.timestamp, stk, url)
80 | }
81 | h5st(time, stk, url) {
82 | stk = stk || (url ? getUrlData(url, '_stk') : '')
83 | const timestamp = new Date(time).Format("yyyyMMddhhmmssSSS");
84 | let hash1 = this.enCryptMethodJD(this.tk, this.fingerprint.toString(), timestamp.toString(), this.appId.toString(), CryptoJS).toString(CryptoJS.enc.Hex);
85 | let st = '';
86 | stk.split(',').map((item, index) => {
87 | st += `${item}:${getUrlData(url, item)}${index === stk.split(',').length - 1 ? '' : '&'}`;
88 | })
89 | const hash2 = CryptoJS.HmacSHA256(st, hash1.toString()).toString(CryptoJS.enc.Hex);
90 | const enc = (["".concat(timestamp.toString()), "".concat(this.fingerprint.toString()), "".concat(this.appId.toString()), "".concat(this.tk), "".concat(hash2)].join(";"))
91 | this.result['fingerprint'] = this.fingerprint;
92 | this.result['timestamp'] = this.timestamp
93 | this.result['stk'] = stk;
94 | this.result['h5st'] = enc
95 | let sp = url.split("?");
96 | let obj = qs.parse(sp[1])
97 | if (obj.callback) {
98 | delete obj.callback
99 | }
100 | let params = Object.assign(obj, {
101 | '_time': this.timestamp,
102 | '_': this.timestamp,
103 | 'timestamp': this.timestamp,
104 | 'sceneval': 2,
105 | 'g_login_type': 1,
106 | 'h5st': enc,
107 | })
108 | this.result['url'] = `${sp[0]}?${qs.stringify(params)}`
109 | return this.result
110 | }
111 | token(user) {
112 | let nickname = user.includes('pt_pin') ? user.match(/pt_pin=([^;]+)/)[1] : user;
113 | let phoneId = this.createuuid(40, 'lc');
114 |
115 | let token = this.md5(decodeURIComponent(nickname) + this.timestamp + phoneId + 'tPOamqCuk9NLgVPAljUyIHcPRmKlVxDy');
116 | return {
117 | 'strPgtimestamp': this.timestamp,
118 | 'strPhoneID': phoneId,
119 | 'strPgUUNum': token
120 | }
121 | }
122 | md5(encryptString) {
123 | return CryptoJS.MD5(encryptString).toString()
124 | }
125 | createuuid(a, c) {
126 | switch (c) {
127 | case "a":
128 | c = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
129 | break;
130 | case "n":
131 | c = "0123456789";
132 | break;
133 | case "c":
134 | c = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
135 | break;
136 | case "l":
137 | c = "abcdefghijklmnopqrstuvwxyz";
138 | break;
139 | case 'cn':
140 | case 'nc':
141 | c = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
142 | break;
143 | case "lc":
144 | case "cl":
145 | c = "abcdefghijklmnopqrstuvwxyz0123456789";
146 | break;
147 | default:
148 | c = "0123456789abcdef"
149 | }
150 | var e = "";
151 | for (var g = 0; g < a; g++) e += c[Math.ceil(1E8 * Math.random()) % c.length];
152 | return e
153 | }
154 | async requestAlgo() {
155 | const options = {
156 | "url": `https://cactus.jd.com/request_algo?g_ty=ajax`,
157 | "headers": {
158 | 'Authority': 'cactus.jd.com',
159 | 'Pragma': 'no-cache',
160 | 'Cache-Control': 'no-cache',
161 | 'Accept': 'application/json',
162 | 'User-Agent': 'jdpingou;iPhone;4.9.4;12.4;ae49fae72d0a8976f5155267f56ec3a5b0da75c3;network/wifi;model/iPhone8,4;appBuild/100579;ADID/00000000-0000-0000-0000-000000000000;supportApplePay/1;hasUPPay/0;pushNoticeIsOpen/0;hasOCPay/0;supportBestPay/0;session/1;pap/JA2019_3111789;brand/apple;supportJDSHWK/1;Mozilla/5.0 (iPhone; CPU iPhone OS 14_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148',
163 | 'Content-Type': 'application/json',
164 | 'Origin': 'https://st.jingxi.com',
165 | 'Sec-Fetch-Site': 'cross-site',
166 | 'Sec-Fetch-Mode': 'cors',
167 | 'Sec-Fetch-Dest': 'empty',
168 | 'Referer': 'https://st.jingxi.com/pingou/dream_factory/index.html?ptag=7155.9.4',
169 | 'Accept-Language': 'zh-CN,zh;q=0.9,zh-TW;q=0.8,en;q=0.7'
170 | },
171 | 'body': JSON.stringify({
172 | "version": "1.0",
173 | "fp": this.fingerprint,
174 | "appId": this.appId.toString(),
175 | "timestamp": this.timestamp,
176 | "platform": "web",
177 | "expandParams": ""
178 | })
179 | }
180 | return new Promise(async resolve => {
181 | request.post(options, (err, resp, data) => {
182 | try {
183 | if (data) {
184 | data = JSON.parse(data);
185 | if (data['status'] === 200) {
186 | let result = data.data.result
187 | this.tk = result.tk;
188 | let enCryptMethodJDString = result.algo;
189 | if (enCryptMethodJDString) {
190 | this.enCryptMethodJD = new Function(`return ${enCryptMethodJDString}`)();
191 | }
192 | this.result = result
193 | }
194 | }
195 | } catch (e) {
196 | console.log(e)
197 | } finally {
198 | resolve(this.result);
199 | }
200 | })
201 | })
202 | }
203 | }
204 | module.exports = jxAlgo
205 |
--------------------------------------------------------------------------------
/function/krgetSign.js:
--------------------------------------------------------------------------------
1 | /*
2 | new Env('getSign');
3 | */
4 |
5 | var version_='jsjiami.com.v7';const il1Ii1Ii=l11IiIIi;(function(ilI1lIi,iI1lllIi,lIII1ii1,lillIill,IiiIlll1,lllIIii,I1i1iIII){return ilI1lIi=ilI1lIi>>0x3,lllIIii='hs',I1i1iIII='hs',function(iI1ill1i,IliIIIl1,ilil1I1I,iIIIIIl1,iIiI1i1I){const li11iI1I=l11IiIIi;iIIIIIl1='tfi',lllIIii=iIIIIIl1+lllIIii,iIiI1i1I='up',I1i1iIII+=iIiI1i1I,lllIIii=ilil1I1I(lllIIii),I1i1iIII=ilil1I1I(I1i1iIII),ilil1I1I=0x0;const II1IlIlI=iI1ill1i();while(!![]&&--lillIill+IliIIIl1){try{iIIIIIl1=parseInt(li11iI1I(0x12a,'FBbs'))/0x1+-parseInt(li11iI1I(0x137,'LB!5'))/0x2+parseInt(li11iI1I(0x142,'ZDIe'))/0x3*(-parseInt(li11iI1I(0x11b,'GHKI'))/0x4)+parseInt(li11iI1I(0x146,'7RwX'))/0x5*(parseInt(li11iI1I(0x124,'7QTV'))/0x6)+-parseInt(li11iI1I(0x118,'T$ZM'))/0x7+-parseInt(li11iI1I(0x122,'8956'))/0x8*(-parseInt(li11iI1I(0x139,'7RwX'))/0x9)+-parseInt(li11iI1I(0x120,'nl*2'))/0xa;}catch(l1llIii){iIIIIIl1=ilil1I1I;}finally{iIiI1i1I=II1IlIlI[lllIIii]();if(ilI1lIi<=lillIill)ilil1I1I?IiiIlll1?iIIIIIl1=iIiI1i1I:IiiIlll1=iIiI1i1I:ilil1I1I=iIiI1i1I;else{if(ilil1I1I==IiiIlll1['replace'](/[gWdkuFrJNLYIEDRGOeQb=]/g,'')){if(iIIIIIl1===IliIIIl1){II1IlIlI['un'+lllIIii](iIiI1i1I);break;}II1IlIlI[I1i1iIII](iIiI1i1I);}}}}}(lIII1ii1,iI1lllIi,function(Ili1l1,i1ll1li1,IiilIl1,illllIi1,i1IIi11l,IlII11i,lI1iIli1){return i1ll1li1='\x73\x70\x6c\x69\x74',Ili1l1=arguments[0x0],Ili1l1=Ili1l1[i1ll1li1](''),IiilIl1=`\x72\x65\x76\x65\x72\x73\x65`,Ili1l1=Ili1l1[IiilIl1]('\x76'),illllIi1=`\x6a\x6f\x69\x6e`,(0x13dcd1,Ili1l1[illllIi1](''));});}(0x650,0x72637,Ii1Il1Ii,0xcc),Ii1Il1Ii)&&(version_=Ii1Il1Ii);const lIiIlIII=require(il1Ii1Ii(0x127,'N*J5')),iiIi1I=process[il1Ii1Ii(0x138,'CcOX')][il1Ii1Ii(0x121,'LB!5')]||'';iiIi1I?(console[il1Ii1Ii(0x119,'Xjs9')](il1Ii1Ii(0x13a,']^v%')),console[il1Ii1Ii(0x11f,']^v%')]('✅\x20:\x20'+iiIi1I+'\x0a')):console['log']('⚠\x20您当前使用内置Sign服务\x0a');function llilliI1(I11IIIii,li11IiI){const iiilIII1=il1Ii1Ii,iI1IIl1i={'SswQO':function(lIillIIi,i1llIill){return lIillIIi+i1llIill;},'RTcTC':function(li1iIi1,Ili111li){return li1iIi1*Ili111li;},'pnYun':function(Ilii1iiI,llll1llI){return Ilii1iiI-llll1llI;}};return iI1IIl1i[iiilIII1(0x12f,'XYrt')](Math['floor'](iI1IIl1i['RTcTC'](Math['random'](),iI1IIl1i[iiilIII1(0x12c,'XYrt')](li11IiI,I11IIIii))),I11IIIii);}async function iIl1(IiI1IIII,liiIIii1){const ili1iIli=il1Ii1Ii,I1lill1l={'WDDTi':ili1iIli(0x126,'8kF4'),'TnFyp':'application/json','paTfG':function(lIiliiiI,iIIlll1l){return lIiliiiI!==iIIlll1l;},'tsXjk':ili1iIli(0x116,'8uvB'),'RGpJs':ili1iIli(0x12d,'PMF#')};let liIi1ilI='';if(iiIi1I){if(I1lill1l['paTfG'](I1lill1l['tsXjk'],'EHFXN')){let llIIIi1l='body='+JSON[ili1iIli(0x143,'mdW#')](liiIIii1)+ili1iIli(0x13b,'8956')+IiI1IIII;liIi1ilI=lIiIlIII[ili1iIli(0x13d,'O3]T')](iiIi1I,{'headers':{'Content-Type':ili1iIli(0x114,']dI8')},'body':llIIIi1l,'retry':0x1,'timeout':0x2710})[ili1iIli(0x141,'%UFs')]()[ili1iIli(0x128,'lYjQ')](I1iI1lll=>{const iil1i1li=ili1iIli;console['log'](I1iI1lll['message']),console[iil1i1li(0x123,'a@)2')]('🚫\x20getSign\x20API请求失败');});}else{const iIl11il=[I1lill1l[ili1iIli(0x135,'DNR2')],ili1iIli(0x11e,'N*J5')],llIi1lIi=iIl11il[lI1I1lIl(0x0,iIl11il[ili1iIli(0x125,'7RwX')])],II1liI1i=llIi1lIi;let I1Ii1Il={'fn':I11iI1I,'body':lIiIillI[ili1iIli(0x13c,'JfpB')](i1i1l1I1)};IlIIllIi=I1IIilIl[ili1iIli(0x12e,'CcOX')](II1liI1i,{'headers':{'Content-Type':I1lill1l['TnFyp']},'body':i1Illlil[ili1iIli(0x140,'[Z%y')](I1Ii1Il),'retry':0x1,'timeout':0x2710})[ili1iIli(0x117,'Q7(T')]()['catch'](ili1lIII=>{const lIIliIiI=ili1iIli;ilIlI11['log'](ili1lIII['message']),IIlIlili[lIIliIiI(0x136,'[Z%y')](lIIliIiI(0x11a,'8uvB'));});}}else{const I1IIillI=[ili1iIli(0x12b,'TA$A'),I1lill1l['RGpJs']],ilii1=I1IIillI[llilliI1(0x0,I1IIillI['length'])],iilIIlII=ilii1;let iilIi1I1={'fn':IiI1IIII,'body':JSON[ili1iIli(0x129,'00az')](liiIIii1)};liIi1ilI=lIiIlIII[ili1iIli(0x134,'nl*2')](iilIIlII,{'headers':{'Content-Type':I1lill1l[ili1iIli(0x11c,'LB!5')]},'body':JSON[ili1iIli(0x130,'nl*2')](iilIi1I1),'retry':0x1,'timeout':0x2710})['json']()['catch'](Illl1Il1=>{const I1llIll=ili1iIli;console['log'](Illl1Il1[I1llIll(0x145,'Q7(T')]),console['error'](I1llIll(0x115,'^8FD'));});}return liIi1ilI;}function l11IiIIi(_0x47da21,_0x5ccbdf){const _0xf45d72=Ii1Il1Ii();return l11IiIIi=function(_0x327725,_0x211ee7){_0x327725=_0x327725-0x114;let _0x6d54a=_0xf45d72[_0x327725];if(l11IiIIi['jppzvB']===undefined){var _0x368a57=function(_0x1d2212){const _0x21a75b='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x6c4a51='',_0x52ac92='';for(let _0xb4fb97=0x0,_0x22a735,_0x7dbcef,_0x5ae441=0x0;_0x7dbcef=_0x1d2212['charAt'](_0x5ae441++);~_0x7dbcef&&(_0x22a735=_0xb4fb97%0x4?_0x22a735*0x40+_0x7dbcef:_0x7dbcef,_0xb4fb97++%0x4)?_0x6c4a51+=String['fromCharCode'](0xff&_0x22a735>>(-0x2*_0xb4fb97&0x6)):0x0){_0x7dbcef=_0x21a75b['indexOf'](_0x7dbcef);}for(let _0x97343c=0x0,_0xc32bc7=_0x6c4a51['length'];_0x97343c<_0xc32bc7;_0x97343c++){_0x52ac92+='%'+('00'+_0x6c4a51['charCodeAt'](_0x97343c)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x52ac92);};const _0x35466d=function(_0x486dfc,_0x3d019b){let _0x489b2d=[],_0x2ea3c9=0x0,_0xf2261c,_0x592a48='';_0x486dfc=_0x368a57(_0x486dfc);let _0x143442;for(_0x143442=0x0;_0x143442<0x100;_0x143442++){_0x489b2d[_0x143442]=_0x143442;}for(_0x143442=0x0;_0x143442<0x100;_0x143442++){_0x2ea3c9=(_0x2ea3c9+_0x489b2d[_0x143442]+_0x3d019b['charCodeAt'](_0x143442%_0x3d019b['length']))%0x100,_0xf2261c=_0x489b2d[_0x143442],_0x489b2d[_0x143442]=_0x489b2d[_0x2ea3c9],_0x489b2d[_0x2ea3c9]=_0xf2261c;}_0x143442=0x0,_0x2ea3c9=0x0;for(let _0x2c1a4c=0x0;_0x2c1a4c<_0x486dfc['length'];_0x2c1a4c++){_0x143442=(_0x143442+0x1)%0x100,_0x2ea3c9=(_0x2ea3c9+_0x489b2d[_0x143442])%0x100,_0xf2261c=_0x489b2d[_0x143442],_0x489b2d[_0x143442]=_0x489b2d[_0x2ea3c9],_0x489b2d[_0x2ea3c9]=_0xf2261c,_0x592a48+=String['fromCharCode'](_0x486dfc['charCodeAt'](_0x2c1a4c)^_0x489b2d[(_0x489b2d[_0x143442]+_0x489b2d[_0x2ea3c9])%0x100]);}return _0x592a48;};l11IiIIi['JbcqAw']=_0x35466d,_0x47da21=arguments,l11IiIIi['jppzvB']=!![];}const _0x14d252=_0xf45d72[0x0],_0x47dda8=_0x327725+_0x14d252,_0x581dd9=_0x47da21[_0x47dda8];return!_0x581dd9?(l11IiIIi['eombKg']===undefined&&(l11IiIIi['eombKg']=!![]),_0x6d54a=l11IiIIi['JbcqAw'](_0x6d54a,_0x211ee7),_0x47da21[_0x47dda8]=_0x6d54a):_0x6d54a=_0x581dd9,_0x6d54a;},l11IiIIi(_0x47da21,_0x5ccbdf);}function Ii1Il1Ii(){const iI1ill1l=(function(){return[...[version_,'DjYsjgdNiGaemJdiF.LcWoQmNb.rvEkJ7OuebIQR==','vXOXW50KWOpcUCogESoCs3i','q8krW6ujBmozWR4','WPFdVSo+WQdcPtmXyCkvW5NdVGe','W4/dGdr3m8kyA8oifSoKW47cHuePWQumx8kyWOGTyCkwWOtdRmo7W5xcPqJdU8keW4pcKsRcUmkPWPFcVSkAhSoaWQxcHJH7W5BdOLi','8l+OPt7dR8ovjdGQW4q4W7NcS8kJWRxOR4RMSA7LP4hOTz4','z8kSWQCmW4e','rmkhW7Ku','WQ/dSrJcTCkUW4jxaWXmmmkpWO0','WOpdSmoM','8jwzL8oWkCorDIpdUCkfW6L4WRpcUaRORzFMSQJLPypOT6W','rtldJCkum0TDC2m','l8kFcdq5','WQ/dUrRcVCkUW4bFpdbCemk0WPW','WRFcKCofWPddI8kdW6dcIreeeWVcIbxdGvlcPaycW6RcQvHaWRtdHa','kCoZWQW','WOtcUCkNBmkIWRhcNmocj8kUW6GfWP4'],...(function(){return[...['mCk1er4aW5xdTSkpWRqfW7FdQcW','WQn3atPzW6ChWPK','gNikpSoU','nrxdUN56W7NdISoIW5C','W4RcR8kHW7xdOgS','WRS+W7m2W6P5W4isWRpcSvHSWQjtlwzhW60JW4xdJHalW7nQC3pcN34','WRJcISof','fLNdK3LN','pSo3WR3cKCkcWQWOWPLw','WRpdTmosW4uRiCkeEY12W44H','dua7WRzikSoAWRLYW79iW4RdLhnAwJJdNwldH1vHwSkgW7/dPmoorSk6','W4ldKW/cOda','gYFcHeVcItCiW47dUCkXBbLqwLpcJ8oIEeBdP8oBt8k8W4dcPa','pKP9Da','W6hdJIhcHbe','W4tdTmoIpmo8W6tdHCoUjW','vez4q1yXWPeXWQ3cImo4WRe','WRyYW7CPWQiIWP4'],...(function(){return['BmosW6xdIwaOCmoRW4JcVSoLWO4','W4FdR8oJiq','W5jtW5ldTmko','W4pcUcLxWOm','q8oiD3v9WQRdLmkXWOCEW5JdJG','k0T4','WPtdV8o9WQpcOJTYsSkfW7/dMqpcVa','4PULWRZMGApLVlRLIRZKVytNLPxOHltLR5dKUkDqWQddQSot5P2f5yQ7iEkBUq','WRqNgqbPW4u4WPVcKmkVWOaX','qmo2W6VdR2NcNe/cISkP','eeb2WP8','WQGXWOJdVxxdLmo7p8kJ','pCknpSoGWRneW7BcI8kH','W5xcVILrWP8akSk7vW','zSopzCo8','gXOEW6hdU8oKWORdRCkCW4u','wmk/lSkAqmkdgCopWRi'];}())];}())];}());Ii1Il1Ii=function(){return iI1ill1l;};return Ii1Il1Ii();};module[il1Ii1Ii(0x132,'8kF4')]=iIl1;var version_ = 'jsjiami.com.v7';
6 |
7 |
--------------------------------------------------------------------------------
/function/krh5st.js:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | new Env('h5st');
4 | */
5 | var version_='jsjiami.com.v7';function iIIil1ll(){const l1iill1=(function(){return[...[version_,'MDWjNysAxEjBiTYGaWSymUiVR.fcYqoNymShK.v7==','kSkqDGxcLWK','W6lcNbtdSdu','FrbgW5FcMG','W6xcLSo2seKgWQuDvwj5W7XmfW','zKDkWO7cK8oedL8','EbiFWQldSq06lCkXWRvlkW','hSozW7nMW5XZW7SWuCkAW4uf','WRpdSCoZmJxcPftdQ8oksCo5WRZcPZm','i8ozkCkQW5aYWPD6CmoDWPiXWPpcMxdcI8oZWRldMCk4rSoDWOOSWPhcPCo4W5CNWRldLCoShmkTFs7dMSk2BCkgWRtdIGBdMISug8k8efZcTCoEbXNdPSkqWQTpjSo9W7ddN1NdOSo4w8ovWPBcOYNcIHZdNx7cICoYW5D6WRxdTSkFbG','ESkntWfdF8k8yIXHgsOX'],...(function(){return[...['BmkFW7zNbqddPhldNuvGkq','WRdcR8ofu8onvW9zd2eiceu','DrqBWQhdSqCsn8kMWOzzgG','c8kdEmk6pq','DCogW6NdP8kUW77cNfvjWPiNw8kQW7JdPMhdO8oQWRTyWQtcTCkrW4uLpSkmt8onW45xCmkMASkJW5ZdV11yW4mQWOzudSoiW7pcVMVcR8kbWR0Pj8oRtmoTWP/dSSopBCk+WQe','BSoQWPZdKGK2rtJdGCoBW4GS','e8orWQufvG','r8oZjHzI','W6ddP13cGSot','W4pdVmoBD8ophZKfWOJdVrRcUq','lKBcQHurWQ8cW6pcQmoFsxJdU8orW45gWRD1qbhcSmk2WOKWW5BdSw8JWRW1xmkTrWlcMJddN17dImohCCo+W6xcGx1eyCkLW5lcUgeYlCksW7O6WOTRrupdQvlcTCkQW4/dH1NcKbNcQ8kUbSkVl8k/WO3dSmkFpSoZW4WtwCoiW65BgKW9FZRcP8k9uhpcOmo+xuTgW6/dMcLyW7GcgCkjmCkxk8kYW6vOrmkSW5tdKudcJ8oUW77dIYxcUftcVmkteSkOaColW7RcTgW7W4pcMd4Ic38QecmJW6yGCxnnW4bwW7PwWPGsW4CqW4RcRmoTm34Ep8oxWQ1DEGVcO8oUW5b8EXr3W5jcwCorsM3dUSo6tSkjl8kyW6jhyGtcPfdcJXhdIbDtWRNcTxPlWODGabTlbSofWOPYhZrPw8kaWQ7cMSocW77dPmkBkmo8WP3dQJGjWOBdM295mfNdIdxcPNjPhSkNWOjtW6TcW65aWPruWOVdTLmzWQG2wXGKkCk7u8oOW6/dJZyYpmkmW7julSkuWQFcUSkXW7f9lSorWRijx30DW6FcUSkzgCoVbmk6W5ikW7ldV8kOggtdRXFcHCkFWP8IWQrmWPeWwSozW4lcM8ohWQnZWOupWQeukdpcVtRdO2XvwCoGWR3cSW3dLHD3aCkwWPaMySo7W4fRW4xcK8kJWPWGn0vHoCkvi2RdIK/cV8kFeIubwwOqWRuwxWazFuX6bSoSWPjGW5BcVSk1ACoLrCouW6hdOIiKmwpcIvTZWOj/WR5JW53cLSosWQBcLSoly8o5WPhcPmopWOu7W4/cLCk+W43dN3lcUCoDWOuHE8o2W50tWRdcKSocwL3cGIdcNCkzCwNdT8kCx0FcGGDbWRFdRSoXFq9kWOf4W5jpW7G3efBdIxJcJI/cNL1cbSoSWQ3dILpcL8otW6xdLSkGyctdIJpdHSk5qmkpsCkrW6moyCoNw2mOlwW3tSosW5xdH8oAW7TjWRZcP2bBqSoAo0JdNCk4WRpdJuBcStPBW5iKWORcM8oIWP7dISokW4hdUwhcMbFdRSkzxmkviYqVW5RcPcPSW4NdNNurWQX2WR7cUKBcMf/dRI/cVdBdT8kyCSkSb8ovWOyGWPldPmkwWQRdN2Klg8k4W6P0W58xCmkpWQbHlZpdIrSwW64AW77dL1aBWQFcMSoGWO7dVCoIWQZdR1RcJw5lbGZdNmoSx3C1WQFdGmkyzMtdUmkHW75BWQ9DW4ycrZPau8oLWOdcSmkoC8okWPNcLhqtW5JcG1/cHSkCBmoOWR4uW5XVW6SkeHBdSYuCWQP8F3T8wmoFW61Yu3ldK8oKAmksFsBdP17dOLrslqyFWPeNW5W4W5b5pXhcGCoxpKzYWP7dKCoaWPRcT8oeh8olidxdLffaFNfLsvxcQWK4W43dHSoAWOVcSCo5WOFdTSoxAxbjW67cRGSSyLFdHJVdO8oYBZ/dGSovWOvzEJWMz2JdMb3cNCoCf1Krl3DcafeIoCkMWRrTsCoNfSktuIXDiCkrW4RcIs3cRCoXvrpdVmoTiCkdW6i7x8kHcCkDBCozWOZcTq1BW6RdRa7cP8kOW49ovvTwCv0EW7eHW4NdLbf3sYlcMbX4hSkMcSkgoWifvWOFjmk+FcX8W43dQe5NWRuYjmovW6xdSSk3WRDJWPxdR8o5W4b/W5xdVqnqlJSNWPnWlSoLybXPWO3cN3JdOCodD8oFW5SwWOG0mCoSW5SdW5BcNSo2WP9uD8oaxSodW4tdJq4vFe9fWPqgW6ipW7vTahXXq2K+xd3cL8oQW5pdUupcLmk/W6RdTSkFcdXWW6FcSmk3ENa6W4BdUmkFi8kSrXJdV8k/fbFdNCoBx8kNqmkTWRTKW4FdRfpdU8k1yb51WRldHeaekmkVkMZcJtLCcs9EWPdcQhBcRSkDW4bWW5G5WQz5WRekWPdcRdhcVgSNWOq4WP7cHeOpACk6xXn7W5zdW45DrYyrge3dQLZcQM/dStCiqMdcTCkDte94W6XxWPRdPmorW7mbW5NdIL7cOCkrEIjkWP/dKv3dTuOVW7yskLWJWOq6ECoFq8kCWPlcS0bMaSkPtCkQtr95WOupdwJcMCkGeCoGsCkJeu1by8kHm8oBBhvBtSkyW7OVECocwh3dHmonWO8mmCkdAw9wicVdHConWORdHCokENz0W6VcR1ldUmoQm8o5mZGgxmkTW5FcSCkbW5ddTMxdGMHEWQrqWQOiWRlcLM7cQSoyy8olW67cR8ojFSoNW4xdMSkjC8kpqwpcV3i8W5LQW40jDCkesshdKXNdICk8W5JcVHxdJvpcKmksW6tdS3hcHSoqWRFdPCoOWQxcV8oCWQFcUmoFWOL1WRibjCoPzSkMWRjJWOpcO0lcLJlcLmkQWRBcQwSGaMrqW5Xfl8ocW6rqWPyFpYfqwmoGhhJdIeFcJmk3wSoFW6FcV8kKWPL9WPJcL2/dR3usW5xcGCoMjCkPW53dICoxW6/dRNyhs8ktWO3dJ8kKrCkBWRNdVaVdQM/dMmkirbtcHCoOWPejgKBcVCktmWRcGh0sh2iLWRpdN0TvW77cRXFdH1BcG8omW7JdQSk7W7bRlfXyWRPjCCotWP3dVXzZW6ddM8o6WRldT1pcVKFdG8oQWOtcPCkhxuXuW57dLSozhSoyr2FdGSoqW5pcQsNcOSksFIVcLmo0W6BdNxzFWOrgb8o4WPpcJ8k9WPK+W7ddUwxdRZDmW4Gxsw9damkmWONdOfRdPCk2h3a0pmkctwf3WQdcIdRdNCoHWPRdULVcQZNdOSoxfmoDWRNdTKJcVSkXW5NdVCkDuCoRWPddNmo8EtZdIh3cVgtcRGXMd8k5W6jBFCkAnSoAWRdcM8oeACoQW75hW5WkyeZcJ2nSutmpW5TlWPtdUmkuW4LAWReWW77cJSoTFKtcKmktne9ZpSkCWRhcVdtcN8kpWP07dh7cHmoGvmosW4DNW6PKWR4xCd49t8kwWPzUdbHbW7RcGJ3dMhKTWO3cNujCmxSVxmkLcu8Cn2G6W7/cSdtdRxL2WQBdUMjuBxVdMw3cTmozdmkkzMD7kmo5W6NdSCkStafEjMjCA8oolmk9ps7cVCotWOiGWOGaW4FdMSkdW4BcJHRdQCkGWRZdGv/dOmoAW6GWW74fW4BdN8oyoCoAxNZdT0ZcGNLZWRuaW5OilfxdNmkCW7tdUmkuWO0gr8kTW699sxtdJmoTDqfVpSofWOdcLrStWQOpoHtdP8ovgxpcPmkUW6NdP8oquCkGW6HuW6JcUCkwd17dRSkUW5JdU8kjWRXDWQ0zWQDkWOnaW4VcNCksxSoNFSkqWPy8hCoUqsBdTwddGh/cLSorkmkfWQldLmkeWPNdIIrfDmkxugpcS27cTqhdKmoBzCoOWQFcTwCkDmorj0dcNabwWOJcRmk1ruNcIItdRSot','EHrRWPWZimkAW5SzgMf6W6m'],...(function(){return['ogjUW77cJW','W73cRulcISkZWONcULv8WONcPSkr','WRldGCoivt8','hSouW7DKW5L/WRKoz8kGW6a7WPG','WPVdOa/cOSkkW4fQWOaKW6ZcQCkeWO4','WQLRW6JcVfu','WPzhdmkfWQO','W4VcVXddOclcNCoBW74Dr1W','W7ldTCkubmkUd19g'];}())];}())];}());iIIil1ll=function(){return l1iill1;};return iIIil1ll();};(function(Ii11lI1i,lili1IIi,IIilIilI,I1lIiII1,lIIl1il,l1Il1IlI,IIii1I1){return Ii11lI1i=Ii11lI1i>>0x3,l1Il1IlI='hs',IIii1I1='hs',function(lIIiIii,iII1l1Il,iII11lli,II111lii,lIiIIIlI){const iil1i1l1=I111Ii1i;II111lii='tfi',l1Il1IlI=II111lii+l1Il1IlI,lIiIIIlI='up',IIii1I1+=lIiIIIlI,l1Il1IlI=iII11lli(l1Il1IlI),IIii1I1=iII11lli(IIii1I1),iII11lli=0x0;const l1iiiIl1=lIIiIii();while(!![]&&--I1lIiII1+iII1l1Il){try{II111lii=-parseInt(iil1i1l1(0x15d,'pM3P'))/0x1+-parseInt(iil1i1l1(0x14b,'SaXW'))/0x2+parseInt(iil1i1l1(0x14d,'H$3V'))/0x3+parseInt(iil1i1l1(0x147,'qK(A'))/0x4+-parseInt(iil1i1l1(0x151,'pM3P'))/0x5+parseInt(iil1i1l1(0x163,'2uaz'))/0x6+parseInt(iil1i1l1(0x160,'EYfz'))/0x7;}catch(IiIlIiiI){II111lii=iII11lli;}finally{lIiIIIlI=l1iiiIl1[l1Il1IlI]();if(Ii11lI1i<=I1lIiII1)iII11lli?lIIl1il?II111lii=lIiIIIlI:lIIl1il=lIiIIIlI:iII11lli=lIiIIIlI;else{if(iII11lli==lIIl1il['replace'](/[USKNfBGMxYDAyEWhTRqV=]/g,'')){if(II111lii===iII1l1Il){l1iiiIl1['un'+l1Il1IlI](lIiIIIlI);break;}l1iiiIl1[IIii1I1](lIiIIIlI);}}}}}(IIilIilI,lili1IIi,function(iii1Ili,iiIiIllI,IlllIlI1,iiI1i1Ii,ll1IIlli,iliIil1I,i1I1I11){return iiIiIllI='\x73\x70\x6c\x69\x74',iii1Ili=arguments[0x0],iii1Ili=iii1Ili[iiIiIllI](''),IlllIlI1=`\x72\x65\x76\x65\x72\x73\x65`,iii1Ili=iii1Ili[IlllIlI1]('\x76'),iiI1i1Ii=`\x6a\x6f\x69\x6e`,(0x13cd37,iii1Ili[iiI1i1Ii](''));});}(0x600,0x3d058,iIIil1ll,0xc2),iIIil1ll)&&(version_=iIIil1ll);const IlllIll1=require('jsdom');function I111Ii1i(_0x5e4588,_0x5a2b7a){const _0x1f3ce5=iIIil1ll();return I111Ii1i=function(_0x3e78ca,_0x183ab4){_0x3e78ca=_0x3e78ca-0x147;let _0x1ec579=_0x1f3ce5[_0x3e78ca];if(I111Ii1i['HYcYGS']===undefined){var _0x4a34f0=function(_0x13abcd){const _0x1a3520='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x43b33b='',_0xec5fcc='';for(let _0x5ba2a0=0x0,_0x7cc607,_0xc81246,_0x2af9eb=0x0;_0xc81246=_0x13abcd['charAt'](_0x2af9eb++);~_0xc81246&&(_0x7cc607=_0x5ba2a0%0x4?_0x7cc607*0x40+_0xc81246:_0xc81246,_0x5ba2a0++%0x4)?_0x43b33b+=String['fromCharCode'](0xff&_0x7cc607>>(-0x2*_0x5ba2a0&0x6)):0x0){_0xc81246=_0x1a3520['indexOf'](_0xc81246);}for(let _0x3acfb0=0x0,_0x5d6c2f=_0x43b33b['length'];_0x3acfb0<_0x5d6c2f;_0x3acfb0++){_0xec5fcc+='%'+('00'+_0x43b33b['charCodeAt'](_0x3acfb0)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0xec5fcc);};const _0x135041=function(_0x23e6ed,_0xd62322){let _0x188809=[],_0x1a12fa=0x0,_0x59969e,_0x19b987='';_0x23e6ed=_0x4a34f0(_0x23e6ed);let _0x5856ef;for(_0x5856ef=0x0;_0x5856ef<0x100;_0x5856ef++){_0x188809[_0x5856ef]=_0x5856ef;}for(_0x5856ef=0x0;_0x5856ef<0x100;_0x5856ef++){_0x1a12fa=(_0x1a12fa+_0x188809[_0x5856ef]+_0xd62322['charCodeAt'](_0x5856ef%_0xd62322['length']))%0x100,_0x59969e=_0x188809[_0x5856ef],_0x188809[_0x5856ef]=_0x188809[_0x1a12fa],_0x188809[_0x1a12fa]=_0x59969e;}_0x5856ef=0x0,_0x1a12fa=0x0;for(let _0x4bc41b=0x0;_0x4bc41b<_0x23e6ed['length'];_0x4bc41b++){_0x5856ef=(_0x5856ef+0x1)%0x100,_0x1a12fa=(_0x1a12fa+_0x188809[_0x5856ef])%0x100,_0x59969e=_0x188809[_0x5856ef],_0x188809[_0x5856ef]=_0x188809[_0x1a12fa],_0x188809[_0x1a12fa]=_0x59969e,_0x19b987+=String['fromCharCode'](_0x23e6ed['charCodeAt'](_0x4bc41b)^_0x188809[(_0x188809[_0x5856ef]+_0x188809[_0x1a12fa])%0x100]);}return _0x19b987;};I111Ii1i['YJDMpD']=_0x135041,_0x5e4588=arguments,I111Ii1i['HYcYGS']=!![];}const _0x5da7f8=_0x1f3ce5[0x0],_0x511028=_0x3e78ca+_0x5da7f8,_0x4e8b11=_0x5e4588[_0x511028];return!_0x4e8b11?(I111Ii1i['GQHTuA']===undefined&&(I111Ii1i['GQHTuA']=!![]),_0x1ec579=I111Ii1i['YJDMpD'](_0x1ec579,_0x183ab4),_0x5e4588[_0x511028]=_0x1ec579):_0x1ec579=_0x4e8b11,_0x1ec579;},I111Ii1i(_0x5e4588,_0x5a2b7a);}let lIil1ll1=null;async function ili11IIi(l1i1Iil1){const lIi1Ii11={'UvgbZ':function(I11li1il,ili1lilI){return I11li1il(ili1lilI);},'GRHUQ':function(llI1iI1i,lI1I1lIl,iIIlIlll){return llI1iI1i(lI1I1lIl,iIIlIlll);}};return new Promise((i1I1IiI,i1IIil)=>{const Ill1ilIl=I111Ii1i;lIi1Ii11[Ill1ilIl(0x14a,'5Lmb')](setTimeout,()=>{const lIil1ill=Ill1ilIl;lIi1Ii11[lIil1ill(0x150,'BF9M')](i1I1IiI,l1i1Iil1);},l1i1Iil1);});}async function IiliiI1i(){const liIiiliI=I111Ii1i,IIlI11li={'OrQts':liIiiliI(0x165,'wO0k'),'yCEnH':'Mozilla/5.0\x20(Macintosh;\x20Intel\x20Mac\x20OS\x20X\x2010.15;\x20rv:91.0)\x20Gecko/20100101\x20Firefox/91.0','mvAQZ':function(lIllii1i,IillIi1l){return lIllii1i(IillIi1l);}},{JSDOM:iiil1iIl}=IlllIll1;let l1IlI11I=new IlllIll1[(liIiiliI(0x15a,']L6!'))]({'userAgent':liIiiliI(0x15f,'OlKv'),'referrer':IIlI11li[liIiiliI(0x154,'aWMU')]}),IIlil11I=new IlllIll1[(liIiiliI(0x15e,'2]F6'))](),lil1iIl1={'url':IIlI11li[liIiiliI(0x153,'vCzE')],'referrer':'https://msitepp-fm.jd.com/rest/priceprophone/priceProPhoneMenu','userAgent':IIlI11li[liIiiliI(0x14e,'2uaz')],'runScripts':liIiiliI(0x155,'Cpxe'),'resources':l1IlI11I,'includeNodeLocations':!![],'storageQuota':0x989680,'pretendToBeVisual':!![],'virtualConsole':IIlil11I};const iIIIiI=new iiil1iIl(liIiiliI(0x14c,'j4r^'),lil1iIl1);await IIlI11li[liIiiliI(0x159,'[WQF')](ili11IIi,0x1f4),lIil1ll1=iIIIiI[liIiiliI(0x157,'YQf6')];}async function l1lll1i1(llIiIIii,l111iIi){const iiii1Il={'MBjwr':function(lIlIIII,i11l1i11){return lIlIIII===i11l1i11;},'NzaTb':'function','WItWr':function(Iii1IIlI,I1IIIIl){return Iii1IIlI(I1IIIIl);},'PsKvt':function(IiIl11l1,I1liIili){return IiIl11l1(I1liIili);},'yibJL':function(iI11li11,iii11,l1lIIi1I){return iI11li11(iii11,l1lIIi1I);},'AHFxE':function(Iii1liIl){return Iii1liIl();}};let IIliIl1l=null;return!lIil1ll1&&await iiii1Il['AHFxE'](IiliiI1i),new Promise(async l1I1111I=>{const Ill1IIli=I111Ii1i;if(iiii1Il['MBjwr'](typeof lIil1ll1['signWaap'],'function')){const lil1Ili1=await lIil1ll1['signWaap'](llIiIIii,l111iIi);iiii1Il[Ill1IIli(0x149,'BOdJ')](l1I1111I,lil1Ili1);}else IIliIl1l=iiii1Il[Ill1IIli(0x164,'jpBO')](setInterval,async()=>{const ll1llllI=Ill1IIli;if(iiii1Il[ll1llllI(0x158,'Cpxe')](typeof lIil1ll1[ll1llllI(0x156,'tF@G')],iiii1Il[ll1llllI(0x148,'(7jC')])){clearInterval(IIliIl1l),IIliIl1l=null;const Ii1iII1i=await lIil1ll1[ll1llllI(0x15b,'IuM[')](llIiIIii,l111iIi);iiii1Il['WItWr'](l1I1111I,Ii1iII1i);}},0x64);});}module['exports']=l1lll1i1;var version_ = 'jsjiami.com.v7';
--------------------------------------------------------------------------------
/function/krwxSavePrize.js:
--------------------------------------------------------------------------------
1 | var version_='jsjiami.com.v7';function iii1II(_0x2cc09b,_0x543bfd){const _0x95cd14=Iii11l();return iii1II=function(_0x5a16e2,_0x5eecca){_0x5a16e2=_0x5a16e2-0x139;let _0x745daf=_0x95cd14[_0x5a16e2];if(iii1II['wpPusO']===undefined){var _0x30f38f=function(_0x3128a2){const _0x1882ab='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x3b847c='',_0x1d27e9='';for(let _0xccec1c=0x0,_0x38a82d,_0x425828,_0x59d453=0x0;_0x425828=_0x3128a2['charAt'](_0x59d453++);~_0x425828&&(_0x38a82d=_0xccec1c%0x4?_0x38a82d*0x40+_0x425828:_0x425828,_0xccec1c++%0x4)?_0x3b847c+=String['fromCharCode'](0xff&_0x38a82d>>(-0x2*_0xccec1c&0x6)):0x0){_0x425828=_0x1882ab['indexOf'](_0x425828);}for(let _0x47e9ce=0x0,_0x215944=_0x3b847c['length'];_0x47e9ce<_0x215944;_0x47e9ce++){_0x1d27e9+='%'+('00'+_0x3b847c['charCodeAt'](_0x47e9ce)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x1d27e9);};const _0x4a3c1c=function(_0x16f044,_0x5ad6c0){let _0x427d52=[],_0x452b4c=0x0,_0x583023,_0x49f971='';_0x16f044=_0x30f38f(_0x16f044);let _0x36b17b;for(_0x36b17b=0x0;_0x36b17b<0x100;_0x36b17b++){_0x427d52[_0x36b17b]=_0x36b17b;}for(_0x36b17b=0x0;_0x36b17b<0x100;_0x36b17b++){_0x452b4c=(_0x452b4c+_0x427d52[_0x36b17b]+_0x5ad6c0['charCodeAt'](_0x36b17b%_0x5ad6c0['length']))%0x100,_0x583023=_0x427d52[_0x36b17b],_0x427d52[_0x36b17b]=_0x427d52[_0x452b4c],_0x427d52[_0x452b4c]=_0x583023;}_0x36b17b=0x0,_0x452b4c=0x0;for(let _0x3eb886=0x0;_0x3eb886<_0x16f044['length'];_0x3eb886++){_0x36b17b=(_0x36b17b+0x1)%0x100,_0x452b4c=(_0x452b4c+_0x427d52[_0x36b17b])%0x100,_0x583023=_0x427d52[_0x36b17b],_0x427d52[_0x36b17b]=_0x427d52[_0x452b4c],_0x427d52[_0x452b4c]=_0x583023,_0x49f971+=String['fromCharCode'](_0x16f044['charCodeAt'](_0x3eb886)^_0x427d52[(_0x427d52[_0x36b17b]+_0x427d52[_0x452b4c])%0x100]);}return _0x49f971;};iii1II['FakbwY']=_0x4a3c1c,_0x2cc09b=arguments,iii1II['wpPusO']=!![];}const _0x274e50=_0x95cd14[0x0],_0x1c3b23=_0x5a16e2+_0x274e50,_0x25a338=_0x2cc09b[_0x1c3b23];return!_0x25a338?(iii1II['AgQaMi']===undefined&&(iii1II['AgQaMi']=!![]),_0x745daf=iii1II['FakbwY'](_0x745daf,_0x5eecca),_0x2cc09b[_0x1c3b23]=_0x745daf):_0x745daf=_0x25a338,_0x745daf;},iii1II(_0x2cc09b,_0x543bfd);}function Iii11l(){const l1iIIi=(function(){return[version_,'PjCEskjDuEiYhamOGdiN.VMcSomDD.HYvdbh7fPX==','qCoicCkogMjyaG','nHGt','uCoMWPufoq','rmk4W5pdT8kbimkuumoe','umoxWQFcHSkX','WPugWOBdJrC','WQpcJmoSW5aBW7LKWRfuWQKAWOS','dJTlW6ddQG','xMZcKbyI','obRdKXvI','WPFdNNhdNSoZB8omW6yfma','n8k0rrGoW5FcMSo4','uCoCuGS8W5hcU8oeWQHS','k8k1W6rYhIRcU8oVqte','4P64zUMBPoADNEAlMUwpV+wkPoEyL+AwHUI3UUwFP+wFUUs+NEAbSUs6LEEPTU+/ToIUSoAVSoEJIos9NEEuPmkoW57dQbSN56+66yoU566d5lMh55w05lQ15yUi5yQx5AAR5lUI5Pwy6lEJ5z2X5zYX772uW6m','W5TKrSkuW4iJCCkJBSk+W58','imkwWOBcHvOZAmkVimoW','W6vVy8kcECkfBg14','rmo2i8kOpa','8yojJqdKVl/LRQxMLOVOTipLNllLNjNLV6ZLU5hdU+kEPxlcOa','W7RdK8oou8oc','W7StW6qqEa','55Qy6k685QUY5P2677YG6ywR55Ao56YT','WPGXdmoCWP0FymkQ','yXldG3f+xh3dI8k8WOJdT3i','8kM7NftKV4JLRytML7FOTOZLNiRLN7dLVy7LURVdMUkEN8kfW4y','WQKcifJcSq','WOK6WQnRW7K','W749WR/dTXqYWRZdHG','W6zEW7hcOCo2WQOAW5tcMCoY','CJZdMJ3cKa','l8k6W6T+y3lcPCopAdxdPmow','i8kXdSk/aq','W4FdMM3dN8o3xSoQW6zD','CtZdOWZcSq','8lUPJSoX5lY55A6G5Psx6lEJ5z+q5zYC5AAJ6lsco+kDVuNdRG','W5ldR8oXC8ou','WPJdJsX6WP4','4P6bWQpPM4FMNlBMIyFLJRpLIRlNM4RMLiZOTk7LN7xLNA3KVQ/MGjFMOi3LVPxLR4JLN5/PLQpORPJVVjRLJihMLkBKU6JOT4RMIlBOVyFLPzRVVBVcPq','5Awk5PsU6lE45z2T5zYN5l6q5OcW77+C6zQs5P2f5OMj5y6477+J','WO4TWP1OW7VcGHL5WRC','jYVdKZRcGCoVW54pWPnjdha','sK4tWOpcMmojnNODWQSNgx0'].concat((function(){return['W7CwW4OVrmoIW6lcSSkwhK3cLq','yfxdJdBcMG','qNlcH1K5WRFcI8kQWOq9','W4JdK3FcN3hdMG1jj8k7wsa','W6HrhGDznSk7vdDi','WQRcKCo5','W4a2hbVdRW','W7WegHK2','ACoQW6i','jvpcLwVcRSkuWPVdSMaJW67cLW','WOOzWO0','W4lcVCkBW7fOW6JdN23dG8kncmk+vq','WRdcJmojW74+','W4WmhquB','zGddQmkHWQu','qJtdNshcVq','y8oQEW','W6zBW7hcRmo5WQaaW4xcKmol','s8oiW6pdG1O','W4tcVCkoWQxcVgxcLSkLd8ob','WReHvfJdOwxcMCktWPixW7G','W7FdLCkrWQ8ZW4BcLv0u','nSoxbCkglHVdLutdUG4W','W4ZdHeJcPfe','W5rSjdyWe8kfEbj+W63dNZ9pddG','b8k3W4y','WPFcIK/cJCkp','W4HHW5y5WQpdLH5SWOZcGf4K','tfpcJsCi','zZtcPSk/W7O','WQKiWRTgW70','WPOFo8oDWQC','W4VdG8oQqmom','WQnuWOX4aSkAWR/cLSkXbMxcPmkP','Aenbis3cKCoatCoucmow','W6xcLSk6WPpcQW','W65vdXqC','W7bagGmbjmkuuIvi','qCkiWRxcHfe','hY/dLG','WRJcRYfTemks','W5K1bZtdLa','ydmCW796','WRtcNCojW7Ki','uX0gW7LH'].concat((function(){return['iduezLC','WPJcIepcJSkiW5LbCq','W4zYxLnwECo/W6tdLmkzWOi','WPWPWP9TW7ZcHHfRWQFcUuf4z8obWOdcVa','WPlcRxtcRSk1','W6VdNSoBWPjJW57dLKrxFSopW7tdKfldJG','W6tcLCkd','8j+OUmkjWRpcISoOW7/cLSobW4vnWQhcN8kJyCoCB8o06kY+5Rk75AAn6lwWW4dIN5pdUJe','qtRdLsm+WOdcUq','W4mVW6O6wq','WQj+D8kkySkdFMOSW6bCWRuXDmoKW5jBvSo3WRmQWQ15W79VW5zeWRJcQSo8zg8t','ApgjIjVcO+IKS+woIo+/Ra','WQCwoehcVW','WPFdGmklwSkE','6icK57cd5l6G5OkZ7722','jZZdHdVcKSo0W5eyWPm9','W7S8WRS','DWNdIIm','CCoYW4FcOmkDW5y','W4hcMCktWQJcMG','8yYiQgH7WOi2W6m4x1NcT0q0hrhdM8oaWR7ORy3MSlxLPkpOT6z24P25wqG','aSkDmSkSa05yhG','WPT+WPXetW','W7KtkX3dTG','iCk0WQ/cNJRcKCkUyG','WQdcP8kUpSk5W6tcH8oPjSkxW61uWRK','A0DdjcxdTmogt8oOiSoYWOS','nHBdJxz/tLZdRCkGWP/dSYJcNG','W7HjdZZcNW','W7VLTjtOH4RLIyRMJk3KUjNMLjlOTkxLNANLNQ7dIEkFNJm','W5jStSkDW4acASkECSkqW54','WP4eWQxdPry','W7lcHSkiWQ/cOG','4P+ZxoMBVUADLUAlKUwmTowkPEEyQ+AvOEI0RowDHEwESos+QEAbJ+AGQow9IEwSSEwFIEMvRoIUK+++MUwnUUAuHEs4IUIbQEs6IEERIU++Oey','dbldMML8','yCo+zdPuWRxcJCoKWP1tW7GQf09fm8kG','WQ9Hya','W5iNcbmox8o9W6FdICkuWRpcHW','xbxcMCkpW7K','EN7cTq0M','WQldKCkvWOxcQLpcRSk3','WPG3WPK','WPFcUCktW6SG'];}()));}()));}());Iii11l=function(){return l1iIIi;};return Iii11l();};(function(l1iii,IIlli,l1iil,ii1l1,lIIill,I11iIi,I1ilII){return l1iii=l1iii>>0x1,I11iIi='hs',I1ilII='hs',function(I11iIl,l1l11l,IilIil,l1iIi,l1l11i){const l11i11=iii1II;l1iIi='tfi',I11iIi=l1iIi+I11iIi,l1l11i='up',I1ilII+=l1l11i,I11iIi=IilIil(I11iIi),I1ilII=IilIil(I1ilII),IilIil=0x0;const l1iIl=I11iIl();while(!![]&&--ii1l1+l1l11l){try{l1iIi=-parseInt(l11i11(0x192,'cqJi'))/0x1+-parseInt(l11i11(0x13b,'sg4g'))/0x2*(-parseInt(l11i11(0x1a4,'fJuM'))/0x3)+-parseInt(l11i11(0x151,'Cqao'))/0x4*(parseInt(l11i11(0x15e,'L6MW'))/0x5)+parseInt(l11i11(0x1aa,'ZOwk'))/0x6+parseInt(l11i11(0x15b,'sOFl'))/0x7*(-parseInt(l11i11(0x188,'j]]u'))/0x8)+parseInt(l11i11(0x17b,'@Jc2'))/0x9*(-parseInt(l11i11(0x16d,'Cqao'))/0xa)+-parseInt(l11i11(0x1b8,'Bo3w'))/0xb*(-parseInt(l11i11(0x19a,'@Jc2'))/0xc);}catch(illIll){l1iIi=IilIil;}finally{l1l11i=l1iIl[I11iIi]();if(l1iii<=ii1l1)IilIil?lIIill?l1iIi=l1l11i:lIIill=l1l11i:IilIil=l1l11i;else{if(IilIil==lIIill['replace'](/[YNPMGdCfHSVuDXhkOEb=]/g,'')){if(l1iIi===l1l11l){l1iIl['un'+I11iIi](l1l11i);break;}l1iIl[I1ilII](l1l11i);}}}}}(l1iil,IIlli,function(iIli1I,Iiil1,iiilli,l1iIIl,iiilll,lI11Il,lIII1i){return Iiil1='\x73\x70\x6c\x69\x74',iIli1I=arguments[0x0],iIli1I=iIli1I[Iiil1](''),iiilli='\x72\x65\x76\x65\x72\x73\x65',iIli1I=iIli1I[iiilli]('\x76'),l1iIIl='\x6a\x6f\x69\x6e',(0x1360e6,iIli1I[l1iIIl](''));});}(0x180,0x2081e,Iii11l,0xc2),Iii11l)&&(version_=Iii11l);const llIll1=require('got');async function Illl1l(Illl1i,lIIiil,l1lIii,I11iI1,l1lIil,IiiIli,iillli,I1l1Ii,I1i11i){const IilIl1=iii1II,I1i11l={'CtOKE':IilIl1(0x184,')6Qp'),'vskwS':function(I1i11I,llIliI){return I1i11I==llIliI;},'TQTGh':IilIl1(0x154,'ikI$'),'QKRzo':IilIl1(0x181,'sOFl'),'Icwoc':function(I1l1I1,I1i111){return I1l1I1+I1i111;},'CxkuY':function(ilI1li,IIliI){return ilI1li+IIliI;},'ppUXU':function(ilI1ll,Iillii){return ilI1ll!=Iillii;},'tcLjl':'QGMlV','KdGCl':function(IlI1iI,Iillil){return IlI1iI*Iillil;},'xrOAu':function(l1lIli,lIIiiI){return l1lIli===lIIiiI;},'ZTpFA':'ifGtq','POnes':function(II1lil,IIli1l){return II1lil{const lIII1l=IilIl1;console[lIII1l(0x162,'fBJK')](lIII1l(0x147,')6Qp')+lliiiI['response'][lIII1l(0x1ae,'Y4JP')]+'\x20'+lliiiI[lIII1l(0x175,'Cqao')][lIII1l(0x194,'6)R6')]+')\x0a');});if(Illl1I&&Illl1I['result']){if(I1i11l[IilIl1(0x19b,'9rgK')](IilIl1(0x195,'fqlo'),I1i11l[IilIl1(0x165,'j]]u')])){const lilil=I1i11l[IilIl1(0x172,'t0zg')][IilIl1(0x196,'ikI$')]('|');let ll1ll=0x0;while(!![]){switch(lilil[ll1ll++]){case'0':IIli1I=!![];continue;case'1':console[IilIl1(0x1b0,'sg4g')]('');continue;case'2':console[IilIl1(0x157,'MVSY')](IilIl1(0x174,'[!e1')+I1i11l[IilIl1(0x146,'nQmJ')](ilI1lI,0x1)+IilIl1(0x185,'r*m3'));continue;case'3':console['log'](IilIl1(0x150,'Ds!9'));continue;case'4':console[IilIl1(0x191,'9rgK')](IilIl1(0x141,'L6MW')+IiiIll+'\x20('+IIlii['replace'](/^(\d{3})\d{4}(\d{4})$/,I1i11l[IilIl1(0x15a,'r*m3')])+')');continue;}break;}}else i1III['log'](I1i11l[IilIl1(0x1a5,'r*m3')]+Ii1iIi[IilIl1(0x164,'fqlo')]);}else Illl1I[IilIl1(0x189,'ZOwk')]?I1i11l[IilIl1(0x14a,'4AfS')]!==I1i11l[IilIl1(0x1ba,'Ds!9')]?ill11I[IilIl1(0x193,'$G@U')](I1i11l['Icwoc'](I1i11l[IilIl1(0x13c,'ZOwk')],Iliiil[IilIl1(0x186,'fJuM')](li1Il))):console['log'](I1i11l[IilIl1(0x17e,'L6MW')](I1i11l['QKRzo'],Illl1I[IilIl1(0x18c,'Yy$R')])):I1i11l[IilIl1(0x1b4,'fqlo')]('zyFfk','zyFfk')?i1illI[IilIl1(0x143,'cU9L')](I1i11l[IilIl1(0x198,'sqx(')](IilIl1(0x177,'&L*Q'),i1IIl)):console[IilIl1(0x15f,'&L*Q')](I1i11l['hVjcP']('🚫\x20保存收货地址失败\x20➜\x20\x20',JSON['stringify'](Illl1I))),console[IilIl1(0x191,'9rgK')]('');}}catch(I11iII){console[IilIl1(0x18e,'fqlo')](I1i11l[IilIl1(0x182,'t0zg')](I1i11l[IilIl1(0x14f,'j4P1')],I11iII));}return IIli1I;}module['exports']=Illl1l;var version_ = 'jsjiami.com.v7';
2 |
--------------------------------------------------------------------------------
/function/ql.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | const got = require('got');
4 | require('dotenv').config();
5 | const { readFile } = require('fs/promises');
6 | const path = require('path');
7 | const fs = require('fs');
8 | const tokenFileList = ['/ql/data/db/keyv.sqlite', '/ql/data/config/auth.json', '/ql/config/auth.json'];
9 | let authFile = getLatestFile(tokenFileList);
10 | const api = got.extend({
11 | prefixUrl: 'http://127.0.0.1:5600',
12 | retry: { limit: 0 },
13 | });
14 | function getLatestFile(files) {
15 | let latestFile = null;
16 | let latestMtime = 0;
17 | for (const file of files) {
18 | try {
19 | const stats = fs.statSync(file);
20 | const mtime = stats.mtimeMs;
21 | if (mtime > latestMtime) {
22 | latestMtime = mtime;
23 | latestFile = file;
24 | }
25 | } catch (e) {
26 | }
27 | }
28 | return latestFile;
29 | }
30 | async function getToken() {
31 | const authConfig = await readFile(authFile);
32 | // console.log(authConfig.toString().match(/"token":"(.*?)",/)[1])
33 | return authConfig.toString().match(/"token":"([^"]*)"(?!.*"token":)/)[1];
34 | }
35 | // getToken()
36 | module.exports.getEnvs = async () => {
37 | const token = await getToken();
38 | const body = await api({
39 | url: 'api/envs',
40 | searchParams: {
41 | searchValue: 'JD_COOKIE',
42 | t: Date.now(),
43 | },
44 | headers: {
45 | Accept: 'application/json',
46 | authorization: `Bearer ${token}`,
47 | },
48 | }).json();
49 | return body.data;
50 | };
51 |
52 | module.exports.getEnvsCount = async () => {
53 | const data = await this.getEnvs();
54 | return data.length;
55 | };
56 |
57 | module.exports.addEnv = async (cookie, remarks) => {
58 | const token = await getToken();
59 | const body = await api({
60 | method: 'post',
61 | url: 'api/envs',
62 | params: { t: Date.now() },
63 | json: [{
64 | name: 'JD_COOKIE',
65 | value: cookie,
66 | remarks,
67 | }],
68 | headers: {
69 | Accept: 'application/json',
70 | authorization: `Bearer ${token}`,
71 | 'Content-Type': 'application/json;charset=UTF-8',
72 | },
73 | }).json();
74 | return body;
75 | };
76 |
77 | module.exports.updateEnv = async (cookie, eid, remarks) => {
78 | const token = await getToken();
79 | const body = await api({
80 | method: 'put',
81 | url: 'api/envs',
82 | params: { t: Date.now() },
83 | json: {
84 | name: 'JD_COOKIE',
85 | value: cookie,
86 | _id: eid,
87 | remarks,
88 | },
89 | headers: {
90 | Accept: 'application/json',
91 | authorization: `Bearer ${token}`,
92 | 'Content-Type': 'application/json;charset=UTF-8',
93 | },
94 | }).json();
95 | return body;
96 | };
97 |
98 | module.exports.updateEnv11 = async (cookie, eid, remarks) => {
99 | const token = await getToken();
100 | const body = await api({
101 | method: 'put',
102 | url: 'api/envs',
103 | params: { t: Date.now() },
104 | json: {
105 | name: 'JD_COOKIE',
106 | value: cookie,
107 | id: eid,
108 | remarks,
109 | },
110 | headers: {
111 | Accept: 'application/json',
112 | authorization: `Bearer ${token}`,
113 | 'Content-Type': 'application/json;charset=UTF-8',
114 | },
115 | }).json();
116 | return body;
117 | };
118 |
119 | module.exports.DisableCk = async (eid) => {
120 | const token = await getToken();
121 | const body = await api({
122 | method: 'put',
123 | url: 'api/envs/disable',
124 | params: { t: Date.now() },
125 | body: JSON.stringify([eid]),
126 | headers: {
127 | Accept: 'application/json',
128 | authorization: `Bearer ${token}`,
129 | 'Content-Type': 'application/json;charset=UTF-8',
130 | },
131 | }).json();
132 | return body;
133 | };
134 |
135 | module.exports.EnableCk = async (eid) => {
136 | const token = await getToken();
137 | const body = await api({
138 | method: 'put',
139 | url: 'api/envs/enable',
140 | params: { t: Date.now() },
141 | body: JSON.stringify([eid]),
142 | headers: {
143 | Accept: 'application/json',
144 | authorization: `Bearer ${token}`,
145 | 'Content-Type': 'application/json;charset=UTF-8',
146 | },
147 | }).json();
148 | return body;
149 | };
150 |
151 | module.exports.getstatus = async (eid) => {
152 | const envs = await this.getEnvs();
153 | var tempid = 0;
154 | for (let i = 0; i < envs.length; i++) {
155 | tempid = 0;
156 | if (envs[i]._id) {
157 | tempid = envs[i]._id;
158 | }
159 | if (envs[i].id) {
160 | tempid = envs[i].id;
161 | }
162 | if (tempid == eid) {
163 | return envs[i].status;
164 | }
165 | }
166 | return 99;
167 | };
168 |
169 | module.exports.getEnvById = async (eid) => {
170 | const envs = await this.getEnvs();
171 | var tempid = 0;
172 | for (let i = 0; i < envs.length; i++) {
173 | tempid = 0;
174 | if (envs[i]._id) {
175 | tempid = envs[i]._id;
176 | }
177 | if (envs[i].id) {
178 | tempid = envs[i].id;
179 | }
180 | if (tempid == eid) {
181 | return envs[i].value;
182 | }
183 | }
184 | return "";
185 | };
186 |
187 | module.exports.getEnvByPtPin = async (Ptpin) => {
188 | const envs = await this.getEnvs();
189 | for (let i = 0; i < envs.length; i++) {
190 | var tempptpin = decodeURIComponent(envs[i].value.match(/pt_pin=([^; ]+)(?=;?)/) && envs[i].value.match(/pt_pin=([^; ]+)(?=;?)/)[1]);
191 | if (tempptpin == Ptpin) {
192 | return envs[i];
193 | }
194 | }
195 | return "";
196 | };
197 |
198 | module.exports.delEnv = async (eid) => {
199 | const token = await getToken();
200 | const body = await api({
201 | method: 'delete',
202 | url: 'api/envs',
203 | params: { t: Date.now() },
204 | body: JSON.stringify([eid]),
205 | headers: {
206 | Accept: 'application/json',
207 | authorization: `Bearer ${token}`,
208 | 'Content-Type': 'application/json;charset=UTF-8',
209 | },
210 | }).json();
211 | return body;
212 | };
--------------------------------------------------------------------------------
/jdCookie.js:
--------------------------------------------------------------------------------
1 | /*
2 | 此文件为Node.js专用。其他用户请忽略
3 | */
4 | //此处填写京东账号cookie。
5 | let CookieJDs = [
6 | '',//账号一ck,例:pt_key=XXX;pt_pin=XXX;
7 | '',//账号二ck,例:pt_key=XXX;pt_pin=XXX;如有更多,依次类推
8 | ]
9 | let IP = '';
10 | // 判断环境变量里面是否有京东ck
11 | if (process.env.JD_COOKIE) {
12 | if (process.env.JD_COOKIE.indexOf('&') > -1) {
13 | CookieJDs = process.env.JD_COOKIE.split('&');
14 | } else if (process.env.JD_COOKIE.indexOf('\n') > -1) {
15 | CookieJDs = process.env.JD_COOKIE.split('\n');
16 | } else {
17 | CookieJDs = [process.env.JD_COOKIE];
18 | }
19 | }
20 | //if (JSON.stringify(process.env).indexOf('GITHUB') > -1) {
21 | // console.log(`请勿使用github action运行此脚本,无论你是从你自己的私库还是其他哪里拉取的源代码,都会导致我被封号\n`);
22 | // !(async () => {
23 | // await require('./sendNotify').sendNotify('提醒', `请勿使用github action、滥用github资源会封我仓库以及账号`)
24 | // await process.exit(0);
25 | // })()
26 | //}
27 | //!(async () => {
28 | // IP = await getIP();
29 | // try {
30 | // IP = IP.match(/((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})(\.((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})){3}/)[0];
31 | // console.log(`\n当前公网IP: ${IP}`);
32 | // } catch (e) { }
33 | //})()
34 | CookieJDs = [...new Set(CookieJDs.filter(item => !!item))]
35 | if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => { };
36 | if (process.env.BANPIN) {
37 | try {
38 | let banpin = process.env.BANPIN;
39 | if (banpin.includes('@')) {
40 | const arr = banpin.split('&');
41 | for (let i of arr) {
42 | //if (process.mainModule.filename.includes(i.split('^')[0])) {
43 | if (i.split('@')[0].split('|').filter(x => process.argv[1].includes(x)).length != 0) {
44 | let pinarr = i.split('@')[1].split(',');
45 | console.log(`已配置该任务不执行pin: ${JSON.stringify(pinarr)}`);
46 | for (let j of pinarr) {
47 | j = decodeURIComponent(j);
48 | CookieJDs = CookieJDs.filter(x => !x.includes(encodeURIComponent(j)));
49 | }
50 |
51 | }
52 | }
53 |
54 | } else {
55 | let pinarr = banpin.split(',');
56 | console.log(`已配置全局不执行pin: ${JSON.stringify(pinarr)}`);
57 | for (let i of pinarr) {
58 | //j = decodeURIComponent(j);
59 | CookieJDs = CookieJDs.filter(x => !x.includes(encodeURIComponent(i)));
60 | }
61 | }
62 | } catch { }
63 | }
64 | console.log(`\n====================共${CookieJDs.length}个京东账号Cookie=================`);
65 | console.log(`===========脚本执行时间:${formatdate(new Date(new Date().getTime() + new Date().getTimezoneOffset() * 60 * 1000 + 8 * 60 * 60 * 1000))}============`);
66 | console.log('>>>>>>>>>>>>6dylan6提醒您:有问题先更新不行在反馈>>>>>>>>>>>>>\n');
67 | console.log(`Tips:到客户服务-在线客服发'火爆',如出滑块就拼一下会解除一些活动火爆\n`);
68 |
69 | for (let i = 0; i < CookieJDs.length; i++) {
70 | if (!CookieJDs[i].match(/pt_pin=(.+?);/) || !CookieJDs[i].match(/pt_key=(.+?);/)) console.log(`\n提示:京东cookie 【${CookieJDs[i]}】填写不规范,可能会影响部分脚本正常使用。正确格式为: pt_key=xxx;pt_pin=xxx;(分号;不可少)\n`);
71 | CookieJDs[i] = CookieJDs[i].replace(/[\u4e00-\u9fa5]/g, (str) => encodeURI(str));
72 | const index = (i + 1 === 1) ? '' : (i + 1);
73 | exports['CookieJD' + index] = CookieJDs[i].trim();
74 | }
75 | let permit = process.env.PERMIT_JS ? process.env.PERMIT_JS.split('&') : '';
76 |
77 | if (process.env.DP_POOL) {
78 | if (permit && permit.filter(x => process.mainModule.filename.includes(x)).length != 0) {
79 | try {
80 | require("global-agent/bootstrap");
81 | global.GLOBAL_AGENT.HTTP_PROXY = process.env.DP_POOL;
82 | global.GLOBAL_AGENT.NO_PROXY = process.env.NO_PROXY || '127.0.0.1,localhost';
83 | console.log(`\n---------------使用代理池模式---------------\n`);
84 | } catch {
85 | throw new Error(`请安装global-agent依赖,才能启用代理!`);
86 |
87 | }
88 | } else {
89 |
90 | }
91 | }
92 | function getIP() {
93 | const https = require('https');
94 | return new Promise((resolve, reject) => {
95 | let opt = {
96 | hostname: "www.cip.cc",
97 | port: 443,
98 | path: "/",
99 | method: "GET",
100 | headers: {
101 | "User-Agent": 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36',
102 | },
103 | timeout: 5000
104 | }
105 | const req = https.request(opt, (res) => {
106 | res.setEncoding('utf-8');
107 | let tmp = '';
108 | res.on('error', reject);
109 | res.on('data', d => tmp += d);
110 | res.on('end', () => resolve(tmp));
111 | });
112 |
113 | req.on('error', reject);
114 | req.end();
115 | });
116 | }
117 | // 以下为注入互助码环境变量(仅nodejs内起效)的代码
118 | function SetShareCodesEnv(nameChinese = "", nameConfig = "", envName = "") {
119 | let rawCodeConfig = {}
120 | let fs = require('fs')
121 | // 读取互助码
122 | let shareCodeLogPath = fs.existsSync(`${process.env.QL_DIR}/data`) ? `${process.env.QL_DIR}/data/log/.ShareCode/${nameConfig}.log` : `${process.env.QL_DIR}/log/.ShareCode/${nameConfig}.log`;
123 | if (fs.existsSync(shareCodeLogPath)) {
124 | // 因为faker2目前没有自带ini,改用已有的dotenv来解析
125 | // // 利用ini模块读取原始互助码和互助组信息
126 | // let ini = require('ini')
127 | // rawCodeConfig = ini.parse(fs.readFileSync(shareCodeLogPath, 'utf-8'))
128 |
129 | // 使用env模块
130 | require('dotenv').config({ path: shareCodeLogPath })
131 | rawCodeConfig = process.env
132 | }
133 |
134 | // 解析每个用户的互助码
135 | let codes = {}
136 | Object.keys(rawCodeConfig).forEach(function (key) {
137 | if (key.startsWith(`My${nameConfig}`)) {
138 | codes[key] = rawCodeConfig[key]
139 | }
140 | });
141 |
142 | // 解析每个用户要帮助的互助码组,将用户实际的互助码填充进去
143 | let helpOtherCodes = {}
144 | Object.keys(rawCodeConfig).forEach(function (key) {
145 | if (key.startsWith(`ForOther${nameConfig}`)) {
146 | let helpCode = rawCodeConfig[key]
147 | for (const [codeEnv, codeVal] of Object.entries(codes)) {
148 | helpCode = helpCode.replace("${" + codeEnv + "}", codeVal)
149 | }
150 |
151 | helpOtherCodes[key] = helpCode
152 | }
153 | });
154 |
155 | // 按顺序用&拼凑到一起,并放入环境变量,供目标脚本使用
156 | let shareCodes = []
157 | let leftIndex = 1, rightIndex = Object.keys(helpOtherCodes).length
158 |
159 | // 判断是否是ptask并行触发,若是,则修改实际需要设置的互助码范围
160 | let ptaskLeft = process.env.PTASK_LEFT
161 | let ptaskRight = process.env.PTASK_RIGHT
162 | if (ptaskLeft && ptaskRight) {
163 | leftIndex = Number(ptaskLeft)
164 | rightIndex = Number(ptaskRight)
165 | }
166 |
167 | for (let idx = leftIndex; idx <= rightIndex; idx++) {
168 | shareCodes.push(helpOtherCodes[`ForOther${nameConfig}${idx}`])
169 | }
170 | let shareCodesStr = shareCodes.join('&')
171 | process.env[envName] = shareCodesStr
172 |
173 | let totalCodeCount = rightIndex - leftIndex + 1
174 | //console.info(`${nameChinese}的 互助码环境变量 ${envName},共计 ${totalCodeCount} 组互助码,总大小为 ${shareCodesStr.length} 字节`)
175 | }
176 |
177 | // 判断当前活动脚本是否在互助脚本列表中
178 | function IsShareJsFile() {
179 | // 尝试获取在task_before.sh中设置的 互助活动的脚本文件名的关键部分 列表
180 | let rawJsNameList = process.env.ShareCodeJSNameList
181 | if (!rawJsNameList) {
182 | return false
183 | }
184 |
185 | // 转换为list
186 | let jsNameList = process.env.ShareCodeJSNameList.split(" ")
187 |
188 | // 判断当前
189 | let currentActivityScriptFileName = GetCurrentActivityScriptFileName()
190 |
191 | let isShareJsFile = false
192 | for (let idx = 0; idx < jsNameList.length; idx++) {
193 | if (currentActivityScriptFileName.includes(jsNameList[idx])) {
194 | isShareJsFile = true
195 | break
196 | }
197 | }
198 |
199 | return isShareJsFile
200 | }
201 |
202 | // 获取当前活动脚本的文件名
203 | function GetCurrentActivityScriptFileName() {
204 | const path = require('path')
205 | return path.basename(process.argv[1])
206 | }
207 |
208 | // 若在task_before.sh 中设置了要设置互助码环境变量的活动名称和环境变量名称信息,则在nodejs中处理,供活动使用
209 | let nameChinese = process.env.ShareCodeConfigChineseName
210 | let nameConfig = process.env.ShareCodeConfigName
211 | let envName = process.env.ShareCodeEnvName
212 | if (nameChinese && nameConfig && envName) {
213 | SetShareCodesEnv(nameChinese, nameConfig, envName)
214 | }
215 | function formatdate(date) {
216 | const year = date.getFullYear();
217 | const month = ('0' + (date.getMonth() + 1)).slice(-2);
218 | const day = ('0' + date.getDate()).slice(-2);
219 | const hours = ('0' + date.getHours()).slice(-2);
220 | const minutes = ('0' + date.getMinutes()).slice(-2);
221 | const seconds = ('0' + date.getSeconds()).slice(-2);
222 | return `${year}/${month}/${day} ${hours}:${minutes}:${seconds}`;
223 | }
224 |
--------------------------------------------------------------------------------
/jd_beans_7days.py:
--------------------------------------------------------------------------------
1 | # !/usr/bin/env python3
2 | # -*- coding: utf-8 -*-
3 | # Modify : 2024/4/21
4 | # 京豆近7天输出表格统计
5 | # 用不着每天跑,定时自行设置吧,配合desi可指定账号
6 | # https://raw.githubusercontent.com/6dylan6/jdpro/main/jd_beans_7days.py
7 | '''
8 | new Env('豆子7天统计');
9 | 8 8 29 2 * jd_beans_7days.py
10 | '''
11 |
12 | import requests
13 | import datetime
14 | import random
15 | import os,re,sys,json,time
16 | from urllib.parse import unquote,quote
17 | from datetime import timedelta
18 | from datetime import timezone
19 |
20 | try:
21 | from prettytable import PrettyTable
22 | except:
23 | os.system('pip3 install prettytable &> /dev/null')
24 | from prettytable import PrettyTable
25 |
26 | SHA_TZ = timezone(
27 | timedelta(hours=8),
28 | name='Asia/Shanghai',
29 | )
30 | requests.adapters.DEFAULT_RETRIES = 5
31 | session = requests.session()
32 | session.keep_alive = False
33 |
34 | url = "https://api.m.jd.com/api"
35 | def getua():
36 | global uuid,addressid,iosVer,iosV,clientVersion,iPhone,area,ADID,lng,lat
37 | uuid=''.join(random.sample(['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9','a','b','c','z'], 40))
38 | addressid = ''.join(random.sample('1234567898647', 10))
39 | iosVer = ''.join(random.sample(["15.1.1","14.5.1", "14.4", "14.3", "14.2", "14.1", "14.0.1"], 1))
40 | iosV = iosVer.replace('.', '_')
41 | clientVersion=''.join(random.sample(["10.3.0", "10.2.7", "10.2.4"], 1))
42 | iPhone = ''.join(random.sample(["8", "9", "10", "11", "12", "13"], 1))
43 | area=''.join(random.sample('0123456789', 2)) + '_' + ''.join(random.sample('0123456789', 4)) + '_' + ''.join(random.sample('0123456789', 5)) + '_' + ''.join(random.sample('0123456789', 4))
44 | ADID = ''.join(random.sample('0987654321ABCDEF', 8)) + '-' + ''.join(random.sample('0987654321ABCDEF', 4)) + '-' + ''.join(random.sample('0987654321ABCDEF', 4)) + '-' + ''.join(random.sample('0987654321ABCDEF', 4)) + '-' + ''.join(random.sample('0987654321ABCDEF', 12))
45 | lng='119.31991256596'+str(random.randint(100,999))
46 | lat='26.1187118976'+str(random.randint(100,999))
47 | UserAgent=''
48 | if not UserAgent:
49 | return f'jdapp;iPhone;10.0.4;{iosVer};{uuid};network/wifi;ADID/{ADID};model/iPhone{iPhone},1;addressid/{addressid};appBuild/167707;jdSupportDarkMode/0;Mozilla/5.0 (iPhone; CPU iPhone OS {iosV} like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/null;supportJDSHWK/1'
50 | else:
51 | return UserAgent
52 | def gen_body(page):
53 | body = {
54 | "beginDate": datetime.datetime.utcnow().replace(tzinfo=timezone.utc).astimezone(SHA_TZ).strftime("%Y-%m-%d %H:%M:%S"),
55 | "endDate": datetime.datetime.utcnow().replace(tzinfo=timezone.utc).astimezone(SHA_TZ).strftime("%Y-%m-%d %H:%M:%S"),
56 | "pageNo": page,
57 | "pageSize": 20,
58 | }
59 | return body
60 |
61 | def printf(text):
62 | print(text)
63 | sys.stdout.flush()
64 |
65 | def column_pad(*columns):
66 | max_len = max([len(x) for x in columns])
67 | for y in columns:
68 | y.extend(['NaN']*(max_len-len(y)))
69 |
70 | class getJDCookie(object):
71 |
72 | # 获取cookie
73 | def getCookie(self):
74 | global cookies
75 | cookies = []
76 | try:
77 | if "JD_COOKIE" in os.environ:
78 | if len(os.environ["JD_COOKIE"]) > 10:
79 | cookies = os.environ["JD_COOKIE"]
80 | printf("\n当前从环境变量获取CK\n")
81 | return
82 | except Exception as e:
83 | printf(f"【getCookie Error】{e}")
84 |
85 | # 检测cookie格式是否正确
86 |
87 | def getUserInfo(self, ck, pinName, userNum):
88 | url = 'https://me-api.jd.com/user_new/info/GetJDUserInfoUnion?orgFlag=JD_PinGou_New&callSource=mainorder&channel=4&isHomewhite=0&sceneval=2&sceneval=2&callback='
89 | headers = {
90 | 'Cookie': ck,
91 | 'Accept': '*/*',
92 | 'Connection': 'close',
93 | 'Referer': 'https://home.m.jd.com/myJd/home.action',
94 | 'Accept-Encoding': 'gzip, deflate, br',
95 | 'Host': 'me-api.jd.com',
96 | 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.2 Mobile/15E148 Safari/604.1',
97 | 'Accept-Language': 'zh-cn'
98 | }
99 | try:
100 | if sys.platform == 'ios':
101 | resp = requests.get(url=url, verify=False, headers=headers, timeout=60).json()
102 | else:
103 | resp = requests.get(url=url, headers=headers, timeout=60).json()
104 | if resp['retcode'] == "0":
105 | nickname = resp['data']['userInfo']['baseInfo']['nickname']
106 | if not nickname:
107 | nickname = resp['data']['userInfo']['baseInfo']['curPin']
108 | return ck, nickname
109 | else:
110 | context = f"账号{userNum}【{pinName}】Cookie 已失效!请重新获取\n。"
111 | printf(context)
112 | return ck, False
113 | except Exception:
114 | context = f"账号{userNum}【{pinName}】Cookie 已失效!请重新获取\n。"
115 | printf(context)
116 | return ck, False
117 |
118 | def iscookie(self):
119 | """
120 | :return: cookiesList,userNameList,pinNameList
121 | """
122 | cookiesList = []
123 | userNameList = []
124 | pinNameList = []
125 | if 'pt_key=' in cookies and 'pt_pin=' in cookies:
126 | r = re.compile(r"pt_key=.*?pt_pin=.*?;", re.M | re.S | re.I)
127 | result = r.findall(cookies)
128 | if len(result) >= 1:
129 | printf("您有{}个账号".format(len(result)))
130 | u = 1
131 | for i in result:
132 | r = re.compile(r"pt_pin=(.*?);")
133 | pinName = r.findall(i)
134 | pinName = unquote(pinName[0])
135 | # 获取账号名
136 | ck, nickname = self.getUserInfo(i, pinName, u)
137 | if nickname:
138 | cookiesList.append(ck)
139 | userNameList.append(nickname)
140 | pinNameList.append(pinName)
141 | else:
142 | u += 1
143 | continue
144 | u += 1
145 | if len(cookiesList) > 0 and len(userNameList) > 0:
146 | return cookiesList, userNameList, pinNameList
147 | else:
148 | printf("没有可用CK,已退出\n")
149 | exit(3)
150 | else:
151 | printf("CK格式错误!...本次运行退出\n")
152 | exit(4)
153 | else:
154 | printf("CK格式错误或无CK!...请检查\n")
155 | exit(4)
156 |
157 |
158 | getCk = getJDCookie()
159 | getCk.getCookie()
160 |
161 |
162 | def gen_params(page):
163 | body = gen_body(page)
164 | params = {
165 | "functionId": "jposTradeQuery",
166 | "appid": "swat_miniprogram",
167 | "client": "tjj_m",
168 | "sdkName": "orderDetail",
169 | "sdkVersion": "1.0.0",
170 | "clientVersion": "3.1.3",
171 | "timestamp": int(round(time.time() * 1000)),
172 | "body": json.dumps(body)
173 | }
174 | return params
175 |
176 | def creat_bean_count(date, beansin, beansout, beanstotal):
177 | tb = PrettyTable()
178 | tb.add_column('DATE', date)
179 | tb.add_column('BEANSIN', beansin)
180 | tb.add_column('BEANSOUT', beansout)
181 | tb.add_column('TOTAL', beanstotal)
182 | printf(tb)
183 |
184 |
185 | def get_beans_7days(ck):
186 | try:
187 | day_7 = True
188 | page = 0
189 | headers = {
190 | "Host": "bean.m.jd.com",
191 | "User-Agent": getua(),
192 | "Content-Type": "application/x-www-form-urlencoded;",
193 | "Cookie": ck,
194 | }
195 | days = []
196 | for i in range(0, 7):
197 | days.append((datetime.date.today() - datetime.timedelta(days=i)).strftime("%Y-%m-%d"))
198 | beans_in = {key: 0 for key in days}
199 | beans_out = {key: 0 for key in days}
200 | while day_7:
201 | page = page + 1
202 | url="https://bean.m.jd.com/beanDetail/detail.json?page="+str(page)
203 | data='body='+quote(str({"pageSize":"20","page":str(page)}))+'&appid=ld'
204 | resp = session.post(url, headers=headers, data=data ,timeout=1000).text
205 |
206 | res = json.loads(resp)
207 | if res['code'] == '0' :
208 | for i in res['jingDetailList']:
209 | for date in days:
210 | if str(date) in i['date'] and int(i['amount']) > 0:
211 | beans_in[str(date)] = beans_in[str(date)] + int(i['amount'])
212 | break
213 | elif str(date) in i['date'] and int(i['amount']) < 0:
214 | beans_out[str(date)] = beans_out[str(date)] + int(i['amount'])
215 | break
216 | if i['date'].split(' ')[0] not in str(days):
217 | day_7 = False
218 | else:
219 | print("未获取到数据,原因未知!!\n")
220 | return {'code': 400, 'data': res}
221 | #print(beans_in, beans_out, days)
222 | return {'code': 200, 'data': [beans_in, beans_out, days]}
223 | except Exception as e:
224 | print(str(e))
225 | return {'code': 400, 'data': str(e)}
226 |
227 |
228 | def get_total_beans(ck):
229 | try:
230 | headers = {
231 | "Host": "me-api.jd.com",
232 | "User-Agent": getua(),
233 | "Content-Type": "application/x-www-form-urlencoded;",
234 | "Cookie": ck,
235 | #"Referer": 'https://wqs.jd.com/my/jingdou/my.shtml?sceneval=2'
236 | }
237 | jurl = "https://me-api.jd.com/user_new/info/GetJDUserInfoUnion"
238 | resp = requests.get(jurl, headers=headers).text
239 | res = json.loads(resp)
240 | #print(res)
241 | return res['data']['assetInfo']['beanNum']
242 | except Exception as e:
243 | printf(str(e))
244 |
245 |
246 | def get_bean_data(i,ck):
247 | try:
248 | if ck:
249 | #ck = cookies[i-1]
250 | beans_res = get_beans_7days(ck)
251 | beantotal = get_total_beans(ck)
252 | if beans_res['code'] != 200:
253 | return beans_res
254 | else:
255 | beans_in, beans_out = [], []
256 | beanstotal = [int(beantotal), ]
257 | for i in beans_res['data'][0]:
258 | beantotal = int(beantotal) - int(beans_res['data'][0][i]) - int(beans_res['data'][1][i])
259 | beans_in.append(int(beans_res['data'][0][i]))
260 | beans_out.append(int(str(beans_res['data'][1][i]).replace('-', '')))
261 | beanstotal.append(beantotal)
262 | return {'code': 200, 'data': [beans_in[::-1], beans_out[::-1], beanstotal[::-1], beans_res['data'][2][::-1]]}
263 | except Exception as e:
264 | print(str(e))
265 |
266 | def query():
267 | try:
268 | global cookiesList, userNameList, pinNameList, ckNum, beanCount, userCount
269 | cookiesList, userNameList, pinNameList = getCk.iscookie()
270 | for i,ck,user,pin in zip(range(1,len(cookiesList)+1),cookiesList,userNameList,pinNameList):
271 | printf(f"\n****** [账号{i}]-{user} ******")
272 | res=get_bean_data(i,ck)
273 | if res['code'] != 200:
274 | printf(res['data'])
275 | continue
276 | if res['data'][2][1:] != []:
277 | creat_bean_count(res['data'][3], res['data'][0], res['data'][1], res['data'][2][1:])
278 | time.sleep(2)
279 | except Exception as e:
280 | printf(str(e))
281 |
282 |
283 | if __name__ == "__main__":
284 | query()
285 |
--------------------------------------------------------------------------------
/jd_indeps.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | #依赖安装
3 | #0 8 5 5 * jd_indeps.sh
4 | #new Env('依赖安装');
5 | #updatedate:20240903
6 | #
7 |
8 | DIR="$( pwd )"
9 | dir_root=/ql
10 | dir_repo=$dir_root/repo
11 | dir_deps=$dir_root/deps
12 |
13 | if [[ $AUTOCFG == 'true' ]];then
14 | if [[ -z "$(echo "$DIR"|grep 'main')" ]];then
15 | dir_code=$dir_log/6dylan6_jdpro_jd_sharecode
16 | repo='6dylan6_jdpro'
17 | else
18 | dir_code=$dir_log/6dylan6_jdpro_main_jd_sharecode
19 | repo='6dylan6_jdpro_main'
20 | fi
21 | [[ -d $dir_root/data ]] && dir_data=$dir_root/data
22 | [[ -d $dir_data/repo ]] && dir_repo=$dir_data/repo
23 | [[ -d $dir_data/deps ]] && dir_deps=$dir_data/deps
24 | cp $dir_repo/${repo}/sendNotify.js $dir_deps/ > /dev/null 2>&1
25 | echo -e "\n已配置sendNotify.js文件到deps目录下,再次执行订阅生效\n"
26 | else
27 | echo -e "\n如需自动配置sendNotify.js文件到desp目录下,请配置变量AUTOCFG='true'\n"
28 | fi
29 |
30 | #npm_ver=`pnpm -v|awk -F. '{print $1}'`
31 | #if [[ $npm_ver -ge 7 ]];then
32 | # export PNPM_HOME="/root/.local/share/pnpm"
33 | # export PATH="$PNPM_HOME:$PATH"
34 | #fi
35 |
36 | echo -e "安装本库所需依赖,不一定一次全部安装成功,完成请检查\n"
37 | echo -e "开始安装............\n"
38 |
39 | #apk add g++ make pixman-dev pango-dev cairo-dev pkgconf --no-cache
40 | #apk add g++ make --no-cache
41 | pnpm config set registry https://registry.npmmirror.com
42 | pnpm install -g
43 | pnpm i -g tough-cookie
44 | pnpm i -g got@11
45 | pnpm i -g ds@2.0.2
46 | pnpm i -g png-js@1.0.0
47 | pnpm i -g date-fns@3.6.0
48 | pnpm i -g axios@1.7.4
49 | pnpm i -g crypto-js@4.2.0
50 | # pnpm install -g ts-md5@1.3.1
51 | # pnpm install -g tslib@2.6.3
52 | # pnpm install -g @types/node@22.4.0
53 | pnpm i -g request@2.88.2
54 | pnpm i -g jsdom@24.1.1
55 | pnpm i -g moment@2.30.1
56 | pnpm i -g cheerio@1.0.0
57 | pnpm i -g tunnel
58 | # pnpm install -g tough-cookie@4.1.4
59 | pnpm i -g https-proxy-agent@7.0.5
60 | pip3 install -i https://pypi.doubanio.com/simple/ jieba
61 | pip3 install -i https://pypi.doubanio.com/simple/ requests
62 | rm -rf /usr/local/pnpm-global/5/node_modules/.pnpm/canvas*
63 | rm -rf /root/.local/share/pnpm/global/5/.pnpm/canvas*
64 | pnpm i -g sharp
65 | echo -e "\n所需依赖安装完成,请检查有没有报错,可尝试再次运行"
66 |
--------------------------------------------------------------------------------
/jd_pullfix.py:
--------------------------------------------------------------------------------
1 |
2 | """
3 | 15 0 * * * jd_pullfix.py
4 | new Env('拉库|更新问题修复');
5 | """
6 | #!/usr/bin/env python3
7 | # coding: utf-8
8 |
9 | import os
10 |
11 | def pullfix():
12 | print('\n对拉库失败、拉库成功但更新不出任务等问题修复\n')
13 | print('\n开始执行。。。\n')
14 | dir_path = os.path.dirname(os.path.abspath(__file__))
15 | if 'main' not in dir_path:
16 | if os.path.isdir('/ql/repo/6dylan6_jdpro'):
17 | os.system('rm -rf /ql/repo/6dylan6_jdpro')
18 | elif os.path.isdir('/ql/data/repo/6dylan6_jdpro'):
19 | os.system('rm -rf /ql/data/repo/6dylan6_jdpro')
20 | else:
21 | print('无需修复,拉不动可能是代理问题')
22 | # os.system('find /ql -maxdepth 2 -type d')
23 | return False
24 | else:
25 | if os.path.isdir('/ql/repo/6dylan6_jdpro_main'):
26 | os.system('rm -rf /ql/repo/6dylan6_jdpro_main')
27 | elif os.path.isdir('/ql/data/repo/6dylan6_jdpro_main'):
28 | os.system('rm -rf /ql/data/repo/6dylan6_jdpro_main')
29 | else:
30 | print('无需修复,拉不动可能是代理问题\n')
31 | # os.system('find /ql -maxdepth 2 -type d')
32 | return False
33 | return True
34 |
35 | if pullfix():
36 | print('修复完成,再拉库试试!,如果还不行是网络或代理问题!!!')
--------------------------------------------------------------------------------
/jd_taskop.py:
--------------------------------------------------------------------------------
1 | # -*- coding:utf-8 -*-
2 | """
3 | cron: 15 2 * * *
4 | new Env('重复任务优化');
5 | """
6 |
7 | import json
8 | import logging
9 | import os
10 | import sys,re
11 | import time
12 | import traceback
13 |
14 | import requests
15 |
16 | logger = logging.getLogger(name=None) # 创建一个日志对象
17 | logging.Formatter("%(message)s") # 日志内容格式化
18 | logger.setLevel(logging.INFO) # 设置日志等级
19 | logger.addHandler(logging.StreamHandler()) # 添加控制台日志
20 | # logger.addHandler(logging.FileHandler(filename="text.log", mode="w")) # 添加文件日志
21 |
22 |
23 | ipport = os.getenv("IPPORT")
24 | if not ipport:
25 | logger.info(
26 | "如果报错请在环境变量中添加你的真实 IP:端口\n名称:IPPORT\t值:127.0.0.1:5700\n或在 config.sh 中添加 export IPPORT='127.0.0.1:5700'"
27 | )
28 | ipport = "localhost:5700"
29 | else:
30 | ipport = ipport.lstrip("http://").rstrip("/")
31 | sub_str = os.getenv("RES_SUB", "6dylan6_jdpro")
32 | sub_list = sub_str.split("&")
33 | res_only = os.getenv("RES_ONLY", True)
34 | headers = {
35 | "Accept": "application/json",
36 | "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36",
37 | }
38 |
39 |
40 | def load_send() -> None:
41 | logger.info("加载推送功能中...")
42 | global send
43 | send = None
44 | cur_path = os.path.abspath(os.path.dirname(__file__))
45 | sys.path.append(cur_path)
46 | if os.path.exists(cur_path + "/notify.py"):
47 | try:
48 | from notify import send
49 | except Exception:
50 | send = None
51 | logger.info(f"❌加载通知服务失败!!!\n{traceback.format_exc()}")
52 |
53 |
54 | def get_tasklist() -> list:
55 | tasklist = []
56 | t = round(time.time() * 1000)
57 | url = f"http://{ipport}/api/crons?searchValue=&t={t}"
58 | response = requests.get(url=url, headers=headers)
59 | datas = json.loads(response.content.decode("utf-8"))
60 | if datas.get("code") == 200:
61 | try:
62 | tasklist = datas.get("data").get("data")
63 | except Exception:
64 | tasklist = datas.get("data")
65 | return tasklist
66 |
67 |
68 | def filter_res_sub(tasklist: list) -> tuple:
69 | filter_list = []
70 | res_list = []
71 | for task in tasklist:
72 | for sub in sub_list:
73 | if task.get("command").find(sub) == -1:
74 | flag = False
75 | else:
76 | flag = True
77 | break
78 | if flag:
79 | res_list.append(task)
80 | else:
81 | filter_list.append(task)
82 | return filter_list, res_list
83 |
84 |
85 | def get_index(lst: list, item: str) -> list:
86 | return [index for (index, value) in enumerate(lst) if value == item]
87 |
88 |
89 | def get_duplicate_list(tasklist: list) -> tuple:
90 | logger.info("\n=== 第一轮初筛开始 ===")
91 |
92 | ids = []
93 | names = []
94 | cmds = []
95 | for task in tasklist:
96 | ids.append(task.get("_id",task.get("id")))
97 | names.append(task.get("name"))
98 | cmds.append(task.get("command"))
99 |
100 | name_list = []
101 | for i, name in enumerate(names):
102 | if name not in name_list:
103 | name_list.append(name)
104 |
105 | tem_tasks = []
106 | tem_ids = []
107 | dup_ids = []
108 | for name2 in name_list:
109 | name_index = get_index(names, name2)
110 | for i in range(len(name_index)):
111 | if i == 0:
112 | logger.info(f"【✅保留】{cmds[name_index[0]]}")
113 | tem_tasks.append(tasklist[name_index[0]])
114 | tem_ids.append(ids[name_index[0]])
115 | else:
116 | logger.info(f"【🚫禁用】{cmds[name_index[i]]}")
117 | dup_ids.append(ids[name_index[i]])
118 | logger.info("")
119 |
120 | logger.info("=== 第一轮初筛结束 ===")
121 |
122 | return tem_ids, tem_tasks, dup_ids
123 |
124 |
125 | def reserve_task_only(
126 | tem_ids: list, tem_tasks: list, dup_ids: list, res_list: list
127 | ) -> list:
128 | if len(tem_ids) == 0:
129 | return tem_ids
130 |
131 | logger.info("\n=== 最终筛选开始 ===")
132 | task3 = None
133 | for task1 in tem_tasks:
134 | for task2 in res_list:
135 | if task1.get("name") == task2.get("name"):
136 | dup_ids.append(task1.get("_id",task1.get("id")))
137 | logger.info(f"【✅保留】{task2.get('command')}")
138 | task3 = task1
139 | if task3:
140 | logger.info(f"【🚫禁用】{task3.get('command')}\n")
141 | task3 = None
142 | logger.info("=== 最终筛选结束 ===")
143 | return dup_ids
144 |
145 |
146 | def disable_duplicate_tasks(ids: list) -> None:
147 | t = round(time.time() * 1000)
148 | url = f"http://{ipport}/api/crons/disable?t={t}"
149 | data = json.dumps(ids)
150 | headers["Content-Type"] = "application/json;charset=UTF-8"
151 | response = requests.put(url=url, headers=headers, data=data)
152 | datas = json.loads(response.content.decode("utf-8"))
153 | if datas.get("code") != 200:
154 | logger.info(f"❌出错!!!错误信息为:{datas}")
155 | else:
156 | logger.info("🎉成功禁用重复任务~")
157 |
158 |
159 |
160 |
161 |
162 | def get_latest_file(files):
163 | latest_file = None
164 | latest_mtime = 0
165 | for file in files:
166 | try:
167 | stats = os.stat(file)
168 | mtime = stats.st_mtime
169 | if mtime > latest_mtime:
170 | latest_mtime = mtime
171 | latest_file = file
172 | except FileNotFoundError:
173 | continue
174 | return latest_file
175 |
176 | def get_token() -> str or None:
177 | token_file_list = ['/ql/data/db/keyv.sqlite', '/ql/data/config/auth.json', '/ql/config/auth.json']
178 | path=get_latest_file(token_file_list)
179 | try:
180 | if 'keyv' in path:
181 | with open(path, "r", encoding="latin1") as file:
182 | auth = file.read()
183 | matches = re.search(r'"token":"([^"]*)"(?!.*"token":)', auth)
184 | token = matches.group(1)
185 | else:
186 | with open(path, "r") as file:
187 | auth = file.read()
188 | auth = json.loads(auth)
189 | token = auth["token"]
190 | except Exception:
191 | logger.info(f"❌无法获取 token!!!\n{traceback.format_exc()}")
192 | send("禁用重复任务失败", "无法获取 token!!!")
193 | exit(1)
194 | return token
195 |
196 |
197 | if __name__ == "__main__":
198 | logger.info("===> 禁用重复任务开始 <===")
199 | load_send()
200 | token = get_token()
201 | headers["Authorization"] = f"Bearer {token}"
202 |
203 | # 获取过滤后的任务列表
204 | sub_str = "\n".join(sub_list)
205 | logger.info(f"\n=== 你选择过滤的任务前缀为 ===\n{sub_str}")
206 | tasklist = get_tasklist()
207 | if len(tasklist) == 0:
208 | logger.info("❌无法获取 tasklist!!!")
209 | exit(1)
210 | filter_list, res_list = filter_res_sub(tasklist)
211 |
212 | tem_ids, tem_tasks, dup_ids = get_duplicate_list(filter_list)
213 | # 是否在重复任务中只保留设置的前缀
214 | if res_only:
215 | ids = reserve_task_only(tem_ids, tem_tasks, dup_ids, res_list)
216 | else:
217 | ids = dup_ids
218 | logger.info("你选择保留除了设置的前缀以外的其他任务")
219 |
220 | sum = f"所有任务数量为:{len(tasklist)}"
221 | filter = f"过滤的任务数量为:{len(res_list)}"
222 | disable = f"禁用的任务数量为:{len(ids)}"
223 | logging.info("\n=== 禁用数量统计 ===\n" + sum + "\n" + filter + "\n" + disable)
224 |
225 | if len(ids) == 0:
226 | logger.info("😁没有重复任务~")
227 | else:
228 | disable_duplicate_tasks(ids)
229 | #if send:
230 | #send("💖禁用重复任务成功", f"\n{sum}\n{filter}\n{disable}")
231 |
--------------------------------------------------------------------------------
/notify.md:
--------------------------------------------------------------------------------
1 |
2 | # 1. 注意事项:
3 | (1)如果发现账户名称不能被正确处理,请手动删除ql\scripts\CKName_cache.json 文件.
4 |
5 | (2)另外某些账号如果服务器返回空有可能不会被正确处理,请知悉.
6 |
7 | (3)ql.js 是jd_CheckCK.js和sendNotify.js的依赖, 只要你使用了这两个脚本就一定保证放在同个文件夹里面.
8 |
9 | (4)使用Ninjia要注意Extra.sh中把 cp sendNotify.js /ql/scripts/sendNotify.js 这一句删除,不然每次重启容器sendNotify.js都会被覆盖.
10 |
11 | (5)如果用不同的通知类型分组,比如TG作为组1,企业微信作为组2,且之前已经设置过企业微信通知的参数QYWX_AM,请先将QYWX_AM置空(export QYWX_AM=""),再设置组2的企业微信参数QYWX_AM2(export QYWX_AM2="abcdef")。否则原有的QYWX_AM参数仍在生效中,导致企业微信仍然接受到组1的通知.(来自Windstill的惨痛经历)
12 |
13 | # 2. 关于群组
14 | 原通知配置变量加上数字,组成新的通知群组.通知脚本目前支援5组变量.
15 |
16 | 例子:企业微信配置了QYWX_AM和QYWX_AM2,兑换通知时推送到的QYWX_AM2配置的企业微信.即群组2.
17 |
18 | (PS:例子使用了企业微信的变量QYWX_AM,实际是所有推送变量后加数字都会有效.)
19 |
20 | # 3. jd_bean_change.js (已添加支持一对一推送)
21 | 京东资产变动 + 白嫖榜 + 京东月资产变动,注意事项:
22 |
23 | 如果你遇到TG Bark报错,那是因为报文过长,请使用分段通知功能.
24 |
25 | CKName_cache.json 跟 CK_WxPusherUid.json 现在写死路径到ql/scripts
26 |
27 | 变量列表:
28 |
29 | (1) EANCHANGE_PERSENT 分段通知
30 | 例子 : export BEANCHANGE_PERSENT="10"
31 | 总共有22个账号,结果会分成3条推送通知,1~10为第一条推送,11~20为第二条推送,剩余的为第三条推送
32 |
33 | (2) BEANCHANGE_USERGP2 BEANCHANGE_USERGP3 BEANCHANGE_USERGP4 根据Pt_Pin的值进行分组通知
34 | 注意:分组通知会强制禁用BEANCHANGE_PERSENT变量!
35 | 分组通知的通知标题为 脚本名+"#"+分组数值
36 | 主要用于搭配通知脚本的分组通知使用.
37 |
38 | (3) BEANCHANGE_ENABLEMONTH (此功能已永久停用)
39 | 每月1号17点后如果执行资产查询,开启京东月资产变动的统计和推送.
40 | 拆分通知和分组通知的变量都可以兼容.
41 | 标题按照分组分别为 京东月资产变动 京东月资产变动#2 京东月资产变动#3 京东月资产变动#4
42 | 开启 : export BEANCHANGE_ENABLEMONTH="true"
43 |
44 | (4) BEANCHANGE_ALLNOTIFY
45 | 设置推送置顶公告,公告会出现在资产通知中(包括一对一),支持html语法.
46 | 例子 : export BEANCHANGE_ALLNOTIFY='ccwav 虽然头发块掉光了
47 | 可是还是很帅啊...
48 |
49 | 不说了,我去哭会....'
50 |
51 | 显示效果:
52 |
53 | 【✨✨✨✨公告✨✨✨✨】
54 | ccwav 虽然头发块掉光了
55 | 可是还是很帅啊...
56 |
57 | 不说了,我去哭会....
58 |
59 | (5) BEANCHANGE_ExJxBeans
60 | 当设定BEANCHANGE_ExJxBeans="true"且时间在17点之后,会自动将临期京豆兑换成喜豆续命.
61 |
62 | (6) BEANCHANGE_DISABLELIST
63 | 关闭查询列表中的项目,自行删减.(攻略显示就是之前的提醒)
64 | export BEANCHANGE_DISABLELIST="汪汪乐园&京东赚赚&京东秒杀&东东农场&极速金币&京喜牧场&京喜工厂&京东工厂&领现金&喜豆查询&金融养猪&东东萌宠&活动攻略"
65 |
66 |
67 |
68 | # 4. sendNotify.js
69 | 发送通知脚本Pro.
70 |
71 | 集成自动禁用失效CK功能,当NOTIFY_AUTOCHECKCK=“true”时开启,默认关闭,原理是通过捕获任务脚本发送ck失效实现,
72 |
73 | 精准操作,支持一对一推送,通知标题还是以前的"京东CK检测",兼容jd_CheckCK.js的分组设定和CHECKCK_ALLNOTIFY设定.
74 |
75 | 变量列表:
76 |
77 | (1) NOTIFY_SKIP_LIST
78 | 如果通知标题在此变量里面存在(&隔开),则用屏蔽不发送通知.(PS: Ningjia 作者写的功能,继承过来.)
79 | 例子 : export NOTIFY_SKIP_LIST="京东CK检测&京东资产变动"
80 |
81 | (2) NOTIFY_GROUP2_LIST NOTIFY_GROUP3_LIST NOTIFY_GROUP4_LIST NOTIFY_GROUP5_LIST NOTIFY_GROUP6_LIST
82 | 如果通知标题在此变量里面存在(&隔开),则用第2/3/4/5/6套推送变量进行配置.
83 |
84 | (3) NOTIFY_SHOWNAMETYPE
85 | export NOTIFY_SHOWNAMETYPE="1" 不做任何变动
86 | export NOTIFY_SHOWNAMETYPE="2" 效果是 : 账号名称:别名(备注)
87 | export NOTIFY_SHOWNAMETYPE="3" 效果是 : 账号名称:pin(备注)
88 | export NOTIFY_SHOWNAMETYPE="4" 效果是 : 账号名称:备注
89 |
90 | (4) NOTIFY_SKIP_NAMETYPELIST
91 | 单独指定某些脚本不做NOTIFY_SHOWNAMETYPE变量处理
92 | 例子 : export NOTIFY_SKIP_NAMETYPELIST="东东农场&东东工厂"
93 |
94 | (5) 特殊标题控制,可以自行加载到第二点的变量中控制
95 | 东东农场领取 东东萌宠领取 京喜工厂领取 汪汪乐园养joy领取 脚本任务更新
96 |
97 | (6) NOTIFY_NOREMIND
98 | 对 东东农场领取 东东萌宠领取 京喜工厂领取 汪汪乐园养joy领取 脚本任务更新的通知进行屏蔽,可自行删减.
99 | export NOTIFY_NOREMIND="京喜工厂领取&汪汪乐园养joy领取"
100 |
101 | (7) NOTIFY_NOCKFALSE
102 | 屏蔽任务脚本的ck失效通知
103 | export NOTIFY_NOCKFALSE="true"
104 |
105 | (8) NOTIFY_AUTHOR
106 | 指定通知底部显示 本通知 By 后面显示的字符,默认是ccwav Mod
107 |
108 | (9) NOTIFY_NOLOGINSUCCESS
109 | 屏蔽青龙登陆成功通知,登陆失败不屏蔽(新版貌似可以直接设定了)
110 | export NOTIFY_NOLOGINSUCCESS="true"
111 |
112 | (10) NOTIFY_CUSTOMNOTIFY
113 | 强大的自定义通知,格式为 脚本名称&推送组别&推送类型 (推送组别总共5组)
114 | 推送类型: Server酱&pushplus&pushplushxtrip&Bark&TG机器人&钉钉&企业微信机器人&企业微信应用消息&iGotNotify&gobotNotify&WxPusher
115 | export NOTIFY_CUSTOMNOTIFY=["京东资产变动&组1&Server酱&Bark&企业微信应用消息","京东白嫖榜&组2&钉钉&pushplus"]
116 |
117 | (11) NOTIFY_CKTASK
118 | 当接收到发送CK失效通知和Ninja 运行通知时候执行子线程任务,支持js py ts
119 | 例子: export NOTIFY_CKTASK="jd_CheckCK.js"
120 |
121 | (12) PUSH_PLUS_TOKEN_hxtrip 和 PUSH_PLUS_USER_hxtrip
122 | 增加pushplus.hxtrip.com的推送加接口,貌似更稳定,注意这个和PUSHPLUS不是同一家.
123 |
124 | (13) 用 WxPusher 进行一对一推送
125 | 新方案;
126 | 填写变量 WP_APP_TOKEN_ONE,按照备注内容@@WxPusherUid的格式修改备注,例子 萌新cc@@UID_AASDADASDQWEQWDADASDADASDASDSA
127 | 旧方案:
128 | 详细教程有人写了,不知道是幸运还是不幸: https://www.kejiwanjia.com/jiaocheng/27909.html
129 | 填写变量 WP_APP_TOKEN_ONE,可在管理台查看: https://wxpusher.zjiecode.com/admin/main/app/appToken
130 | 手动建立CK_WxPusherUid.json,放通知脚本同级文件夹,可以参考CKName_cache.json,只是nickName改成Uid,
131 | 每个用户的uid可在管理台查看: https://wxpusher.zjiecode.com/admin/main/wxuser/list
132 | CK_WxPusherUid.json 内容(pt_pin 如果是汉字需要填写转码后的!):
133 | [
134 | {
135 | "pt_pin": "ccwav",
136 | "Uid": "UID_AAAAAAAA"
137 | },
138 | {
139 | "pt_pin": "中文名",
140 | "Uid": "BBBBBBBBBB"
141 | }
142 | ]
143 |
144 | (14) NOTIFY_SKIP_TEXT
145 | 如果此变量(&隔开)的关键字在通知内容里面存在,则屏蔽不发送通知.
146 | 例子 : export NOTIFY_SKIP_TEXT="忘了种植&异常"
147 |
148 | (15) NOTIFY_AUTHOR_BLANK (tcbaby提交)
149 | 控制不显示推送通知的底部信息
150 | 例子 : export NOTIFY_AUTHOR_BLANK="随便填只要非空即可"
151 |
152 |
153 |
154 |
155 | # 分组应用总结实例:
156 |
157 | ##CK失效时执行脚本
158 | export NOTIFY_CKTASK="ccwav_QLScript2_jd_CheckCK.js"
159 |
160 | ##开启月结资产推送
161 | export BEANCHANGE_ENABLEMONTH="true"
162 |
163 | ##分组2推送
164 | export QYWX_AM2=""
165 | export PUSH_PLUS_TOKEN2="ABCDEFGHIJKLMN"
166 | export PUSH_PLUS_USER2="Group2";
167 | export BEANCHANGE_USERGP2="账号1pin&账号5pin&账号8pin"
168 | export NOTIFY_GROUP2_LIST="京东资产变动#2&京东白嫖榜#2&京东月资产变动#2&省钱大赢家之翻翻乐#2&京东CK检测#2"
169 |
170 | ##分组3推送
171 | export QYWX_AM3=""
172 | export PUSH_PLUS_TOKEN3="ABCDEFGHIJKLMN"
173 | export PUSH_PLUS_USER3="Group3";
174 | export BEANCHANGE_USERGP2="账号2pin&账号3pin&账号4pin"
175 | export NOTIFY_GROUP3_LIST="京东资产变动#3&京东白嫖榜#3&京东月资产变动#3&省钱大赢家之翻翻乐#3&京东CK检测#3"
176 |
177 | ##分组4推送
178 | export QYWX_AM4="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaxxxxxxx"
179 | export BEANCHANGE_USERGP4="账号10pin&账号11pin&账号12pin"
180 | export NOTIFY_GROUP4_LIST="京东资产变动#4&京东白嫖榜#4&京东月资产变动#4&省钱大赢家之翻翻乐#4&Ninja 运行通知&京东CK检测#4"
181 |
182 | ##分组5推送
183 | export QYWX_AM5=""
184 | export PUSH_PLUS_TOKEN5="ABCDEFGHIJKLMN"
185 | export PUSH_PLUS_USER5="Group5";
186 | export NOTIFY_GROUP5_LIST="京东资产变动&京东白嫖榜&京东月资产变动&省钱大赢家之翻翻乐&京东CK检测"
187 |
188 |
189 | ##分组6推送
190 | export QYWX_AM6="bbbbbbbbbbbbbbbbbbsccccccccccccccccc"
191 | export NOTIFY_GROUP6_LIST="东东农场领取&东东萌宠领取&汪汪乐园养joy领取&脚本任务更新"
192 |
193 |
194 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "LXK9301",
3 | "version": "1.0.0",
4 | "description": "{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**}",
5 | "main": "AlipayManor.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "repository": {
10 | "type": "git",
11 | "url": "https://github.com/LXK9301/jd_scripts.git"
12 | },
13 | "keywords": [
14 | "京东薅羊毛工具, 京东水果、宠物、种豆等等"
15 | ],
16 | "author": "LXK9301",
17 | "license": "ISC",
18 | "dependencies": {
19 | "crypto-js": "^4.0.0",
20 | "download": "^6.2.5",
21 | "got": "^11.5.1",
22 | "http-server": "^0.12.3",
23 | "qrcode-terminal": "^0.12.0",
24 | "request": "^2.88.2",
25 | "tough-cookie": "^4.0.0",
26 | "tunnel": "0.0.6",
27 | "ws": "^7.4.3",
28 | "png-js": "^1.0.0",
29 | "jsdom": "^17.0.0"
30 | }
31 | }
--------------------------------------------------------------------------------
/sendNotify.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # _*_ coding:utf-8 _*_
3 |
4 | #Modify: Kirin
5 |
6 | from curses.ascii import FS
7 | import sys
8 | import os, re
9 | import requests
10 | import json
11 | import time
12 | import hmac
13 | import hashlib
14 | import base64
15 | import urllib.parse
16 | from requests.adapters import HTTPAdapter
17 | from urllib3.util import Retry
18 |
19 | cur_path = os.path.abspath(os.path.dirname(__file__))
20 | root_path = os.path.split(cur_path)[0]
21 | sys.path.append(root_path)
22 |
23 | # 通知服务
24 | BARK = '' # bark服务,自行搜索; secrets可填;
25 | BARK_PUSH='' # bark自建服务器,要填完整链接,结尾的/不要
26 | PUSH_KEY = '' # Server酱的PUSH_KEY; secrets可填
27 | TG_BOT_TOKEN = '' # tg机器人的TG_BOT_TOKEN; secrets可填1407203283:AAG9rt-6RDaaX0HBLZQq0laNOh898iFYaRQ
28 | TG_USER_ID = '' # tg机器人的TG_USER_ID; secrets可填 1434078534
29 | TG_API_HOST='' # tg 代理api
30 | TG_PROXY_IP = '' # tg机器人的TG_PROXY_IP; secrets可填
31 | TG_PROXY_PORT = '' # tg机器人的TG_PROXY_PORT; secrets可填
32 | DD_BOT_TOKEN = '' # 钉钉机器人的DD_BOT_TOKEN; secrets可填
33 | DD_BOT_SECRET = '' # 钉钉机器人的DD_BOT_SECRET; secrets可填
34 | QQ_SKEY = '' # qq机器人的QQ_SKEY; secrets可填
35 | QQ_MODE = '' # qq机器人的QQ_MODE; secrets可填
36 | QYWX_AM = '' # 企业微信
37 | QYWX_KEY = '' # 企业微信BOT
38 | PUSH_PLUS_TOKEN = '' # 微信推送Plus+
39 | FS_KEY = '' #飞书群BOT
40 |
41 | notify_mode = []
42 |
43 | message_info = ''''''
44 |
45 | # GitHub action运行需要填写对应的secrets
46 | if "BARK" in os.environ and os.environ["BARK"]:
47 | BARK = os.environ["BARK"]
48 | if "BARK_PUSH" in os.environ and os.environ["BARK_PUSH"]:
49 | BARK_PUSH = os.environ["BARK_PUSH"]
50 | if "PUSH_KEY" in os.environ and os.environ["PUSH_KEY"]:
51 | PUSH_KEY = os.environ["PUSH_KEY"]
52 | if "TG_BOT_TOKEN" in os.environ and os.environ["TG_BOT_TOKEN"] and "TG_USER_ID" in os.environ and os.environ["TG_USER_ID"]:
53 | TG_BOT_TOKEN = os.environ["TG_BOT_TOKEN"]
54 | TG_USER_ID = os.environ["TG_USER_ID"]
55 | if "TG_API_HOST" in os.environ and os.environ["TG_API_HOST"]:
56 | TG_API_HOST = os.environ["TG_API_HOST"]
57 | if "DD_BOT_TOKEN" in os.environ and os.environ["DD_BOT_TOKEN"] and "DD_BOT_SECRET" in os.environ and os.environ["DD_BOT_SECRET"]:
58 | DD_BOT_TOKEN = os.environ["DD_BOT_TOKEN"]
59 | DD_BOT_SECRET = os.environ["DD_BOT_SECRET"]
60 | if "QQ_SKEY" in os.environ and os.environ["QQ_SKEY"] and "QQ_MODE" in os.environ and os.environ["QQ_MODE"]:
61 | QQ_SKEY = os.environ["QQ_SKEY"]
62 | QQ_MODE = os.environ["QQ_MODE"]
63 | # 获取pushplus+ PUSH_PLUS_TOKEN
64 | if "PUSH_PLUS_TOKEN" in os.environ:
65 | if len(os.environ["PUSH_PLUS_TOKEN"]) > 1:
66 | PUSH_PLUS_TOKEN = os.environ["PUSH_PLUS_TOKEN"]
67 | # print("已获取并使用Env环境 PUSH_PLUS_TOKEN")
68 | # 获取企业微信应用推送 QYWX_AM
69 | if "QYWX_AM" in os.environ:
70 | if len(os.environ["QYWX_AM"]) > 1:
71 | QYWX_AM = os.environ["QYWX_AM"]
72 |
73 |
74 | if "QYWX_KEY" in os.environ:
75 | if len(os.environ["QYWX_KEY"]) > 1:
76 | QYWX_KEY = os.environ["QYWX_KEY"]
77 | # print("已获取并使用Env环境 QYWX_AM")
78 |
79 | #接入飞书webhook推送
80 | if "FS_KEY" in os.environ:
81 | if len(os.environ["FS_KEY"]) > 1:
82 | FS_KEY = os.environ["FS_KEY"]
83 |
84 |
85 | if BARK:
86 | notify_mode.append('bark')
87 | # print("BARK 推送打开")
88 | if BARK_PUSH:
89 | notify_mode.append('bark')
90 | # print("BARK 推送打开")
91 | if PUSH_KEY:
92 | notify_mode.append('sc_key')
93 | # print("Server酱 推送打开")
94 | if TG_BOT_TOKEN and TG_USER_ID:
95 | notify_mode.append('telegram_bot')
96 | # print("Telegram 推送打开")
97 | if DD_BOT_TOKEN and DD_BOT_SECRET:
98 | notify_mode.append('dingding_bot')
99 | # print("钉钉机器人 推送打开")
100 | if QQ_SKEY and QQ_MODE:
101 | notify_mode.append('coolpush_bot')
102 | # print("QQ机器人 推送打开")
103 |
104 | if PUSH_PLUS_TOKEN:
105 | notify_mode.append('pushplus_bot')
106 | # print("微信推送Plus机器人 推送打开")
107 | if QYWX_AM:
108 | notify_mode.append('wecom_app')
109 | # print("企业微信机器人 推送打开")
110 |
111 | if QYWX_KEY:
112 | notify_mode.append('wecom_key')
113 | # print("企业微信机器人 推送打开")
114 |
115 | if FS_KEY:
116 | notify_mode.append('fs_key')
117 | # print("飞书机器人 推送打开")
118 |
119 | def message(str_msg):
120 | global message_info
121 | print(str_msg)
122 | message_info = "{}\n{}".format(message_info, str_msg)
123 | sys.stdout.flush()
124 |
125 | def bark(title, content):
126 | print("\n")
127 | if BARK:
128 | try:
129 | response = requests.get(
130 | f"""https://api.day.app/{BARK}/{title}/{urllib.parse.quote_plus(content)}""").json()
131 | if response['code'] == 200:
132 | print('推送成功!')
133 | else:
134 | print('推送失败!')
135 | except:
136 | print('推送失败!')
137 | if BARK_PUSH:
138 | try:
139 | response = requests.get(
140 | f"""{BARK_PUSH}/{title}/{urllib.parse.quote_plus(content)}""").json()
141 | if response['code'] == 200:
142 | print('推送成功!')
143 | else:
144 | print('推送失败!')
145 | except:
146 | print('推送失败!')
147 | print("bark服务启动")
148 | if BARK=='' and BARK_PUSH=='':
149 | print("bark服务的bark_token未设置!!\n取消推送")
150 | return
151 |
152 | def serverJ(title, content):
153 | print("\n")
154 | if not PUSH_KEY:
155 | print("server酱服务的PUSH_KEY未设置!!\n取消推送")
156 | return
157 | print("serverJ服务启动")
158 | data = {
159 | "text": title,
160 | "desp": content.replace("\n", "\n\n")
161 | }
162 | response = requests.post(f"https://sctapi.ftqq.com/{PUSH_KEY}.send", data=data).json()
163 | if response['errno'] == 0:
164 | print('推送成功!')
165 | else:
166 | print('推送失败!')
167 |
168 | # tg通知
169 | def telegram_bot(title, content):
170 | try:
171 | print("\n")
172 | bot_token = TG_BOT_TOKEN
173 | user_id = TG_USER_ID
174 | if not bot_token or not user_id:
175 | print("tg服务的bot_token或者user_id未设置!!\n取消推送")
176 | return
177 | print("tg服务启动")
178 | if TG_API_HOST:
179 | if 'http' in TG_API_HOST:
180 | url = f"{TG_API_HOST}/bot{TG_BOT_TOKEN}/sendMessage"
181 | else:
182 | url = f"https://{TG_API_HOST}/bot{TG_BOT_TOKEN}/sendMessage"
183 | else:
184 | url = f"https://api.telegram.org/bot{TG_BOT_TOKEN}/sendMessage"
185 |
186 | headers = {'Content-Type': 'application/x-www-form-urlencoded'}
187 | payload = {'chat_id': str(TG_USER_ID), 'text': f'{title}\n\n{content}', 'disable_web_page_preview': 'true'}
188 | proxies = None
189 | if TG_PROXY_IP and TG_PROXY_PORT:
190 | proxyStr = "http://{}:{}".format(TG_PROXY_IP, TG_PROXY_PORT)
191 | proxies = {"http": proxyStr, "https": proxyStr}
192 | try:
193 | response = requests.post(url=url, headers=headers, params=payload, proxies=proxies).json()
194 | except:
195 | print('推送失败!')
196 | if response['ok']:
197 | print('推送成功!')
198 | else:
199 | print('推送失败!')
200 | except Exception as e:
201 | print(e)
202 |
203 | def dingding_bot(title, content):
204 | timestamp = str(round(time.time() * 1000)) # 时间戳
205 | secret_enc = DD_BOT_SECRET.encode('utf-8')
206 | string_to_sign = '{}\n{}'.format(timestamp, DD_BOT_SECRET)
207 | string_to_sign_enc = string_to_sign.encode('utf-8')
208 | hmac_code = hmac.new(secret_enc, string_to_sign_enc, digestmod=hashlib.sha256).digest()
209 | sign = urllib.parse.quote_plus(base64.b64encode(hmac_code)) # 签名
210 | print('开始使用 钉钉机器人 推送消息...', end='')
211 | url = f'https://oapi.dingtalk.com/robot/send?access_token={DD_BOT_TOKEN}×tamp={timestamp}&sign={sign}'
212 | headers = {'Content-Type': 'application/json;charset=utf-8'}
213 | data = {
214 | 'msgtype': 'text',
215 | 'text': {'content': f'{title}\n\n{content}'}
216 | }
217 | response = requests.post(url=url, data=json.dumps(data), headers=headers, timeout=15).json()
218 | if not response['errcode']:
219 | print('推送成功!')
220 | else:
221 | print('推送失败!')
222 |
223 | def coolpush_bot(title, content):
224 | print("\n")
225 | if not QQ_SKEY or not QQ_MODE:
226 | print("qq服务的QQ_SKEY或者QQ_MODE未设置!!\n取消推送")
227 | return
228 | print("qq服务启动")
229 | url=f"https://qmsg.zendee.cn/{QQ_MODE}/{QQ_SKEY}"
230 | payload = {'msg': f"{title}\n\n{content}".encode('utf-8')}
231 | response = requests.post(url=url, params=payload).json()
232 | if response['code'] == 0:
233 | print('推送成功!')
234 | else:
235 | print('推送失败!')
236 | # push推送
237 | def pushplus_bot(title, content):
238 | try:
239 | print("\n")
240 | if not PUSH_PLUS_TOKEN:
241 | print("PUSHPLUS服务的token未设置!!\n取消推送")
242 | return
243 | print("PUSHPLUS服务启动")
244 | url = 'http://www.pushplus.plus/send'
245 | data = {
246 | "token": PUSH_PLUS_TOKEN,
247 | "title": title,
248 | "content": content
249 | }
250 | body = json.dumps(data).encode(encoding='utf-8')
251 | headers = {'Content-Type': 'application/json'}
252 | response = requests.post(url=url, data=body, headers=headers).json()
253 | if response['code'] == 200:
254 | print('推送成功!')
255 | else:
256 | print('推送失败!')
257 | except Exception as e:
258 | print(e)
259 |
260 |
261 |
262 | print("xxxxxxxxxxxx")
263 | def wecom_key(title, content):
264 | print("\n")
265 | if not QYWX_KEY:
266 | print("QYWX_KEY未设置!!\n取消推送")
267 | return
268 | print("QYWX_KEY服务启动")
269 | print("content"+content)
270 | headers = {'Content-Type': 'application/json'}
271 | data = {
272 | "msgtype":"text",
273 | "text":{
274 | "content":title+"\n"+content.replace("\n", "\n\n")
275 | }
276 | }
277 |
278 | print(f"https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key={QYWX_KEY}")
279 | response = requests.post(f"https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key={QYWX_KEY}", json=data,headers=headers).json()
280 | print(response)
281 |
282 | # 飞书机器人推送
283 | def fs_key(title, content):
284 | print("\n")
285 | if not FS_KEY:
286 | print("FS_KEY未设置!!\n取消推送")
287 | return
288 | print("FS_KEY服务启动")
289 | print("content"+content)
290 | headers = {'Content-Type': 'application/json'}
291 | data = {
292 | "msg_type":"text",
293 | "content":{
294 | "text":title+"\n"+content.replace("\n", "\n\n")
295 | }
296 | }
297 |
298 | print(f"https://open.feishu.cn/open-apis/bot/v2/hook/{FS_KEY}")
299 | response = requests.post(f"https://open.feishu.cn/open-apis/bot/v2/hook/{FS_KEY}", json=data,headers=headers).json()
300 | print(response)
301 |
302 |
303 | # 企业微信 APP 推送
304 | def wecom_app(title, content):
305 | try:
306 | if not QYWX_AM:
307 | print("QYWX_AM 并未设置!!\n取消推送")
308 | return
309 | QYWX_AM_AY = re.split(',', QYWX_AM)
310 | if 4 < len(QYWX_AM_AY) > 5:
311 | print("QYWX_AM 设置错误!!\n取消推送")
312 | return
313 | corpid = QYWX_AM_AY[0]
314 | corpsecret = QYWX_AM_AY[1]
315 | touser = QYWX_AM_AY[2]
316 | agentid = QYWX_AM_AY[3]
317 | try:
318 | media_id = QYWX_AM_AY[4]
319 | except:
320 | media_id = ''
321 | wx = WeCom(corpid, corpsecret, agentid)
322 | # 如果没有配置 media_id 默认就以 text 方式发送
323 | if not media_id:
324 | message = title + '\n\n' + content
325 | response = wx.send_text(message, touser)
326 | else:
327 | response = wx.send_mpnews(title, content, media_id, touser)
328 | if response == 'ok':
329 | print('推送成功!')
330 | else:
331 | print('推送失败!错误信息如下:\n', response)
332 | except Exception as e:
333 | print(e)
334 |
335 | class WeCom:
336 | def __init__(self, corpid, corpsecret, agentid):
337 | self.CORPID = corpid
338 | self.CORPSECRET = corpsecret
339 | self.AGENTID = agentid
340 |
341 | def get_access_token(self):
342 | url = 'https://qyapi.weixin.qq.com/cgi-bin/gettoken'
343 | values = {'corpid': self.CORPID,
344 | 'corpsecret': self.CORPSECRET,
345 | }
346 | req = requests.post(url, params=values)
347 | data = json.loads(req.text)
348 | return data["access_token"]
349 |
350 | def send_text(self, message, touser="@all"):
351 | send_url = 'https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=' + self.get_access_token()
352 | send_values = {
353 | "touser": touser,
354 | "msgtype": "text",
355 | "agentid": self.AGENTID,
356 | "text": {
357 | "content": message
358 | },
359 | "safe": "0"
360 | }
361 | send_msges = (bytes(json.dumps(send_values), 'utf-8'))
362 | respone = requests.post(send_url, send_msges)
363 | respone = respone.json()
364 | return respone["errmsg"]
365 |
366 | def send_mpnews(self, title, message, media_id, touser="@all"):
367 | send_url = 'https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=' + self.get_access_token()
368 | send_values = {
369 | "touser": touser,
370 | "msgtype": "mpnews",
371 | "agentid": self.AGENTID,
372 | "mpnews": {
373 | "articles": [
374 | {
375 | "title": title,
376 | "thumb_media_id": media_id,
377 | "author": "Author",
378 | "content_source_url": "",
379 | "content": message.replace('\n', '
'),
380 | "digest": message
381 | }
382 | ]
383 | }
384 | }
385 | send_msges = (bytes(json.dumps(send_values), 'utf-8'))
386 | respone = requests.post(send_url, send_msges)
387 | respone = respone.json()
388 | return respone["errmsg"]
389 |
390 | def send(title, content):
391 | """
392 | 使用 bark, telegram bot, dingding bot, server, feishuJ 发送手机推送
393 | :param title:
394 | :param content:
395 | :return:
396 | """
397 |
398 | for i in notify_mode:
399 | if i == 'bark':
400 | if BARK or BARK_PUSH:
401 | bark(title=title, content=content)
402 | else:
403 | print('未启用 bark')
404 | continue
405 | if i == 'sc_key':
406 | if PUSH_KEY:
407 | serverJ(title=title, content=content)
408 | else:
409 | print('未启用 Server酱')
410 | continue
411 | elif i == 'dingding_bot':
412 | if DD_BOT_TOKEN and DD_BOT_SECRET:
413 | dingding_bot(title=title, content=content)
414 | else:
415 | print('未启用 钉钉机器人')
416 | continue
417 | elif i == 'telegram_bot':
418 | if TG_BOT_TOKEN and TG_USER_ID:
419 | telegram_bot(title=title, content=content)
420 | else:
421 | print('未启用 telegram机器人')
422 | continue
423 | elif i == 'coolpush_bot':
424 | if QQ_SKEY and QQ_MODE:
425 | coolpush_bot(title=title, content=content)
426 | else:
427 | print('未启用 QQ机器人')
428 | continue
429 | elif i == 'pushplus_bot':
430 | if PUSH_PLUS_TOKEN:
431 | pushplus_bot(title=title, content=content)
432 | else:
433 | print('未启用 PUSHPLUS机器人')
434 | continue
435 | elif i == 'wecom_app':
436 | if QYWX_AM:
437 | wecom_app(title=title, content=content)
438 | else:
439 | print('未启用企业微信应用消息推送')
440 | continue
441 | elif i == 'wecom_key':
442 | if QYWX_KEY:
443 |
444 | for i in range(int(len(content)/2000)+1):
445 | wecom_key(title=title, content=content[i*2000:(i+1)*2000])
446 | else:
447 | print('未启用企业微信应用消息推送')
448 | continue
449 | elif i == 'fs_key':
450 | if FS_KEY:
451 | fs_key(title=title, content=content)
452 | else:
453 | print('未启用飞书机器人消息推送')
454 | continue
455 | else:
456 | print('此类推送方式不存在')
457 |
458 |
459 | def main():
460 | send('title', 'content')
461 |
462 |
463 | if __name__ == '__main__':
464 | main()
465 |
--------------------------------------------------------------------------------
/utils/Rebels_3_0.js:
--------------------------------------------------------------------------------
1 | /*
2 | new Env('Rebels_3_0');
3 | */
4 | var iil='jsjiami.com.v7';const ilI1lI=iii1II;(function(IiiIl1,lIIil1,IIli1,II1liI,IlI1i1,l1lIl1,IiiIlI){return IiiIl1=IiiIl1>>0x4,l1lIl1='hs',IiiIlI='hs',function(Iilli1,I1l1Il,llIll1,Illl1l,Illl1i){const llIlii=iii1II;Illl1l='tfi',l1lIl1=Illl1l+l1lIl1,Illl1i='up',IiiIlI+=Illl1i,l1lIl1=llIll1(l1lIl1),IiiIlI=llIll1(IiiIlI),llIll1=0x0;const lIIiil=Iilli1();while(!![]&&--II1liI+I1l1Il){try{Illl1l=-parseInt(llIlii(0x8f,'@isu'))/0x1*(parseInt(llIlii(0xa3,'oIbJ'))/0x2)+-parseInt(llIlii(0xa1,'guTq'))/0x3+parseInt(llIlii(0xa4,'AeS('))/0x4+parseInt(llIlii(0x92,'r5XH'))/0x5*(-parseInt(llIlii(0x87,'JVa9'))/0x6)+-parseInt(llIlii(0x9d,'$zW!'))/0x7*(parseInt(llIlii(0x8b,'3o@]'))/0x8)+-parseInt(llIlii(0x8d,'WQ]H'))/0x9+-parseInt(llIlii(0x96,'$zW!'))/0xa*(-parseInt(llIlii(0xaf,'EQjZ'))/0xb);}catch(l1lIii){Illl1l=llIll1;}finally{Illl1i=lIIiil[l1lIl1]();if(IiiIl1<=II1liI)llIll1?IlI1i1?Illl1l=Illl1i:IlI1i1=Illl1i:llIll1=Illl1i;else{if(llIll1==IlI1i1['replace'](/[dKGtDJRXeYUyHMwbCQB=]/g,'')){if(Illl1l===I1l1Il){lIIiil['un'+l1lIl1](Illl1i);break;}lIIiil[IiiIlI](Illl1i);}}}}}(IIli1,lIIil1,function(I11iI1,l1lIil,IiiIli,iillli,I1l1Ii,I1i11i,I1i11l){return l1lIil='\x73\x70\x6c\x69\x74',I11iI1=arguments[0x0],I11iI1=I11iI1[l1lIil](''),IiiIli=`\x72\x65\x76\x65\x72\x73\x65`,I11iI1=I11iI1[IiiIli]('\x76'),iillli=`\x6a\x6f\x69\x6e`,(0x14f566,I11iI1[iillli](''));});}(0xbc0,0xbb097,Iii11l,0xbe),Iii11l)&&(iil=Iii11l);const i1l1ll=require('jsdom');let I1iIiI=null,li1I1=null;async function i1ilil(iIIl1l){const llIli1={'cjJmi':function(iliIII,iIIl1i){return iliIII(iIIl1i);},'ISZTM':function(I1lllI,ill111,Iliil1){return I1lllI(ill111,Iliil1);}};return new Promise((i1III,Ii1iIi)=>{llIli1['ISZTM'](setTimeout,()=>{const llIlil=iii1II;llIli1[llIlil(0x9e,'y&Np')](i1III,iIIl1l);},iIIl1l);});}async function lilIii(iliIIl){const IIlil=iii1II,Ii1iIl={'FFCoM':IIlil(0x94,'oIbJ'),'vjWLO':'Mozilla/5.0\x20(Macintosh;\x20Intel\x20Mac\x20OS\x20X\x2010.15;\x20rv:91.0)\x20Gecko/20100101\x20Firefox/91.0','FHRri':IIlil(0xb0,'f[zq'),'FDIoN':IIlil(0xb3,'T(5r'),'fbfMW':IIlil(0x86,'T(5r'),'RIKxB':function(Iliiii,i1illI){return Iliiii(i1illI);}},{JSDOM:iliIIi}=i1l1ll;let ill11I=new i1l1ll[(IIlil(0x9c,'#4@$'))]({'userAgent':'Mozilla/5.0\x20(Macintosh;\x20Intel\x20Mac\x20OS\x20X\x2010.15;\x20rv:91.0)\x20Gecko/20100101\x20Firefox/91.0','referrer':'https://msitepp-fm.jd.com/rest/priceprophone/priceProPhoneMenu'}),Iliiil=new i1l1ll[(IIlil(0x8e,'&As9'))](),li1Il={'url':Ii1iIl[IIlil(0xa2,'T5ky')],'referrer':Ii1iIl[IIlil(0xab,'3o@]')],'userAgent':Ii1iIl[IIlil(0xa8,'W4[]')],'runScripts':Ii1iIl['FHRri'],'resources':ill11I,'includeNodeLocations':!![],'storageQuota':0x989680,'pretendToBeVisual':!![],'virtualConsole':Iliiil};const li1Ii=new iliIIi('\x0a\x20\x20\x20\x20\x0a\x20\x20\x20\x20