├── Script.txt ├── ql_58tc.js ├── ql_bhxcy.js ├── ql_ddgy.js ├── ql_ddgy1.js ├── ql_ddsd.js ├── ql_djxs.js ├── ql_djxs1.js ├── ql_dsj.js ├── ql_dt.js ├── ql_dyhsb.js ├── ql_fdsh.js ├── ql_fqxs.js ├── ql_gylm.js ├── ql_htt.js ├── ql_htt1.js ├── ql_kgyy.js ├── ql_kjwj.js ├── ql_kt.js ├── ql_qsqqg.js ├── ql_sjb.js ├── ql_slyd.js ├── ql_sqxs.js ├── ql_tc.js ├── ql_wlkd.js ├── ql_xj.js ├── ql_xlh.js ├── ql_xmyd.py ├── ql_yysk.js ├── ql_zssq.js ├── ql_zssq1.js └── ql_🍅.js /Script.txt: -------------------------------------------------------------------------------- 1 | hostname=*.palmestore.com,game.xiaojukeji.com,*.zhongchuanjukan.com,api-access.pangolin-sdk-toutiao.com,*.gylm315.cn,game.vrupup.com,*.fqnovel.com,*.beijzc.com,api.cashtoutiao.com 2 | #得间小说 3 | https://dj.palmestore.com/.+/info/getUserInfo? url script-request-body http://script.frp.aiuyo.com:8680/scripts/djxs.js 4 | https://dj.palmestore.com/.+video/report? url script-request-header http://script.frp.aiuyo.com:8680/scripts/djxs.js 5 | #滴滴果园 6 | https://game.xiaojukeji.com/api/game/plant/enter url script-request-header https://raw.githubusercontent.com/leafTheFish/DeathNote/main/ddgy.js 7 | #文旅看点 8 | https://wlkdapi.zhongchuanjukan.com/home/info url script-request-body http://script.frp.aiuyo.com/scripts/wlkd.js 9 | #高佣联盟 10 | https://prd.h5.gylm315.cn/custom_api/html5/taskv6/v1/everydaySignIn url script-request-header http://script.frp.aiuyo.com:8680/scripts/gylm.js 11 | https://api-access.pangolin-sdk-toutiao.com/api/ad/union/sdk/reward_video/reward/ url script-request-body http://script.frp.aiuyo.com:8680/scripts/gylm.js 12 | #香飘飘 13 | sanguo/wujinwen/h5/xpp_10yx/public/index.php/api/index url script-request-header https://raw.githubusercontent.com/Soul012/Scripts/main/ql_xpp.js 14 | #番茄小说 15 | luckycat/novel/v1/task/sign_in/.+ url script-request-header https://raw.githubusercontent.com/Soul012/Scripts/main/ql_fqxs.js 16 | /excitation_ad_treasure_box url script-request-header https://raw.githubusercontent.com/Soul012/Scripts/main/ql_fqxs.js 17 | #书路阅读 18 | v2/welfare url script-request-body http://script.frp.aiuyo.com/scripts/slyd.js 19 | Verify/verifyLogin url script-request-body http://script.frp.aiuyo.com/scripts/slyd.js 20 | #惠头条 21 | /task/list url script-request-header http://script.frp.zhoudedi.top:60080/scripts/htt.js -------------------------------------------------------------------------------- /ql_djxs.js: -------------------------------------------------------------------------------- 1 | /* 2 | 软件名称:得间小说 3 | 完成时间:2021-10-27 @YaphetS0903 4 | 脚本说明:得间小说。。。下载地址,appstore搜索下载 5 | 暂时一天2毛,先刷着,后续更新其他任务,有活动提现,3块4块的样子,常规30提现 6 | 本脚本以学习为主 7 | 获取数据: 进入软件,点击福利,点击看视频赚1000金币,看一个视频获取数据 8 | TG通知群:https://t.me/tom_ww 9 | TG电报交流群: https://t.me/tom_210120 10 | boxjs地址 : 11 | https://raw.githubusercontent.com/YaphetS0903/JStest/main/YaphteS0903.boxjs.json 12 | 得间小说 13 | 青龙环境抓取链接https://dj.palmestore.com/zycl/gold/receive? 14 | 环境配置(@隔开,json格式) 15 | export djxsCookie='抓取的Cookie1@抓取的Cookie2' 16 | export djxsReferer='抓取的Referer1@抓取的Referer2' 17 | 圈X配置如下,其他自行测试,60分钟运行一次,宝箱60分钟开一次 18 | [task_local] 19 | #得间小说 20 | 0 6-23 * * * https://raw.githubusercontent.com/YaphetS0903/JStest/main/djxs.js, tag=得间小说, enabled=true 21 | [rewrite_local] 22 | #得间小说 23 | https://dj.palmestore.com/zycl/gold/receive? url script-request-header https://raw.githubusercontent.com/YaphetS0903/JStest/main/djxs.js 24 | [MITM] 25 | hostname = dj.palmestore.com 26 | cron: 0 6-23 * * * 27 | */ 28 | 29 | const $ = new Env('得间小说'); 30 | let status; 31 | 32 | status = (status = ($.getval("djxsstatus") || "1")) > 1 ? `${status}` : ""; 33 | let djxsurlArr = [], djxsCookieArr = [],djxsRefererArr = [],djxscount = '' 34 | let djxsurl = $.getdata('djxsurl') 35 | let djxsCookie = $.isNode() ? (process.env.djxsCookie ? process.env.djxsCookie : "") : ($.getdata('djxsCookie') ? $.getdata('djxsCookie') : "") 36 | let djxsReferer = $.isNode() ? (process.env.djxsReferer ? process.env.djxsReferer : "") : ($.getdata('djxsReferer') ? $.getdata('djxsReferer') : "") 37 | let b = Math.round(new Date().getTime() / 1000).toString(); 38 | let DD = RT(2000, 3500) 39 | let tz = ($.getval('tz') || '1'); 40 | let tx = ($.getval('tx') || '1'); 41 | let id = '', txid = '',Pigid = '',Catid = '',Dogid = '',dreferfer = '' 42 | $.message = '' 43 | let djxsCookies = "",djxsReferers= "" 44 | 45 | 46 | 47 | 48 | !(async () => { 49 | if (typeof $request !== "undefined") { 50 | await djxsck() 51 | } else { 52 | if (!$.isNode()) { 53 | djxsurlArr.push($.getdata('djxsurl')) 54 | djxsCookieArr.push($.getdata('djxsCookie')) 55 | djxsRefererArr.push($.getdata('djxsReferer')) 56 | 57 | let djxscount = ($.getval('djxscount') || '1'); 58 | for (let i = 2; i <= djxscount; i++) { 59 | djxsurlArr.push($.getdata(`djxsurl${i}`)) 60 | djxsCookieArr.push($.getdata(`djxsCookie${i}`)) 61 | djxsRefererArr.push($.getdata(`djxsReferer${i}`)) 62 | 63 | } 64 | console.log( 65 | `\n\n=============================================== 脚本执行 - 北京时间(UTC+8):${new Date( 66 | new Date().getTime() + 67 | new Date().getTimezoneOffset() * 60 * 1000 + 68 | 8 * 60 * 60 * 1000 69 | ).toLocaleString()} ===============================================\n`); 70 | for (let i = 0; i < djxsCookieArr.length; i++) { 71 | if (djxsCookieArr[i]) { 72 | 73 | djxsurl = djxsurlArr[i]; 74 | djxsCookie = djxsCookieArr[i]; 75 | djxsReferer = djxsRefererArr[i]; 76 | 77 | $.index = i + 1; 78 | console.log(`\n\n开始【得间小说${$.index}】`) 79 | await djxsvideo() 80 | await $.wait(2000) 81 | await djxsbox() 82 | // message() 83 | } 84 | } 85 | } else { 86 | if (process.env.djxsCookie && process.env.djxsCookie.indexOf('@') > -1) { 87 | djxsCookieArr = process.env.djxsCookie.split('@'); 88 | console.log(`您选择的是用"@"隔开\n`) 89 | } else { 90 | djxsCookies = [process.env.djxsCookie] 91 | }; 92 | Object.keys(djxsCookies).forEach((item) => { 93 | if (djxsCookies[item]) { 94 | djxsCookieArr.push(djxsCookies[item]) 95 | } 96 | }) 97 | if (process.env.djxsReferer && process.env.djxsReferer.indexOf('@') > -1) { 98 | djxsRefererArr = process.env.djxsReferer.split('@'); 99 | console.log(`您选择的是用"@"隔开\n`) 100 | } else { 101 | djxsReferers = [process.env.djxsReferer] 102 | }; 103 | Object.keys(djxsReferers).forEach((item) => { 104 | if (djxsReferers[item]) { 105 | djxsRefererArr.push(djxsReferers[item]) 106 | } 107 | }) 108 | 109 | console.log(`共${djxsCookieArr.length}个cookie`) 110 | for (let k = 0; k < djxsCookieArr.length; k++) { 111 | $.message = "" 112 | 113 | djxsCookie = djxsCookieArr[k]; 114 | djxsReferer = djxsRefererArr[k]; 115 | 116 | $.index = k + 1; 117 | console.log(`\n开始【得间小说${$.index}】`) 118 | 119 | await djxsvideo() 120 | await $.wait(2000) 121 | await djxsbox() 122 | // message() 123 | } 124 | } 125 | 126 | } 127 | })() 128 | 129 | .catch((e) => $.logErr(e)) 130 | .finally(() => $.done()) 131 | 132 | 133 | 134 | function djxsck() { 135 | if ($request.url.indexOf("gold/receive?") > -1) { 136 | const djxsurl = $request.url 137 | if (djxsurl) $.setdata(djxsurl, `djxsurl${status}`) 138 | $.log(djxsurl) 139 | 140 | const djxsCookie = $request.headers.Cookie 141 | if (djxsCookie) $.setdata(djxsCookie, `djxsCookie${status}`) 142 | $.log(djxsCookie) 143 | 144 | const djxsReferer = $request.headers.Referer 145 | if (djxsReferer) $.setdata(djxsReferer, `djxsReferer${status}`) 146 | $.log(djxsReferer) 147 | 148 | $.msg($.name, "", `得间小说${status}获取数据成功`) 149 | 150 | } 151 | } 152 | 153 | 154 | 155 | 156 | //看视频 157 | function djxsvideo(timeout = 0) { 158 | return new Promise((resolve) => { 159 | const hd ={"Accept": "*/*", 160 | "Accept-Encoding": "gzip, deflate, br", 161 | "Accept-Language": "zh-cn", 162 | "Connection": "keep-alive", 163 | "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8", 164 | "Cookie": djxsCookie, 165 | "Host": "dj.palmestore.com", 166 | "Referer": djxsReferer, 167 | "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 14_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148", 168 | "X-Requested-With": "XMLHttpRequest"} 169 | dreferfer=djxsReferer.match(/index?(\S.+)/)[1] 170 | let url = { 171 | url: `https://dj.palmestore.com/zycl/gold/receive?${dreferfer}&type=videoTask&videoId=158`, 172 | headers: hd, 173 | 174 | } 175 | $.get(url, async (err, resp, data) => { 176 | try { 177 | 178 | const result = JSON.parse(data) 179 | 180 | if (result.code == 0) { 181 | console.log(`【看视频】:${result.msg}\n`) 182 | console.log(`【获得金币】:${result.body.coin}\n`) 183 | 184 | 185 | } else { 186 | console.log(`【看视频失败】:${result.msg}\n`) 187 | 188 | } 189 | } catch (e) { 190 | 191 | } finally { 192 | 193 | resolve() 194 | } 195 | }, timeout) 196 | }) 197 | } 198 | 199 | 200 | 201 | //开宝箱 202 | function djxsbox(timeout = 0) { 203 | return new Promise((resolve) => { 204 | const hd ={"Accept": "*/*", 205 | "Accept-Encoding": "gzip, deflate, br", 206 | "Accept-Language": "zh-cn", 207 | "Connection": "keep-alive", 208 | "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8", 209 | "Cookie": djxsCookie, 210 | "Host": "dj.palmestore.com", 211 | "Referer": djxsReferer, 212 | "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 14_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148", 213 | "X-Requested-With": "XMLHttpRequest"} 214 | dreferfer=djxsReferer.match(/index?(\S.+)/)[1] 215 | let url = { 216 | url: `https://dj.palmestore.com/zycl/gold/receive?${dreferfer}&type=boxTask&incrId=51`, 217 | headers: hd, 218 | 219 | } 220 | $.get(url, async (err, resp, data) => { 221 | try { 222 | 223 | const result = JSON.parse(data) 224 | 225 | if (result.code == 0) { 226 | console.log(`【开宝箱】:${result.msg}\n`) 227 | console.log(`【获得金币】:${result.body.coin}\n`) 228 | await $.wait(12000) 229 | await djxsboxdb() 230 | 231 | } else { 232 | console.log(`【开宝箱失败】:${result.msg}\n`) 233 | 234 | } 235 | } catch (e) { 236 | 237 | } finally { 238 | 239 | resolve() 240 | } 241 | }, timeout) 242 | }) 243 | } 244 | 245 | //开宝箱翻倍 246 | function djxsboxdb(timeout = 0) { 247 | return new Promise((resolve) => { 248 | const hd ={"Accept": "*/*", 249 | "Accept-Encoding": "gzip, deflate, br", 250 | "Accept-Language": "zh-cn", 251 | "Connection": "keep-alive", 252 | "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8", 253 | "Cookie": djxsCookie, 254 | "Host": "dj.palmestore.com", 255 | "Referer": djxsReferer, 256 | "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 14_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148", 257 | "X-Requested-With": "XMLHttpRequest"} 258 | dreferfer=djxsReferer.match(/index?(\S.+)/)[1] 259 | let url = { 260 | url: `https://dj.palmestore.com/zycl/gold/receive?${dreferfer}&type=boxVideoTask&videoId=168&coin=56`, 261 | headers: hd, 262 | 263 | } 264 | $.get(url, async (err, resp, data) => { 265 | try { 266 | 267 | const result = JSON.parse(data) 268 | 269 | if (result.code == 0) { 270 | console.log(`【开宝箱翻倍】:${result.msg}\n`) 271 | console.log(`【剩余次数】:${result.body.remainingCount}\n`) 272 | 273 | } else { 274 | console.log(`【开宝箱翻倍失败】:${result.msg}\n`) 275 | 276 | } 277 | } catch (e) { 278 | 279 | } finally { 280 | 281 | resolve() 282 | } 283 | }, timeout) 284 | }) 285 | } 286 | 287 | 288 | 289 | 290 | 291 | 292 | function message() { 293 | if (tz == 1) { $.msg($.name, "", $.message) } 294 | } 295 | //时间 296 | nowTimes = new Date( 297 | new Date().getTime() + 298 | new Date().getTimezoneOffset() * 60 * 1000 + 299 | 8 * 60 * 60 * 1000 300 | ); 301 | 302 | function RT(X, Y) { 303 | do rt = Math.floor(Math.random() * Y); 304 | while (rt < X) 305 | return rt; 306 | } 307 | 308 | 309 | //console.log('\n'+getCurrentDate()); 310 | function getCurrentDate() { 311 | var date = new Date(); 312 | var seperator1 = "-"; 313 | var seperator2 = ":"; 314 | var month = date.getMonth() + 1; 315 | var strDate = date.getDate(); 316 | if (month >= 1 && month <= 9) { 317 | month = "0" + month; 318 | } 319 | if (strDate >= 0 && strDate <= 9) { 320 | strDate = "0" + strDate; 321 | } 322 | var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate 323 | + " " + date.getHours() + seperator2 + date.getMinutes() 324 | + seperator2 + date.getSeconds(); 325 | return currentdate; 326 | 327 | 328 | } 329 | 330 | 331 | 332 | 333 | 334 | 335 | function Env(name, opts) { 336 | class Http { 337 | constructor(env) { 338 | this.env = env 339 | } 340 | send(opts, method = 'GET') { 341 | opts = typeof opts === 'string' ? { 342 | url: opts 343 | } : opts 344 | let sender = this.get 345 | if (method === 'POST') { 346 | sender = this.post 347 | } 348 | return new Promise((resolve, reject) => { 349 | sender.call(this, opts, (err, resp, body) => { 350 | if (err) reject(err) 351 | else resolve(resp) 352 | }) 353 | }) 354 | } 355 | get(opts) { 356 | return this.send.call(this.env, opts) 357 | } 358 | post(opts) { 359 | return this.send.call(this.env, opts, 'POST') 360 | } 361 | } 362 | return new (class { 363 | constructor(name, opts) { 364 | this.name = name 365 | this.http = new Http(this) 366 | this.data = null 367 | this.dataFile = 'box.dat' 368 | this.logs = [] 369 | this.isMute = false 370 | this.isNeedRewrite = false 371 | this.logSeparator = '\n' 372 | this.startTime = new Date().getTime() 373 | Object.assign(this, opts) 374 | this.log('', `🔔${this.name 375 | }, 开始!`) 376 | } 377 | isNode() { 378 | return 'undefined' !== typeof module && !!module.exports 379 | } 380 | isQuanX() { 381 | return 'undefined' !== typeof $task 382 | } 383 | isSurge() { 384 | return 'undefined' !== typeof $httpClient && 'undefined' === typeof $loon 385 | } 386 | isLoon() { 387 | return 'undefined' !== typeof $loon 388 | } 389 | isShadowrocket() { 390 | return 'undefined' !== typeof $rocket 391 | } 392 | toObj(str, defaultValue = null) { 393 | try { 394 | return JSON.parse(str) 395 | } catch { 396 | return defaultValue 397 | } 398 | } 399 | toStr(obj, defaultValue = null) { 400 | try { 401 | return JSON.stringify(obj) 402 | } catch { 403 | return defaultValue 404 | } 405 | } 406 | getjson(key, defaultValue) { 407 | let json = defaultValue 408 | const val = this.getdata(key) 409 | if (val) { 410 | try { 411 | json = JSON.parse(this.getdata(key)) 412 | } catch { } 413 | } 414 | return json 415 | } 416 | setjson(val, key) { 417 | try { 418 | return this.setdata(JSON.stringify(val), key) 419 | } catch { 420 | return false 421 | } 422 | } 423 | getScript(url) { 424 | return new Promise((resolve) => { 425 | this.get({ 426 | url 427 | }, (err, resp, body) => resolve(body)) 428 | }) 429 | } 430 | runScript(script, runOpts) { 431 | return new Promise((resolve) => { 432 | let httpapi = this.getdata('@chavy_boxjs_userCfgs.httpapi') 433 | httpapi = httpapi ? httpapi.replace(/\n/g, '').trim() : httpapi 434 | let httpapi_timeout = this.getdata('@chavy_boxjs_userCfgs.httpapi_timeout') 435 | httpapi_timeout = httpapi_timeout ? httpapi_timeout * 1 : 20 436 | httpapi_timeout = runOpts && runOpts.timeout ? runOpts.timeout : httpapi_timeout 437 | const [key, addr] = httpapi.split('@') 438 | const opts = { 439 | url: `http: //${addr}/v1/scripting/evaluate`, 440 | body: { 441 | script_text: script, 442 | mock_type: 'cron', 443 | timeout: httpapi_timeout 444 | }, 445 | headers: { 446 | 'X-Key': key, 447 | 'Accept': '*/*' 448 | } 449 | } 450 | this.post(opts, (err, resp, body) => resolve(body)) 451 | }).catch((e) => this.logErr(e)) 452 | } 453 | loaddata() { 454 | if (this.isNode()) { 455 | this.fs = this.fs ? this.fs : require('fs') 456 | this.path = this.path ? this.path : require('path') 457 | const curDirDataFilePath = this.path.resolve(this.dataFile) 458 | const rootDirDataFilePath = this.path.resolve(process.cwd(), this.dataFile) 459 | const isCurDirDataFile = this.fs.existsSync(curDirDataFilePath) 460 | const isRootDirDataFile = !isCurDirDataFile && this.fs.existsSync(rootDirDataFilePath) 461 | if (isCurDirDataFile || isRootDirDataFile) { 462 | const datPath = isCurDirDataFile ? curDirDataFilePath : rootDirDataFilePath 463 | try { 464 | return JSON.parse(this.fs.readFileSync(datPath)) 465 | } catch (e) { 466 | return {} 467 | } 468 | } else return {} 469 | } else return {} 470 | } 471 | writedata() { 472 | if (this.isNode()) { 473 | this.fs = this.fs ? this.fs : require('fs') 474 | this.path = this.path ? this.path : require('path') 475 | const curDirDataFilePath = this.path.resolve(this.dataFile) 476 | const rootDirDataFilePath = this.path.resolve(process.cwd(), this.dataFile) 477 | const isCurDirDataFile = this.fs.existsSync(curDirDataFilePath) 478 | const isRootDirDataFile = !isCurDirDataFile && this.fs.existsSync(rootDirDataFilePath) 479 | const jsondata = JSON.stringify(this.data) 480 | if (isCurDirDataFile) { 481 | this.fs.writeFileSync(curDirDataFilePath, jsondata) 482 | } else if (isRootDirDataFile) { 483 | this.fs.writeFileSync(rootDirDataFilePath, jsondata) 484 | } else { 485 | this.fs.writeFileSync(curDirDataFilePath, jsondata) 486 | } 487 | } 488 | } 489 | lodash_get(source, path, defaultValue = undefined) { 490 | const paths = path.replace(/[(d+)]/g, '.$1').split('.') 491 | let result = source 492 | for (const p of paths) { 493 | result = Object(result)[p] 494 | if (result === undefined) { 495 | return defaultValue 496 | } 497 | } 498 | return result 499 | } 500 | lodash_set(obj, path, value) { 501 | if (Object(obj) !== obj) return obj 502 | if (!Array.isArray(path)) path = path.toString().match(/[^.[]]+/g) || [] 503 | path 504 | .slice(0, -1) 505 | .reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[ 506 | path[path.length - 1] 507 | ] = value 508 | return obj 509 | } 510 | getdata(key) { 511 | let val = this.getval(key) 512 | // 如果以 @ 513 | if (/^@/.test(key)) { 514 | const [, objkey, paths] = /^@(.*?).(.*?)$/.exec(key) 515 | const objval = objkey ? this.getval(objkey) : '' 516 | if (objval) { 517 | try { 518 | const objedval = JSON.parse(objval) 519 | val = objedval ? this.lodash_get(objedval, paths, '') : val 520 | } catch (e) { 521 | val = '' 522 | } 523 | } 524 | } 525 | return val 526 | } 527 | setdata(val, key) { 528 | let issuc = false 529 | if (/^@/.test(key)) { 530 | const [, objkey, paths] = /^@(.*?).(.*?)$/.exec(key) 531 | const objdat = this.getval(objkey) 532 | const objval = objkey ? (objdat === 'null' ? null : objdat || '{}') : '{}' 533 | try { 534 | const objedval = JSON.parse(objval) 535 | this.lodash_set(objedval, paths, val) 536 | issuc = this.setval(JSON.stringify(objedval), objkey) 537 | } catch (e) { 538 | const objedval = {} 539 | this.lodash_set(objedval, paths, val) 540 | issuc = this.setval(JSON.stringify(objedval), objkey) 541 | } 542 | } else { 543 | issuc = this.setval(val, key) 544 | } 545 | return issuc 546 | } 547 | getval(key) { 548 | if (this.isSurge() || this.isLoon()) { 549 | return $persistentStore.read(key) 550 | } else if (this.isQuanX()) { 551 | return $prefs.valueForKey(key) 552 | } else if (this.isNode()) { 553 | this.data = this.loaddata() 554 | return this.data[key] 555 | } else { 556 | return (this.data && this.data[key]) || null 557 | } 558 | } 559 | setval(val, key) { 560 | if (this.isSurge() || this.isLoon()) { 561 | return $persistentStore.write(val, key) 562 | } else if (this.isQuanX()) { 563 | return $prefs.setValueForKey(val, key) 564 | } else if (this.isNode()) { 565 | this.data = this.loaddata() 566 | this.data[key] = val 567 | this.writedata() 568 | return true 569 | } else { 570 | return (this.data && this.data[key]) || null 571 | } 572 | } 573 | initGotEnv(opts) { 574 | this.got = this.got ? this.got : require('got') 575 | this.cktough = this.cktough ? this.cktough : require('tough-cookie') 576 | this.ckjar = this.ckjar ? this.ckjar : new this.cktough.CookieJar() 577 | if (opts) { 578 | opts.headers = opts.headers ? opts.headers : {} 579 | if (undefined === opts.headers.Cookie && undefined === opts.cookieJar) { 580 | opts.cookieJar = this.ckjar 581 | } 582 | } 583 | } 584 | get(opts, callback = () => { }) { 585 | if (opts.headers) { 586 | delete opts.headers['Content-Type'] 587 | delete opts.headers['Content-Length'] 588 | } 589 | if (this.isSurge() || this.isLoon()) { 590 | if (this.isSurge() && this.isNeedRewrite) { 591 | opts.headers = opts.headers || {} 592 | Object.assign(opts.headers, { 593 | 'X-Surge-Skip-Scripting': false 594 | }) 595 | } 596 | $httpClient.get(opts, (err, resp, body) => { 597 | if (!err && resp) { 598 | resp.body = body 599 | resp.statusCode = resp.status 600 | } 601 | callback(err, resp, body) 602 | }) 603 | } else if (this.isQuanX()) { 604 | if (this.isNeedRewrite) { 605 | opts.opts = opts.opts || {} 606 | Object.assign(opts.opts, { 607 | hints: false 608 | }) 609 | } 610 | $task.fetch(opts).then( 611 | (resp) => { 612 | const { 613 | statusCode: status, 614 | statusCode, 615 | headers, 616 | body 617 | } = resp 618 | callback(null, { 619 | status, 620 | statusCode, 621 | headers, 622 | body 623 | }, body) 624 | }, 625 | (err) => callback(err) 626 | ) 627 | } else if (this.isNode()) { 628 | this.initGotEnv(opts) 629 | this.got(opts) 630 | .on('redirect', (resp, nextOpts) => { 631 | try { 632 | if (resp.headers['set-cookie']) { 633 | const ck = resp.headers['set-cookie'].map(this.cktough.Cookie.parse).toString() 634 | if (ck) { 635 | this.ckjar.setCookieSync(ck, null) 636 | } 637 | nextOpts.cookieJar = this.ckjar 638 | } 639 | } catch (e) { 640 | this.logErr(e) 641 | } 642 | // this.ckjar.setCookieSync(resp.headers['set-cookie'].map(Cookie.parse).toString()) 643 | }) 644 | .then( 645 | (resp) => { 646 | const { 647 | statusCode: status, 648 | statusCode, 649 | headers, 650 | body 651 | } = resp 652 | callback(null, { 653 | status, 654 | statusCode, 655 | headers, 656 | body 657 | }, body) 658 | }, 659 | (err) => { 660 | const { 661 | message: error, 662 | response: resp 663 | } = err 664 | callback(error, resp, resp && resp.body) 665 | } 666 | ) 667 | } 668 | } 669 | post(opts, callback = () => { }) { 670 | const method = opts.method ? opts.method.toLocaleLowerCase() : 'post' 671 | // 如果指定了请求体, 但没指定`Content-Type`, 则自动生成 672 | if (opts.body && opts.headers && !opts.headers['Content-Type']) { 673 | opts.headers['Content-Type'] = 'application/x-www-form-urlencoded' 674 | } 675 | if (opts.headers) delete opts.headers['Content-Length'] 676 | if (this.isSurge() || this.isLoon()) { 677 | if (this.isSurge() && this.isNeedRewrite) { 678 | opts.headers = opts.headers || {} 679 | Object.assign(opts.headers, { 680 | 'X-Surge-Skip-Scripting': false 681 | }) 682 | } 683 | $httpClient[method](opts, (err, resp, body) => { 684 | if (!err && resp) { 685 | resp.body = body 686 | resp.statusCode = resp.status 687 | } 688 | callback(err, resp, body) 689 | }) 690 | } else if (this.isQuanX()) { 691 | opts.method = method 692 | if (this.isNeedRewrite) { 693 | opts.opts = opts.opts || {} 694 | Object.assign(opts.opts, { 695 | hints: false 696 | }) 697 | } 698 | $task.fetch(opts).then( 699 | (resp) => { 700 | const { 701 | statusCode: status, 702 | statusCode, 703 | headers, 704 | body 705 | } = resp 706 | callback(null, { 707 | status, 708 | statusCode, 709 | headers, 710 | body 711 | }, body) 712 | }, 713 | (err) => callback(err) 714 | ) 715 | } else if (this.isNode()) { 716 | this.initGotEnv(opts) 717 | const { 718 | url, 719 | ..._opts 720 | } = opts 721 | this.got[method](url, _opts).then( 722 | (resp) => { 723 | const { 724 | statusCode: status, 725 | statusCode, 726 | headers, 727 | body 728 | } = resp 729 | callback(null, { 730 | status, 731 | statusCode, 732 | headers, 733 | body 734 | }, body) 735 | }, 736 | (err) => { 737 | const { 738 | message: error, 739 | response: resp 740 | } = err 741 | callback(error, resp, resp && resp.body) 742 | } 743 | ) 744 | } 745 | } 746 | /** 747 | * 748 | * 示例:$.time('yyyy-MM-dd qq HH:mm:ss.S') 749 | * :$.time('yyyyMMddHHmmssS') 750 | * y:年 M:月 d:日 q:季 H:时 m:分 s:秒 S:毫秒 751 | * 其中y可选0-4位占位符、S可选0-1位占位符,其余可选0-2位占位符 752 | * @param {string} fmt 格式化参数 753 | * @param {number} 可选: 根据指定时间戳返回格式化日期 754 | * 755 | */ 756 | time(fmt, ts = null) { 757 | const date = ts ? new Date(ts) : new Date() 758 | let o = { 759 | 'M+': date.getMonth() + 1, 760 | 'd+': date.getDate(), 761 | 'H+': date.getHours(), 762 | 'm+': date.getMinutes(), 763 | 's+': date.getSeconds(), 764 | 'q+': Math.floor((date.getMonth() + 3) / 3), 765 | 'S': date.getMilliseconds() 766 | } 767 | if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length)) 768 | for (let k in o) 769 | if (new RegExp('(' + k + ')').test(fmt)) 770 | fmt = fmt.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ('00' + o[k]).substr(('' + o[k]).length)) 771 | return fmt 772 | } 773 | /** 774 | * 系统通知 775 | * 776 | * > 通知参数: 同时支持 QuanX 和 Loon 两种格式, EnvJs根据运行环境自动转换, Surge 环境不支持多媒体通知 777 | * 778 | * 示例: 779 | * $.msg(title, subt, desc, 'twitter://') 780 | * $.msg(title, subt, desc, { 'open-url': 'twitter://', 'media-url': 'https://github.githubassets.com/images/modules/open_graph/github-mark.png' }) 781 | * $.msg(title, subt, desc, { 'open-url': 'https://bing.com', 'media-url': 'https://github.githubassets.com/images/modules/open_graph/github-mark.png' }) 782 | * 783 | * @param {*} title 标题 784 | * @param {*} subt 副标题 785 | * @param {*} desc 通知详情 786 | * @param {*} opts 通知参数 787 | * 788 | */ 789 | msg(title = name, subt = '', desc = '', opts) { 790 | const toEnvOpts = (rawopts) => { 791 | if (!rawopts) return rawopts 792 | if (typeof rawopts === 'string') { 793 | if (this.isLoon()) return rawopts 794 | else if (this.isQuanX()) return { 795 | 'open-url': rawopts 796 | } 797 | else if (this.isSurge()) return { 798 | url: rawopts 799 | } 800 | else return undefined 801 | } else if (typeof rawopts === 'object') { 802 | if (this.isLoon()) { 803 | let openUrl = rawopts.openUrl || rawopts.url || rawopts['open-url'] 804 | let mediaUrl = rawopts.mediaUrl || rawopts['media-url'] 805 | return { 806 | openUrl, 807 | mediaUrl 808 | } 809 | } else if (this.isQuanX()) { 810 | let openUrl = rawopts['open-url'] || rawopts.url || rawopts.openUrl 811 | let mediaUrl = rawopts['media-url'] || rawopts.mediaUrl 812 | return { 813 | 'open-url': openUrl, 814 | 'media-url': mediaUrl 815 | } 816 | } else if (this.isSurge()) { 817 | let openUrl = rawopts.url || rawopts.openUrl || rawopts['open-url'] 818 | return { 819 | url: openUrl 820 | } 821 | } 822 | } else { 823 | return undefined 824 | } 825 | } 826 | if (!this.isMute) { 827 | if (this.isSurge() || this.isLoon()) { 828 | $notification.post(title, subt, desc, toEnvOpts(opts)) 829 | } else if (this.isQuanX()) { 830 | $notify(title, subt, desc, toEnvOpts(opts)) 831 | } 832 | } 833 | if (!this.isMuteLog) { 834 | let logs = ['', '==============📣系统通知📣=============='] 835 | logs.push(title) 836 | subt ? logs.push(subt) : '' 837 | desc ? logs.push(desc) : '' 838 | console.log(logs.join('\n')) 839 | this.logs = this.logs.concat(logs) 840 | } 841 | } 842 | log(...logs) { 843 | if (logs.length > 0) { 844 | this.logs = [...this.logs, ...logs] 845 | } 846 | console.log(logs.join(this.logSeparator)) 847 | } 848 | logErr(err, msg) { 849 | const isPrintSack = !this.isSurge() && !this.isQuanX() && !this.isLoon() 850 | if (!isPrintSack) { 851 | this.log('', `❗️${this.name 852 | }, 错误!`, err) 853 | } else { 854 | this.log('', `❗️${this.name 855 | }, 错误!`, err.stack) 856 | } 857 | } 858 | wait(time) { 859 | return new Promise((resolve) => setTimeout(resolve, time)) 860 | } 861 | done(val = {}) { 862 | const endTime = new Date().getTime() 863 | const costTime = (endTime - this.startTime) / 1000 864 | this.log('', `🔔${this.name 865 | }, 结束!🕛${costTime}秒`) 866 | this.log() 867 | if (this.isSurge() || this.isQuanX() || this.isLoon()) { 868 | $done(val) 869 | } 870 | } 871 | })(name, opts) 872 | } 873 | 874 | 875 | -------------------------------------------------------------------------------- /ql_fdsh.js: -------------------------------------------------------------------------------- 1 | //const $ = new Env('福袋生活') 2 | //cron: 25 8,18 * * * 3 | const _0x50e6b9=_0x3dfb;(function(_0x567560,_0x10411a){const _0x25c4c4=_0x3dfb,_0x9521d6=_0x567560();while(!![]){try{const _0x3494df=parseInt(_0x25c4c4(0xb9))/0x1+parseInt(_0x25c4c4(0xc8))/0x2*(-parseInt(_0x25c4c4(0x10c))/0x3)+-parseInt(_0x25c4c4(0xb3))/0x4+-parseInt(_0x25c4c4(0x117))/0x5*(parseInt(_0x25c4c4(0xca))/0x6)+-parseInt(_0x25c4c4(0x141))/0x7*(-parseInt(_0x25c4c4(0x12d))/0x8)+parseInt(_0x25c4c4(0x138))/0x9*(-parseInt(_0x25c4c4(0xf6))/0xa)+-parseInt(_0x25c4c4(0x12f))/0xb*(-parseInt(_0x25c4c4(0xbb))/0xc);if(_0x3494df===_0x10411a)break;else _0x9521d6['push'](_0x9521d6['shift']());}catch(_0x17e08a){_0x9521d6['push'](_0x9521d6['shift']());}}}(_0x5496,0x8319e));const $=new Env('福袋生活');let envSplitor=['@','\x0a'],result,resurq,resurp,abcd=[],userList=[],usid=0x0,userCount=0x0,OooOo=_0x50e6b9(0xc9),userCookie=($[_0x50e6b9(0x119)]()?process[_0x50e6b9(0xf5)][OooOo]:$['getdata'](OooOo))||'',qd=[...Array(0x32)][_0x50e6b9(0x103)]((_0x4d844e,_0x5b9482)=>_0x5b9482+0x1);function _0x5496(){const _0x1f05ae=['sid','\x20运行通知\x0a\x0a','250vVLVwJ','getDate','isNode','randomList','{\x22taskType\x22:','enc','water','浇水:','decrypt','个账号','done',',\x22multiple\x22:1}','logAndNotify','waterlist','random','tasklist','substr','getHours','isSurge','https://saas.hixiaoman.com/activityTree/getConfig',',\x22taskConfigId\x22:','keep-alive','296QABHXq','isMute','88495OcsSNT','AES','\x20开始运行:\x0a','Content-Length','Mozilla/5.0\x20(iPhone;\x20CPU\x20iPhone\x20OS\x2016_1\x20like\x20Mac\x20OS\x20X)\x20AppleWebKit/605.1.15\x20(KHTML,\x20like\x20Gecko)\x20Mobile/15E148\x20bxnative-1.4.1','signtask','finally','extend','Base64','1793223ktIOsO','签到:','getMinutes','writedata','元==>果树等级:','undefined','sendNotify','\x20秒!','&vcs=0&wuBaNum=0','39403bZrAjD','getplantinfo','headers','https://saas.hixiaoman.com',';sign=fdsh-IOS-hdgj_rxbhsy=','desc','getMonth','./sendNotify','mode','treeid','mediaUrl','taskList','\x0a==============\x20推送\x20==============','toUpperCase','notifyStr','application/json','sty','randomString','charAt','DayWelfare','未找到任何账号','speedTask','consumerId=fdsh-IOS-hdgj_rxbhsy=','test','exec','setdata','read','bottle','post','padStr','wait','speed','opts','url','floor','isLoon','parse','https://saas.hixiaoman.com/activityTask/receiveTaskList','CBC','https://saas.hixiaoman.com/activityTask/finishTask','&isShare=null&consumerId=','3942924ZvbFUt','setValueForKey','signlist','Utf8','fetch','str2json','786840fmqCBz','找到\x20','2124dHVJPZ',';\x20userId=fdsh-IOS-hdgj_rxbhsy=','indexOf','exports','got','body','openUrl','pad','qwertyuioplkjhgfdsazxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890','data','XMLHttpRequest','loaddata','isQuanX','10AVBmVx','fdshck','80916IYcQlm','stringify','无效的http方法:','GITHUB','object','fromCharCode','https://saas.hixiaoman.com/activityTree/receiveBottle','taskType','getMin','tasklist1','write','join','https://saas.hixiaoman.com/activityTree/receiveSign','signTask','rid','string','delete','getSeconds','dotask','领取水桶:','账户现金:','catch','getTime','https://saas.hixiaoman.com/tree_default.html?ADTAG=3096&appKey=fdsh-IOS-hdgj_rxbhsy&activityNo=NC-TREE-002&parentActNo=NC-TREE-002&subActivityNo=NC-TREE-002&strategyId=32&parentStrategyId=32&parentPeriodId=1589&parentActPlanId=1064&activityId=56&bossId=32&placeId=3096&activityType=6&putType=60000&as=2&skinId=92&themeId=530&flowId=0&flowActPlanId=0&activityPlanId=1064&flowActivityType=0&actPeriodId=1589&actTaskId=null&consumeType=1&userKey=','time','setval','{\x22treeId\x22:','奖励领取结果:','saas.hixiaoman.com','keys','showmsg','media-url','length','replace','gzip,\x20deflate,\x20br','==============\x20系统通知\x20==============','Content-Type','zh-CN,zh-Hans;q=0.9','https://saas.hixiaoman.com/activityTask/receiveUpgradeSpeed','open-url','rty','encrypt','getval','env','10eUQodB','get',':任务','treeConfig','assign','每日福利:','log','https://saas.hixiaoman.com/activityTask/getActivityTaskList','then','name','method','本次需要10哟','\x20运行结束,共运行了\x20','map','https://saas.hixiaoman.com/activityTree/watering','send','lodash_set','task','balance','领取奖励:','startTime','push','13686JMCskJ','toString','getdata','https://saas.hixiaoman.com/activityTree/receiveDayWelfare','code','*/*','split','领取阶段奖励:','任务:'];_0x5496=function(){return _0x1f05ae;};return _0x5496();}class UserInfo{constructor(_0x353037){const _0x3c465e=_0x50e6b9;this['_']=++usid,this['f']='账号\x20['+this['_']+']\x20',this['ck']=_0x353037[_0x3c465e(0x112)]('#'),this['i']=this['ck'][0x0],this['p']=this['ck'][0x1],this['s']=this['ck'][0x2],this['h']={'X-Requested-With':_0x3c465e(0xc5),'Connection':'keep-alive','Accept-Encoding':_0x3c465e(0xec),'Content-Type':_0x3c465e(0x150),'Origin':'https://saas.hixiaoman.com','User-Agent':_0x3c465e(0x133),'Cookie':'consumerId=fdsh-IOS-hdgj_rxbhsy='+this['p']+_0x3c465e(0x145)+this['i']+';\x20userId=fdsh-IOS-hdgj_rxbhsy='+this['i']+';','Host':_0x3c465e(0xe6),'Referer':_0x3c465e(0xe1)+this['i']+_0x3c465e(0xb2)+this['p']+_0x3c465e(0x140),'Accept-Language':_0x3c465e(0xef),'Accept':'*/*'};}async[_0x50e6b9(0x107)](){const _0x249515=_0x50e6b9;await this[_0x249515(0x14a)](),await this[_0x249515(0x9d)](),await this[_0x249515(0xb5)]();for(let _0x443cbf of qd){await this[_0x249515(0x142)]();if(this['b']==0x1)break;}await this[_0x249515(0x126)](),await this[_0x249515(0xd3)]();}async[_0x50e6b9(0x9d)](){const _0x876c23=_0x50e6b9;this['h']={'X-Requested-With':_0x876c23(0xc5),'Connection':_0x876c23(0x12c),'Accept-Encoding':_0x876c23(0xec),'Content-Type':'application/json','Origin':_0x876c23(0x144),'User-Agent':_0x876c23(0x133),'Cookie':_0x876c23(0xa0)+this['p']+_0x876c23(0x145)+this['i']+_0x876c23(0xbc)+this['i']+';','Host':'saas.hixiaoman.com','Referer':_0x876c23(0xe1)+this['i']+_0x876c23(0xb2)+this['p']+_0x876c23(0x140),'Accept-Language':_0x876c23(0xef),'Accept':_0x876c23(0x111)},await httpRequest('post',popu(_0x876c23(0x10f),this['h'])),console[_0x876c23(0xfc)](this['f']+_0x876c23(0xfb)+result[_0x876c23(0x146)]);}async[_0x50e6b9(0x14a)](){const _0x343b50=_0x50e6b9;await httpRequest(_0x343b50(0xf7),popu('https://saas.hixiaoman.com/activityTree/getConfig',this['h'])),console['log'](this['f']+_0x343b50(0xde)+result[_0x343b50(0xc4)][_0x343b50(0x108)]/0x64+_0x343b50(0x13c)+result[_0x343b50(0xc4)]['expLevelNo']+'级'),this[_0x343b50(0x14a)]=result[_0x343b50(0xc4)][_0x343b50(0xf9)]['treeId'],await $[_0x343b50(0xa8)](0x7d0),await this[_0x343b50(0xa5)]();}async['bottle'](){const _0x3b5577=_0x50e6b9;this['h']={'X-Requested-With':'XMLHttpRequest','Connection':_0x3b5577(0x12c),'Accept-Encoding':_0x3b5577(0xec),'Content-Type':_0x3b5577(0x150),'Origin':_0x3b5577(0x144),'User-Agent':'Mozilla/5.0\x20(iPhone;\x20CPU\x20iPhone\x20OS\x2016_1\x20like\x20Mac\x20OS\x20X)\x20AppleWebKit/605.1.15\x20(KHTML,\x20like\x20Gecko)\x20Mobile/15E148\x20bxnative-1.4.1','Cookie':_0x3b5577(0xa0)+this['p']+';sign=fdsh-IOS-hdgj_rxbhsy='+this['i']+_0x3b5577(0xbc)+this['i']+';','Host':_0x3b5577(0xe6),'Referer':_0x3b5577(0xe1)+this['i']+_0x3b5577(0xb2)+this['p']+_0x3b5577(0x140),'Accept-Language':_0x3b5577(0xef),'Accept':_0x3b5577(0x111)},this[_0x3b5577(0xc4)]=_0x3b5577(0xe4)+this[_0x3b5577(0x14a)]+_0x3b5577(0x122),await httpRequest('post',popu(_0x3b5577(0xd0),this['h'],this[_0x3b5577(0xc4)])),console[_0x3b5577(0xfc)](this['f']+_0x3b5577(0xdd)+result['desc']),await $[_0x3b5577(0xa8)](0x1388);}async['signlist'](){const _0x244078=_0x50e6b9;await httpRequest(_0x244078(0xf7),popu(_0x244078(0xfd),this['h']));for(let _0x222782 of result[_0x244078(0xc4)][_0x244078(0xd7)]){this[_0x244078(0x115)]=_0x222782['id'],this[_0x244078(0x151)]=_0x222782['taskType'],await this[_0x244078(0x134)]();}}async[_0x50e6b9(0x126)](){const _0x234788=_0x50e6b9;await httpRequest(_0x234788(0xf7),popu('https://saas.hixiaoman.com/activityTask/getActivityTaskList',this['h']));for(let _0x500912 of result[_0x234788(0xc4)][_0x234788(0x9f)]){this['id']=_0x500912['id'],this['ty']=_0x500912[_0x234788(0xd1)],await this[_0x234788(0xa9)]();}}async[_0x50e6b9(0xd3)](){const _0x1e92cc=_0x50e6b9;await httpRequest(_0x1e92cc(0xf7),popu(_0x1e92cc(0xfd),this['h']));for(let _0xb663 of result[_0x1e92cc(0xc4)][_0x1e92cc(0x14c)]){this[_0x1e92cc(0xd8)]=_0xb663['id'],this['rty']=_0xb663[_0x1e92cc(0xd1)],await this[_0x1e92cc(0xdc)](),await this['waterlist']();}}async[_0x50e6b9(0x134)](){const _0xcb2ee1=_0x50e6b9;this['h']={'X-Requested-With':_0xcb2ee1(0xc5),'Connection':_0xcb2ee1(0x12c),'Accept-Encoding':'gzip,\x20deflate,\x20br','Content-Type':_0xcb2ee1(0x150),'Origin':_0xcb2ee1(0x144),'User-Agent':'Mozilla/5.0\x20(iPhone;\x20CPU\x20iPhone\x20OS\x2016_1\x20like\x20Mac\x20OS\x20X)\x20AppleWebKit/605.1.15\x20(KHTML,\x20like\x20Gecko)\x20Mobile/15E148\x20bxnative-1.4.1','Cookie':_0xcb2ee1(0xa0)+this['p']+_0xcb2ee1(0x145)+this['i']+_0xcb2ee1(0xbc)+this['i']+';','Host':_0xcb2ee1(0xe6),'Referer':_0xcb2ee1(0xe1)+this['i']+_0xcb2ee1(0xb2)+this['p']+'&vcs=0&wuBaNum=0','Accept-Language':_0xcb2ee1(0xef),'Accept':'*/*'},this[_0xcb2ee1(0xc4)]=_0xcb2ee1(0x11b)+this[_0xcb2ee1(0x151)]+_0xcb2ee1(0x12b)+this['sid']+'}',await httpRequest(_0xcb2ee1(0xa6),popu(_0xcb2ee1(0xd6),this['h'],this[_0xcb2ee1(0xc4)])),result[_0xcb2ee1(0x110)]==0x0&&console['log'](this['f']+_0xcb2ee1(0x139)+result[_0xcb2ee1(0x146)]),result['code']==0x495e3&&console[_0xcb2ee1(0xfc)](this['f']+'签到:'+result['desc']);}async[_0x50e6b9(0x142)](){const _0x5b5939=_0x50e6b9;await httpRequest('get',popu(_0x5b5939(0x12a),this['h'])),this['treeid']=result[_0x5b5939(0xc4)][_0x5b5939(0xf9)]['treeId'],await this[_0x5b5939(0x11d)]();if(result[_0x5b5939(0x146)]==_0x5b5939(0x101))this['b']=0x1;}async['water'](){const _0x338a06=_0x50e6b9;this['h']={'X-Requested-With':_0x338a06(0xc5),'Connection':_0x338a06(0x12c),'Accept-Encoding':_0x338a06(0xec),'Content-Type':_0x338a06(0x150),'Origin':'https://saas.hixiaoman.com','User-Agent':_0x338a06(0x133),'Cookie':'consumerId=fdsh-IOS-hdgj_rxbhsy='+this['p']+';sign=fdsh-IOS-hdgj_rxbhsy='+this['i']+_0x338a06(0xbc)+this['i']+';','Host':_0x338a06(0xe6),'Referer':'https://saas.hixiaoman.com/tree_default.html?ADTAG=3096&appKey=fdsh-IOS-hdgj_rxbhsy&activityNo=NC-TREE-002&parentActNo=NC-TREE-002&subActivityNo=NC-TREE-002&strategyId=32&parentStrategyId=32&parentPeriodId=1589&parentActPlanId=1064&activityId=56&bossId=32&placeId=3096&activityType=6&putType=60000&as=2&skinId=92&themeId=530&flowId=0&flowActPlanId=0&activityPlanId=1064&flowActivityType=0&actPeriodId=1589&actTaskId=null&consumeType=1&userKey='+this['i']+'&isShare=null&consumerId='+this['p']+_0x338a06(0x140),'Accept-Language':_0x338a06(0xef),'Accept':_0x338a06(0x111)},this[_0x338a06(0xc4)]='{\x22treeId\x22:'+this[_0x338a06(0x14a)]+'}',await httpRequest(_0x338a06(0xa6),popu(_0x338a06(0x104),this['h'],this['data'])),console[_0x338a06(0xfc)](this['f']+_0x338a06(0x11e)+result[_0x338a06(0x146)]),await $[_0x338a06(0xa8)](0x1388);}async[_0x50e6b9(0x124)](){const _0x3bc0b9=_0x50e6b9;this['h']={'X-Requested-With':_0x3bc0b9(0xc5),'Connection':_0x3bc0b9(0x12c),'Accept-Encoding':'gzip,\x20deflate,\x20br','Content-Type':_0x3bc0b9(0x150),'Origin':_0x3bc0b9(0x144),'User-Agent':_0x3bc0b9(0x133),'Cookie':_0x3bc0b9(0xa0)+this['p']+';sign=fdsh-IOS-hdgj_rxbhsy='+this['i']+';\x20userId=fdsh-IOS-hdgj_rxbhsy='+this['i']+';','Host':_0x3bc0b9(0xe6),'Referer':_0x3bc0b9(0xe1)+this['i']+_0x3bc0b9(0xb2)+this['p']+_0x3bc0b9(0x140),'Accept-Language':_0x3bc0b9(0xef),'Accept':_0x3bc0b9(0x111)},this[_0x3bc0b9(0xc4)]=_0x3bc0b9(0x11b)+this[_0x3bc0b9(0xf2)]+_0x3bc0b9(0x12b)+this[_0x3bc0b9(0xd8)]+'}',await httpRequest(_0x3bc0b9(0xa6),popu(_0x3bc0b9(0xaf),this['h'],this[_0x3bc0b9(0xc4)])),result[_0x3bc0b9(0x110)]==0x0&&console[_0x3bc0b9(0xfc)](this['f']+_0x3bc0b9(0xf8)+this['rid']+_0x3bc0b9(0x109)+result[_0x3bc0b9(0x146)]),console['log'](this['f']+_0x3bc0b9(0xf8)+this[_0x3bc0b9(0xd8)]+_0x3bc0b9(0xe5)+result[_0x3bc0b9(0x146)]),await $[_0x3bc0b9(0xa8)](0x1388);}async[_0x50e6b9(0xdc)](){const _0x19725c=_0x50e6b9;this['h']={'X-Requested-With':_0x19725c(0xc5),'Connection':_0x19725c(0x12c),'Accept-Encoding':'gzip,\x20deflate,\x20br','Content-Type':_0x19725c(0x150),'Origin':_0x19725c(0x144),'User-Agent':'Mozilla/5.0\x20(iPhone;\x20CPU\x20iPhone\x20OS\x2016_1\x20like\x20Mac\x20OS\x20X)\x20AppleWebKit/605.1.15\x20(KHTML,\x20like\x20Gecko)\x20Mobile/15E148\x20bxnative-1.4.1','Cookie':_0x19725c(0xa0)+this['p']+';sign=fdsh-IOS-hdgj_rxbhsy='+this['i']+_0x19725c(0xbc)+this['i']+';','Host':_0x19725c(0xe6),'Referer':_0x19725c(0xe1)+this['i']+_0x19725c(0xb2)+this['p']+_0x19725c(0x140),'Accept-Language':'zh-CN,zh-Hans;q=0.9','Accept':'*/*'},this[_0x19725c(0xc4)]=_0x19725c(0x11b)+this[_0x19725c(0xf2)]+',\x22taskConfigId\x22:'+this[_0x19725c(0xd8)]+'}',await httpRequest(_0x19725c(0xa6),popu(_0x19725c(0xb1),this['h'],this['data'])),console[_0x19725c(0xfc)](this['f']+_0x19725c(0x114)+result[_0x19725c(0x146)]),await $[_0x19725c(0xa8)](0x1388);}async[_0x50e6b9(0xa9)](){const _0x5b221f=_0x50e6b9;this['h']={'X-Requested-With':_0x5b221f(0xc5),'Connection':'keep-alive','Accept-Encoding':'gzip,\x20deflate,\x20br','Content-Type':'application/json','Origin':_0x5b221f(0x144),'User-Agent':_0x5b221f(0x133),'Cookie':_0x5b221f(0xa0)+this['p']+_0x5b221f(0x145)+this['i']+_0x5b221f(0xbc)+this['i']+';','Host':_0x5b221f(0xe6),'Referer':_0x5b221f(0xe1)+this['i']+_0x5b221f(0xb2)+this['p']+_0x5b221f(0x140),'Accept-Language':_0x5b221f(0xef),'Accept':_0x5b221f(0x111)},this[_0x5b221f(0xc4)]=_0x5b221f(0x11b)+this['ty']+_0x5b221f(0x12b)+this['id']+'}',await httpRequest(_0x5b221f(0xa6),popu(_0x5b221f(0xf0),this['h'],this[_0x5b221f(0xc4)])),result[_0x5b221f(0x110)]==0x0&&console[_0x5b221f(0xfc)](this['f']+_0x5b221f(0xf8)+this['id']+_0x5b221f(0x113)+result[_0x5b221f(0x146)]),console['log'](this['f']+':任务'+this['id']+'领取阶段奖励结果:'+result[_0x5b221f(0x146)]),await $['wait'](0x1388);}}!(async()=>{const _0x1c5e12=_0x50e6b9;if(!await checkEnv())return;for(let _0x328232 of userList)await _0x328232[_0x1c5e12(0x107)]();})()[_0x50e6b9(0xdf)](_0x2bf002=>console[_0x50e6b9(0xfc)](_0x2bf002))[_0x50e6b9(0x135)](()=>$[_0x50e6b9(0x121)]());function encrypt(_0x5dc25f){const _0x438877=_0x50e6b9;return CryptoJS['AES'][_0x438877(0xf3)](_0x5dc25f,CryptoJS[_0x438877(0x11c)][_0x438877(0xb6)][_0x438877(0xae)](key),{'iv':CryptoJS[_0x438877(0x11c)][_0x438877(0xb6)]['parse'](iv),'mode':CryptoJS[_0x438877(0x149)][_0x438877(0xb0)],'padding':CryptoJS[_0x438877(0xc2)]['ZeroPadding']})[_0x438877(0x10d)]();}function decrypt(_0x4c8e58){const _0x51544c=_0x50e6b9;return CryptoJS[_0x51544c(0x130)][_0x51544c(0x11f)](_0x4c8e58,CryptoJS[_0x51544c(0x11c)][_0x51544c(0xb6)][_0x51544c(0xae)](key),{'iv':CryptoJS[_0x51544c(0x11c)]['Utf8'][_0x51544c(0xae)](iv),'mode':CryptoJS[_0x51544c(0x149)]['CBC'],'padding':CryptoJS[_0x51544c(0xc2)]['ZeroPadding']})['toString'](CryptoJS[_0x51544c(0x11c)][_0x51544c(0xb6)]);}function EncryptCrypto(_0x8d16a9,_0x2ec12f,_0x363a41,_0xacf838,_0x46e1c1,_0x34902d){const _0x270de6=_0x50e6b9;return CryptoJS[_0x8d16a9]['encrypt'](CryptoJS[_0x270de6(0x11c)][_0x270de6(0xb6)]['parse'](_0xacf838),CryptoJS[_0x270de6(0x11c)][_0x270de6(0xb6)][_0x270de6(0xae)](_0x46e1c1),{'mode':CryptoJS[_0x270de6(0x149)][_0x2ec12f],'padding':CryptoJS[_0x270de6(0xc2)][_0x363a41],'iv':CryptoJS[_0x270de6(0x11c)][_0x270de6(0xb6)][_0x270de6(0xae)](_0x34902d)})['ciphertext'][_0x270de6(0x10d)](CryptoJS[_0x270de6(0x11c)][_0x270de6(0x137)]);}function MD5Encrypt(_0x3b0e49){const _0x93c0cf=_0x50e6b9;function _0xc8155(_0x1dec0c,_0x337ac3){return _0x1dec0c<<_0x337ac3|_0x1dec0c>>>0x20-_0x337ac3;}function _0x590efb(_0x803c4a,_0xb8fde){var _0x578480,_0x3f3482,_0x1ee9bc,_0x800315,_0x59e048;return _0x1ee9bc=0x80000000&_0x803c4a,_0x800315=0x80000000&_0xb8fde,_0x578480=0x40000000&_0x803c4a,_0x3f3482=0x40000000&_0xb8fde,_0x59e048=(0x3fffffff&_0x803c4a)+(0x3fffffff&_0xb8fde),_0x578480&_0x3f3482?0x80000000^_0x59e048^_0x1ee9bc^_0x800315:_0x578480|_0x3f3482?0x40000000&_0x59e048?0xc0000000^_0x59e048^_0x1ee9bc^_0x800315:0x40000000^_0x59e048^_0x1ee9bc^_0x800315:_0x59e048^_0x1ee9bc^_0x800315;}function _0xda711a(_0x1b9ee6,_0x52013a,_0x5b3e8a,_0x26e454,_0x4a30a4,_0xc636a4,_0x3d43ac){var _0x4acb52,_0x2abc22;return _0x1b9ee6=_0x590efb(_0x1b9ee6,_0x590efb(_0x590efb((_0x4acb52=_0x52013a)&(_0x2abc22=_0x5b3e8a)|~_0x4acb52&_0x26e454,_0x4a30a4),_0x3d43ac)),_0x590efb(_0xc8155(_0x1b9ee6,_0xc636a4),_0x52013a);}function _0x32e843(_0x529caa,_0x4f79aa,_0x903f67,_0x5cf183,_0x5390f6,_0x390e9a,_0x5ea167){var _0x3abb15,_0x32b28e,_0x1e6c7d;return _0x529caa=_0x590efb(_0x529caa,_0x590efb(_0x590efb((_0x3abb15=_0x4f79aa,_0x32b28e=_0x903f67,_0x3abb15&(_0x1e6c7d=_0x5cf183)|_0x32b28e&~_0x1e6c7d),_0x5390f6),_0x5ea167)),_0x590efb(_0xc8155(_0x529caa,_0x390e9a),_0x4f79aa);}function _0x43a099(_0x23cecb,_0x173e9d,_0x521bae,_0x1813a6,_0x12131e,_0x3881c5,_0x333b3d){var _0x570e79,_0x19b9a2;return _0x23cecb=_0x590efb(_0x23cecb,_0x590efb(_0x590efb((_0x570e79=_0x173e9d)^(_0x19b9a2=_0x521bae)^_0x1813a6,_0x12131e),_0x333b3d)),_0x590efb(_0xc8155(_0x23cecb,_0x3881c5),_0x173e9d);}function _0x33906c(_0x4be411,_0x4fbb5c,_0x574dd4,_0x345f0a,_0xfa8a9d,_0x491283,_0x41511f){var _0x353c17,_0x3aca00;return _0x4be411=_0x590efb(_0x4be411,_0x590efb(_0x590efb((_0x353c17=_0x4fbb5c,(_0x3aca00=_0x574dd4)^(_0x353c17|~_0x345f0a)),_0xfa8a9d),_0x41511f)),_0x590efb(_0xc8155(_0x4be411,_0x491283),_0x4fbb5c);}function _0x2d1970(_0x294ef3){const _0x333ac8=_0x3dfb;var _0x337466,_0x116915='',_0x9e95f4='';for(_0x337466=0x0;0x3>=_0x337466;_0x337466++)_0x116915+=(_0x9e95f4='0'+(_0x294ef3>>>0x8*_0x337466&0xff)['toString'](0x10))[_0x333ac8(0x127)](_0x9e95f4[_0x333ac8(0xea)]-0x2,0x2);return _0x116915;}var _0x1f9c9b,_0x411bc7,_0x3f7581,_0x22f23e,_0x3045d2,_0x5281a0,_0x47ce6c,_0x51c7be,_0x2a5263,_0x1a5d2c=[];for(_0x1a5d2c=function(_0x23f82b){for(var _0x58109a,_0x291dd9=_0x23f82b['length'],_0xcdf2f8=_0x291dd9+0x8,_0x406e97=0x10*((_0xcdf2f8-_0xcdf2f8%0x40)/0x40+0x1),_0xcedf78=Array(_0x406e97-0x1),_0x2bdfd9=0x0,_0xfb6062=0x0;_0x291dd9>_0xfb6062;)_0x58109a=(_0xfb6062-_0xfb6062%0x4)/0x4,_0x2bdfd9=_0xfb6062%0x4*0x8,_0xcedf78[_0x58109a]=_0xcedf78[_0x58109a]|_0x23f82b['charCodeAt'](_0xfb6062)<<_0x2bdfd9,_0xfb6062++;return _0x58109a=(_0xfb6062-_0xfb6062%0x4)/0x4,_0x2bdfd9=_0xfb6062%0x4*0x8,_0xcedf78[_0x58109a]=_0xcedf78[_0x58109a]|0x80<<_0x2bdfd9,_0xcedf78[_0x406e97-0x2]=_0x291dd9<<0x3,_0xcedf78[_0x406e97-0x1]=_0x291dd9>>>0x1d,_0xcedf78;}(_0x3b0e49=function(_0x47aeb1){const _0x566199=_0x3dfb;_0x47aeb1=_0x47aeb1[_0x566199(0xeb)](/\r\n/g,'\x0a');for(var _0x2dc0f9='',_0x57d86f=0x0;_0x57d86f<_0x47aeb1[_0x566199(0xea)];_0x57d86f++){var _0x3d347b=_0x47aeb1['charCodeAt'](_0x57d86f);0x80>_0x3d347b?_0x2dc0f9+=String[_0x566199(0xcf)](_0x3d347b):_0x3d347b>0x7f&&0x800>_0x3d347b?(_0x2dc0f9+=String['fromCharCode'](_0x3d347b>>0x6|0xc0),_0x2dc0f9+=String[_0x566199(0xcf)](0x3f&_0x3d347b|0x80)):(_0x2dc0f9+=String[_0x566199(0xcf)](_0x3d347b>>0xc|0xe0),_0x2dc0f9+=String[_0x566199(0xcf)](_0x3d347b>>0x6&0x3f|0x80),_0x2dc0f9+=String[_0x566199(0xcf)](0x3f&_0x3d347b|0x80));}return _0x2dc0f9;}(_0x3b0e49)),_0x5281a0=0x67452301,_0x47ce6c=0xefcdab89,_0x51c7be=0x98badcfe,_0x2a5263=0x10325476,_0x1f9c9b=0x0;_0x1f9c9b<_0x1a5d2c[_0x93c0cf(0xea)];_0x1f9c9b+=0x10)_0x411bc7=_0x5281a0,_0x3f7581=_0x47ce6c,_0x22f23e=_0x51c7be,_0x3045d2=_0x2a5263,_0x5281a0=_0xda711a(_0x5281a0,_0x47ce6c,_0x51c7be,_0x2a5263,_0x1a5d2c[_0x1f9c9b+0x0],0x7,0xd76aa478),_0x2a5263=_0xda711a(_0x2a5263,_0x5281a0,_0x47ce6c,_0x51c7be,_0x1a5d2c[_0x1f9c9b+0x1],0xc,0xe8c7b756),_0x51c7be=_0xda711a(_0x51c7be,_0x2a5263,_0x5281a0,_0x47ce6c,_0x1a5d2c[_0x1f9c9b+0x2],0x11,0x242070db),_0x47ce6c=_0xda711a(_0x47ce6c,_0x51c7be,_0x2a5263,_0x5281a0,_0x1a5d2c[_0x1f9c9b+0x3],0x16,0xc1bdceee),_0x5281a0=_0xda711a(_0x5281a0,_0x47ce6c,_0x51c7be,_0x2a5263,_0x1a5d2c[_0x1f9c9b+0x4],0x7,0xf57c0faf),_0x2a5263=_0xda711a(_0x2a5263,_0x5281a0,_0x47ce6c,_0x51c7be,_0x1a5d2c[_0x1f9c9b+0x5],0xc,0x4787c62a),_0x51c7be=_0xda711a(_0x51c7be,_0x2a5263,_0x5281a0,_0x47ce6c,_0x1a5d2c[_0x1f9c9b+0x6],0x11,0xa8304613),_0x47ce6c=_0xda711a(_0x47ce6c,_0x51c7be,_0x2a5263,_0x5281a0,_0x1a5d2c[_0x1f9c9b+0x7],0x16,0xfd469501),_0x5281a0=_0xda711a(_0x5281a0,_0x47ce6c,_0x51c7be,_0x2a5263,_0x1a5d2c[_0x1f9c9b+0x8],0x7,0x698098d8),_0x2a5263=_0xda711a(_0x2a5263,_0x5281a0,_0x47ce6c,_0x51c7be,_0x1a5d2c[_0x1f9c9b+0x9],0xc,0x8b44f7af),_0x51c7be=_0xda711a(_0x51c7be,_0x2a5263,_0x5281a0,_0x47ce6c,_0x1a5d2c[_0x1f9c9b+0xa],0x11,0xffff5bb1),_0x47ce6c=_0xda711a(_0x47ce6c,_0x51c7be,_0x2a5263,_0x5281a0,_0x1a5d2c[_0x1f9c9b+0xb],0x16,0x895cd7be),_0x5281a0=_0xda711a(_0x5281a0,_0x47ce6c,_0x51c7be,_0x2a5263,_0x1a5d2c[_0x1f9c9b+0xc],0x7,0x6b901122),_0x2a5263=_0xda711a(_0x2a5263,_0x5281a0,_0x47ce6c,_0x51c7be,_0x1a5d2c[_0x1f9c9b+0xd],0xc,0xfd987193),_0x51c7be=_0xda711a(_0x51c7be,_0x2a5263,_0x5281a0,_0x47ce6c,_0x1a5d2c[_0x1f9c9b+0xe],0x11,0xa679438e),_0x47ce6c=_0xda711a(_0x47ce6c,_0x51c7be,_0x2a5263,_0x5281a0,_0x1a5d2c[_0x1f9c9b+0xf],0x16,0x49b40821),_0x5281a0=_0x32e843(_0x5281a0,_0x47ce6c,_0x51c7be,_0x2a5263,_0x1a5d2c[_0x1f9c9b+0x1],0x5,0xf61e2562),_0x2a5263=_0x32e843(_0x2a5263,_0x5281a0,_0x47ce6c,_0x51c7be,_0x1a5d2c[_0x1f9c9b+0x6],0x9,0xc040b340),_0x51c7be=_0x32e843(_0x51c7be,_0x2a5263,_0x5281a0,_0x47ce6c,_0x1a5d2c[_0x1f9c9b+0xb],0xe,0x265e5a51),_0x47ce6c=_0x32e843(_0x47ce6c,_0x51c7be,_0x2a5263,_0x5281a0,_0x1a5d2c[_0x1f9c9b+0x0],0x14,0xe9b6c7aa),_0x5281a0=_0x32e843(_0x5281a0,_0x47ce6c,_0x51c7be,_0x2a5263,_0x1a5d2c[_0x1f9c9b+0x5],0x5,0xd62f105d),_0x2a5263=_0x32e843(_0x2a5263,_0x5281a0,_0x47ce6c,_0x51c7be,_0x1a5d2c[_0x1f9c9b+0xa],0x9,0x2441453),_0x51c7be=_0x32e843(_0x51c7be,_0x2a5263,_0x5281a0,_0x47ce6c,_0x1a5d2c[_0x1f9c9b+0xf],0xe,0xd8a1e681),_0x47ce6c=_0x32e843(_0x47ce6c,_0x51c7be,_0x2a5263,_0x5281a0,_0x1a5d2c[_0x1f9c9b+0x4],0x14,0xe7d3fbc8),_0x5281a0=_0x32e843(_0x5281a0,_0x47ce6c,_0x51c7be,_0x2a5263,_0x1a5d2c[_0x1f9c9b+0x9],0x5,0x21e1cde6),_0x2a5263=_0x32e843(_0x2a5263,_0x5281a0,_0x47ce6c,_0x51c7be,_0x1a5d2c[_0x1f9c9b+0xe],0x9,0xc33707d6),_0x51c7be=_0x32e843(_0x51c7be,_0x2a5263,_0x5281a0,_0x47ce6c,_0x1a5d2c[_0x1f9c9b+0x3],0xe,0xf4d50d87),_0x47ce6c=_0x32e843(_0x47ce6c,_0x51c7be,_0x2a5263,_0x5281a0,_0x1a5d2c[_0x1f9c9b+0x8],0x14,0x455a14ed),_0x5281a0=_0x32e843(_0x5281a0,_0x47ce6c,_0x51c7be,_0x2a5263,_0x1a5d2c[_0x1f9c9b+0xd],0x5,0xa9e3e905),_0x2a5263=_0x32e843(_0x2a5263,_0x5281a0,_0x47ce6c,_0x51c7be,_0x1a5d2c[_0x1f9c9b+0x2],0x9,0xfcefa3f8),_0x51c7be=_0x32e843(_0x51c7be,_0x2a5263,_0x5281a0,_0x47ce6c,_0x1a5d2c[_0x1f9c9b+0x7],0xe,0x676f02d9),_0x47ce6c=_0x32e843(_0x47ce6c,_0x51c7be,_0x2a5263,_0x5281a0,_0x1a5d2c[_0x1f9c9b+0xc],0x14,0x8d2a4c8a),_0x5281a0=_0x43a099(_0x5281a0,_0x47ce6c,_0x51c7be,_0x2a5263,_0x1a5d2c[_0x1f9c9b+0x5],0x4,0xfffa3942),_0x2a5263=_0x43a099(_0x2a5263,_0x5281a0,_0x47ce6c,_0x51c7be,_0x1a5d2c[_0x1f9c9b+0x8],0xb,0x8771f681),_0x51c7be=_0x43a099(_0x51c7be,_0x2a5263,_0x5281a0,_0x47ce6c,_0x1a5d2c[_0x1f9c9b+0xb],0x10,0x6d9d6122),_0x47ce6c=_0x43a099(_0x47ce6c,_0x51c7be,_0x2a5263,_0x5281a0,_0x1a5d2c[_0x1f9c9b+0xe],0x17,0xfde5380c),_0x5281a0=_0x43a099(_0x5281a0,_0x47ce6c,_0x51c7be,_0x2a5263,_0x1a5d2c[_0x1f9c9b+0x1],0x4,0xa4beea44),_0x2a5263=_0x43a099(_0x2a5263,_0x5281a0,_0x47ce6c,_0x51c7be,_0x1a5d2c[_0x1f9c9b+0x4],0xb,0x4bdecfa9),_0x51c7be=_0x43a099(_0x51c7be,_0x2a5263,_0x5281a0,_0x47ce6c,_0x1a5d2c[_0x1f9c9b+0x7],0x10,0xf6bb4b60),_0x47ce6c=_0x43a099(_0x47ce6c,_0x51c7be,_0x2a5263,_0x5281a0,_0x1a5d2c[_0x1f9c9b+0xa],0x17,0xbebfbc70),_0x5281a0=_0x43a099(_0x5281a0,_0x47ce6c,_0x51c7be,_0x2a5263,_0x1a5d2c[_0x1f9c9b+0xd],0x4,0x289b7ec6),_0x2a5263=_0x43a099(_0x2a5263,_0x5281a0,_0x47ce6c,_0x51c7be,_0x1a5d2c[_0x1f9c9b+0x0],0xb,0xeaa127fa),_0x51c7be=_0x43a099(_0x51c7be,_0x2a5263,_0x5281a0,_0x47ce6c,_0x1a5d2c[_0x1f9c9b+0x3],0x10,0xd4ef3085),_0x47ce6c=_0x43a099(_0x47ce6c,_0x51c7be,_0x2a5263,_0x5281a0,_0x1a5d2c[_0x1f9c9b+0x6],0x17,0x4881d05),_0x5281a0=_0x43a099(_0x5281a0,_0x47ce6c,_0x51c7be,_0x2a5263,_0x1a5d2c[_0x1f9c9b+0x9],0x4,0xd9d4d039),_0x2a5263=_0x43a099(_0x2a5263,_0x5281a0,_0x47ce6c,_0x51c7be,_0x1a5d2c[_0x1f9c9b+0xc],0xb,0xe6db99e5),_0x51c7be=_0x43a099(_0x51c7be,_0x2a5263,_0x5281a0,_0x47ce6c,_0x1a5d2c[_0x1f9c9b+0xf],0x10,0x1fa27cf8),_0x47ce6c=_0x43a099(_0x47ce6c,_0x51c7be,_0x2a5263,_0x5281a0,_0x1a5d2c[_0x1f9c9b+0x2],0x17,0xc4ac5665),_0x5281a0=_0x33906c(_0x5281a0,_0x47ce6c,_0x51c7be,_0x2a5263,_0x1a5d2c[_0x1f9c9b+0x0],0x6,0xf4292244),_0x2a5263=_0x33906c(_0x2a5263,_0x5281a0,_0x47ce6c,_0x51c7be,_0x1a5d2c[_0x1f9c9b+0x7],0xa,0x432aff97),_0x51c7be=_0x33906c(_0x51c7be,_0x2a5263,_0x5281a0,_0x47ce6c,_0x1a5d2c[_0x1f9c9b+0xe],0xf,0xab9423a7),_0x47ce6c=_0x33906c(_0x47ce6c,_0x51c7be,_0x2a5263,_0x5281a0,_0x1a5d2c[_0x1f9c9b+0x5],0x15,0xfc93a039),_0x5281a0=_0x33906c(_0x5281a0,_0x47ce6c,_0x51c7be,_0x2a5263,_0x1a5d2c[_0x1f9c9b+0xc],0x6,0x655b59c3),_0x2a5263=_0x33906c(_0x2a5263,_0x5281a0,_0x47ce6c,_0x51c7be,_0x1a5d2c[_0x1f9c9b+0x3],0xa,0x8f0ccc92),_0x51c7be=_0x33906c(_0x51c7be,_0x2a5263,_0x5281a0,_0x47ce6c,_0x1a5d2c[_0x1f9c9b+0xa],0xf,0xffeff47d),_0x47ce6c=_0x33906c(_0x47ce6c,_0x51c7be,_0x2a5263,_0x5281a0,_0x1a5d2c[_0x1f9c9b+0x1],0x15,0x85845dd1),_0x5281a0=_0x33906c(_0x5281a0,_0x47ce6c,_0x51c7be,_0x2a5263,_0x1a5d2c[_0x1f9c9b+0x8],0x6,0x6fa87e4f),_0x2a5263=_0x33906c(_0x2a5263,_0x5281a0,_0x47ce6c,_0x51c7be,_0x1a5d2c[_0x1f9c9b+0xf],0xa,0xfe2ce6e0),_0x51c7be=_0x33906c(_0x51c7be,_0x2a5263,_0x5281a0,_0x47ce6c,_0x1a5d2c[_0x1f9c9b+0x6],0xf,0xa3014314),_0x47ce6c=_0x33906c(_0x47ce6c,_0x51c7be,_0x2a5263,_0x5281a0,_0x1a5d2c[_0x1f9c9b+0xd],0x15,0x4e0811a1),_0x5281a0=_0x33906c(_0x5281a0,_0x47ce6c,_0x51c7be,_0x2a5263,_0x1a5d2c[_0x1f9c9b+0x4],0x6,0xf7537e82),_0x2a5263=_0x33906c(_0x2a5263,_0x5281a0,_0x47ce6c,_0x51c7be,_0x1a5d2c[_0x1f9c9b+0xb],0xa,0xbd3af235),_0x51c7be=_0x33906c(_0x51c7be,_0x2a5263,_0x5281a0,_0x47ce6c,_0x1a5d2c[_0x1f9c9b+0x2],0xf,0x2ad7d2bb),_0x47ce6c=_0x33906c(_0x47ce6c,_0x51c7be,_0x2a5263,_0x5281a0,_0x1a5d2c[_0x1f9c9b+0x9],0x15,0xeb86d391),_0x5281a0=_0x590efb(_0x5281a0,_0x411bc7),_0x47ce6c=_0x590efb(_0x47ce6c,_0x3f7581),_0x51c7be=_0x590efb(_0x51c7be,_0x22f23e),_0x2a5263=_0x590efb(_0x2a5263,_0x3045d2);return(_0x2d1970(_0x5281a0)+_0x2d1970(_0x47ce6c)+_0x2d1970(_0x51c7be)+_0x2d1970(_0x2a5263))['toLowerCase']();}function _0x3dfb(_0x354970,_0x496703){const _0x5496c1=_0x5496();return _0x3dfb=function(_0x3dfb6d,_0x3fd532){_0x3dfb6d=_0x3dfb6d-0x9d;let _0x50fd78=_0x5496c1[_0x3dfb6d];return _0x50fd78;},_0x3dfb(_0x354970,_0x496703);}async function checkEnv(){const _0x496c50=_0x50e6b9;if(userCookie){let _0x225eda=envSplitor[0x0];for(let _0x2148cd of envSplitor)if(userCookie[_0x496c50(0xbd)](_0x2148cd)>-0x1){_0x225eda=_0x2148cd;break;}for(let _0x49da8e of userCookie['split'](_0x225eda))_0x49da8e&&userList[_0x496c50(0x10b)](new UserInfo(_0x49da8e));userCount=userList[_0x496c50(0xea)];}else console[_0x496c50(0xfc)](_0x496c50(0x9e));return console[_0x496c50(0xfc)](_0x496c50(0xba)+userCount+_0x496c50(0x120)),!0x0;}function popu(_0x52bcea,_0x8021ad,_0x44b48e=''){const _0x536073=_0x50e6b9;_0x52bcea[_0x536073(0xeb)]('//','/')['split']('/')[0x1];let _0x128a0c={'url':_0x52bcea,'headers':_0x8021ad,'timeout':0x2ee0};return _0x44b48e&&(_0x128a0c[_0x536073(0xc0)]=_0x44b48e,_0x128a0c['headers'][_0x536073(0x132)]=_0x44b48e?.[_0x536073(0xea)]||0x0),_0x128a0c;}async function httpRequest(_0x4094f3,_0x2eced2){return result=null,resurq=null,resurp=null,new Promise(_0x4cd7a8=>{const _0x57b9de=_0x3dfb;$[_0x57b9de(0x105)](_0x4094f3,_0x2eced2,async(_0x5291d5,_0x188c40,_0x5d2ced)=>{const _0x41e372=_0x57b9de;try{if(resurq=_0x188c40,resurp=_0x5d2ced,_0x5291d5);else{if(_0x5d2ced[_0x41e372(0xc0)]){if(_0x41e372(0xce)==typeof _0x5d2ced[_0x41e372(0xc0)])result=_0x5d2ced[_0x41e372(0xc0)];else try{result=JSON['parse'](_0x5d2ced[_0x41e372(0xc0)]);}catch(_0x58b7ba){result=_0x5d2ced[_0x41e372(0xc0)];}}}}catch(_0x59d19c){console[_0x41e372(0xfc)](_0x59d19c);}finally{_0x4cd7a8();}});});}function randomszxx(_0x33e4cc){const _0xca9c6=_0x50e6b9;_0x33e4cc=_0x33e4cc||0x20;var _0x15758f=_0xca9c6(0xc3),_0x3bec74=_0x15758f[_0xca9c6(0xea)],_0x2e79b3='';for(i=0x0;i<_0x33e4cc;i++)_0x2e79b3+=_0x15758f[_0xca9c6(0x153)](Math[_0xca9c6(0xac)](Math[_0xca9c6(0x125)]()*_0x3bec74));return _0x2e79b3;}function Env(_0x15b68c,_0x427719){const _0x5d963b=_0x50e6b9;return _0x5d963b(0x13d)!=typeof process&&JSON[_0x5d963b(0xcb)](process[_0x5d963b(0xf5)])[_0x5d963b(0xbd)](_0x5d963b(0xcd))>-0x1&&process['exit'](0x0),new class{constructor(_0x26f958,_0x53a97c){const _0x516265=_0x5d963b;this[_0x516265(0xff)]=_0x26f958,this[_0x516265(0x14f)]='',this[_0x516265(0x10a)]=new Date()[_0x516265(0xe0)](),Object[_0x516265(0xfa)](this,_0x53a97c),console[_0x516265(0xfc)](this[_0x516265(0xff)]+_0x516265(0x131));}[_0x5d963b(0x119)](){const _0x2647d9=_0x5d963b;return _0x2647d9(0x13d)!=typeof module&&!!module[_0x2647d9(0xbe)];}[_0x5d963b(0xc7)](){const _0x293134=_0x5d963b;return _0x293134(0x13d)!=typeof $task;}[_0x5d963b(0x129)](){const _0x1f45f3=_0x5d963b;return _0x1f45f3(0x13d)!=typeof $httpClient&&_0x1f45f3(0x13d)==typeof $loon;}[_0x5d963b(0xad)](){return'undefined'!=typeof $loon;}[_0x5d963b(0x10e)](_0x17a185){const _0x32cf61=_0x5d963b;let _0x5b735b=this['getval'](_0x17a185);if(/^@/[_0x32cf61(0xa1)](_0x17a185)){let [,_0x122518,_0x85cff5]=/^@(.*?)\.(.*?)$/[_0x32cf61(0xa2)](_0x17a185),_0x5d1943=_0x122518?this[_0x32cf61(0xf4)](_0x122518):'';if(_0x5d1943)try{let _0x589647=JSON['parse'](_0x5d1943);_0x5b735b=_0x589647?this['lodash_get'](_0x589647,_0x85cff5,''):_0x5b735b;}catch(_0x2bde4f){_0x5b735b='';}}return _0x5b735b;}[_0x5d963b(0xa3)](_0x8e4d44,_0x233d95){const _0x288192=_0x5d963b;let _0x14cc62=!0x1;if(/^@/[_0x288192(0xa1)](_0x233d95)){let [,_0x5ddf34,_0x439c72]=/^@(.*?)\.(.*?)$/[_0x288192(0xa2)](_0x233d95),_0x2c37e8=this[_0x288192(0xf4)](_0x5ddf34);try{let _0x4292fe=JSON['parse'](_0x5ddf34?'null'===_0x2c37e8?null:_0x2c37e8||'{}':'{}');this[_0x288192(0x106)](_0x4292fe,_0x439c72,_0x8e4d44),_0x14cc62=this[_0x288192(0xe3)](JSON[_0x288192(0xcb)](_0x4292fe),_0x5ddf34);}catch(_0x4efb06){let _0x4de938={};this[_0x288192(0x106)](_0x4de938,_0x439c72,_0x8e4d44),_0x14cc62=this[_0x288192(0xe3)](JSON[_0x288192(0xcb)](_0x4de938),_0x5ddf34);}}else _0x14cc62=this[_0x288192(0xe3)](_0x8e4d44,_0x233d95);return _0x14cc62;}[_0x5d963b(0xf4)](_0x551b19){const _0x5b6268=_0x5d963b;return this['isSurge']()||this[_0x5b6268(0xad)]()?$persistentStore[_0x5b6268(0xa4)](_0x551b19):this['isQuanX']()?$prefs['valueForKey'](_0x551b19):this['isNode']()?(this[_0x5b6268(0xc4)]=this[_0x5b6268(0xc6)](),this[_0x5b6268(0xc4)][_0x551b19]):this[_0x5b6268(0xc4)]&&this[_0x5b6268(0xc4)][_0x551b19]||null;}[_0x5d963b(0xe3)](_0x108640,_0xf4afc4){const _0x44fde4=_0x5d963b;return this[_0x44fde4(0x129)]()||this['isLoon']()?$persistentStore[_0x44fde4(0xd4)](_0x108640,_0xf4afc4):this[_0x44fde4(0xc7)]()?$prefs[_0x44fde4(0xb4)](_0x108640,_0xf4afc4):this[_0x44fde4(0x119)]()?(this[_0x44fde4(0xc4)]=this[_0x44fde4(0xc6)](),this[_0x44fde4(0xc4)][_0xf4afc4]=_0x108640,this[_0x44fde4(0x13b)](),!0x0):this[_0x44fde4(0xc4)]&&this[_0x44fde4(0xc4)][_0xf4afc4]||null;}['send'](_0x4673f2,_0x4da9cf,_0x4b5a25=()=>{}){const _0x4fa2e7=_0x5d963b;if(_0x4fa2e7(0xf7)!=_0x4673f2&&_0x4fa2e7(0xa6)!=_0x4673f2&&'put'!=_0x4673f2&&_0x4fa2e7(0xda)!=_0x4673f2){console[_0x4fa2e7(0xfc)](_0x4fa2e7(0xcc)+_0x4673f2);return;}if(_0x4fa2e7(0xf7)==_0x4673f2&&_0x4da9cf[_0x4fa2e7(0x143)]?(delete _0x4da9cf[_0x4fa2e7(0x143)][_0x4fa2e7(0xee)],delete _0x4da9cf[_0x4fa2e7(0x143)][_0x4fa2e7(0x132)]):_0x4da9cf['body']&&_0x4da9cf['headers']&&(_0x4da9cf[_0x4fa2e7(0x143)][_0x4fa2e7(0xee)]||(_0x4da9cf[_0x4fa2e7(0x143)][_0x4fa2e7(0xee)]='application/x-www-form-urlencoded')),this[_0x4fa2e7(0x129)]()||this[_0x4fa2e7(0xad)]()){this['isSurge']()&&this['isNeedRewrite']&&(_0x4da9cf[_0x4fa2e7(0x143)]=_0x4da9cf[_0x4fa2e7(0x143)]||{},Object[_0x4fa2e7(0xfa)](_0x4da9cf[_0x4fa2e7(0x143)],{'X-Surge-Skip-Scripting':!0x1}));let _0x2e5dc9={'method':_0x4673f2,'url':_0x4da9cf[_0x4fa2e7(0xab)],'headers':_0x4da9cf['headers'],'timeout':_0x4da9cf['timeout'],'data':_0x4da9cf[_0x4fa2e7(0xc0)]};_0x4fa2e7(0xf7)==_0x4673f2&&delete _0x2e5dc9[_0x4fa2e7(0xc4)],$axios(_0x2e5dc9)[_0x4fa2e7(0xfe)](_0xf17c6d=>{let {status:_0x5305ad,request:_0x361c1c,headers:_0x38fc9c,data:_0x2a6b2e}=_0xf17c6d;_0x4b5a25(null,_0x361c1c,{'statusCode':_0x5305ad,'headers':_0x38fc9c,'body':_0x2a6b2e});})['catch'](_0x1c0881=>console[_0x4fa2e7(0xfc)](_0x1c0881));}else{if(this[_0x4fa2e7(0xc7)]())_0x4da9cf[_0x4fa2e7(0x100)]=_0x4673f2[_0x4fa2e7(0x14e)](),this['isNeedRewrite']&&(_0x4da9cf[_0x4fa2e7(0xaa)]=_0x4da9cf[_0x4fa2e7(0xaa)]||{},Object[_0x4fa2e7(0xfa)](_0x4da9cf['opts'],{'hints':!0x1})),$task[_0x4fa2e7(0xb7)](_0x4da9cf)[_0x4fa2e7(0xfe)](_0x3aac73=>{let {statusCode:_0x214647,request:_0x216324,headers:_0x254f68,body:_0x18e612}=_0x3aac73;_0x4b5a25(null,_0x216324,{'statusCode':_0x214647,'headers':_0x254f68,'body':_0x18e612});},_0x1a5249=>_0x4b5a25(_0x1a5249));else{if(this['isNode']()){this[_0x4fa2e7(0xbf)]=this[_0x4fa2e7(0xbf)]?this['got']:require(_0x4fa2e7(0xbf));let {url:_0xf71bfa,..._0x3cc04b}=_0x4da9cf;this['instance']=this[_0x4fa2e7(0xbf)][_0x4fa2e7(0x136)]({'followRedirect':!0x1}),this['instance'][_0x4673f2](_0xf71bfa,_0x3cc04b)[_0x4fa2e7(0xfe)](_0x5cd6fd=>{let {statusCode:_0x220842,request:_0xd0eb7d,headers:_0x38fe68,body:_0x3d3664}=_0x5cd6fd;_0x4b5a25(null,_0xd0eb7d,{'statusCode':_0x220842,'headers':_0x38fe68,'body':_0x3d3664});},_0x3b7864=>{const _0x949ea=_0x4fa2e7;let {message:_0xb961b,response:_0x3d6cf4}=_0x3b7864;_0x4b5a25(_0xb961b,_0x3d6cf4,_0x3d6cf4&&_0x3d6cf4[_0x949ea(0xc0)]);});}}}}[_0x5d963b(0xe2)](_0x329238){const _0x2106d5=_0x5d963b;let _0x5973a8={'M+':new Date()['getMonth']()+0x1,'d+':new Date()[_0x2106d5(0x118)](),'h+':new Date()[_0x2106d5(0x128)](),'m+':new Date()[_0x2106d5(0x13a)](),'s+':new Date()[_0x2106d5(0xdb)](),'q+':Math[_0x2106d5(0xac)]((new Date()[_0x2106d5(0x147)]()+0x3)/0x3),'S':new Date()['getMilliseconds']()};for(let _0x2b49a2 in(/(y+)/[_0x2106d5(0xa1)](_0x329238)&&(_0x329238=_0x329238[_0x2106d5(0xeb)](RegExp['$1'],(new Date()['getFullYear']()+'')['substr'](0x4-RegExp['$1'][_0x2106d5(0xea)]))),_0x5973a8))RegExp('('+_0x2b49a2+')')[_0x2106d5(0xa1)](_0x329238)&&(_0x329238=_0x329238[_0x2106d5(0xeb)](RegExp['$1'],0x1==RegExp['$1'][_0x2106d5(0xea)]?_0x5973a8[_0x2b49a2]:('00'+_0x5973a8[_0x2b49a2])[_0x2106d5(0x127)]((''+_0x5973a8[_0x2b49a2])[_0x2106d5(0xea)])));return _0x329238;}async[_0x5d963b(0xe8)](){const _0x584c86=_0x5d963b;if(!this[_0x584c86(0x14f)])return;let _0x1ba7cf=this[_0x584c86(0xff)]+_0x584c86(0x116)+this['notifyStr'];if($[_0x584c86(0x119)]()){var _0x13ca71=require(_0x584c86(0x148));console['log'](_0x584c86(0x14d)),await _0x13ca71[_0x584c86(0x13e)](this[_0x584c86(0xff)],_0x1ba7cf);}else this['msg'](_0x1ba7cf);}[_0x5d963b(0x123)](_0x5b9a28){const _0x567fe9=_0x5d963b;console[_0x567fe9(0xfc)](_0x5b9a28),this['notifyStr']+=_0x5b9a28,this['notifyStr']+='\x0a';}['msg'](_0x48881c=t,_0x26407a='',_0x5672f5='',_0x2ad569){const _0x5a2c65=_0x5d963b;let _0x401117=_0x5bf762=>{const _0x301b76=_0x3dfb;if(!_0x5bf762)return _0x5bf762;if(_0x301b76(0xd9)==typeof _0x5bf762)return this[_0x301b76(0xad)]()?_0x5bf762:this['isQuanX']()?{'open-url':_0x5bf762}:this['isSurge']()?{'url':_0x5bf762}:void 0x0;if('object'==typeof _0x5bf762){if(this[_0x301b76(0xad)]()){let _0x4f6b3d;return{'openUrl':_0x5bf762[_0x301b76(0xc1)]||_0x5bf762[_0x301b76(0xab)]||_0x5bf762[_0x301b76(0xf1)],'mediaUrl':_0x5bf762['mediaUrl']||_0x5bf762[_0x301b76(0xe9)]};}if(this[_0x301b76(0xc7)]()){let _0x4f6e66;return{'open-url':_0x5bf762[_0x301b76(0xf1)]||_0x5bf762[_0x301b76(0xab)]||_0x5bf762[_0x301b76(0xc1)],'media-url':_0x5bf762[_0x301b76(0xe9)]||_0x5bf762[_0x301b76(0x14b)]};}if(this[_0x301b76(0x129)]())return{'url':_0x5bf762[_0x301b76(0xab)]||_0x5bf762[_0x301b76(0xc1)]||_0x5bf762[_0x301b76(0xf1)]};}};this[_0x5a2c65(0x12e)]||(this[_0x5a2c65(0x129)]()||this[_0x5a2c65(0xad)]()?$notification[_0x5a2c65(0xa6)](_0x48881c,_0x26407a,_0x5672f5,_0x401117(_0x2ad569)):this[_0x5a2c65(0xc7)]()&&$notify(_0x48881c,_0x26407a,_0x5672f5,_0x401117(_0x2ad569)));let _0x1a1e29=['',_0x5a2c65(0xed)];_0x1a1e29['push'](_0x48881c),_0x26407a&&_0x1a1e29[_0x5a2c65(0x10b)](_0x26407a),_0x5672f5&&_0x1a1e29[_0x5a2c65(0x10b)](_0x5672f5),console[_0x5a2c65(0xfc)](_0x1a1e29[_0x5a2c65(0xd5)]('\x0a'));}[_0x5d963b(0xd2)](_0xee7a83,_0x47af46){return _0xee7a83<_0x47af46?_0xee7a83:_0x47af46;}['getMax'](_0x4b3f61,_0xbf3d93){return _0x4b3f61<_0xbf3d93?_0xbf3d93:_0x4b3f61;}[_0x5d963b(0xa7)](_0x1ac565,_0x5805a2,_0x3a1427='0'){const _0x560016=_0x5d963b;let _0x518adc=String(_0x1ac565),_0x57bb5d=_0x5805a2>_0x518adc['length']?_0x5805a2-_0x518adc[_0x560016(0xea)]:0x0,_0x126f14='';for(let _0x5a0c1e=0x0;_0x5a0c1e<_0x57bb5d;_0x5a0c1e++)_0x126f14+=_0x3a1427;return _0x126f14+_0x518adc;}['json2str'](_0x54772c,_0x153b25,_0xdb21db=!0x1){const _0x7951e4=_0x5d963b;let _0x724ef8=[];for(let _0x38569a of Object[_0x7951e4(0xe7)](_0x54772c)['sort']()){let _0x4742ae=_0x54772c[_0x38569a];_0x4742ae&&_0xdb21db&&(_0x4742ae=encodeURIComponent(_0x4742ae)),_0x724ef8[_0x7951e4(0x10b)](_0x38569a+'='+_0x4742ae);}return _0x724ef8['join'](_0x153b25);}[_0x5d963b(0xb8)](_0x55dc1d,_0x1b1e48=!0x1){const _0x21422f=_0x5d963b;let _0x27c674={};for(let _0x558f50 of _0x55dc1d['split']('#')){if(!_0x558f50)continue;let _0x51b2ec=_0x558f50['indexOf']('=');if(-0x1==_0x51b2ec)continue;let _0x4951c0=_0x558f50[_0x21422f(0x127)](0x0,_0x51b2ec),_0x5651b7=_0x558f50[_0x21422f(0x127)](_0x51b2ec+0x1);_0x1b1e48&&(_0x5651b7=decodeURIComponent(_0x5651b7)),_0x27c674[_0x4951c0]=_0x5651b7;}return _0x27c674;}[_0x5d963b(0x152)](_0x3ba4b0,_0x1c41cb='abcdef0123456789'){const _0x1d108e=_0x5d963b;let _0x2e66b6='';for(let _0x50dc6b=0x0;_0x50dc6b<_0x3ba4b0;_0x50dc6b++)_0x2e66b6+=_0x1c41cb[_0x1d108e(0x153)](Math[_0x1d108e(0xac)](Math['random']()*_0x1c41cb[_0x1d108e(0xea)]));return _0x2e66b6;}[_0x5d963b(0x11a)](_0x194cc4){const _0x69fecc=_0x5d963b;return _0x194cc4[Math[_0x69fecc(0xac)](Math[_0x69fecc(0x125)]()*_0x194cc4[_0x69fecc(0xea)])];}[_0x5d963b(0xa8)](_0x5af86c){return new Promise(_0x1745a9=>setTimeout(_0x1745a9,_0x5af86c));}[_0x5d963b(0x121)](_0x589089={}){const _0x500080=_0x5d963b;let _0x2e01e2=(new Date()[_0x500080(0xe0)]()-this[_0x500080(0x10a)])/0x3e8;console['log']('\x0a'+this['name']+_0x500080(0x102)+_0x2e01e2+_0x500080(0x13f)),(this[_0x500080(0x129)]()||this[_0x500080(0xc7)]()||this[_0x500080(0xad)]())&&$done(_0x589089);}}(_0x15b68c,_0x427719);} -------------------------------------------------------------------------------- /ql_htt.js: -------------------------------------------------------------------------------- 1 | /* 2 | 下载地址 3 | http://a13.app.qq.com/o/simple.jsp?pkgname=com.cashtoutiao&ckey=CK1430507080047 4 | 邀请码必填得金币 29629303 5 | [rewrite_local] 6 | https://api.cashtoutiao.com/frontend/sign/record\S+ url script-request-body http://47.101.146.160/scripts/htt.js 7 | 8 | hostname = api.cashtoutiao.com 9 | ##点任务获取数据## 10 | ===========ql=========== 11 | 拉取 12 | ql raw http://47.101.146.160/scripts/htt.js 13 | 变量 14 | export htthd='{"loginId":"替换的","userId":替换的}' 15 | 16 | 多账号用@隔开 17 | cron: 27 6-23 * * * 18 | */ 19 | // [task_local] 20 | // */60 * * * * http://47.101.146.160/scripts/htt.js, tag=惠头条, img-url=circles.hexagongrid.fill.system, enabled=true 21 | 22 | const $ = new Env('惠头条'); 23 | let status; 24 | status = (status = ($.getval("httstatus") || "1") ) > 1 ? `${status}` : ""; // 账号扩展字符 25 | let htthdArr = [],httckArr = [],jzreadcount = '' 26 | let htthd= $.isNode() ? (process.env.htthd ? process.env.htthd : "") : ($.getdata('htthd') ? $.getdata('htthd') : "") 27 | let httck= $.isNode() ? (process.env.httck ? process.env.httck : "") : ($.getdata('httck') ? $.getdata('httck') : "") 28 | let httcks = '' 29 | let htthds = '' 30 | const logs =0; 31 | 32 | var hours = new Date().getHours(); 33 | var s = new Date().getMinutes(); 34 | 35 | var timestamp = Math.round(new Date().getTime()/1000).toString(); 36 | !(async () => { 37 | if (typeof $request !== "undefined") { 38 | await getck() 39 | } else { 40 | if(!$.isNode()){ 41 | htthdArr.push($.getdata('htthd')) 42 | httckArr.push($.getdata('httck')) 43 | let jzreadcount = ($.getval('httcount') || '1'); 44 | for (let i = 2; i <= jzreadcount; i++) { 45 | htthdArr.push($.getdata(`htthd${i}`)) 46 | httckArr.push($.getdata(`httck${i}`)) 47 | } 48 | console.log(`------------- 共${htthdArr.length}个账号-------------\n`) 49 | for (let i = 0; i < htthdArr.length; i++) { 50 | if (htthdArr[i]) { 51 | htthd = htthdArr[i]; 52 | httck = httckArr[i] 53 | $.index = i + 1; 54 | 55 | console.log(`\n开始【惠头条${$.index}】`) 56 | 57 | await ql() 58 | 59 | } 60 | } 61 | }else { 62 | if (process.env.htthd && process.env.htthd.indexOf('@') > -1) { 63 | htthdArr = process.env.htthd.split('@'); 64 | 65 | console.log(`您选择的是用"@"隔开\n`) 66 | } else { 67 | htthds = [process.env.htthd] 68 | 69 | }; 70 | Object.keys(htthds).forEach((item) => { 71 | if (htthds[item]) { 72 | htthdArr.push(htthds[item]) 73 | } 74 | }) 75 | 76 | console.log(`共${htthdArr.length}个cookie`) 77 | for (let k = 0; k < htthdArr.length; k++) { 78 | $.message = "" 79 | htthd = htthdArr[k] 80 | httck = httckArr[k] 81 | $.index = k + 1; 82 | console.log(`\n开始【惠头条${$.index}】`) 83 | //$.log(htthd) 84 | await ql() 85 | } 86 | } 87 | } 88 | })() 89 | .catch((e) => $.logErr(e)) 90 | .finally(() => $.done()) 91 | 92 | 93 | function getck() { 94 | if ($request.url.indexOf("sign/record") > -1) { 95 | const htthd = $request.body 96 | if(htthd) $.setdata(htthd,`htthd${status}`) 97 | const httck = JSON.stringify($request.headers) 98 | if(httck) $.setdata(httck,`httck${status}`) 99 | 100 | $.log(decodeURIComponent (htthd)) 101 | //$.log(httck) 102 | 103 | $.msg($.name,"",'惠头条'+`${status}` +'数据获取成功!') 104 | 105 | } 106 | } 107 | 108 | async function ql(){ 109 | 110 | await qlsign1() 111 | await qlxslist() 112 | await qlreads() 113 | await qllotteryinfo() 114 | await info() 115 | } 116 | async function qlsign1(){ 117 | return new Promise((resolve) => { 118 | qlsign = JSON.parse(htthd) 119 | 120 | let nm = { 121 | url: `https://api.cashtoutiao.com/frontend/sign?userId=${qlsign.userId}&loginId=${qlsign.loginId}&appVersion=1043&platform=1&versionName=4.6.0`, 122 | body: `{"loginId":"${qlsign.loginId}","versionName":"4.6.0","userId":${qlsign.userId},"appVersion":1043,"platform":1}`, 123 | headers:{ 124 | 125 | 126 | 'Host': 'api.cashtoutiao.com', 127 | 'Content-Type': 'application/json', 128 | 'Connection': 'keep-alive', 129 | 130 | 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148', 131 | 'Accept-Language': 'zh-Hans-CN;q=1, zh-Hant-HK;q=0.9, zh-Hant-CN;q=0.8', 132 | 'Accept-Encoding': 'gzip, deflate', 133 | 134 | 135 | } 136 | 137 | } 138 | $.post(nm,async(error, response, data) =>{ 139 | 140 | try{ 141 | const result = JSON.parse(data) 142 | if(logs)$.log(data) 143 | if(result.statusCode == 200) 144 | $.log(result.msg) 145 | 146 | if(result.statusCode != 200) 147 | 148 | $.log(result.msg+",已经签到过") 149 | 150 | }catch(e) { 151 | $.logErr(e, response); 152 | } finally { 153 | resolve(); 154 | } 155 | }) 156 | }) 157 | } 158 | 159 | async function qlxslist(){ 160 | return new Promise((resolve) => { 161 | qlsign = JSON.parse(htthd) 162 | 163 | let nm = { 164 | url: `https://api.cashtoutiao.com/frontend/newbie/task/list?userId=${qlsign.userId}&loginId=${qlsign.loginId}&appVersion=1043&platform=1&versionName=4.6.0`, 165 | body: `{"loginId":"${qlsign.loginId}","registerTime":1630305246177,"versionName":"4.6.0","userId":${qlsign.userId},"appVersion":1043,"platform":1}`, 166 | headers:{ 167 | 168 | 169 | 'Host': 'api.cashtoutiao.com', 170 | 'Content-Type': 'application/json', 171 | 'Connection': 'keep-alive', 172 | 173 | 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148', 174 | 'Accept-Language': 'zh-Hans-CN;q=1, zh-Hant-HK;q=0.9, zh-Hant-CN;q=0.8', 175 | 'Accept-Encoding': 'gzip, deflate', 176 | 177 | 178 | } 179 | 180 | } 181 | $.post(nm,async(error, response, data) =>{ 182 | 183 | try{ 184 | const result = JSON.parse(data) 185 | if(logs)$.log(data) 186 | if(result.statusCode == 200){ 187 | if(result.newbieTaskList){ 188 | xslist = result.newbieTaskList 189 | for(let i=0;i { 212 | qlsign = JSON.parse(htthd) 213 | 214 | let nm = { 215 | url: `https://api.cashtoutiao.com/frontend/newbie/task/draw?userId=${qlsign.userId}&loginId=${qlsign.loginId}&appVersion=1043&platform=1&versionName=4.6.0`, 216 | body: `{"loginId":"${qlsign.loginId}","versionName":"4.6.0","taskId":${taskId},"userId":${qlsign.userId},"appVersion":1043,"platform":1}`, 217 | headers:{ 218 | 219 | 220 | 'Host': 'api.cashtoutiao.com', 221 | 'Content-Type': 'application/json', 222 | 'Connection': 'keep-alive', 223 | 224 | 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148', 225 | 'Accept-Language': 'zh-Hans-CN;q=1, zh-Hant-HK;q=0.9, zh-Hant-CN;q=0.8', 226 | 'Accept-Encoding': 'gzip, deflate', 227 | 228 | 229 | } 230 | 231 | } 232 | $.post(nm,async(error, response, data) =>{ 233 | //$.log(data) 234 | try{ 235 | const result = JSON.parse(data) 236 | if(logs)$.log(data) 237 | if(result.statusCode == 200){ 238 | $.log(result.msg) 239 | 240 | }else if(result.statusCode != 200) 241 | 242 | $.log(result.msg) 243 | 244 | }catch(e) { 245 | $.logErr(e, response); 246 | } finally { 247 | resolve(); 248 | } 249 | }) 250 | }) 251 | } 252 | 253 | async function qlcheck(type,newsId){ 254 | return new Promise((resolve) => { 255 | qlsign = JSON.parse(htthd) 256 | 257 | let nm = { 258 | url: `https://api.cashtoutiao.com/frontend/collection/check?userId=${qlsign.userId}&loginId=${qlsign.loginId}&appVersion=1043&platform=1&versionName=4.6.0`, 259 | body: `{"appVersion":1043,"loginId":"${qlsign.loginId}","versionName":"4.6.0","${type}":${newsId},"userId":${qlsign.userId},"platform":1}`, 260 | 261 | headers:{ 262 | 263 | 264 | 'Host': 'api.cashtoutiao.com', 265 | 'Content-Type': 'application/json', 266 | 'Connection': 'keep-alive', 267 | 268 | 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148', 269 | 'Accept-Language': 'zh-Hans-CN;q=1, zh-Hant-HK;q=0.9, zh-Hant-CN;q=0.8', 270 | 'Accept-Encoding': 'gzip, deflate', 271 | 272 | 273 | } 274 | 275 | } 276 | $.post(nm,async(error, response, data) =>{ 277 | //$.log(data) 278 | try{ 279 | //const result = JSON.parse(data) 280 | //if(logs)$.log(data) 281 | //if(result.statusCode == 200){ 282 | //$.log(result.msg) 283 | 284 | // }else if(result.statusCode != 200) 285 | 286 | // $.log(result.msg) 287 | 288 | }catch(e) { 289 | $.logErr(e, response); 290 | } finally { 291 | resolve(); 292 | } 293 | }) 294 | }) 295 | } 296 | 297 | async function qlread(newsId){ 298 | return new Promise((resolve) => { 299 | qlsign = JSON.parse(htthd) 300 | 301 | let nm = { 302 | url: `https://api.cashtoutiao.com/frontend/read/sych/duration?userId=${qlsign.userId}&loginId=${qlsign.loginId}&appVersion=1043&platform=1&versionName=4.6.0`, 303 | body: `{"versionName":"4.6.0","platform":1,"count":1,"userId":${qlsign.userId},"multiple":false,"channel":"dongfang","duration":30,"appVersion":1043,"loginId":"${qlsign.loginId}","readActionInfo":{"maxHistorySize":0,"toolTypes":[0],"moveAvgPressure":1.0454913377761841,"downCount":43,"monkey":false,"moveCount":1521,"downAvgPressure":0.014857879839837551}}`, 304 | 305 | headers:{ 306 | 307 | 308 | 'Host': 'api.cashtoutiao.com', 309 | 'Content-Type': 'application/json', 310 | 'Connection': 'keep-alive', 311 | 312 | 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148', 313 | 'Accept-Language': 'zh-Hans-CN;q=1, zh-Hant-HK;q=0.9, zh-Hant-CN;q=0.8', 314 | 'Accept-Encoding': 'gzip, deflate', 315 | 316 | 317 | } 318 | 319 | } 320 | $.post(nm,async(error, response, data) =>{ 321 | //$.log(data) 322 | try{ 323 | const result = JSON.parse(data) 324 | if(logs)$.log(data) 325 | if(result.statusCode == 200){ 326 | $.log(result.incCredit) 327 | 328 | }else if(result.statusCode != 200) 329 | 330 | $.log(result.msg) 331 | 332 | }catch(e) { 333 | $.logErr(e, response); 334 | } finally { 335 | resolve(); 336 | } 337 | }) 338 | }) 339 | } 340 | 341 | async function qlreads(){ 342 | return new Promise((resolve) => { 343 | qlsign = JSON.parse(htthd) 344 | 345 | let nm = { 346 | url: `http://api.admin.cp.cashtoutiao.com/headLine/getVideoAndArticleNoCoverApi?userId=${qlsign.userId}&appVersion=1043&platform=1&versionName=4.6.0`, 347 | body: `{"deviceId":"3ea6d7a3676b4f0a9d1e591250288888","appVersion":1043,"userId":${qlsign.userId},"versionName":"4.6.0","platform":1,"backVersion":"3","type":"toutiao","page":0}`, 348 | headers:{ 349 | 350 | 351 | 'Host': 'api.admin.cp.cashtoutiao.com', 352 | 'Content-Type': 'application/json', 353 | 'Connection': 'keep-alive', 354 | 355 | 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148', 356 | 'Accept-Language': 'zh-Hans-CN;q=1, zh-Hant-HK;q=0.9, zh-Hant-CN;q=0.8', 357 | 'Accept-Encoding': 'gzip, deflate', 358 | 359 | 360 | } 361 | 362 | } 363 | $.post(nm,async(error, response, data) =>{ 364 | 365 | try{ 366 | const result = JSON.parse(data) 367 | if(logs)$.log(data) 368 | if(result.state == true){ 369 | if(result.data){ 370 | readlist = result.data 371 | for(let i=0;i { 394 | qlsign = JSON.parse(htthd) 395 | 396 | let nm = { 397 | url: `https://api.easytask.huadongmedia.com/task-center/lottery/info`, 398 | body: `{"mediaId":"cashtoutiao","userId":"${qlsign.userId}"}`, 399 | 400 | headers:{ 401 | 402 | 'Host': 'api.easytask.huadongmedia.com', 403 | 'Content-Type': 'application/json', 404 | 'Origin': 'http://page.huadongmedia.com', 405 | 'Accept-Encoding': 'gzip, deflate, br', 406 | 'Connection': 'keep-alive', 407 | 'Accept': 'application/json, text/javascript, */*; q=0.01', 408 | 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148', 409 | 'Referer': `http://page.huadongmedia.com/h5/product/lottery/index.html?mediaId=cashtoutiao&userId=${qlsign.userId}`, 410 | 411 | 412 | } 413 | 414 | } 415 | $.post(nm,async(error, response, data) =>{ 416 | //$.log(data) 417 | try{ 418 | const result = JSON.parse(data) 419 | if(logs)$.log(data) 420 | if(result.statusCode == 200){ 421 | drawNum=result.lotteryInfo.drawRemainNum 422 | 423 | if(drawNum>0){ 424 | $.log("drawRemainNum:"+result.lotteryInfo.drawRemainNum) 425 | for(let i=0;i { 443 | qlsign = JSON.parse(htthd) 444 | 445 | let nm = { 446 | url: `https://api.easytask.huadongmedia.com/task-center/lottery/draw`, 447 | body: `{"mediaId":"cashtoutiao","userId":"${qlsign.userId}"}`, 448 | 449 | headers:{ 450 | 451 | 'Host': 'api.easytask.huadongmedia.com', 452 | 'Content-Type': 'application/json', 453 | 'Origin': 'http://page.huadongmedia.com', 454 | 'Accept-Encoding': 'gzip, deflate, br', 455 | 'Connection': 'keep-alive', 456 | 'Accept': 'application/json, text/javascript, */*; q=0.01', 457 | 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148', 458 | 'Referer': `http://page.huadongmedia.com/h5/product/lottery/index.html?mediaId=cashtoutiao&userId=${qlsign.userId}`, 459 | 460 | 461 | } 462 | 463 | } 464 | $.post(nm,async(error, response, data) =>{ 465 | //$.log(data) 466 | try{ 467 | const result = JSON.parse(data) 468 | if(logs)$.log(data) 469 | if(result.statusCode == 200){ 470 | $.log(result.drawInfo.coin) 471 | 472 | }else if(result.statusCode != 200) 473 | 474 | $.log(result.msg) 475 | 476 | }catch(e) { 477 | $.logErr(e, response); 478 | } finally { 479 | resolve(); 480 | } 481 | }) 482 | }) 483 | } 484 | async function info(){ 485 | return new Promise((resolve) => { 486 | qlsign = JSON.parse(htthd) 487 | 488 | let nm = { 489 | url: `https://api.cashtoutiao.com/frontend/credit/summary?userId=${qlsign.userId}&loginId=${qlsign.loginId}&appVersion=1043&platform=1&versionName=4.6.0`, 490 | body: `{"loginId":"${qlsign.loginId}","versionName":"4.6.0","userId":${qlsign.userId},"appVersion":1043,"platform":1}`, 491 | 492 | headers:{ 493 | 494 | 495 | 'Host': 'api.cashtoutiao.com', 496 | 'Content-Type': 'application/json', 497 | 'Connection': 'keep-alive', 498 | 499 | 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148', 500 | 'Accept-Language': 'zh-Hans-CN;q=1, zh-Hant-HK;q=0.9, zh-Hant-CN;q=0.8', 501 | 'Accept-Encoding': 'gzip, deflate', 502 | 503 | 504 | } 505 | 506 | } 507 | $.post(nm,async(error, response, data) =>{ 508 | //$.log(data) 509 | try{ 510 | const result = JSON.parse(data) 511 | if(logs)$.log(data) 512 | if(result.statusCode == 200){ 513 | $.log(`remaining: ${result.userCreditSummary.remaining}\ntoday: ${result.userCreditSummary.todayIncome}\ntotal: ${result.userCreditSummary.total}\ncan bank: ${result.userCreditSummary.withDrawRemaining}`) 514 | 515 | }else if(result.statusCode != 200) 516 | 517 | $.log(result.msg) 518 | 519 | }catch(e) { 520 | $.logErr(e, response); 521 | } finally { 522 | resolve(); 523 | } 524 | }) 525 | }) 526 | } 527 | 528 | function Env(t,e){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("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}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("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(a,(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){let e={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).length)));return t}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=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];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("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)} 529 | -------------------------------------------------------------------------------- /ql_kjwj.js: -------------------------------------------------------------------------------- 1 | /* 2 | cron: 15 9 * * * 3 | */ 4 | const $ = new Env('科技玩家') 5 | const logDebug = 0 6 | 7 | const notifyFlag = 1; //0为关闭通知,1为打开通知,默认为1 8 | let notifyStr = '' 9 | 10 | let envSplitor = ['\n','#'] 11 | let httpResult //global buffer 12 | 13 | let userCookie = ($.isNode() ? process.env.kjwjCookie : $.getdata('kjwjCookie')) || ''; 14 | let userList = [] 15 | 16 | let userIdx = 0 17 | let userCount = 0 18 | 19 | /////////////////////////////////////////////////////////////////// 20 | class UserInfo { 21 | constructor(str) { 22 | this.index = ++userIdx 23 | this.usr = str.indexOf('username=')>-1 ? str.match(/username=(.+?);/)[1] : '' 24 | this.pwd = str.indexOf('password=')>-1 ? str.match(/password=(.+?);/)[1] : '' 25 | this.token = '' 26 | } 27 | 28 | async login() { 29 | if(!this.usr || !this.pwd) { 30 | console.log(`账号[${this.index}]没有找到正确的用户名密码,请检查`) 31 | return; 32 | } 33 | let url = `https://www.kejiwanjia.com/wp-json/jwt-auth/v1/token` 34 | let body = `nickname=&username=${encodeURIComponent(this.usr)}&password=${this.pwd}&code=&img_code=&invitation_code=&token=&smsToken=&luoToken=&confirmPassword=&loginType=` 35 | let urlObject = populateUrlObject(url,this.token,body) 36 | await httpRequest('post',urlObject) 37 | let result = httpResult; 38 | if(!result) return 39 | //console.log(result) 40 | if(result.code) { 41 | console.log(`账号[${this.index}]登录失败:${result.message}`) 42 | } else { 43 | this.name = result.name 44 | this.token = result.token 45 | console.log(`账号[${this.name}]登录成功,现有积分:${result.credit}`) 46 | await $.wait(500); 47 | await this.getUserMission(); 48 | } 49 | } 50 | 51 | async getUserMission() { 52 | let url = `https://www.kejiwanjia.com/wp-json/b2/v1/getUserMission` 53 | let body = `count=5&paged=1` 54 | let urlObject = populateUrlObject(url,this.token,body) 55 | await httpRequest('post',urlObject) 56 | let result = httpResult; 57 | if(!result) return 58 | //console.log(result) 59 | if(result.code) { 60 | console.log(`账号[${this.name}]签到失败:${result}`) 61 | } else { 62 | if(result.mission.credit == 0) { 63 | await $.wait(500); 64 | await this.doSign(); 65 | } else { 66 | console.log(`账号[${this.name}]今天已签到,获得了${result.mission.credit}积分`) 67 | } 68 | } 69 | } 70 | 71 | async doSign() { 72 | let url = `https://www.kejiwanjia.com/wp-json/b2/v1/userMission` 73 | let body = `` 74 | let urlObject = populateUrlObject(url,this.token,body) 75 | await httpRequest('post',urlObject) 76 | let result = httpResult; 77 | if(!result) return 78 | //console.log(result) 79 | if(result.code) { 80 | console.log(`账号[${this.name}]签到失败:${result}`) 81 | } else { 82 | if(result.credit) { 83 | console.log(`账号[${this.name}]签到成功,获得${result.credit}积分,现有积分:${result.mission.my_credit}`) 84 | } 85 | } 86 | } 87 | } 88 | 89 | !(async () => { 90 | if (typeof $request !== "undefined") { 91 | await GetRewrite() 92 | }else { 93 | if(!(await checkEnv())) return; 94 | 95 | for(let user of userList) { 96 | await user.login(); 97 | await $.wait(200); 98 | } 99 | } 100 | })() 101 | .catch((e) => $.logErr(e)) 102 | .finally(() => $.done()) 103 | 104 | /////////////////////////////////////////////////////////////////// 105 | async function GetRewrite() { 106 | if($request.url.indexOf(`job/listJob.json`) > -1) { 107 | let ck = $request.url.split('sessionId=')[1] 108 | 109 | if(userCookie) { 110 | if(userCookie.indexOf(ck) == -1) { 111 | userCookie = userCookie + '@' + ck 112 | $.setdata(userCookie, 'jjyCookie'); 113 | ckList = userCookie.split('@') 114 | $.msg(jsname+` 获取第${ckList.length}个ck成功: ${ck}`) 115 | } 116 | } else { 117 | $.setdata(ck, 'jjyCookie'); 118 | $.msg(jsname+` 获取第1个ck成功: ${ck}`) 119 | } 120 | } 121 | } 122 | 123 | async function checkEnv() { 124 | if(userCookie) { 125 | let splitor = envSplitor[0]; 126 | for(let sp of envSplitor) { 127 | if(userCookie.indexOf(sp) > -1) { 128 | splitor = sp; 129 | break; 130 | } 131 | } 132 | for(let userCookies of userCookie.split(splitor)) { 133 | if(userCookies) userList.push(new UserInfo(userCookies)) 134 | } 135 | userCount = userList.length 136 | } else { 137 | console.log('未找到CK') 138 | return; 139 | } 140 | 141 | console.log(`共找到${userCount}个账号`) 142 | return true 143 | } 144 | 145 | //通知 146 | async function showmsg() { 147 | if(!notifyStr) return; 148 | notifyBody = jsname + "运行通知\n\n" + notifyStr 149 | if (notifyFlag > 0) { 150 | $.msg(notifyBody); 151 | if($.isNode()){ 152 | var notify = require('./sendNotify'); 153 | await notify.sendNotify($.name, notifyBody ); 154 | } 155 | } else { 156 | console.log(notifyBody); 157 | } 158 | } 159 | 160 | //pushDear 161 | async function pushDear(str) { 162 | if(!PushDearKey) return; 163 | if(!str) return; 164 | 165 | console.log('\n============= PushDear 通知 =============\n') 166 | console.log(str) 167 | let urlObject = { 168 | url: `https://api2.pushdeer.com/message/push?pushkey=${PushDearKey}&text=${encodeURIComponent(str)}`, 169 | headers: {}, 170 | }; 171 | await httpRequest('get',urlObject) 172 | let result = httpResult; 173 | let retStr = result.content.result==false ? '失败' : '成功' 174 | console.log(`\n========== PushDear 通知发送${retStr} ==========\n`) 175 | } 176 | //////////////////////////////////////////////////////////////////// 177 | function populateUrlObject(url,auth,body=''){ 178 | let host = url.replace('//','/').split('/')[1] 179 | let urlObject = { 180 | url: url, 181 | headers: { 182 | 'Host': host, 183 | }, 184 | } 185 | if(auth) { 186 | urlObject.headers.Authorization = 'Bearer ' + auth; 187 | urlObject.headers.Cookie = `b2_token=${auth};`; 188 | } 189 | if(body) { 190 | urlObject.body = body 191 | urlObject.headers['Content-Type'] = 'application/x-www-form-urlencoded' 192 | urlObject.headers['Content-Length'] = urlObject.body ? urlObject.body.length : 0 193 | } 194 | return urlObject; 195 | } 196 | 197 | async function httpRequest(method,url) { 198 | httpResult = null 199 | return new Promise((resolve) => { 200 | $[method](url, async (err, resp, data) => { 201 | try { 202 | if (err) { 203 | console.log(`${method}请求失败`); 204 | console.log(JSON.stringify(err)); 205 | $.logErr(err); 206 | } else { 207 | if (safeGet(data)) { 208 | httpResult = JSON.parse(data); 209 | if(logDebug) console.log(httpResult); 210 | } 211 | } 212 | } catch (e) { 213 | $.logErr(e, resp); 214 | } finally { 215 | resolve(); 216 | } 217 | }); 218 | }); 219 | } 220 | 221 | function safeGet(data) { 222 | try { 223 | if (typeof JSON.parse(data) == "object") { 224 | return true; 225 | } else { 226 | console.log(data) 227 | } 228 | } catch (e) { 229 | console.log(e); 230 | console.log(`服务器访问数据为空,请检查自身设备网络情况`); 231 | return false; 232 | } 233 | } 234 | 235 | function getMin(a,b){ 236 | return ((anumStr.length) ? (length-numStr.length) : 0 246 | let retStr = '' 247 | for(let i=0; i>2;o=(n&3)<<4|r>>4;u=(r&15)<<2|i>>6;a=i&63;if(isNaN(r)){u=a=64}else if(isNaN(i)){a=64}t=t+this._keyStr.charAt(s)+this._keyStr.charAt(o)+this._keyStr.charAt(u)+this._keyStr.charAt(a)}return t},decode:function(e){var t="";var n,r,i;var s,o,u,a;var f=0;e=e.replace(/[^A-Za-z0-9+/=]/g,"");while(f>4;r=(o&15)<<4|u>>2;i=(u&3)<<6|a;t=t+String.fromCharCode(n);if(u!=64){t=t+String.fromCharCode(r)}if(a!=64){t=t+String.fromCharCode(i)}}t=Base64._utf8_decode(t);return t},_utf8_encode:function(e){e=e.replace(/rn/g,"n");var t="";for(var n=0;n127&&r<2048){t+=String.fromCharCode(r>>6|192);t+=String.fromCharCode(r&63|128)}else{t+=String.fromCharCode(r>>12|224);t+=String.fromCharCode(r>>6&63|128);t+=String.fromCharCode(r&63|128)}}return t},_utf8_decode:function(e){var t="";var n=0;var r=c1=c2=0;while(n191&&r<224){c2=e.charCodeAt(n+1);t+=String.fromCharCode((r&31)<<6|c2&63);n+=2}else{c2=e.charCodeAt(n+1);c3=e.charCodeAt(n+2);t+=String.fromCharCode((r&15)<<12|(c2&63)<<6|c3&63);n+=3}}return t}} 285 | 286 | function MD5Encrypt(a){function b(a,b){return a<>>32-b}function c(a,b){var c,d,e,f,g;return e=2147483648&a,f=2147483648&b,c=1073741824&a,d=1073741824&b,g=(1073741823&a)+(1073741823&b),c&d?2147483648^g^e^f:c|d?1073741824&g?3221225472^g^e^f:1073741824^g^e^f:g^e^f}function d(a,b,c){return a&b|~a&c}function e(a,b,c){return a&c|b&~c}function f(a,b,c){return a^b^c}function g(a,b,c){return b^(a|~c)}function h(a,e,f,g,h,i,j){return a=c(a,c(c(d(e,f,g),h),j)),c(b(a,i),e)}function i(a,d,f,g,h,i,j){return a=c(a,c(c(e(d,f,g),h),j)),c(b(a,i),d)}function j(a,d,e,g,h,i,j){return a=c(a,c(c(f(d,e,g),h),j)),c(b(a,i),d)}function k(a,d,e,f,h,i,j){return a=c(a,c(c(g(d,e,f),h),j)),c(b(a,i),d)}function l(a){for(var b,c=a.length,d=c+8,e=(d-d%64)/64,f=16*(e+1),g=new Array(f-1),h=0,i=0;c>i;)b=(i-i%4)/4,h=i%4*8,g[b]=g[b]|a.charCodeAt(i)<>>29,g}function m(a){var b,c,d="",e="";for(c=0;3>=c;c++)b=a>>>8*c&255,e="0"+b.toString(16),d+=e.substr(e.length-2,2);return d}function n(a){a=a.replace(/\r\n/g,"\n");for(var b="",c=0;cd?b+=String.fromCharCode(d):d>127&&2048>d?(b+=String.fromCharCode(d>>6|192),b+=String.fromCharCode(63&d|128)):(b+=String.fromCharCode(d>>12|224),b+=String.fromCharCode(d>>6&63|128),b+=String.fromCharCode(63&d|128))}return b}var o,p,q,r,s,t,u,v,w,x=[],y=7,z=12,A=17,B=22,C=5,D=9,E=14,F=20,G=4,H=11,I=16,J=23,K=6,L=10,M=15,N=21;for(a=n(a),x=l(a),t=1732584193,u=4023233417,v=2562383102,w=271733878,o=0;o-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),"PUT"===e&&(s=this.put),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")}put(t){return this.send.call(this.env,t,"PUT")}}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("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}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("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(a,(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();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)})}}put(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.put(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="PUT",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.put(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){let e={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).length)));return t}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}}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r)));let h=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];h.push(e),s&&h.push(s),i&&h.push(i),console.log(h.join("\n")),this.logs=this.logs.concat(h)}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("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)} -------------------------------------------------------------------------------- /ql_xj.js: -------------------------------------------------------------------------------- 1 | //const $ = new Env('习酒') 2 | //cron: 0 */2 * * * 3 | const $ = new Env('习酒'); 4 | var request = require("request"); 5 | let status; 6 | status = (status = ($.getval("xjstatus") || "1") ) > 1 ? `${status}` : ""; // 账号扩展字符 7 | let xjhdArr = [],xjcount = '' 8 | const notify = $.isNode() ? require('./sendNotify') : ''; 9 | let xjhd= $.isNode() ? (process.env.xjhd ? process.env.xjhd : "") : ($.getdata('xjhd') ? $.getdata('xjhd') : "") 10 | 11 | let allMessage = ''; 12 | let xjhds = "" 13 | const logs =0; 14 | const host='https://xcx.exijiu.com/' 15 | const host1='https://apimallwm.exijiu.com/' 16 | var hours = new Date().getHours(); 17 | var s = new Date().getMinutes(); 18 | 19 | var timestamp = Math.round(new Date().getTime()/1000).toString(); 20 | !(async () => { 21 | if (typeof $request !== "undefined") { 22 | 23 | } else { 24 | if(!$.isNode()){ 25 | xjhdArr.push($.getdata('xjhd')) 26 | let xjcount = ($.getval('xjcount') || '1'); 27 | for (let i = 2; i <= xjcount; i++) { 28 | xjhdArr.push($.getdata(`xjhd${i}`)) 29 | } 30 | console.log(`------------- 共${xjhdArr.length}个账号-------------\n`) 31 | for (let i = 0; i < xjhdArr.length; i++) { 32 | if (xjhdArr[i]) { 33 | xjhd = xjhdArr[i]; 34 | $.index = i + 1; 35 | 36 | } 37 | } 38 | }else { 39 | if (process.env.xjhd && process.env.xjhd.indexOf('@') > -1) { 40 | xjhdArr = process.env.xjhd.split('@'); 41 | console.log(`您选择的是用"&"隔开\n`) 42 | } else { 43 | xjhds = [process.env.xjhd] 44 | }; 45 | Object.keys(xjhds).forEach((item) => { 46 | if (xjhds[item]) { 47 | xjhdArr.push(xjhds[item]) 48 | } 49 | }) 50 | console.log(`共${xjhdArr.length}个cookie`) 51 | for (let k = 0; k < xjhdArr.length; k++) { 52 | $.message = "" 53 | xjhd = xjhdArr[k] 54 | $.index = k + 1; 55 | 56 | console.log(`\n开始【习酒${$.index}】`) 57 | 58 | 59 | await getJifenShopMemberInfo() 60 | await getJwt() 61 | 62 | 63 | } 64 | 65 | 66 | } 67 | } 68 | if ($.isNode() && allMessage) { 69 | await notify.sendNotify(`${$.name}`, `${allMessage}` ) 70 | } 71 | })() 72 | .catch((e) => $.logErr(e)) 73 | .finally(() => $.done()) 74 | 75 | function hasDataMsCenterUser() { 76 | return new Promise((resolve) => { 77 | 78 | $.get(indexapi1(`anti-channeling/public/index.php/api/v2/Member/hasDataMsCenterUser`,token), async (err, resp, data) => { 79 | 80 | try { 81 | if (err) { 82 | console.log(`${JSON.stringify(err)}`) 83 | console.log(`${$.name} API请求失败,请检查网路重试`) 84 | }// else { 85 | if (safeGet(data)) { 86 | data = JSON.parse(data); 87 | if(data.code==0){ 88 | 89 | console.log(`刷新:${data.msg}`) 90 | 91 | 92 | 93 | } 94 | else if(data.code == -1){ 95 | console.log(data.msg) 96 | 97 | } 98 | } 99 | 100 | } catch (e) { 101 | $.logErr(e, resp) 102 | } finally { 103 | resolve(data); 104 | } 105 | }) 106 | }) 107 | } 108 | function getJifenShopMemberInfo() { 109 | return new Promise((resolve) => { 110 | 111 | $.get(indexapi(`anti-channeling/public/index.php/api/v2/Member/getJifenShopMemberInfo`), async (err, resp, data) => { 112 | 113 | try { 114 | if (err) { 115 | console.log(`${JSON.stringify(err)}`) 116 | console.log(`${$.name} API请求失败,请检查网路重试`) 117 | }// else { 118 | if (safeGet(data)) { 119 | data = JSON.parse(data); 120 | if(data.code==0){ 121 | 122 | console.log(`id:${data.data.id}\nintegration:${data.data.integration}\n${data.data['level_name']}`) 123 | 124 | 125 | 126 | } 127 | else if(data.code == -1){ 128 | console.log(data.msg) 129 | 130 | } 131 | } 132 | 133 | } catch (e) { 134 | $.logErr(e, resp) 135 | } finally { 136 | resolve(data); 137 | } 138 | }) 139 | }) 140 | } 141 | function getJwt() { 142 | return new Promise((resolve) => { 143 | 144 | $.get(indexapi(`anti-channeling/public/index.php/api/v2/Member/getJwt`), async (err, resp, data) => { 145 | 146 | try { 147 | if (err) { 148 | console.log(`${JSON.stringify(err)}`) 149 | console.log(`${$.name} API请求失败,请检查网路重试`) 150 | }// else { 151 | if (safeGet(data)) { 152 | data = JSON.parse(data); 153 | if(data.code==0){ 154 | token = data.data.jwt 155 | id = data.data.member_id 156 | console.log(id) 157 | await hasDataMsCenterUser() 158 | await gardenmemberwine() 159 | await info() 160 | await member() 161 | await signin() 162 | await dailySign() 163 | await Gardenquestiontask() 164 | await dailyShare() 165 | await $.wait(1000) 166 | await dailyShare() 167 | await $.wait(1000) 168 | await dailyShare() 169 | await realscene() 170 | //await sorghum() 171 | for(let i=0;i<1;i++){ 172 | await watering() 173 | await manuring() 174 | } 175 | await sorghumindex() 176 | 177 | 178 | //await extend(2) 179 | } 180 | else if(data.code == -1){ 181 | console.log(data.msg) 182 | 183 | } 184 | } 185 | 186 | } catch (e) { 187 | $.logErr(e, resp) 188 | } finally { 189 | resolve(data); 190 | } 191 | }) 192 | }) 193 | } 194 | function signin() { 195 | return new Promise((resolve) => { 196 | 197 | $.post(xjpost(`member/signin/sign`,'from=miniprogram_index',token), async (err, resp, data) => { 198 | 199 | try { 200 | if (err) { 201 | console.log(`${JSON.stringify(err)}`) 202 | console.log(`${$.name} API请求失败,请检查网路重试`) 203 | }// else { 204 | if (safeGet(data)) { 205 | data = JSON.parse(data); 206 | if(data.err==0){ 207 | 208 | console.log("signin:"+data.msg) 209 | 210 | 211 | 212 | } 213 | else if(data.err !== 0){ 214 | console.log("signin:"+data.msg) 215 | 216 | } 217 | } 218 | 219 | } catch (e) { 220 | $.logErr(e, resp) 221 | } finally { 222 | resolve(data); 223 | } 224 | }) 225 | }) 226 | } 227 | 228 | function dailySign() { 229 | return new Promise((resolve) => { 230 | 231 | $.post(xjpost(`garden/sign/dailySign`,'',token), async (err, resp, data) => { 232 | 233 | try { 234 | if (err) { 235 | console.log(`${JSON.stringify(err)}`) 236 | console.log(`${$.name} API请求失败,请检查网路重试`) 237 | }// else { 238 | if (safeGet(data)) { 239 | data = JSON.parse(data); 240 | if(data.err==0){ 241 | 242 | console.log("dailySign:"+data.data.tips+data.msg) 243 | 244 | 245 | 246 | } 247 | else if(data.err !== 0){ 248 | console.log(data.msg) 249 | 250 | } 251 | } 252 | 253 | } catch (e) { 254 | $.logErr(e, resp) 255 | } finally { 256 | resolve(data); 257 | } 258 | }) 259 | }) 260 | } 261 | function Gardenquestiontask() { 262 | return new Promise((resolve) => { 263 | 264 | $.get(xjget(`garden/Gardenquestiontask/index`,token), async (err, resp, data) => { 265 | 266 | try { 267 | if (err) { 268 | console.log(`${JSON.stringify(err)}`) 269 | console.log(`${$.name} API请求失败,请检查网路重试`) 270 | }// else { 271 | if (safeGet(data)) { 272 | data = JSON.parse(data); 273 | if(data.err==0){ 274 | ansid = data.data[0].id 275 | answer = data.data[0].answer 276 | 277 | console.log(data.data[0].title) 278 | console.log("答案为:"+answer) 279 | await answerResults(ansid,answer) 280 | 281 | } 282 | else if(data.err !== 0){ 283 | console.log(data.msg) 284 | 285 | } 286 | } 287 | 288 | } catch (e) { 289 | $.logErr(e, resp) 290 | } finally { 291 | resolve(data); 292 | } 293 | }) 294 | }) 295 | } 296 | function answerResults(a,b) { 297 | return new Promise((resolve) => { 298 | 299 | $.get(xjget(`garden/Gardenquestiontask/answerResults?answer=%5B%7B%22itemid%22%3A${a}%2C%22selected%22%3A%22${b}%22%7D%5D`,token), async (err, resp, data) => { 300 | 301 | try { 302 | if (err) { 303 | console.log(`${JSON.stringify(err)}`) 304 | console.log(`${$.name} API请求失败,请检查网路重试`) 305 | }// else { 306 | if (safeGet(data)) { 307 | data = JSON.parse(data); 308 | if(data.err==0){ 309 | 310 | console.log("答题:"+data.msg) 311 | 312 | 313 | } 314 | else if(data.err !== 0){ 315 | console.log(data.msg) 316 | 317 | } 318 | } 319 | 320 | } catch (e) { 321 | $.logErr(e, resp) 322 | } finally { 323 | resolve(data); 324 | } 325 | }) 326 | }) 327 | } 328 | function dailyShare() { 329 | return new Promise((resolve) => { 330 | 331 | $.post(xjpost(`garden/gardenmemberinfo/dailyShare`,'',token), async (err, resp, data) => { 332 | 333 | try { 334 | if (err) { 335 | console.log(`${JSON.stringify(err)}`) 336 | console.log(`${$.name} API请求失败,请检查网路重试`) 337 | }// else { 338 | if (safeGet(data)) { 339 | data = JSON.parse(data); 340 | if(data.err==0){ 341 | 342 | console.log("分享:"+data.msg) 343 | 344 | 345 | } 346 | else if(data.err !== 0){ 347 | console.log(data.msg) 348 | 349 | } 350 | } 351 | 352 | } catch (e) { 353 | $.logErr(e, resp) 354 | } finally { 355 | resolve(data); 356 | } 357 | }) 358 | }) 359 | } 360 | function realscene() { 361 | return new Promise((resolve) => { 362 | 363 | $.get(xjget(`garden/realscene/reward`,token), async (err, resp, data) => { 364 | 365 | try { 366 | if (err) { 367 | console.log(`${JSON.stringify(err)}`) 368 | console.log(`${$.name} API请求失败,请检查网路重试`) 369 | }// else { 370 | if (safeGet(data)) { 371 | data = JSON.parse(data); 372 | if(data.err==0){ 373 | 374 | console.log("查看:"+data.msg) 375 | 376 | 377 | } 378 | else if(data.err !== 0){ 379 | console.log("查看:"+data.msg) 380 | 381 | } 382 | } 383 | 384 | } catch (e) { 385 | $.logErr(e, resp) 386 | } finally { 387 | resolve(data); 388 | } 389 | }) 390 | }) 391 | } 392 | 393 | function sorghum(id,type) { 394 | return new Promise((resolve) => { 395 | 396 | $.post(xjpost(`garden/sorghum/seed`,'{"id":'+id+',"type":'+type+'}',token), async (err, resp, data) => { 397 | 398 | try { 399 | if (err) { 400 | console.log(`${JSON.stringify(err)}`) 401 | console.log(`${$.name} API请求失败,请检查网路重试`) 402 | }// else { 403 | if (safeGet(data)) { 404 | data = JSON.parse(data); 405 | if(data.err==0){ 406 | console.log("种植高粱:"+data.msg) 407 | console.log("施肥次数:"+data.data['manure_num']) 408 | console.log("浇水次数:"+data.data['water_num']) 409 | //type = data.data[0].type 410 | //if(type == 1){ 411 | // await harvest() 412 | //} 413 | } 414 | else if(data.err !== 0){ 415 | console.log(data.msg) 416 | 417 | } 418 | } 419 | 420 | } catch (e) { 421 | $.logErr(e, resp) 422 | } finally { 423 | resolve(data); 424 | } 425 | }) 426 | }) 427 | } 428 | 429 | function watering() { 430 | return new Promise((resolve) => { 431 | 432 | $.post(xjpost(`garden/sorghum/watering`,'{"id":772352}',token), async (err, resp, data) => { 433 | 434 | try { 435 | if (err) { 436 | console.log(`${JSON.stringify(err)}`) 437 | console.log(`${$.name} API请求失败,请检查网路重试`) 438 | }// else { 439 | if (safeGet(data)) { 440 | data = JSON.parse(data); 441 | if(data.err==0){ 442 | console.log(data.msg) 443 | console.log("施肥次数:"+data.data['manure_num']) 444 | console.log("浇水次数:"+data.data['water_num']) 445 | type = data.data.type 446 | if(type == 1){ 447 | await harvest() 448 | } 449 | } 450 | else if(data.err !== 0){ 451 | console.log(data.msg) 452 | 453 | } 454 | } 455 | 456 | } catch (e) { 457 | $.logErr(e, resp) 458 | } finally { 459 | resolve(data); 460 | } 461 | }) 462 | }) 463 | } 464 | function manuring() { 465 | return new Promise((resolve) => { 466 | 467 | $.post(xjpost(`garden/sorghum/manuring`,'{"id":772352}',token), async (err, resp, data) => { 468 | 469 | try { 470 | if (err) { 471 | console.log(`${JSON.stringify(err)}`) 472 | console.log(`${$.name} API请求失败,请检查网路重试`) 473 | }// else { 474 | if (safeGet(data)) { 475 | data = JSON.parse(data); 476 | if(data.err==0){ 477 | console.log(data.msg) 478 | console.log("施肥次数:"+data.data['manure_num']) 479 | console.log("浇水次数:"+data.data['water_num']) 480 | type = data.data.type 481 | if(type == 1){ 482 | await harvest() 483 | } 484 | } 485 | else if(data.err !== 0){ 486 | console.log(data.msg) 487 | 488 | } 489 | } 490 | 491 | } catch (e) { 492 | $.logErr(e, resp) 493 | } finally { 494 | resolve(data); 495 | } 496 | }) 497 | }) 498 | } 499 | function harvest(id) { 500 | return new Promise((resolve) => { 501 | 502 | $.post(xjpost(`garden/sorghum/harvest`,'{"id":'+id+'}',token), async (err, resp, data) => { 503 | 504 | try { 505 | if (err) { 506 | console.log(`${JSON.stringify(err)}`) 507 | console.log(`${$.name} API请求失败,请检查网路重试`) 508 | }// else { 509 | if (safeGet(data)) { 510 | data = JSON.parse(data); 511 | if(data.err==0){ 512 | console.log(data.msg) 513 | 514 | 515 | } 516 | else if(data.err !== 0){ 517 | console.log(data.msg) 518 | 519 | } 520 | } 521 | 522 | } catch (e) { 523 | $.logErr(e, resp) 524 | } finally { 525 | resolve(data); 526 | } 527 | }) 528 | }) 529 | } 530 | function sorghumindex() { 531 | return new Promise((resolve) => { 532 | 533 | $.get(xjget(`garden/sorghum/index`,token), async (err, resp, data) => { 534 | // $.log(data) 535 | try { 536 | if (err) { 537 | console.log(`${JSON.stringify(err)}`) 538 | console.log(`${$.name} API请求失败,请检查网路重试`) 539 | }// else { 540 | if (safeGet(data)) { 541 | data = JSON.parse(data); 542 | if(data.err==0){ 543 | list = data.data 544 | for(let i=0;i { 583 | 584 | $.post(xjpost(`garden/sorghum/extend`,'{"serial_number":'+id+'}',token), async (err, resp, data) => { 585 | 586 | try { 587 | if (err) { 588 | console.log(`${JSON.stringify(err)}`) 589 | console.log(`${$.name} API请求失败,请检查网路重试`) 590 | }// else { 591 | if (safeGet(data)) { 592 | data = JSON.parse(data); 593 | if(data.err==0){ 594 | console.log(data.msg) 595 | 596 | 597 | } 598 | else if(data.err !== 0){ 599 | console.log(data.msg) 600 | 601 | } 602 | } 603 | 604 | } catch (e) { 605 | $.logErr(e, resp) 606 | } finally { 607 | resolve(data); 608 | } 609 | }) 610 | }) 611 | } 612 | 613 | function gardenmemberwine() { 614 | return new Promise((resolve) => { 615 | 616 | $.get(xjget(`garden/gardenmemberwine/index `,token), async (err, resp, data) => { 617 | 618 | try { 619 | if (err) { 620 | console.log(`${JSON.stringify(err)}`) 621 | console.log(`${$.name} API请求失败,请检查网路重试`) 622 | }// else { 623 | if (safeGet(data)) { 624 | data = JSON.parse(data); 625 | if(data.err==0){ 626 | if(data.total==1){ 627 | console.log("酿酒成熟时间:"+data.data[0].crop_time) 628 | console.log('ID: '+data.data[0].id) 629 | if(data.data[0].status==4){ 630 | console.log('已成熟 可以收取') 631 | status =data.data[0].status 632 | await harvestWine(data.data[0].id) 633 | } 634 | }else console.log('还未酿酒') 635 | await makeWine() 636 | } 637 | else if(data.err !== 0){ 638 | console.log(data.msg) 639 | 640 | } 641 | } 642 | 643 | } catch (e) { 644 | $.logErr(e, resp) 645 | } finally { 646 | resolve(data); 647 | } 648 | }) 649 | }) 650 | } 651 | function harvestWine(a) { 652 | return new Promise((resolve) => { 653 | 654 | $.get(xjget(`garden/gardenmemberwine/harvestWine?id=${a}`,token), async (err, resp, data) => { 655 | 656 | try { 657 | if (err) { 658 | console.log(`${JSON.stringify(err)}`) 659 | console.log(`${$.name} API请求失败,请检查网路重试`) 660 | }// else { 661 | if (safeGet(data)) { 662 | data = JSON.parse(data); 663 | if(data.err==0){ 664 | 665 | console.log("收取:"+data.msg) 666 | await makeWine() 667 | 668 | } 669 | else if(data.err !== 0){ 670 | console.log(data.msg) 671 | 672 | } 673 | } 674 | 675 | } catch (e) { 676 | $.logErr(e, resp) 677 | } finally { 678 | resolve(data); 679 | } 680 | }) 681 | }) 682 | } 683 | function harvestWine(a) { 684 | return new Promise((resolve) => { 685 | 686 | $.get(xjget(`garden/gardenmemberwine/harvestWine?id=${a}`,token), async (err, resp, data) => { 687 | 688 | try { 689 | if (err) { 690 | console.log(`${JSON.stringify(err)}`) 691 | console.log(`${$.name} API请求失败,请检查网路重试`) 692 | }// else { 693 | if (safeGet(data)) { 694 | data = JSON.parse(data); 695 | if(data.err==0){ 696 | 697 | console.log("收取:"+data.msg) 698 | await makeWine() 699 | 700 | } 701 | else if(data.err !== 0){ 702 | console.log(data.msg) 703 | 704 | } 705 | } 706 | 707 | } catch (e) { 708 | $.logErr(e, resp) 709 | } finally { 710 | resolve(data); 711 | } 712 | }) 713 | }) 714 | } 715 | function member() { 716 | return new Promise((resolve) => { 717 | 718 | $.get(xjget(`member/recommend/personal_center?phone_no=19955177897`,token), async (err, resp, data) => { 719 | 720 | try { 721 | if (err) { 722 | console.log(`${JSON.stringify(err)}`) 723 | console.log(`${$.name} API请求失败,请检查网路重试`) 724 | }// else { 725 | if (safeGet(data)) { 726 | data = JSON.parse(data); 727 | if(data.err==0){ 728 | 729 | 730 | } 731 | else if(data.err !== 0){ 732 | 733 | 734 | } 735 | } 736 | 737 | } catch (e) { 738 | $.logErr(e, resp) 739 | } finally { 740 | resolve(data); 741 | } 742 | }) 743 | }) 744 | } 745 | 746 | function all() { 747 | return new Promise((resolve) => { 748 | 749 | $.get(xjget(`garden/Sorghum/harvestAll`,token), async (err, resp, data) => { 750 | 751 | try { 752 | if (err) { 753 | console.log(`${JSON.stringify(err)}`) 754 | console.log(`${$.name} API请求失败,请检查网路重试`) 755 | }// else { 756 | if (safeGet(data)) { 757 | data = JSON.parse(data); 758 | if(data.err==0){ 759 | 760 | console.log("收取:"+data.msg) 761 | 762 | 763 | } 764 | else if(data.err !== 0){ 765 | console.log(data.msg) 766 | 767 | } 768 | } 769 | 770 | } catch (e) { 771 | $.logErr(e, resp) 772 | } finally { 773 | resolve(data); 774 | } 775 | }) 776 | }) 777 | } 778 | 779 | function makeWine() { 780 | return new Promise((resolve) => { 781 | 782 | $.post(xjpost1(`garden/gardenmemberwine/makeWine`,'volumn=200',token), async (err, resp, data) => { 783 | 784 | try { 785 | if (err) { 786 | console.log(`${JSON.stringify(err)}`) 787 | console.log(`${$.name} API请求失败,请检查网路重试`) 788 | }// else { 789 | if (safeGet(data)) { 790 | data = JSON.parse(data); 791 | if(data.err==0){ 792 | 793 | console.log("收取:"+data.msg) 794 | 795 | 796 | } 797 | else if(data.err !== 0){ 798 | console.log(data.msg) 799 | 800 | } 801 | } 802 | 803 | } catch (e) { 804 | $.logErr(e, resp) 805 | } finally { 806 | resolve(data); 807 | } 808 | }) 809 | }) 810 | } 811 | function info() { 812 | return new Promise((resolve) => { 813 | 814 | $.get(xjget(`garden/Gardenmemberinfo/getMemberInfo`,token), async (err, resp, data) => { 815 | 816 | try { 817 | if (err) { 818 | console.log(`${JSON.stringify(err)}`) 819 | console.log(`${$.name} API请求失败,请检查网路重试`) 820 | }// else { 821 | if (safeGet(data)) { 822 | data = JSON.parse(data); 823 | if(data.err==0){ 824 | 825 | console.log('积分:'+data.data.integration) 826 | console.log('高粱:'+data.data.sorghum) 827 | console.log('小麦:'+data.data.wheat) 828 | console.log('酒曲:'+data.data['wine_yeast']) 829 | console.log('酒:'+data.data.wine) 830 | if(data.data.wine>0){ 831 | await exchange(data.data.wine) 832 | } 833 | 834 | 835 | } 836 | else if(data.err !== 0){ 837 | console.log(data.msg) 838 | 839 | } 840 | } 841 | 842 | } catch (e) { 843 | $.logErr(e, resp) 844 | } finally { 845 | resolve(data); 846 | } 847 | }) 848 | }) 849 | } 850 | function exchange(a) { 851 | return new Promise((resolve) => { 852 | 853 | $.get(xjget(`garden/Gardenjifenshop/exchange?wine=${a}`,token), async (err, resp, data) => { 854 | 855 | try { 856 | if (err) { 857 | console.log(`${JSON.stringify(err)}`) 858 | console.log(`${$.name} API请求失败,请检查网路重试`) 859 | }// else { 860 | if (safeGet(data)) { 861 | data = JSON.parse(data); 862 | if(data.err==0){ 863 | 864 | console.log('积分:'+data.msg) 865 | 866 | } 867 | else if(data.err !== 0){ 868 | console.log(data.msg) 869 | 870 | } 871 | } 872 | 873 | } catch (e) { 874 | $.logErr(e, resp) 875 | } finally { 876 | resolve(data); 877 | } 878 | }) 879 | }) 880 | } 881 | 882 | function indexapi1(a,body,token) { 883 | return { 884 | 885 | url: `${host}${a}`, 886 | 887 | headers: { 888 | 'Host': 'xcx.exijiu.com', 889 | 'Connection': 'keep-alive', 890 | 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36 MicroMessenger/7.0.9.501 NetType/WIFI MiniProgramEnv/Windows WindowsWechat', 891 | 'content-type': 'application/json', 892 | 'login_code': xjhd, 893 | 'Authorization': token, 894 | 'Referer': 'https://servicewechat.com/wx489f950decfeb93e/195/page-frame.html', 895 | 'Accept-Encoding': 'gzip, deflate', 896 | 897 | } 898 | } 899 | } 900 | 901 | function indexapi(a,body) { 902 | return { 903 | 904 | url: `${host}${a}`, 905 | 906 | headers: { 907 | 'Host': 'xcx.exijiu.com', 908 | 'Connection': 'keep-alive', 909 | 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36 MicroMessenger/7.0.9.501 NetType/WIFI MiniProgramEnv/Windows WindowsWechat', 910 | 'content-type': 'application/json', 911 | 'login_code': xjhd, 912 | 'Referer': 'https://servicewechat.com/wx489f950decfeb93e/195/page-frame.html', 913 | 'Accept-Encoding': 'gzip, deflate', 914 | 915 | } 916 | } 917 | } 918 | function xjget(a,token) { 919 | return { 920 | 921 | url: `${host1}${a}`, 922 | headers: { 923 | 'Host': 'apimallwm.exijiu.com', 924 | 'Connection': 'keep-alive', 925 | 'Authorization': token, 926 | 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36 MicroMessenger/7.0.9.501 NetType/WIFI MiniProgramEnv/Windows WindowsWechat', 927 | 'Content-Type': 'application/x-www-form-urlencoded', 928 | 'Accept': '*/*', 929 | 'Sec-Fetch-Site': 'same-site', 930 | 'Sec-Fetch-Mode': 'cors', 931 | 'Sec-Fetch-Dest': 'empty', 932 | 'Referer': 'https://mallwm.exijiu.com/', 933 | 'Accept-Language': 'en-us,en', 934 | 'Accept-Encoding':' gzip, deflate', 935 | 'login_code': xjhd, 936 | } 937 | } 938 | } 939 | function xjpost(a,b,token) { 940 | return { 941 | 942 | url: `${host1}${a}`, 943 | body:`${b}`, 944 | headers: { 945 | 'Host': 'apimallwm.exijiu.com', 946 | 'Connection': 'keep-alive', 947 | 'Authorization': token, 948 | 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36 MicroMessenger/7.0.9.501 NetType/WIFI MiniProgramEnv/Windows WindowsWechat', 949 | 'Content-Type': 'application/json, text/plain, */*', 950 | 'Accept': '*/*', 951 | 'Sec-Fetch-Site': 'same-site', 952 | 'Sec-Fetch-Mode': 'cors', 953 | 'Sec-Fetch-Dest': 'empty', 954 | 'Referer': 'https://mallwm.exijiu.com/', 955 | 'Accept-Language': 'en-us,en', 956 | 'Accept-Encoding':' gzip, deflate', 957 | 'login_code': xjhd, 958 | } 959 | } 960 | } 961 | function xjpost1(a,b,token) { 962 | return { 963 | 964 | url: `${host1}${a}`, 965 | body:`${b}`, 966 | headers: { 967 | 'Host': 'apimallwm.exijiu.com', 968 | 'Connection': 'keep-alive', 969 | 'Authorization': token, 970 | 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36 MicroMessenger/7.0.9.501 NetType/WIFI MiniProgramEnv/Windows WindowsWechat', 971 | 'Content-Type': 'application/x-www-form-urlencoded', 972 | 'Accept': 'application/json, text/plain, */*', 973 | 'Sec-Fetch-Site': 'same-site', 974 | 'Sec-Fetch-Mode': 'cors', 975 | 'Sec-Fetch-Dest': 'empty', 976 | 'Referer': 'https://mallwm.exijiu.com/', 977 | 'Accept-Language': 'en-us,en', 978 | 'Accept-Encoding':' gzip, deflate', 979 | 'login_code': xjhd, 980 | } 981 | } 982 | } 983 | 984 | 985 | function safeGet(data) { 986 | try { 987 | if (typeof JSON.parse(data) == "object") { 988 | return true; 989 | } 990 | } catch (e) { 991 | console.log(e); 992 | console.log(`京东服务器访问数据为空,请检查自身设备网络情况`); 993 | return false; 994 | } 995 | } 996 | function jsonParse(str) { 997 | if (typeof str == "string") { 998 | try { 999 | return JSON.parse(str); 1000 | } catch (e) { 1001 | console.log(e); 1002 | $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') 1003 | return []; 1004 | } 1005 | } 1006 | } 1007 | 1008 | function Env(t,e){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("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}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("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(a,(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){let e={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).length)));return t}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=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];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("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)} 1009 | -------------------------------------------------------------------------------- /ql_xlh.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 骁龙会 3 | * cron 18 7 * * * yml_javascript/xlh.js 4 | * 5 | * 骁龙会 微信小程序 6 | * 3-22 签到任务 、 阅读5/15分钟任务 完成,商城任务暂时没写 ,有效期测试中 7 | * 3-25 完成圈x、青龙双平台,增加运行通知(理论v2p也兼容,未测试) 8 | * 感谢所有测试人员 9 | * ========= 青龙--配置文件 ========= 10 | * 变量格式: export xlhCookies='sessionKey的值 & userId的值@sessionKey的值&userId的值' 多个账号用 @分割 11 | * qualcomm.growthideadata.com 关键词的包 基本每个包都有变量 12 | * 13 | * ========= V2P,QX重写 ========= 14 | * --- mimt(主机名) --- 15 | * mimt= qualcomm.growthideadata.com 16 | * --- 重写 --- 17 | * https://qualcomm.growthideadata.com/qualcomm-app/api/activity url script-request-header https://raw.githubusercontent.com/yml2213/javascript/master/xlh/xlh.js 18 | * 19 | * 0 0 7 * * ? https://raw.githubusercontent.com/yml2213/javascript/master/xlh/xlh.js, tag=骁龙会, enabled=true 20 | * 21 | * 还是不会的请百度或者群里求助:QQ群:884234287 tg:https://t.me/yml_tg 22 | */ 23 | //const $ = new Env('骁龙会') 24 | //cron: 18 13 * * * 25 | const $ = new Env("骁龙会"); 26 | const notify = $.isNode() ? require('./sendNotify') : ''; 27 | const Notify = 1; //0为关闭通知,1为打开通知,默认为1 28 | const debug = 0; //0为关闭调试,1为打开调试,默认为0 29 | 30 | 31 | let xlhCookies = ($.isNode() ? process.env.xlhCookies : $.getdata('xlhCookies')) || ""; 32 | let xlhCookiesArr = []; 33 | let msg = ''; 34 | let UA = 'Mozilla/5.0 (iPhone; CPU iPhone OS 15_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.18(0x18001239) NetType/WIFI Language/zh_CN' 35 | 36 | // // UA判断部分 37 | // if (!process.env.xlh_UA) { 38 | // console.log(`\n【${$.name}】:未填写 xlh_UA 变量,将默认分配一个UA`); 39 | // UA = 'Mozilla/5.0 (iPhone; CPU iPhone OS 15_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.18(0x18001239) NetType/WIFI Language/zh_CN' 40 | // } else { 41 | // UA = process.env.xlh_UA 42 | // } 43 | 44 | 45 | !(async () => { 46 | if (typeof $request !== "undefined") { 47 | await GetRewrite() 48 | } else { 49 | if (!(await Envs())) //多账号分割 判断变量是否为空 初步处理多账号 50 | return; 51 | else { 52 | 53 | console.log( 54 | `\n\n========================================= 脚本执行 - 北京时间(UTC+8):${new Date( 55 | new Date().getTime() + 56 | new Date().getTimezoneOffset() * 60 * 1000 + 57 | 8 * 60 * 60 * 1000 58 | ).toLocaleString()} =========================================\n`); 59 | 60 | 61 | await wyy(); 62 | await $.wait(2 * 1000); 63 | 64 | 65 | $.log(`\n=================== 共找到 ${xlhCookiesArr.length} 个账号 ===================`) 66 | 67 | if (debug) { 68 | console.log(`【debug】 这是你的账号数组:\n ${xlhCookiesArr}`); 69 | } 70 | 71 | 72 | if (debug) { 73 | console.log(`\n【debug】 这是你的UA数据:\n ${UA}\n`); 74 | } 75 | 76 | for (let index = 0; index < xlhCookiesArr.length; index++) { 77 | 78 | 79 | data = xlhCookiesArr[index].split('&') 80 | 81 | if (debug) { 82 | console.log(`\n【debug】 这是你的账号信息:\n sessionKey:${data[0]}\n userId:${data[1]}`); 83 | } 84 | 85 | let num = index + 1 86 | $.log(`\n========= 开始【第 ${num} 个账号】=========\n`) 87 | msg += `\n【第 ${num} 个账号】` 88 | 89 | // 获取用户信息 90 | await getUsreInfo(data[0], data[1]); 91 | // await Query_Balance(true); 92 | await $.wait(1 * 1000); 93 | 94 | 95 | 96 | 97 | $.log('开始 【签到】') 98 | await sign(); 99 | await $.wait(2 * 1000); 100 | 101 | 102 | $.log('开始 【获取文章列表】') 103 | await articles() 104 | await $.wait(2 * 1000); 105 | 106 | 107 | $.log('开始 【阅读文章】') 108 | await enterRead() 109 | await $.wait(2 * 1000); 110 | 111 | 112 | $.log('停止 【阅读文章】') 113 | await exitRead() 114 | await $.wait(2 * 1000); 115 | 116 | 117 | $.log('查询 【任务完成后积分】') 118 | await getUsreInfo_end(data[0], data[1]); 119 | // await Query_Balance(true); 120 | await $.wait(1 * 1000); 121 | 122 | 123 | } 124 | await SendMsg(msg); 125 | 126 | } 127 | } 128 | })() 129 | .catch((e) => $.logErr(e)) 130 | .finally(() => $.done()) 131 | 132 | //#region 固定代码 133 | // ============================================变量检查============================================ \\ 134 | async function Envs() { 135 | if (xlhCookies) { 136 | if (xlhCookies.indexOf("@") != -1) { 137 | xlhCookies.split("@").forEach((item) => { 138 | xlhCookiesArr.push(item); 139 | }); 140 | } else { 141 | xlhCookiesArr.push(xlhCookies); 142 | } 143 | } else { 144 | $.log(`\n【${$.name}】:未填写变量 xlhCookies`) 145 | return; 146 | } 147 | 148 | return true; 149 | } 150 | // ============================================ 重写 ============================================ \\ 151 | async function GetRewrite() { 152 | if ($request.url.indexOf(`check`) > -1 && $request.headers) { 153 | 154 | let sessionKey = $request.headers.sessionKey; 155 | let userId = $request.headers.userId; 156 | 157 | if (sessionKey == 'sessionKey=anonymous') 158 | return; 159 | if (userId == 'userId=anonymous') 160 | return; 161 | 162 | let cookie = `${sessionKey}&${userId}` 163 | 164 | if (debug) { 165 | $.msg(`\n【debug】 这是你圈x获取的数据:\n ${cookie}`) 166 | } 167 | 168 | 169 | if (xlhCookies != '') { 170 | if (xlhCookies.indexOf(cookie) == -1) { 171 | xlhCookies = xlhCookies + '@' + cookie 172 | let List = xlhCookies.split('@') 173 | 174 | $.setdata(xlhCookies, 'xlhCookies'); 175 | $.msg(`【${$.name}】 获取第${List.length}个CK成功: ${cookie}`) 176 | } else { 177 | //$.msg($.name + ` 该账号CK已存在`) 178 | } 179 | } else { 180 | $.setdata(cookie, 'xlhCookies'); 181 | $.msg(`【${$.name}】 获取第1个CK成功: ${cookie}`) 182 | } 183 | 184 | } 185 | } 186 | // ============================================发送消息============================================ \\ 187 | async function SendMsg(message) { 188 | if (!message) 189 | return; 190 | 191 | if (Notify > 0) { 192 | if ($.isNode()) { 193 | var notify = require('./sendNotify'); 194 | await notify.sendNotify($.name, message); 195 | } else { 196 | $.msg(message); 197 | } 198 | } else { 199 | console.log(message); 200 | } 201 | } 202 | 203 | /** 204 | * 随机数生成 205 | */ 206 | function randomString(e) { 207 | e = e || 32; 208 | var t = "QWERTYUIOPASDFGHJKLZXCVBNM1234567890", 209 | a = t.length, 210 | n = ""; 211 | for (i = 0; i < e; i++) 212 | n += t.charAt(Math.floor(Math.random() * a)); 213 | return n 214 | } 215 | 216 | /** 217 | * 随机整数生成 218 | */ 219 | function randomInt(min, max) { 220 | return Math.round(Math.random() * (max - min) + min) 221 | } 222 | 223 | //每日网抑云 224 | function wyy(timeout = 3 * 1000) { 225 | return new Promise((resolve) => { 226 | let url = { 227 | url: `https://keai.icu/apiwyy/api` 228 | } 229 | $.get(url, async (err, resp, data) => { 230 | try { 231 | data = JSON.parse(data) 232 | $.log(`\n【网抑云时间】: ${data.content} by--${data.music}`); 233 | 234 | } catch (e) { 235 | $.logErr(e, resp); 236 | } finally { 237 | resolve() 238 | } 239 | }, timeout) 240 | }) 241 | } 242 | 243 | //#endregion 244 | 245 | /** 246 | * 获取用户信息 247 | */ 248 | function getUsreInfo(sessionKey, userId) { 249 | return new Promise((resolve) => { 250 | let url = { 251 | url: `https://qualcomm.growthideadata.com/qualcomm-app/api/user/info?userId=${userId}`, 252 | headers: { 253 | 254 | "userId": data[1], 255 | "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8", 256 | "Host": "qualcomm.growthideadata.com", 257 | "User-Agent": UA, 258 | "sessionKey": sessionKey, 259 | "Referer": "https://servicewechat.com/wx026c06df6adc5d06/176/page-frame.html", 260 | "Connection": "keep-alive" 261 | }, 262 | 263 | } 264 | 265 | if (debug) { 266 | console.log(`\n=============== 这是 获取用户信息 请求 url ===============`); 267 | console.log(JSON.stringify(url)); 268 | } 269 | 270 | $.get(url, async (error, response, data) => { 271 | try { 272 | let result = JSON.parse(data); 273 | if (debug) { 274 | console.log(`\n\n=============== 这是 获取用户信息 返回data ==============`); 275 | console.log(data) 276 | } 277 | if (result.code == 200) { 278 | 279 | console.log(`\n🎉🎉🎉 欢迎光临 🎉🎉🎉 \n【昵称】${result.data.nick}\n【等级】${result.data.level}级:${result.data.levelName}\n【用户Id】${result.data.id}\n【现有积分】${result.data.coreCoin}\n【累计获得积分】${result.data.cumulativeCoreCoin}\n`); 280 | 281 | msg += `\n🎉🎉🎉 欢迎光临 🎉🎉🎉 \n【昵称】${result.data.nick}\n【等级】${result.data.level}级:${result.data.levelName}\n【用户Id】${result.data.id}\n【现有积分】${result.data.coreCoin}\n【累计获得积分】${result.data.cumulativeCoreCoin}\n` 282 | 283 | 284 | // $.msg(`\n🎉🎉🎉 欢迎光临 🎉🎉🎉 \n【昵称】${result.data.nick}\n【等级】${result.data.level}级${result.data.levelName}\n【用户Id】${result.data.id}\n【现有积分】${result.data.coreCoin}\n【累计获得积分】${result.data.cumulativeCoreCoin}\n`) 285 | 286 | 287 | } else if (result.code === 40001) { // 登陆过期 288 | 289 | $.log(`\n【获取用户信息】 失败 ,可能是:${result.message}!\n `) 290 | msg += `\n【获取用户信息】 失败 ,可能是:${result.message}!\n` 291 | // $.msg(`【${$.name}】 【签到】: ${result.message}`) 292 | SendMsg(`${xlhCookiesArr[index]}该CK已过期`) 293 | 294 | 295 | } else { 296 | // $.log(results.msg) 297 | SendMsg(`${xlhCookiesArr[index]}该CK出现未知问题,请检查!`) 298 | } 299 | 300 | } catch (e) { 301 | console.log(e) 302 | } finally { 303 | resolve(); 304 | } 305 | }) 306 | }) 307 | } 308 | 309 | 310 | /** 311 | * 查询 任务完成后积分 312 | */ 313 | function getUsreInfo_end(sessionKey, userId) { 314 | return new Promise((resolve) => { 315 | let url = { 316 | url: `https://qualcomm.growthideadata.com/qualcomm-app/api/user/info?userId=${userId}`, 317 | headers: { 318 | 319 | "userId": data[1], 320 | "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8", 321 | "Host": "qualcomm.growthideadata.com", 322 | "User-Agent": UA, 323 | "sessionKey": sessionKey, 324 | "Referer": "https://servicewechat.com/wx026c06df6adc5d06/176/page-frame.html", 325 | "Connection": "keep-alive" 326 | }, 327 | 328 | } 329 | 330 | if (debug) { 331 | console.log(`\n=============== 这是 获取用户信息 请求 url ===============`); 332 | console.log(JSON.stringify(url)); 333 | } 334 | 335 | $.get(url, async (error, response, data) => { 336 | try { 337 | let result = JSON.parse(data); 338 | if (debug) { 339 | console.log(`\n\n=============== 这是 获取用户信息 返回data ==============`); 340 | console.log(data) 341 | } 342 | if (result.code == 200) { 343 | 344 | console.log(`【昵称】${result.data.nick}\n【任务后积分】${result.data.coreCoin} `) 345 | 346 | msg += `【昵称】${result.data.nick}\n【任务后积分】${result.data.coreCoin} ` 347 | 348 | // $.msg(`【昵称】${result.data.nick}\n【任务后积分】${result.data.coreCoin} `) 349 | 350 | } 351 | 352 | } catch (e) { 353 | console.log(e) 354 | } finally { 355 | resolve(); 356 | } 357 | }) 358 | }) 359 | } 360 | 361 | 362 | 363 | 364 | /** 365 | * 签到 366 | */ 367 | function sign(timeout = 3 * 1000) { 368 | return new Promise((resolve) => { 369 | let url = { 370 | url: `https://qualcomm.growthideadata.com/qualcomm-app/api/user/signIn?userId=${data[1]}`, 371 | headers: { 372 | 373 | "userId": data[1], 374 | "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8", 375 | "Host": "qualcomm.growthideadata.com", 376 | "User-Agent": UA, 377 | "sessionKey": data[0], 378 | "Referer": "https://servicewechat.com/wx026c06df6adc5d06/176/page-frame.html", 379 | "Connection": "keep-alive" 380 | }, 381 | 382 | } 383 | 384 | if (debug) { 385 | console.log(`\n【debug】=============== 这是 签到 请求 url ===============`); 386 | console.log(JSON.stringify(url)); 387 | } 388 | 389 | $.get(url, async (error, response, data) => { 390 | try { 391 | if (debug) { 392 | console.log(`\n\n【debug】===============这是 签到 返回data==============`); 393 | console.log(data) 394 | } 395 | let result = JSON.parse(data); 396 | if (result.code == 200) { 397 | 398 | console.log(`【签到】${result.message} 🎉🎉🎉 `) 399 | msg += `\n【签到】${result.message} 🎉🎉🎉` 400 | $.msg(`【${$.name}】 【签到】: ${result.message} 🎉🎉🎉`) 401 | 402 | } else if (result.code === 1) { 403 | 404 | $.log(`\n【签到】 失败 ,可能是:${result.message}!\n `) 405 | msg += `\n【签到】 失败 ,可能是:${result.message}!\n` 406 | $.msg(`【${$.name}】 【签到】: ${result.message}`) 407 | 408 | } else if (result.code === 40001) { 409 | 410 | $.log(`\n【签到】 失败 ,可能是:${result.message}!\n `) 411 | msg += `\n【签到】 失败 ,可能是:${result.message}!\n` 412 | $.msg(`【${$.name}】 【签到】: ${result.message}`) 413 | 414 | } else { 415 | 416 | $.log(`\n【签到】 失败 ❌ 了呢,可能是网络被外星人抓走了!\n `) 417 | msg += `\n【签到】 失败 ❌ 了呢,可能是网络被外星人抓走了!\n` 418 | $.msg(`【${$.name}】 【签到】: 失败 ❌ 了呢,可能是网络被外星人抓走了!`) 419 | 420 | } 421 | 422 | } catch (e) { 423 | console.log(e) 424 | } finally { 425 | resolve(); 426 | } 427 | }, timeout) 428 | }) 429 | } 430 | 431 | 432 | 433 | /** 434 | * 阅读任务部分 435 | * 获取文章列表,随机选择一篇文章获取 articleId 436 | */ 437 | function articles(timeout = 3 * 1000) { 438 | return new Promise((resolve, reject) => { 439 | 440 | let d = new Date(); 441 | let y = d.getFullYear(); 442 | let m = d.getMonth(); 443 | m = m.toString(); 444 | if (m.length == 1) { 445 | m = `0${m}` 446 | } 447 | let time = `${y}-${m}`; 448 | // console.log(time); 449 | 450 | 451 | let url = { 452 | url: `https://qualcomm.growthideadata.com/qualcomm-app/api/home/articles?page=1&size=20&userId=${data[1]}&labelId=&searchDate=${time}&showType=0`, 453 | headers: { 454 | 455 | "userId": data[1], 456 | "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8", 457 | "Host": "qualcomm.growthideadata.com", 458 | "User-Agent": UA, 459 | "sessionKey": data[0], 460 | "Referer": "https://servicewechat.com/wx026c06df6adc5d06/176/page-frame.html", 461 | "Connection": "keep-alive" 462 | }, 463 | 464 | } 465 | if (debug) { 466 | console.log(`\n【debug】=============== 这是 获取文章列表 请求 url ===============`); 467 | console.log(JSON.stringify(url)); 468 | } 469 | $.get(url, async (error, response, data) => { 470 | try { 471 | 472 | let result = JSON.parse(data); 473 | if (debug) { 474 | console.log(`\n\n【debug】=============== 这是 获取文章列表 返回data ==============`); 475 | console.log(data) 476 | } 477 | 478 | if (result.code == 200) { 479 | 480 | 481 | console.log(`【获取文章列表】${result.message} 🎉`) 482 | msg += `\n 【获取文章列表】${result.message} 🎉` 483 | // $.msg(`【${$.name}】 【获取文章列表】: ${result.message} 🎉`) 484 | 485 | console.log(`\n 请耐心等待 5 s\n`) 486 | await $.wait(5 * 1000); 487 | 488 | // 随机1-10 数字 489 | let num = randomInt(1, 10); 490 | // console.log(num); 491 | 492 | // 获取文章 articleId 493 | articleId = result.data.articleList[num].id; 494 | // console.log(articleId); 495 | // 获取文章 title 496 | title = result.data.articleList[num].title; 497 | // console.log(title); 498 | 499 | } 500 | 501 | } catch (e) { 502 | console.log(error) 503 | } finally { 504 | resolve(); 505 | } 506 | }, timeout) 507 | }) 508 | } 509 | 510 | 511 | 512 | /** 513 | * 开始阅读 514 | */ 515 | // https://qualcomm.growthideadata.com/qualcomm-app/api/article/enterRead?articleId=7626&userId=281687 516 | function enterRead(timeout = 3 * 1000) { 517 | return new Promise((resolve, reject) => { 518 | let url = { 519 | url: `https://qualcomm.growthideadata.com/qualcomm-app/api/article/enterRead?articleId=${articleId}&userId=${data[1]}`, 520 | headers: { 521 | 522 | "userId": data[1], 523 | "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8", 524 | "Host": "qualcomm.growthideadata.com", 525 | "User-Agent": UA, 526 | "sessionKey": data[0], 527 | "Referer": "https://servicewechat.com/wx026c06df6adc5d06/176/page-frame.html", 528 | "Connection": "keep-alive" 529 | }, 530 | 531 | } 532 | if (debug) { 533 | console.log(`\n【debug】=============== 这是 开始阅读 请求 url ===============`); 534 | console.log(JSON.stringify(url)); 535 | } 536 | $.get(url, async (error, response, data) => { 537 | try { 538 | let result = JSON.parse(data); 539 | if (debug) { 540 | console.log(`\n\n【debug】=============== 这是 开始阅读 返回data ==============`); 541 | console.log(data) 542 | } 543 | if (result.code == 200) { 544 | 545 | console.log(`【开始阅读】阅读${result.message} 🎉\n恭喜你,开始阅读文章“${title}”\n 请耐心等待16分钟,你可以去做别的事情了鸭!\n`) 546 | msg += `【开始阅读】阅读${result.message} 🎉\n恭喜你,开始阅读文章“${title}”\n 请耐心等待16分钟,你可以去做别的事情了鸭!\n\n` 547 | // $.msg(`【开始阅读】阅读${result.message} 🎉\n恭喜你,开始阅读文章“${title}”\n 请耐心等待16分钟,你可以去做别的事情了鸭!\n`) 548 | 549 | 550 | 551 | await $.wait(10 * 1000); 552 | console.log(`\n 请耐心等待16分钟,你可以去做别的事情了鸭!\n`) 553 | msg += `\n 请耐心等待16分钟,你可以去做别的事情了鸭!\n` 554 | // $.msg(`\n 请耐心等待16分钟,你可以去做别的事情了鸭!`) 555 | 556 | await $.wait(10 * 1000); 557 | console.log(`\n 请耐心等待16分钟,你可以去做别的事情了鸭!\n`) 558 | msg += `\n 请耐心等待16分钟,你可以去做别的事情了鸭!\n` 559 | // $.msg(`\n 请耐心等待16分钟,你可以去做别的事情了鸭!`) 560 | 561 | await $.wait(960 * 1000); 562 | 563 | 564 | } 565 | 566 | } catch (e) { 567 | console.log(error) 568 | } finally { 569 | resolve(); 570 | } 571 | }, timeout) 572 | }) 573 | } 574 | 575 | /** 576 | * 停止阅读 577 | */ 578 | // https://qualcomm.growthideadata.com/qualcomm-app/api/article/exitRead?articleId=7626&userId=281687 579 | function exitRead(timeout = 3 * 1000) { 580 | return new Promise((resolve, reject) => { 581 | let url = { 582 | url: `https://qualcomm.growthideadata.com/qualcomm-app/api/article/exitRead?articleId=${articleId}&userId=${data[1]}`, 583 | headers: { 584 | 585 | "userId": data[1], 586 | "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8", 587 | "Host": "qualcomm.growthideadata.com", 588 | "User-Agent": UA, 589 | "sessionKey": data[0], 590 | "Referer": "https://servicewechat.com/wx026c06df6adc5d06/176/page-frame.html", 591 | "Connection": "keep-alive" 592 | }, 593 | 594 | } 595 | if (debug) { 596 | console.log(`\n【debug】=============== 这是 停止阅读 请求 url ===============`); 597 | console.log(JSON.stringify(url)); 598 | } 599 | $.get(url, async (error, response, data) => { 600 | try { 601 | let result = JSON.parse(data); 602 | if (debug) { 603 | console.log(`\n\n【debug】=============== 这是 停止阅读 返回data ==============`); 604 | console.log(data) 605 | } 606 | if (result.code == 200) { 607 | console.log(`【停止阅读】停止阅读${result.message} 🎉】\n恭喜你,停止阅读文章“${title}”\n 快去看看你的任务完成了吗!\n`) 608 | msg += `【停止阅读】停止阅读${result.message} 🎉】\n恭喜你,停止阅读文章“${title}”\n 快去看看你的任务完成了吗!\n` 609 | // $.msg(`【停止阅读】停止阅读${result.message} 🎉】\n恭喜你,停止阅读文章“${title}”\n 快去看看你的任务完成了吗!\n`) 610 | 611 | await $.wait(2 * 1000); 612 | 613 | } 614 | 615 | } catch (e) { 616 | console.log(error) 617 | } finally { 618 | resolve(); 619 | } 620 | }, timeout) 621 | }) 622 | } 623 | 624 | 625 | 626 | 627 | 628 | 629 | 630 | 631 | 632 | 633 | 634 | 635 | 636 | // prettier-ignore 637 | 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) } 638 | -------------------------------------------------------------------------------- /ql_xmyd.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf8 -*- 3 | # python >=3.8 4 | """ 5 | Author: Squaregentleman 6 | Modifier: Oreo 7 | Date: Tue Aug 10 08:24:30 UTC 2021 8 | cron: 25 20 * * * 9 | new Env('小米改步'); 10 | ------------ 11 | 环境变量说明 12 | MI_USER: 账号 仅支持手机号,多账号用 # 分隔 13 | MI_PWD: 密码 多账号用 # 分隔,且与账号一一对应 14 | STEP: 步数 空或不填则为 18000-25000 之间随机,自定义示例: 18763 或 19000-24000 15 | PMODE: 推送模式 || PKEY: 具体推送格式填写(不带 [TG: ],请用具体的值代替) 16 | wx [Server 酱: skey] 17 | nwx [新 Server 酱: skey] 18 | tg [TG: tg_bot_token@user_id] 19 | qwx [企业微信: touser-corpid-corpsecret-agentid 其中 touser 可填 @all,agenid 不填默认为 1000002] 20 | pp [PushPlus: push_plus_token] 21 | off [关闭推送] 22 | """ 23 | 24 | import json 25 | import os 26 | import random 27 | import re 28 | import time 29 | 30 | import requests 31 | 32 | now = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) 33 | headers = {"User-Agent": "Dalvik/2.1.0 (Linux; U; Android 9; MI 6 MIUI/20.6.18)"} 34 | 35 | 36 | # 获取登录 code 37 | def get_code(location): 38 | code_pattern = re.compile("(?<=access=).*?(?=&)") 39 | code = code_pattern.findall(location)[0] 40 | return code 41 | 42 | 43 | # 登录 44 | def login(_user, password): 45 | url1 = "https://api-user.huami.com/registrations/+86" + _user + "/tokens" 46 | _headers = { 47 | "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8", 48 | "User-Agent": "MiFit/4.6.0 (iPhone; iOS 14.0.1; Scale/2.00)", 49 | } 50 | data1 = { 51 | "client_id": "HuaMi", 52 | "password": f"{password}", 53 | "redirect_uri": "https://s3-us-west-2.amazonaws.com/hm-registration/successsignin.html", 54 | "token": "access", 55 | } 56 | r1 = requests.post(url1, data=data1, headers=_headers, allow_redirects=False) 57 | try: 58 | location = r1.headers["Location"] 59 | code = get_code(location) 60 | except Exception: 61 | return 0, 0 62 | # print("access_code获取成功!") 63 | # print(code) 64 | 65 | url2 = "https://account.huami.com/v2/client/login" 66 | data2 = { 67 | "app_name": "com.xiaomi.hm.health", 68 | "app_version": "4.6.0", 69 | "code": f"{code}", 70 | "country_code": "CN", 71 | "device_id": "2C8B4939-0CCD-4E94-8CBA-CB8EA6E613A1", 72 | "device_model": "phone", 73 | "grant_type": "access_token", 74 | "third_name": "huami_phone", 75 | } 76 | r2 = requests.post(url2, data=data2, headers=_headers).json() 77 | login_token = r2["token_info"]["login_token"] 78 | # print("login_token获取成功!") 79 | # print(login_token) 80 | userid = r2["token_info"]["user_id"] 81 | # print("userid获取成功!") 82 | # print(userid) 83 | 84 | return login_token, userid 85 | 86 | 87 | # 主函数 88 | def main(_user, _passwd, _step): 89 | _user = str(_user) 90 | password = str(_passwd) 91 | _step = str(_step) 92 | if _user == "" or password == "": 93 | print("用户名或密码不能为空!") 94 | return "user and passwd not empty!" 95 | 96 | if _step == "": 97 | print("已设置为随机步数(18000-25000)") 98 | _step = str(random.randint(18000, 25000)) 99 | login_token, userid = login(_user, password) 100 | if login_token == 0: 101 | print("登陆失败!") 102 | return "login fail!" 103 | 104 | t = get_time() 105 | 106 | app_token = get_app_token(login_token) 107 | 108 | today = time.strftime("%F") 109 | 110 | data_json = "%5B%7B%22data_hr%22%3A%22%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F9L%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2FVv%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F0v%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F9e%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F0n%5C%2Fa%5C%2F%5C%2F%5C%2FS%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F0b%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F1FK%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2FR%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F9PTFFpaf9L%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2FR%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F0j%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F9K%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2FOv%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2Fzf%5C%2F%5C%2F%5C%2F86%5C%2Fzr%5C%2FOv88%5C%2Fzf%5C%2FPf%5C%2F%5C%2F%5C%2F0v%5C%2FS%5C%2F8%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2FSf%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2Fz3%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F0r%5C%2FOv%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2FS%5C%2F9L%5C%2Fzb%5C%2FSf9K%5C%2F0v%5C%2FRf9H%5C%2Fzj%5C%2FSf9K%5C%2F0%5C%2F%5C%2FN%5C%2F%5C%2F%5C%2F%5C%2F0D%5C%2FSf83%5C%2Fzr%5C%2FPf9M%5C%2F0v%5C%2FOv9e%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2FS%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2Fzv%5C%2F%5C%2Fz7%5C%2FO%5C%2F83%5C%2Fzv%5C%2FN%5C%2F83%5C%2Fzr%5C%2FN%5C%2F86%5C%2Fz%5C%2F%5C%2FNv83%5C%2Fzn%5C%2FXv84%5C%2Fzr%5C%2FPP84%5C%2Fzj%5C%2FN%5C%2F9e%5C%2Fzr%5C%2FN%5C%2F89%5C%2F03%5C%2FP%5C%2F89%5C%2Fz3%5C%2FQ%5C%2F9N%5C%2F0v%5C%2FTv9C%5C%2F0H%5C%2FOf9D%5C%2Fzz%5C%2FOf88%5C%2Fz%5C%2F%5C%2FPP9A%5C%2Fzr%5C%2FN%5C%2F86%5C%2Fzz%5C%2FNv87%5C%2F0D%5C%2FOv84%5C%2F0v%5C%2FO%5C%2F84%5C%2Fzf%5C%2FMP83%5C%2FzH%5C%2FNv83%5C%2Fzf%5C%2FN%5C%2F84%5C%2Fzf%5C%2FOf82%5C%2Fzf%5C%2FOP83%5C%2Fzb%5C%2FMv81%5C%2FzX%5C%2FR%5C%2F9L%5C%2F0v%5C%2FO%5C%2F9I%5C%2F0T%5C%2FS%5C%2F9A%5C%2Fzn%5C%2FPf89%5C%2Fzn%5C%2FNf9K%5C%2F07%5C%2FN%5C%2F83%5C%2Fzn%5C%2FNv83%5C%2Fzv%5C%2FO%5C%2F9A%5C%2F0H%5C%2FOf8%5C%2F%5C%2Fzj%5C%2FPP83%5C%2Fzj%5C%2FS%5C%2F87%5C%2Fzj%5C%2FNv84%5C%2Fzf%5C%2FOf83%5C%2Fzf%5C%2FOf83%5C%2Fzb%5C%2FNv9L%5C%2Fzj%5C%2FNv82%5C%2Fzb%5C%2FN%5C%2F85%5C%2Fzf%5C%2FN%5C%2F9J%5C%2Fzf%5C%2FNv83%5C%2Fzj%5C%2FNv84%5C%2F0r%5C%2FSv83%5C%2Fzf%5C%2FMP%5C%2F%5C%2F%5C%2Fzb%5C%2FMv82%5C%2Fzb%5C%2FOf85%5C%2Fz7%5C%2FNv8%5C%2F%5C%2F0r%5C%2FS%5C%2F85%5C%2F0H%5C%2FQP9B%5C%2F0D%5C%2FNf89%5C%2Fzj%5C%2FOv83%5C%2Fzv%5C%2FNv8%5C%2F%5C%2F0f%5C%2FSv9O%5C%2F0ZeXv%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F1X%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F9B%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2FTP%5C%2F%5C%2F%5C%2F1b%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F0%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F9N%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2F%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%5C%2Fv7%2B%22%2C%22date%22%3A%222021-08-07%22%2C%22data%22%3A%5B%7B%22start%22%3A0%2C%22stop%22%3A1439%2C%22value%22%3A%22UA8AUBQAUAwAUBoAUAEAYCcAUBkAUB4AUBgAUCAAUAEAUBkAUAwAYAsAYB8AYB0AYBgAYCoAYBgAYB4AUCcAUBsAUB8AUBwAUBIAYBkAYB8AUBoAUBMAUCEAUCIAYBYAUBwAUCAAUBgAUCAAUBcAYBsAYCUAATIPYD0KECQAYDMAYB0AYAsAYCAAYDwAYCIAYB0AYBcAYCQAYB0AYBAAYCMAYAoAYCIAYCEAYCYAYBsAYBUAYAYAYCIAYCMAUB0AUCAAUBYAUCoAUBEAUC8AUB0AUBYAUDMAUDoAUBkAUC0AUBQAUBwAUA0AUBsAUAoAUCEAUBYAUAwAUB4AUAwAUCcAUCYAUCwKYDUAAUUlEC8IYEMAYEgAYDoAYBAAUAMAUBkAWgAAWgAAWgAAWgAAWgAAUAgAWgAAUBAAUAQAUA4AUA8AUAkAUAIAUAYAUAcAUAIAWgAAUAQAUAkAUAEAUBkAUCUAWgAAUAYAUBEAWgAAUBYAWgAAUAYAWgAAWgAAWgAAWgAAUBcAUAcAWgAAUBUAUAoAUAIAWgAAUAQAUAYAUCgAWgAAUAgAWgAAWgAAUAwAWwAAXCMAUBQAWwAAUAIAWgAAWgAAWgAAWgAAWgAAWgAAWgAAWgAAWREAWQIAUAMAWSEAUDoAUDIAUB8AUCEAUC4AXB4AUA4AWgAAUBIAUA8AUBAAUCUAUCIAUAMAUAEAUAsAUAMAUCwAUBYAWgAAWgAAWgAAWgAAWgAAWgAAUAYAWgAAWgAAWgAAUAYAWwAAWgAAUAYAXAQAUAMAUBsAUBcAUCAAWwAAWgAAWgAAWgAAWgAAUBgAUB4AWgAAUAcAUAwAWQIAWQkAUAEAUAIAWgAAUAoAWgAAUAYAUB0AWgAAWgAAUAkAWgAAWSwAUBIAWgAAUC4AWSYAWgAAUAYAUAoAUAkAUAIAUAcAWgAAUAEAUBEAUBgAUBcAWRYAUA0AWSgAUB4AUDQAUBoAXA4AUA8AUBwAUA8AUA4AUA4AWgAAUAIAUCMAWgAAUCwAUBgAUAYAUAAAUAAAUAAAUAAAUAAAUAAAUAAAUAAAUAAAWwAAUAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAeSEAeQ8AcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcBcAcAAAcAAAcCYOcBUAUAAAUAAAUAAAUAAAUAUAUAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcCgAeQAAcAAAcAAAcAAAcAAAcAAAcAYAcAAAcBgAeQAAcAAAcAAAegAAegAAcAAAcAcAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcCkAeQAAcAcAcAAAcAAAcAwAcAAAcAAAcAIAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcCIAeQAAcAAAcAAAcAAAcAAAcAAAeRwAeQAAWgAAUAAAUAAAUAAAUAAAUAAAcAAAcAAAcBoAeScAeQAAegAAcBkAeQAAUAAAUAAAUAAAUAAAUAAAUAAAcAAAcAAAcAAAcAAAcAAAcAAAegAAegAAcAAAcAAAcBgAeQAAcAAAcAAAcAAAcAAAcAAAcAkAegAAegAAcAcAcAAAcAcAcAAAcAAAcAAAcAAAcA8AeQAAcAAAcAAAeRQAcAwAUAAAUAAAUAAAUAAAUAAAUAAAcAAAcBEAcA0AcAAAWQsAUAAAUAAAUAAAUAAAUAAAcAAAcAoAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAYAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcBYAegAAcAAAcAAAegAAcAcAcAAAcAAAcAAAcAAAcAAAeRkAegAAegAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAEAcAAAcAAAcAAAcAUAcAQAcAAAcBIAeQAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcBsAcAAAcAAAcBcAeQAAUAAAUAAAUAAAUAAAUAAAUBQAcBYAUAAAUAAAUAoAWRYAWTQAWQAAUAAAUAAAUAAAcAAAcAAAcAAAcAAAcAAAcAMAcAAAcAQAcAAAcAAAcAAAcDMAeSIAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcAAAcBQAeQwAcAAAcAAAcAAAcAMAcAAAeSoAcA8AcDMAcAYAeQoAcAwAcFQAcEMAeVIAaTYAbBcNYAsAYBIAYAIAYAIAYBUAYCwAYBMAYDYAYCkAYDcAUCoAUCcAUAUAUBAAWgAAYBoAYBcAYCgAUAMAUAYAUBYAUA4AUBgAUAgAUAgAUAsAUAsAUA4AUAMAUAYAUAQAUBIAASsSUDAAUDAAUBAAYAYAUBAAUAUAUCAAUBoAUCAAUBAAUAoAYAIAUAQAUAgAUCcAUAsAUCIAUCUAUAoAUA4AUB8AUBkAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAAfgAA%22%2C%22tz%22%3A32%2C%22did%22%3A%22DA932FFFFE8816E7%22%2C%22src%22%3A24%7D%5D%2C%22summary%22%3A%22%7B%5C%22v%5C%22%3A6%2C%5C%22slp%5C%22%3A%7B%5C%22st%5C%22%3A1628296479%2C%5C%22ed%5C%22%3A1628296479%2C%5C%22dp%5C%22%3A0%2C%5C%22lt%5C%22%3A0%2C%5C%22wk%5C%22%3A0%2C%5C%22usrSt%5C%22%3A-1440%2C%5C%22usrEd%5C%22%3A-1440%2C%5C%22wc%5C%22%3A0%2C%5C%22is%5C%22%3A0%2C%5C%22lb%5C%22%3A0%2C%5C%22to%5C%22%3A0%2C%5C%22dt%5C%22%3A0%2C%5C%22rhr%5C%22%3A0%2C%5C%22ss%5C%22%3A0%7D%2C%5C%22stp%5C%22%3A%7B%5C%22ttl%5C%22%3A18272%2C%5C%22dis%5C%22%3A10627%2C%5C%22cal%5C%22%3A510%2C%5C%22wk%5C%22%3A41%2C%5C%22rn%5C%22%3A50%2C%5C%22runDist%5C%22%3A7654%2C%5C%22runCal%5C%22%3A397%2C%5C%22stage%5C%22%3A%5B%7B%5C%22start%5C%22%3A327%2C%5C%22stop%5C%22%3A341%2C%5C%22mode%5C%22%3A1%2C%5C%22dis%5C%22%3A481%2C%5C%22cal%5C%22%3A13%2C%5C%22step%5C%22%3A680%7D%2C%7B%5C%22start%5C%22%3A342%2C%5C%22stop%5C%22%3A367%2C%5C%22mode%5C%22%3A3%2C%5C%22dis%5C%22%3A2295%2C%5C%22cal%5C%22%3A95%2C%5C%22step%5C%22%3A2874%7D%2C%7B%5C%22start%5C%22%3A368%2C%5C%22stop%5C%22%3A377%2C%5C%22mode%5C%22%3A4%2C%5C%22dis%5C%22%3A1592%2C%5C%22cal%5C%22%3A88%2C%5C%22step%5C%22%3A1664%7D%2C%7B%5C%22start%5C%22%3A378%2C%5C%22stop%5C%22%3A386%2C%5C%22mode%5C%22%3A3%2C%5C%22dis%5C%22%3A1072%2C%5C%22cal%5C%22%3A51%2C%5C%22step%5C%22%3A1245%7D%2C%7B%5C%22start%5C%22%3A387%2C%5C%22stop%5C%22%3A393%2C%5C%22mode%5C%22%3A4%2C%5C%22dis%5C%22%3A1036%2C%5C%22cal%5C%22%3A57%2C%5C%22step%5C%22%3A1124%7D%2C%7B%5C%22start%5C%22%3A394%2C%5C%22stop%5C%22%3A398%2C%5C%22mode%5C%22%3A3%2C%5C%22dis%5C%22%3A488%2C%5C%22cal%5C%22%3A19%2C%5C%22step%5C%22%3A607%7D%2C%7B%5C%22start%5C%22%3A399%2C%5C%22stop%5C%22%3A414%2C%5C%22mode%5C%22%3A4%2C%5C%22dis%5C%22%3A2220%2C%5C%22cal%5C%22%3A120%2C%5C%22step%5C%22%3A2371%7D%2C%7B%5C%22start%5C%22%3A415%2C%5C%22stop%5C%22%3A427%2C%5C%22mode%5C%22%3A3%2C%5C%22dis%5C%22%3A1268%2C%5C%22cal%5C%22%3A59%2C%5C%22step%5C%22%3A1489%7D%2C%7B%5C%22start%5C%22%3A428%2C%5C%22stop%5C%22%3A433%2C%5C%22mode%5C%22%3A1%2C%5C%22dis%5C%22%3A152%2C%5C%22cal%5C%22%3A4%2C%5C%22step%5C%22%3A238%7D%2C%7B%5C%22start%5C%22%3A434%2C%5C%22stop%5C%22%3A444%2C%5C%22mode%5C%22%3A3%2C%5C%22dis%5C%22%3A2295%2C%5C%22cal%5C%22%3A95%2C%5C%22step%5C%22%3A2874%7D%2C%7B%5C%22start%5C%22%3A445%2C%5C%22stop%5C%22%3A455%2C%5C%22mode%5C%22%3A4%2C%5C%22dis%5C%22%3A1592%2C%5C%22cal%5C%22%3A88%2C%5C%22step%5C%22%3A1664%7D%2C%7B%5C%22start%5C%22%3A456%2C%5C%22stop%5C%22%3A466%2C%5C%22mode%5C%22%3A3%2C%5C%22dis%5C%22%3A1072%2C%5C%22cal%5C%22%3A51%2C%5C%22step%5C%22%3A1245%7D%2C%7B%5C%22start%5C%22%3A467%2C%5C%22stop%5C%22%3A477%2C%5C%22mode%5C%22%3A4%2C%5C%22dis%5C%22%3A1036%2C%5C%22cal%5C%22%3A57%2C%5C%22step%5C%22%3A1124%7D%2C%7B%5C%22start%5C%22%3A478%2C%5C%22stop%5C%22%3A488%2C%5C%22mode%5C%22%3A3%2C%5C%22dis%5C%22%3A488%2C%5C%22cal%5C%22%3A19%2C%5C%22step%5C%22%3A607%7D%2C%7B%5C%22start%5C%22%3A489%2C%5C%22stop%5C%22%3A499%2C%5C%22mode%5C%22%3A4%2C%5C%22dis%5C%22%3A2220%2C%5C%22cal%5C%22%3A120%2C%5C%22step%5C%22%3A2371%7D%2C%7B%5C%22start%5C%22%3A500%2C%5C%22stop%5C%22%3A511%2C%5C%22mode%5C%22%3A3%2C%5C%22dis%5C%22%3A1268%2C%5C%22cal%5C%22%3A59%2C%5C%22step%5C%22%3A1489%7D%2C%7B%5C%22start%5C%22%3A512%2C%5C%22stop%5C%22%3A522%2C%5C%22mode%5C%22%3A1%2C%5C%22dis%5C%22%3A152%2C%5C%22cal%5C%22%3A4%2C%5C%22step%5C%22%3A238%7D%5D%7D%2C%5C%22goal%5C%22%3A8000%2C%5C%22tz%5C%22%3A%5C%2228800%5C%22%7D%22%2C%22source%22%3A24%2C%22type%22%3A0%7D%5D" 111 | 112 | find_date = re.compile(r".*?date%22%3A%22(.*?)%22%2C%22data.*?") 113 | find_step = re.compile(r".*?ttl%5C%22%3A(.*?)%2C%5C%22dis.*?") 114 | data_json = re.sub(find_date.findall(data_json)[0], today, str(data_json)) 115 | data_json = re.sub(find_step.findall(data_json)[0], _step, str(data_json)) 116 | 117 | url = f"https://api-mifit-cn.huami.com/v1/data/band_data.json?&t={t}" 118 | head = {"apptoken": app_token, "Content-Type": "application/x-www-form-urlencoded"} 119 | 120 | data = f"userid={userid}&last_sync_data_time=1597306380&device_type=0&last_deviceid=DA932FFFFE8816E7&data_json={data_json}" 121 | 122 | response = requests.post(url, data=data, headers=head).json() 123 | # print(response) 124 | result = f"{_user[:3]}****{_user[-4:]}: [{now}] 修改步数({_step})" + response["message"] 125 | print(result) 126 | return result 127 | 128 | 129 | # 获取时间戳 130 | def get_time(): 131 | url = "http://api.m.taobao.com/rest/api3.do?api=mtop.common.getTimestamp" 132 | response = requests.get(url, headers=headers).json() 133 | t = response["data"]["t"] 134 | return t 135 | 136 | 137 | # 获取app_token 138 | def get_app_token(login_token): 139 | url = f"https://account-cn.huami.com/v1/client/app_tokens?app_name=com.xiaomi.hm.health&dn=api-user.huami.com%2Capi-mifit.huami.com%2Capp-analytics.huami.com&login_token={login_token}" 140 | response = requests.get(url, headers=headers).json() 141 | app_token = response["token_info"]["app_token"] 142 | # print("app_token获取成功!") 143 | # print(app_token) 144 | return app_token 145 | 146 | 147 | # 推送 server 酱 148 | def push_wx(_sckey, desp=""): 149 | if _sckey == "": 150 | print("[注意] 未提供sckey,不进行推送!") 151 | else: 152 | server_url = f"https://sc.ftqq.com/{_sckey}.send" 153 | params = {"text": "小米运动 步数修改", "desp": desp} 154 | 155 | response = requests.get(server_url, params=params) 156 | json_data = response.json() 157 | 158 | if json_data["errno"] == 0: 159 | print(f"[{now}] 推送成功。") 160 | else: 161 | print(f"[{now}] 推送失败:{json_data['errno']}({json_data['errmsg']})") 162 | 163 | 164 | # 推送新 server 酱 165 | def push_server(_sckey, desp=""): 166 | if _sckey == "": 167 | print("[注意] 未提供sckey,不进行微信推送!") 168 | else: 169 | server_url = f"https://sctapi.ftqq.com/{_sckey}.send" 170 | params = {"title": "小米运动 步数修改", "desp": desp} 171 | 172 | response = requests.get(server_url, params=params) 173 | json_data = response.json() 174 | 175 | if json_data["code"] == 0: 176 | print(f"[{now}] 推送成功。") 177 | else: 178 | print(f"[{now}] 推送失败:{json_data['code']}({json_data['message']})") 179 | 180 | 181 | # 推送消息到 pushplus 182 | def push_pushplus(token, content=""): 183 | if token == "": 184 | print("[注意] 未提供token,不进行pushplus推送!") 185 | else: 186 | server_url = "http://www.pushplus.plus/send" 187 | params = {"token": token, "title": "小米运动 步数修改", "content": content} 188 | 189 | response = requests.get(server_url, params=params) 190 | json_data = response.json() 191 | 192 | if json_data["code"] == 200: 193 | print(f"[{now}] 推送成功。") 194 | else: 195 | print(f"[{now}] 推送失败:{json_data['code']}({json_data['message']})") 196 | 197 | 198 | # 推送消息到 TG 199 | def push_tg(token, chat_id, desp=""): 200 | if token == "": 201 | print("[注意] 未提供token,不进行tg推送!") 202 | elif chat_id == "": 203 | print("[注意] 未提供chat_id,不进行tg推送!") 204 | else: 205 | server_url = f"https://api.telegram.org/bot{token}/sendmessage" 206 | params = {"text": "小米运动 步数修改\n\n" + desp, "chat_id": chat_id} 207 | 208 | response = requests.get(server_url, params=params) 209 | json_data = response.json() 210 | 211 | if json_data["ok"]: 212 | print(f"[{now}] 推送成功。") 213 | else: 214 | print(f"[{now}] 推送失败:{json_data['error_code']}({json_data['description']})") 215 | 216 | 217 | # 企业微信推送 218 | def wxpush(msg, usr, corpid, corpsecret, agentid=1000002): 219 | base_url = "https://qyapi.weixin.qq.com/cgi-bin/gettoken?" 220 | req_url = "https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=" 221 | corpid = corpid 222 | corpsecret = corpsecret 223 | agentid = agentid 224 | 225 | if agentid == 0: 226 | agentid = 1000002 227 | 228 | # 获取 access_token,每次的 access_token 都不一样,所以需要运行一次请求一次 229 | def get_access_token(_base_url, _corpid, _corpsecret): 230 | urls = _base_url + "corpid=" + _corpid + "&corpsecret=" + _corpsecret 231 | resp = requests.get(urls).json() 232 | access_token = resp["access_token"] 233 | return access_token 234 | 235 | def send_message(_msg, _usr): 236 | data = get_message(_msg, _usr) 237 | req_urls = req_url + get_access_token(base_url, corpid, corpsecret) 238 | res = requests.post(url=req_urls, data=data) 239 | ret = res.json() 240 | if ret["errcode"] == 0: 241 | print(f"[{now}] 企业微信推送成功") 242 | else: 243 | print(f"[{now}] 推送失败:{ret['errcode']} 错误信息:{ret['errmsg']}") 244 | 245 | def get_message(_msg, _usr): 246 | data = { 247 | "touser": _usr, 248 | "toparty": "@all", 249 | "totag": "@all", 250 | "msgtype": "text", 251 | "agentid": agentid, 252 | "text": {"content": _msg}, 253 | "safe": 0, 254 | "enable_id_trans": 0, 255 | "enable_duplicate_check": 0, 256 | "duplicate_check_interval": 1800, 257 | } 258 | data = json.dumps(data) 259 | return data 260 | 261 | msg = msg 262 | usr = usr 263 | if corpid == "": 264 | print("[注意] 未提供corpid,不进行企业微信推送!") 265 | elif corpsecret == "": 266 | print("[注意] 未提供corpsecret,不进行企业微信推送!") 267 | else: 268 | send_message(msg, usr) 269 | 270 | 271 | if __name__ == "__main__": 272 | # Push Mode 273 | Pm = os.environ.get("PMODE") 274 | if Pm == "wx" or Pm == "nwx": 275 | _sckey = os.environ.get("PKEY") 276 | if _sckey == "": 277 | print("未提供 sckey,不进行推送!") 278 | elif Pm == "tg": 279 | token = os.environ.get("PKEY") 280 | sl = token.split("@") 281 | if len(sl) != 2: 282 | print("tg 推送参数有误!") 283 | elif Pm == "qwx": 284 | token = os.environ.get("PKEY") 285 | sl = token.split("-") 286 | if len(sl) < 3: 287 | print("企业微信推送参数有误!") 288 | elif Pm == "pp": 289 | token = os.environ.get("PKEY") 290 | if token == "": 291 | print("未提供 pushplus token,不进行推送!") 292 | elif Pm == "off": 293 | print("不推送") 294 | else: 295 | print("推送选项有误!") 296 | exit(0) 297 | 298 | user = os.environ.get("MI_USER") 299 | passwd = os.environ.get("MI_PWD") 300 | step = os.environ.get("STEP") 301 | 302 | user_list = user.split("#") 303 | passwd_list = passwd.split("#") 304 | if step is None: 305 | step = "" 306 | step_array = "" 307 | else: 308 | step_array = step.split("-") 309 | 310 | if len(user_list) == len(passwd_list): 311 | push = "" 312 | for line in range(0, len(user_list)): 313 | if len(step_array) == 2: 314 | step = str(random.randint(int(step_array[0]), int(step_array[1]))) 315 | print(f"已设置为随机步数({step_array[0]}-{step_array[1]})") 316 | elif str(step) == "": 317 | step = "" 318 | push += main(user_list[line], passwd_list[line], step) + "\n" 319 | if Pm == "wx": 320 | push_wx(_sckey, push) 321 | elif Pm == "nwx": 322 | push_server(_sckey, push) 323 | elif Pm == "tg": 324 | push_tg(sl[0], sl[1], push) 325 | elif Pm == "qwx": 326 | if len(sl) == 4: 327 | wxpush(push, sl[0], sl[1], sl[2], int(sl[3])) 328 | else: 329 | wxpush(push, sl[0], sl[1], sl[2]) 330 | elif Pm == "pp": 331 | push_pushplus(token, push) 332 | elif Pm == "off": 333 | pass 334 | else: 335 | print("用户名和密码数量不对") 336 | --------------------------------------------------------------------------------