From 3eb171bed1a3275ed2025b55db6cae56abbf10e4 Mon Sep 17 00:00:00 2001 From: XiaoGe-LiBai <2381919454@qq.com> Date: Wed, 12 Feb 2025 23:07:07 +0800 Subject: [PATCH] 1 --- zsoh.js | 181 ---------------------------------------------------- zsohkcjk.js | 166 ----------------------------------------------- 2 files changed, 347 deletions(-) delete mode 100644 zsoh.js delete mode 100644 zsohkcjk.js diff --git a/zsoh.js b/zsoh.js deleted file mode 100644 index 9a30a36..0000000 --- a/zsoh.js +++ /dev/null @@ -1,181 +0,0 @@ -/* -jzack - -掌上瓯海 一天600积分左右 - -抓包 newsapi.wzrb.com.cn 域名 Authorization的值 填入 变量 swZS里面 多账户 @ 或者 回车分割 - -变量示例 7557206663AD0927A8XXXXXXXX 旧版没问题则不需要更新 新版去掉Bearer 只要 Authorization的 Bearer后面的值 - -一天运行1次 运行空白是在扫任务 不用管 -*/ -const $ = new Env("掌上瓯海"); -const envSplitor = ['\n','@','&'] -const ckName = 'swZS' -let userCookie = ($.isNode() ? process.env[ckName] : $.getdata(ckName)) || ''; -let userList = [], usid = 0, userCount = 0, __=30 -const defaultContentType = 'application/json;charset=utf-8' -let qq=[...Array(__)].map((a,_)=>_+1) -/////////////////////////////////////////////////////////////////// -class UserInfo { - constructor(str) { - this.index = ++usid - this.idx=`账号 [${this.index}] `, this.ck = str - } - async taskApi(paramIn={}) { - let paramOut = {} - try { - let host = paramIn.url.replace('//','/').split('/')[1] - let url = paramIn.url - if(paramIn.queryParam) url += '?' + $.json2str(paramIn.queryParam,'&',true) - let urlObject = { - url: url, - headers: this.h, - timeout: 5000, - } - if(paramIn.body) { - if(typeof paramIn.body === 'object') { - if(urlObject.headers['Content-Type'].includes('json')) { - urlObject.body = JSON.stringify(paramIn.body) - } else { - for(let key in paramIn.body) { - if(typeof paramIn.body[key] === 'object') { - paramIn.body[key] = JSON.stringify(paramIn.body[key]) - } - } - urlObject.body = $.json2str(paramIn.body,'&') - } - } else { - urlObject.body = paramIn.body - } - if($.isNode()) { - urlObject.headers['Content-Length'] = urlObject.body ? Buffer.byteLength(urlObject.body, 'utf8') : 0 - } else { - urlObject.headers['Content-Length'] = urlObject.body ? urlObject.body.length : 0 - } - } - if(paramIn.urlObjectParam) Object.assign(urlObject,paramIn.urlObjectParam); - if(paramIn.headerParam) Object.assign(urlObject.headers,paramIn.headerParam); - //console.log(urlObject); - paramOut = Object.assign({},await httpRequest(paramIn.method,urlObject)) - paramOut.statusCode = paramOut?.err?.response?.statusCode || paramOut?.resp?.statusCode - if(paramOut.statusCode != 200) { - console.log(`[${paramIn.fn}]返回[${paramOut.statusCode}]`) - } - if(paramOut?.resp?.body) { - if(typeof paramOut.resp.body === 'object') { - paramOut.result = paramOut.resp.body - } else { - try { - paramOut.result = JSON.parse(paramOut.resp.body) - } catch (e) { - paramOut.result = paramOut.resp.body - } - } - } - } catch(e) { - console.log(e) - } finally { - return Promise.resolve(paramOut); - } - } - async finish() { - let paramOut = {} - let urlParam = { - fn: 'finish', - method: 'post', - url: `https://newsapi.wzrb.com.cn/api/users/completed-quests`, - body: `{ "questId": ${this.id}}` - } - this.h = { -'Accept' : `*/*`, -'Connection' : `keep-alive`, -'Content-Type' : `application/json`, -'Host' : `newsapi.wzrb.com.cn`, -'Authorization' : 'Bearer '+this.ck -} - paramOut = Object.assign({},await this.taskApi(urlParam)) - let result = paramOut.result - //console.log(result) - if(result.status==200 && result.data.quest)console.log(`${this.idx}任务: ${result.data.quest.name} 得到积分 ${result.data.quest.score} 最多完成次数 ${result.data.quest.maxTime}`) - - } - async Info() { - let paramOut = {} - let urlParam = { - fn: 'Info', - method: 'get', - url: `https://newsapi.wzrb.com.cn/api/Users/Info`, - body: `` - } - this.h = { -'Accept-Encoding' : `gzip, deflate, br`, -'Connection' : `keep-alive`, -'Host' : `newsapi.wzrb.com.cn`, -'User-Agent' : `ohnews/4.0 (iPhone; iOS 14.8; Scale/2.00)`, -'Authorization' : 'Bearer '+this.ck, -'Accept-Language' : `zh-Hans-CN;q=1, ja-CN;q=0.9` -} - paramOut = Object.assign({},await this.taskApi(urlParam)) - let result = paramOut.result - console.log(`\n${this.idx}积分余额 ${result.data.points}`) - } - async task() { - await this.Info() - for (let b of qq){ - for (let a of qq)this.id=a, - await this.finish() - } - await this.Info() - } -} -!(async () => { - if (typeof $request !== "undefined") { - await GetRewrite() - }else { - if(!checkEnv()) return; - for(let user of userList) { - await user.task(); - } - } -})() -.catch((e) => console.log(e)) -.finally(() => $.done()) - -/////////////////////////////////////////////////////////////////// -async function GetRewrite() { -} -function checkEnv() { - if(userCookie) { - let splitor = envSplitor[0]; - for(let sp of envSplitor) { - if(userCookie.indexOf(sp) > -1) { - splitor = sp; - break; - } - } - for(let userCookies of userCookie.split(splitor)) { - if(userCookies) userList.push(new UserInfo(userCookies)) - } - userCount = userList.length - } else { - console.log(`未找到CK: ${ckName}`) - return false; - } - console.log(`共找到${userCount}个账号`) - return true -} -//////////////////////////////////////////////////////////////////// -async function httpRequest(method,url) { - return new Promise((resolve) => { - $.send(method, url, async (err, req, resp) => { - resolve({err,req,resp}) - }) - }); -} -//////////////////////////////////////////////////////////////////// -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),new class{constructor(e,s){this.name=e,this.notifyStr="",this.notifyFlag=!1,this.startTime=(new Date).getTime(),Object.assign(this,s),console.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}getdata(e){let s=this.getval(e);if(/^@/.test(e)){let[,i,n]=/^@(.*?)\.(.*?)$/.exec(e),r=i?this.getval(i):"";if(r)try{let o=JSON.parse(r);s=o?this.lodash_get(o,n,""):s}catch(a){s=""}}return s}setdata(e,s){let i=!1;if(/^@/.test(s)){let[,n,r]=/^@(.*?)\.(.*?)$/.exec(s),o=this.getval(n);try{let a=JSON.parse(n?"null"===o?null:o||"{}":"{}");this.lodash_set(a,r,e),i=this.setval(JSON.stringify(a),n)}catch(l){let h={};this.lodash_set(h,r,e),i=this.setval(JSON.stringify(h),n)}}else i=this.setval(e,s);return i}getval(e){return this.isSurge()||this.isLoon()?$persistentStore.read(e):this.isQuanX()?$prefs.valueForKey(e):this.isNode()?(this.data=this.loaddata(),this.data[e]):this.data&&this.data[e]||null}setval(e,s){return this.isSurge()||this.isLoon()?$persistentStore.write(e,s):this.isQuanX()?$prefs.setValueForKey(e,s):this.isNode()?(this.data=this.loaddata(),this.data[s]=e,this.writedata(),!0):this.data&&this.data[s]||null}send(e,s,i=()=>{}){if("get"!=e&&"post"!=e&&"put"!=e&&"delete"!=e){console.log(`无效的http方法:${e}`);return}if("get"==e&&s.headers?(delete s.headers["Content-Type"],delete s.headers["Content-Length"]):s.body&&s.headers&&!s.headers["Content-Type"]&&(s.headers["Content-Type"]="application/x-www-form-urlencoded"),this.isSurge()||this.isLoon()){this.isSurge()&&this.isNeedRewrite&&(s.headers=s.headers||{},Object.assign(s.headers,{"X-Surge-Skip-Scripting":!1}));let n={method:e,url:s.url,headers:s.headers,timeout:s.timeout,data:s.body};"get"==e&&delete n.data,$axios(n).then(e=>{let{status:s,request:n,headers:r,data:o}=e;i(null,n,{statusCode:s,headers:r,body:o})}).catch(e=>console.log(e))}else if(this.isQuanX())s.method=e.toUpperCase(),this.isNeedRewrite&&(s.opts=s.opts||{},Object.assign(s.opts,{hints:!1})),$task.fetch(s).then(e=>{let{statusCode:s,request:n,headers:r,body:o}=e;i(null,n,{statusCode:s,headers:r,body:o})},e=>i(e));else if(this.isNode()){this.got=this.got?this.got:require("got");let{url:r,...o}=s;this.instance=this.got.extend({followRedirect:!1}),this.instance[e](r,o).then(e=>{let{statusCode:s,request:n,headers:r,body:o}=e;i(null,n,{statusCode:s,headers:r,body:o})},e=>{let{message:s,request:n,response:r}=e;i(s,n,r)})}}time(e,s=null){let i=s?new Date(s):new Date,n={"M+":i.getMonth()+1,"d+":i.getDate(),"h+":i.getHours(),"m+":i.getMinutes(),"s+":i.getSeconds(),"q+":Math.floor((i.getMonth()+3)/3),S:this.padStr(i.getMilliseconds(),3)};for(let r in/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(i.getFullYear()+"").substr(4-RegExp.$1.length))),n)RegExp("("+r+")").test(e)&&(e=e.replace(RegExp.$1,1==RegExp.$1.length?n[r]:("00"+n[r]).substr((""+n[r]).length)));return e}async showmsg(){if(!this.notifyFlag||!this.notifyStr)return;let e=this.name+" 运行通知\n\n"+this.notifyStr;if($.isNode()){var s=require("./sendNotify");console.log("\n============== 推送 =============="),await s.sendNotify(this.name,e)}else this.msg(e)}logAndNotify(e,s=!0){s&&(this.notifyFlag=!0),console.log(e),this.notifyStr+=e,this.notifyStr+="\n"}logAndNotifyWithTime(e,s=!0){s&&(this.notifyFlag=!0);let i="["+this.time("hh:mm:ss.S")+"]"+e;console.log(i),this.notifyStr+=i,this.notifyStr+="\n"}logWithTime(e){console.log("["+this.time("hh:mm:ss.S")+"]"+e)}msg(e=t,s="",i="",n){let r=e=>{if(!e)return e;if("string"==typeof e)return this.isLoon()?e:this.isQuanX()?{"open-url":e}:this.isSurge()?{url:e}:void 0;if("object"==typeof e){if(this.isLoon()){let s;return{openUrl:e.openUrl||e.url||e["open-url"],mediaUrl:e.mediaUrl||e["media-url"]}}if(this.isQuanX()){let i;return{"open-url":e["open-url"]||e.url||e.openUrl,"media-url":e["media-url"]||e.mediaUrl}}if(this.isSurge())return{url:e.url||e.openUrl||e["open-url"]}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,r(n)):this.isQuanX()&&$notify(e,s,i,r(n)));let o=["","============== 系统通知 =============="];o.push(e),s&&o.push(s),i&&o.push(i),console.log(o.join("\n"))}getMin(e,s){return en.length?s-n.length:0,o="";for(let a=0;asetTimeout(s,e))}async done(e={}){await this.showmsg();let s=(new Date).getTime(),i=(s-this.startTime)/1e3;console.log(` -${this.name} 运行结束,共运行了 ${i} 秒!`),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(e)}}(e,s)} diff --git a/zsohkcjk.js b/zsohkcjk.js deleted file mode 100644 index 07dd362..0000000 --- a/zsohkcjk.js +++ /dev/null @@ -1,166 +0,0 @@ -const $ = new Env('掌上瓯海库存监控'); -const jsname = "掌上瓯海库存监控"; -const notify = $.isNode() ? require("./sendNotify") : ""; // 这里是 node(青龙属于node环境)通知相关的 -const Notify = 1; //0为关闭通知,1为打开通知,默认为1 -const debug = 1; //0为关闭调试,1为打开调试,默认为0 -////////////////////// -let data = ''; -let msg = ''; - - -!(async () => { - - - // 这里是开始做任务 需要注意的点 - // 1. await只能运行与async函数中 - // 2. 函数的名字不可以相同 - // 3. 不够可以自己复制 - - console.log('开始查询'); - await chaxunkucun(); - await $.wait(2 * 1000); - await SendMsg(msg); - - -})() - .catch((e) => console.logErr(e)) - .finally(() => $.done()) - - - - - - -/** - * 下面我们来看看函数需要注意的东西吧 - */ - function chaxunkucun(timeout = 3 * 1000) { - return new Promise((resolve) => { - let url = { - url: `http://lwintegral.wznbw.com/addons/leescore/index/ajaxGoodlist?appid=2`, // 这是请求的 url 可以直接用我们抓包、精简后的URL - headers: { - "Host": "lwintegral.wznbw.com" - }, - //body: ``, // 这是一个 get 请求,没有请求体 body 如果是 post 不要忘记他鸭! - - } - - if (debug) { - console.log(`\n【debug】=============== 这是 查询库存 请求 url ===============`); - console.log(JSON.stringify(url)); - } - - $.get(url, async (error, response, data) => { // 这是一个 get 请求 , 如果是 post 记得把这里改了 - try { - if (debug) { - console.log(`\n\n【debug】===============这是 查询库存 返回data==============`); - console.log(data) - } - - let result = JSON.parse(data); - - for (let c = 0; c < result.data.length; c++) { - - console.log(` ${result.data[c].name},当前库存:${result.data[c].stock}\n `) - msg += `${result.data[c].name},当前库存:${result.data[c].stock}\n` - } - } catch (e) { - console.log(e) - } finally { - resolve(); - } - }, timeout) - }) -} - - - - -// 如果有更多的需求,直接复制上一个函数,改个名 然后稍微更改一下内容 就可以用了 -// 不要忘记与上面的 函数调用对应起来鸭 - - -//#region 固定代码 可以不管他 -// ============================================变量检查============================================ \\ -async function Envs() { - if (zsohkcjk_data) { - if (zsohkcjk_data.indexOf("@") != -1) { - zsohkcjk_data.split("@").forEach((item) => { - zsohkcjk_dataArr.push(item); - }); - } else { - zsohkcjk_dataArr.push(zsohkcjk_data); - } - } else { - console.log(`\n 【${$.name}】:未填写变量 zsohkcjk_data`) - return; - } - - return true; -} - -// ============================================发送消息============================================ \\ -async function SendMsg(message) { - if (!message) - return; - - if (Notify > 0) { - if ($.isNode()) { - var notify = require('./sendNotify'); - await notify.sendNotify($.name,message); - } else { - $.msg(message); - } - } else { - console.log(message); - } -} - -/** - * 随机数生成 - */ -function randomString(e) { - e = e || 32; - var t = "QWERTYUIOPASDFGHJKLZXCVBNM1234567890", - a = t.length, - n = ""; - for (i = 0; i < e; i++) - n += t.charAt(Math.floor(Math.random() * a)); - return n -} - - - - -/** - * 随机整数生成 - */ -function randomInt(min, max) { - return Math.round(Math.random() * (max - min) + min) -} - -//每日网抑云 -function wyy(timeout = 3 * 1000) { - return new Promise((resolve) => { - let url = { - url: `https://keai.icu/apiwyy/api` - } - $.get(url, async (err, resp, data) => { - try { - data = JSON.parse(data) - console.log(`\n 【网抑云时间】: ${data.content} by--${data.music}`); - - } catch (e) { - console.logErr(e, resp); - } finally { - resolve() - } - }, timeout) - }) -} - -//#endregion - - -// prettier-ignore 固定代码 不用管他 -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) } \ No newline at end of file