KR/jd_qy.js

14 lines
29 KiB
JavaScript
Raw Normal View History

2023-08-25 10:09:18 +08:00
/*
#临时小豆
只运行一次即可多次无效
[task_local]
#临时小豆
31 11 25 8 * jd_qy.js, tag=临时小豆, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/jd.png, enabled=true*/
const $ = new Env("临时小豆");
var version_='jsjiami.com.v7';function iii1II(_0x338840,_0x5a4e51){const _0x40f8e1=Iii11l();return iii1II=function(_0x3c4ebf,_0x1f3712){_0x3c4ebf=_0x3c4ebf-0x149;let _0xba1d8=_0x40f8e1[_0x3c4ebf];if(iii1II['bPzjQR']===undefined){var _0x2b2bf1=function(_0x3c7975){const _0x4cda60='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x49de0d='',_0x3d58bd='';for(let _0x4ab86b=0x0,_0x388719,_0x122b7e,_0x5279e4=0x0;_0x122b7e=_0x3c7975['charAt'](_0x5279e4++);~_0x122b7e&&(_0x388719=_0x4ab86b%0x4?_0x388719*0x40+_0x122b7e:_0x122b7e,_0x4ab86b++%0x4)?_0x49de0d+=String['fromCharCode'](0xff&_0x388719>>(-0x2*_0x4ab86b&0x6)):0x0){_0x122b7e=_0x4cda60['indexOf'](_0x122b7e);}for(let _0x3dde32=0x0,_0x49984b=_0x49de0d['length'];_0x3dde32<_0x49984b;_0x3dde32++){_0x3d58bd+='%'+('00'+_0x49de0d['charCodeAt'](_0x3dde32)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x3d58bd);};const _0x15bfdb=function(_0x28e880,_0x59b16c){let _0x168589=[],_0x12b05d=0x0,_0x44e041,_0x34685a='';_0x28e880=_0x2b2bf1(_0x28e880);let _0xfa3f0a;for(_0xfa3f0a=0x0;_0xfa3f0a<0x100;_0xfa3f0a++){_0x168589[_0xfa3f0a]=_0xfa3f0a;}for(_0xfa3f0a=0x0;_0xfa3f0a<0x100;_0xfa3f0a++){_0x12b05d=(_0x12b05d+_0x168589[_0xfa3f0a]+_0x59b16c['charCodeAt'](_0xfa3f0a%_0x59b16c['length']))%0x100,_0x44e041=_0x168589[_0xfa3f0a],_0x168589[_0xfa3f0a]=_0x168589[_0x12b05d],_0x168589[_0x12b05d]=_0x44e041;}_0xfa3f0a=0x0,_0x12b05d=0x0;for(let _0x5d5459=0x0;_0x5d5459<_0x28e880['length'];_0x5d5459++){_0xfa3f0a=(_0xfa3f0a+0x1)%0x100,_0x12b05d=(_0x12b05d+_0x168589[_0xfa3f0a])%0x100,_0x44e041=_0x168589[_0xfa3f0a],_0x168589[_0xfa3f0a]=_0x168589[_0x12b05d],_0x168589[_0x12b05d]=_0x44e041,_0x34685a+=String['fromCharCode'](_0x28e880['charCodeAt'](_0x5d5459)^_0x168589[(_0x168589[_0xfa3f0a]+_0x168589[_0x12b05d])%0x100]);}return _0x34685a;};iii1II['RpPCWN']=_0x15bfdb,_0x338840=arguments,iii1II['bPzjQR']=!![];}const _0x571404=_0x40f8e1[0x0],_0xf9d6c0=_0x3c4ebf+_0x571404,_0x2581b1=_0x338840[_0xf9d6c0];return!_0x2581b1?(iii1II['SPzJmH']===undefined&&(iii1II['SPzJmH']=!![]),_0xba1d8=iii1II['RpPCWN'](_0xba1d8,_0x1f3712),_0x338840[_0xf9d6c0]=_0xba1d8):_0xba1d8=_0x2581b1,_0xba1d8;},iii1II(_0x338840,_0x5a4e51);}const IllIi1=iii1II;(function(IIliIi,IllIiI,i1il1,I1l111,IIii1l,I1iIII,liiI11){return IIliIi=IIliIi>>0x8,I1iIII='hs',liiI11='hs',function(ililI1,IIii1i,i1ili,Iiill1,I1iII1){const iIIii1=iii1II;Iiill1='tfi',I1iIII=Iiill1+I1iIII,I1iII1='up',liiI11+=I1iII1,I1iIII=i1ili(I1iIII),liiI11=i1ili(liiI11),i1ili=0x0;const lilII1=ililI1();while(!![]&&--I1l111+IIii1i){try{Iiill1=parseInt(iIIii1(0x188,'S^dq'))/0x1+parseInt(iIIii1(0x208,'Ytd^'))/0x2*(parseInt(iIIii1(0x1c3,'B5@z'))/0x3)+parseInt(iIIii1(0x1f9,'H7Sp'))/0x4*(parseInt(iIIii1(0x19f,'tqR@'))/0x5)+parseInt(iIIii1(0x1e7,'0F[*'))/0x6*(parseInt(iIIii1(0x212,'K)L1'))/0x7)+parseInt(iIIii1(0x1be,'pWTL'))/0x8+-parseInt(iIIii1(0x19b,'@nK('))/0x9*(parseInt(iIIii1(0x1ef,'H7Sp'))/0xa)+-parseInt(iIIii1(0x21a,'r3JW'))/0xb;}catch(iill1){Iiill1=i1ili;}finally{I1iII1=lilII1[I1iIII]();if(IIliIi<=I1l111)i1ili?IIii1l?Iiill1=I1iII1:IIii1l=I1iII1:i1ili=I1iII1;else{if(i1ili==IIii1l['replace'](/[AIqkuLxSrlQXGtFWgnEO=]/g,'')){if(Iiill1===IIii1i){lilII1['un'+I1iIII](I1iII1);break;}lilII1[liiI11](I1iII1);}}}}}(i1il1,IllIiI,function(iii1l1,IIliIl,II11ll,liiI1I,ililII,lI1II1,i1ilII){return IIliIl='\x73\x70\x6c\x69\x74',iii1l1=arguments[0x0],iii1l1=iii1l1[IIliIl](''),II11ll='\x72\x65\x76\x65\x72\x73\x65',iii1l1=iii1l1[II11ll]('\x76'),liiI1I='\x6a\x6f\x69\x6e',(0x13b076,iii1l1[liiI1I](''));});}(0xbc00,0x81bdb,Iii11l,0xbe),Iii11l)&&(version_=Iii11l);const illlIi=$[IllIi1(0x1d5,'K)L1')]()?require(IllIi1(0x1dc,'Ma8u')):'',I1lIii=$['isNode']()?require(IllIi1(0x160,'S^dq')):'',IiI1I=require(IllIi1(0x1f4,'0F[*')),illlIl=require(IllIi1(0x1c1,'pWTL')),i11ill=require(IllIi1(0x1c9,'@nK('));let IIIIIi=[],IIIIIl='',I1lIil,IIIl1i,liiII1={};function Iii11l(){const iii1li=(function(){return[version_,'ISjXxsQEjkiIOaGnmQLiL.OcuWom.FAvrx7tlgGq==','omkGqa','WQrXu2Hp','l8kdk8oCwG','wmkyW6VcUmkckLTSWOe','W5VcRGCTWQddUZr4W4NcSsNcGLe','mwu6zSoEWQNdKMFcLqHQWPu6mCk8tSoFW7RdOmkyWQ/cSmopW7TouW','
// 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"])