1 Star 0 Fork 0

冷心/Thread

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
jd_wzqddnh.js 16.88 KB
一键复制 编辑 原始数据 按行查看 历史
gys619 提交于 2023-01-11 15:11 . up
/**
* 我最期待的年货
*cron "2 2 29 2 *" jd_wzqddnh.js
*/
const $ = new Env('我最期待的年货');
const notify = $.isNode() ? require('./sendNotify') : '';
const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
var __encode ='jsjiami.com',_a={}, _0xb483=["\x5F\x64\x65\x63\x6F\x64\x65","\x68\x74\x74\x70\x3A\x2F\x2F\x77\x77\x77\x2E\x73\x6F\x6A\x73\x6F\x6E\x2E\x63\x6F\x6D\x2F\x6A\x61\x76\x61\x73\x63\x72\x69\x70\x74\x6F\x62\x66\x75\x73\x63\x61\x74\x6F\x72\x2E\x68\x74\x6D\x6C"];(function(_0xd642x1){_0xd642x1[_0xb483[0]]= _0xb483[1]})(_a);var __Oxf3439=["","\x69\x73\x4E\x6F\x64\x65","\x70\x75\x73\x68","\x66\x6F\x72\x45\x61\x63\x68","\x6B\x65\x79\x73","\x4A\x44\x5F\x44\x45\x42\x55\x47","\x65\x6E\x76","\x66\x61\x6C\x73\x65","\x6C\x6F\x67","\x66\x69\x6C\x74\x65\x72","\x43\x6F\x6F\x6B\x69\x65\x4A\x44","\x67\x65\x74\x64\x61\x74\x61","\x43\x6F\x6F\x6B\x69\x65\x4A\x44\x32","\x63\x6F\x6F\x6B\x69\x65","\x6D\x61\x70","\x43\x6F\x6F\x6B\x69\x65\x73\x4A\x44","\x5B\x5D","\x64\x6F\x6E\x65","\x66\x69\x6E\x61\x6C\x6C\x79","\u274C\x20","\x6E\x61\x6D\x65","\x2C\x20\u5931\u8D25\x21\x20\u539F\u56E0\x3A\x20","\x21","\x63\x61\x74\x63\x68","\u3010\u63D0\u793A\u3011\u8BF7\u5148\u83B7\u53D6\u4EAC\u4E1C\u8D26\u53F7\u4E00\x63\x6F\x6F\x6B\x69\x65\x0A\u76F4\u63A5\u4F7F\u7528\x4E\x6F\x62\x79\x44\x61\u7684\u4EAC\u4E1C\u7B7E\u5230\u83B7\u53D6","\x68\x74\x74\x70\x73\x3A\x2F\x2F\x62\x65\x61\x6E\x2E\x6D\x2E\x6A\x64\x2E\x63\x6F\x6D\x2F\x62\x65\x61\x6E\x2F\x73\x69\x67\x6E\x49\x6E\x64\x65\x78\x2E\x61\x63\x74\x69\x6F\x6E","\x6D\x73\x67","\x6C\x65\x6E\x67\x74\x68","\x55\x73\x65\x72\x4E\x61\x6D\x65","\x6D\x61\x74\x63\x68","\x69\x6E\x64\x65\x78","\x6E\x69\x63\x6B\x4E\x61\x6D\x65","\x69\x73\x4C\x6F\x67\x69\x6E","\x2A\x2A\x2A\x2A\x2A\x2A\u5F00\u59CB\u3010\u4EAC\u4E1C\u8D26\u53F7","\u3011","\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A","\x72\x61\x6E\x64\x6F\x6D","\x77\x61\x69\x74","\x70\x61\x72\x73\x65","\x6F\x62\x6A\x65\x63\x74","\x68\x74\x74\x70\x73\x3A\x2F\x2F\x6D\x67\x6F\x6C\x64\x2E\x6A\x64\x2E\x63\x6F\x6D\x2F\x61\x70\x69\x2F\x76\x6F\x74\x65\x3F\x74\x79\x70\x65\x3D\x41\x26\x73\x6B\x75\x49\x64\x3D\x31\x30\x30\x30\x34\x32\x35\x36\x38\x35\x30\x33","\x68\x74\x74\x70\x73\x3A\x2F\x2F\x6D\x67\x6F\x6C\x64\x2E\x6A\x64\x2E\x63\x6F\x6D\x2F\x61\x70\x69\x2F\x76\x6F\x74\x65\x3F\x74\x79\x70\x65\x3D\x42\x26\x73\x6B\x75\x49\x64\x3D\x31\x30\x30\x30\x31\x36\x33\x39\x33\x36\x32\x34","\x68\x74\x74\x70\x73\x3A\x2F\x2F\x6D\x67\x6F\x6C\x64\x2E\x6A\x64\x2E\x63\x6F\x6D\x2F\x61\x70\x69\x2F\x76\x6F\x74\x65\x3F\x74\x79\x70\x65\x3D\x43\x26\x73\x6B\x75\x49\x64\x3D\x31\x30\x30\x30\x30\x31\x36\x39\x31\x39\x36\x37","\x68\x74\x74\x70\x73\x3A\x2F\x2F\x6D\x67\x6F\x6C\x64\x2E\x6A\x64\x2E\x63\x6F\x6D\x2F\x61\x70\x69\x2F\x76\x6F\x74\x65\x3F\x74\x79\x70\x65\x3D\x44\x26\x73\x6B\x75\x49\x64\x3D\x31\x30\x30\x30\x31\x38\x33\x31\x33\x39\x37\x37","\x68\x74\x74\x70\x73\x3A\x2F\x2F\x6D\x67\x6F\x6C\x64\x2E\x6A\x64\x2E\x63\x6F\x6D\x2F\x61\x70\x69\x2F\x76\x6F\x74\x65\x3F\x74\x79\x70\x65\x3D\x45\x26\x73\x6B\x75\x49\x64\x3D\x31\x30\x30\x36\x37\x30\x33\x30\x39\x34\x36\x32\x36\x33","\x2A\x2F\x2A","\x68\x74\x74\x70\x73\x3A\x2F\x2F\x70\x72\x6F\x64\x65\x76\x2E\x6D\x2E\x6A\x64\x2E\x63\x6F\x6D","\x55\x41","\x68\x74\x74\x70\x73\x3A\x2F\x2F\x70\x72\x6F\x64\x65\x76\x2E\x6D\x2E\x6A\x64\x2E\x63\x6F\x6D\x2F\x6D\x61\x6C\x6C\x2F\x61\x63\x74\x69\x76\x65\x2F\x38\x4A\x54\x7A\x36\x4D\x71\x67\x54\x31\x69\x32\x47\x66\x75\x45\x53\x51\x6E\x46\x74\x74\x42\x47\x77\x6E\x5A\x2F\x69\x6E\x64\x65\x78\x2E\x68\x74\x6D\x6C","\x74\x6F\x53\x74\x72","\x20\x63\x6F\x6F\x6B\x69\x65\x20\x41\x50\x49\u8BF7\u6C42\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u7F51\u8DEF\u91CD\u8BD5","\x73\x74\x72\x69\x6E\x67","\x63\x6F\x64\x65","\u83B7\u5F97\x3A\x20","\x61\x6D\x6F\x75\x6E\x74","\x64\x61\x74\x61","\u8C46","\x6C\x6F\x67\x45\x72\x72","\x67\x65\x74","\u8BF7\u52FF\u968F\u610F\u5728\x42\x6F\x78\x4A\x73\u8F93\u5165\u6846\u4FEE\u6539\u5185\u5BB9\x0A\u5EFA\u8BAE\u901A\u8FC7\u811A\u672C\u53BB\u83B7\u53D6\x63\x6F\x6F\x6B\x69\x65","\x6A\x64\x61\x70\x70\x3B\x69\x50\x68\x6F\x6E\x65\x3B\x31\x30\x2E\x34\x2E\x34\x3B\x31\x33\x2E\x31\x2E\x32\x3B","\x3B\x6E\x65\x74\x77\x6F\x72\x6B\x2F\x77\x69\x66\x69\x3B\x6D\x6F\x64\x65\x6C\x2F\x69\x50\x68\x6F\x6E\x65\x38\x2C\x31\x3B\x61\x64\x64\x72\x65\x73\x73\x69\x64\x2F\x32\x33\x30\x38\x34\x36\x30\x36\x31\x31\x3B\x61\x70\x70\x42\x75\x69\x6C\x64\x2F\x31\x36\x37\x38\x31\x34\x3B\x6A\x64\x53\x75\x70\x70\x6F\x72\x74\x44\x61\x72\x6B\x4D\x6F\x64\x65\x2F\x30\x3B\x4D\x6F\x7A\x69\x6C\x6C\x61\x2F\x35\x2E\x30\x20\x28\x69\x50\x68\x6F\x6E\x65\x3B\x20\x43\x50\x55\x20\x69\x50\x68\x6F\x6E\x65\x20\x4F\x53\x20\x31\x33\x5F\x31\x5F\x32\x20\x6C\x69\x6B\x65\x20\x4D\x61\x63\x20\x4F\x53\x20\x58\x29\x20\x41\x70\x70\x6C\x65\x57\x65\x62\x4B\x69\x74\x2F\x36\x30\x35\x2E\x31\x2E\x31\x35\x20\x28\x4B\x48\x54\x4D\x4C\x2C\x20\x6C\x69\x6B\x65\x20\x47\x65\x63\x6B\x6F\x29\x20\x4D\x6F\x62\x69\x6C\x65\x2F\x31\x35\x45\x31\x34\x38\x3B\x73\x75\x70\x70\x6F\x72\x74\x4A\x44\x53\x48\x57\x4B\x2F\x31","\x61\x62\x63\x64\x65\x66\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39","\x66\x6C\x6F\x6F\x72","\x63\x68\x61\x72\x41\x74","\x75\x6E\x64\x65\x66\x69\x6E\x65\x64","\u5220\u9664","\u7248\u672C\u53F7\uFF0C\x6A\x73\u4F1A\u5B9A","\u671F\u5F39\u7A97\uFF0C","\u8FD8\u8BF7\u652F\u6301\u6211\u4EEC\u7684\u5DE5\u4F5C","\x6A\x73\x6A\x69\x61","\x6D\x69\x2E\x63\x6F\x6D"];let cookiesArr=[],cookie=__Oxf3439[0x0],message;if($[__Oxf3439[0x1]]()){Object[__Oxf3439[0x4]](jdCookieNode)[__Oxf3439[0x3]]((_0x5ebfx4)=>{cookiesArr[__Oxf3439[0x2]](jdCookieNode[_0x5ebfx4])});if(process[__Oxf3439[0x6]][__Oxf3439[0x5]]&& process[__Oxf3439[0x6]][__Oxf3439[0x5]]=== __Oxf3439[0x7]){console[__Oxf3439[0x8]]= ()=>{}}}else {cookiesArr= [$[__Oxf3439[0xb]](__Oxf3439[0xa]),$[__Oxf3439[0xb]](__Oxf3439[0xc]),...jsonParse($[__Oxf3439[0xb]](__Oxf3439[0xf])|| __Oxf3439[0x10])[__Oxf3439[0xe]]((_0x5ebfx4)=>{return _0x5ebfx4[__Oxf3439[0xd]]})][__Oxf3439[0x9]]((_0x5ebfx4)=>{return !!_0x5ebfx4})};!(async ()=>{if(!cookiesArr[0x0]){$[__Oxf3439[0x1a]]($[__Oxf3439[0x14]],__Oxf3439[0x18],__Oxf3439[0x19],{"\x6F\x70\x65\x6E\x2D\x75\x72\x6C":__Oxf3439[0x19]});return};for(let _0x5ebfx6=0;_0x5ebfx6< cookiesArr[__Oxf3439[0x1b]];_0x5ebfx6++){getUA();cookie= cookiesArr[_0x5ebfx6];$[__Oxf3439[0x1c]]= decodeURIComponent(cookie[__Oxf3439[0x1d]](/pt_pin=([^; ]+)(?=;?)/)&& cookie[__Oxf3439[0x1d]](/pt_pin=([^; ]+)(?=;?)/)[0x1]);$[__Oxf3439[0x1e]]= _0x5ebfx6+ 1;$[__Oxf3439[0x1f]]= __Oxf3439[0x0];$[__Oxf3439[0x20]]= true;console[__Oxf3439[0x8]](`${__Oxf3439[0x21]}${$[__Oxf3439[0x1e]]}${__Oxf3439[0x22]}${$[__Oxf3439[0x1f]]|| $[__Oxf3439[0x1c]]}${__Oxf3439[0x23]}`); await main(); await $[__Oxf3439[0x25]](parseInt(Math[__Oxf3439[0x24]]()* 1500+ 1500,10))}})()[__Oxf3439[0x17]]((_0x5ebfx5)=>{$[__Oxf3439[0x8]](__Oxf3439[0x0],`${__Oxf3439[0x13]}${$[__Oxf3439[0x14]]}${__Oxf3439[0x15]}${_0x5ebfx5}${__Oxf3439[0x16]}`,__Oxf3439[0x0])})[__Oxf3439[0x12]](()=>{$[__Oxf3439[0x11]]()});function safeGet(_0x5ebfx8){try{if( typeof JSON[__Oxf3439[0x26]](_0x5ebfx8)== __Oxf3439[0x27]){return true}}catch(e){return false}}async function main(){takeGet(`${__Oxf3439[0x28]}`); await $[__Oxf3439[0x25]](1000);takeGet(`${__Oxf3439[0x29]}`); await $[__Oxf3439[0x25]](1000);takeGet(`${__Oxf3439[0x2a]}`); await $[__Oxf3439[0x25]](1000);takeGet(`${__Oxf3439[0x2b]}`); await $[__Oxf3439[0x25]](1000);takeGet(`${__Oxf3439[0x2c]}`); await $[__Oxf3439[0x25]](1000)}function takeGet(_0x5ebfxb){return new Promise((_0x5ebfxc)=>{let _0x5ebfxd={url:`${__Oxf3439[0x0]}${_0x5ebfxb}${__Oxf3439[0x0]}`,headers:{"\x41\x63\x63\x65\x70\x74":__Oxf3439[0x2d],"\x6F\x72\x69\x67\x69\x6E":__Oxf3439[0x2e],"\x55\x73\x65\x72\x2D\x41\x67\x65\x6E\x74":$[__Oxf3439[0x2f]],'\x52\x65\x66\x65\x72\x65\x72':__Oxf3439[0x30],"\x43\x6F\x6F\x6B\x69\x65":cookie},timeout:30000};$[__Oxf3439[0x3a]](_0x5ebfxd,async (_0x5ebfxe,_0x5ebfxf,_0x5ebfx8)=>{try{if(_0x5ebfxe){console[__Oxf3439[0x8]](`${__Oxf3439[0x0]}${$[__Oxf3439[0x31]](_0x5ebfxe)}${__Oxf3439[0x0]}`);console[__Oxf3439[0x8]](`${__Oxf3439[0x0]}${$[__Oxf3439[0x14]]}${__Oxf3439[0x32]}`)}else {if( typeof _0x5ebfx8== __Oxf3439[0x33]){res= JSON[__Oxf3439[0x26]](_0x5ebfx8);if(res[__Oxf3439[0x34]]== 200){console[__Oxf3439[0x8]](`${__Oxf3439[0x35]}${res[__Oxf3439[0x37]][__Oxf3439[0x36]]}${__Oxf3439[0x38]}`)}}}}catch(e){$[__Oxf3439[0x39]](e,_0x5ebfxf)}finally{_0x5ebfxc()}})})}function jsonParse(_0x5ebfx11){if( typeof _0x5ebfx11== __Oxf3439[0x33]){try{return JSON[__Oxf3439[0x26]](_0x5ebfx11)}catch(e){console[__Oxf3439[0x8]](e);$[__Oxf3439[0x1a]]($[__Oxf3439[0x14]],__Oxf3439[0x0],__Oxf3439[0x3b]);return []}}}async function getUA(){$[__Oxf3439[0x2f]]= `${__Oxf3439[0x3c]}${randomString(40)}${__Oxf3439[0x3d]}`;return $[__Oxf3439[0x2f]]}function randomString(_0x5ebfx5){_0x5ebfx5= _0x5ebfx5|| 32;let _0x5ebfx14=__Oxf3439[0x3e],_0x5ebfx15=_0x5ebfx14[__Oxf3439[0x1b]],_0x5ebfx16=__Oxf3439[0x0];for(i= 0;i< _0x5ebfx5;i++){_0x5ebfx16+= _0x5ebfx14[__Oxf3439[0x40]](Math[__Oxf3439[0x3f]](Math[__Oxf3439[0x24]]()* _0x5ebfx15))};return _0x5ebfx16}function random(_0x5ebfx18,_0x5ebfx19){return Math[__Oxf3439[0x3f]](Math[__Oxf3439[0x24]]()* (_0x5ebfx19- _0x5ebfx18))+ _0x5ebfx18}(function(_0x5ebfx1a,_0x5ebfx1b,_0x5ebfx1c,_0x5ebfx1d,_0x5ebfx1e,_0x5ebfx1f){_0x5ebfx1f= __Oxf3439[0x41];_0x5ebfx1d= function(_0x5ebfx20){if( typeof alert!== _0x5ebfx1f){alert(_0x5ebfx20)};if( typeof console!== _0x5ebfx1f){console[__Oxf3439[0x8]](_0x5ebfx20)}};_0x5ebfx1c= function(_0x5ebfx15,_0x5ebfx1a){return _0x5ebfx15+ _0x5ebfx1a};_0x5ebfx1e= _0x5ebfx1c(__Oxf3439[0x42],_0x5ebfx1c(_0x5ebfx1c(__Oxf3439[0x43],__Oxf3439[0x44]),__Oxf3439[0x45]));try{_0x5ebfx1a= __encode;if(!( typeof _0x5ebfx1a!== _0x5ebfx1f&& _0x5ebfx1a=== _0x5ebfx1c(__Oxf3439[0x46],__Oxf3439[0x47]))){_0x5ebfx1d(_0x5ebfx1e)}}catch(e){_0x5ebfx1d(_0x5ebfx1e)}})({})
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)}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/lengxin/Thread.git
git@gitee.com:lengxin/Thread.git
lengxin
Thread
Thread
main

搜索帮助

0d507c66 1850385 C8b1a773 1850385