faker2/jd_gmart.js

16 lines
42 KiB
JavaScript
Raw Normal View History

2024-07-13 06:25:05 +00:00
/*
活动名称京东国际任务
环境变量jd_gmart_interval // 自定义运行间隔时长整数单位毫秒默认1500
jd_gmart_notify // 是否推送通知true/false默认不推送
jd_gmart_pinFilter // 账号pin过滤多个用@进行分割
jd_gmart_signapi // 自定义SIGN的API
cron:15 1,17 * * *
*/
const $ = new Env('京东国际任务')
2024-07-14 13:03:07 +00:00
var il='jsjiami.com.v7';const III111=iii1II;(function(llii1I,iiIiIi,l1lll1,IilI,liIlli,lil11,Iillll){return llii1I=llii1I>>0x8,lil11='hs',Iillll='hs',function(lllI1,III11I,Ilii1,ll11i1,ili1I1){const ll11l=iii1II;ll11i1='tfi',lil11=ll11i1+lil11,ili1I1='up',Iillll+=ili1I1,lil11=Ilii1(lil11),Iillll=Ilii1(Iillll),Ilii1=0x0;const Iill=lllI1();while(!![]&&--IilI+III11I){try{ll11i1=-parseInt(ll11l(0x11f,'7lHq'))/0x1*(parseInt(ll11l(0x10c,'(Mbl'))/0x2)+parseInt(ll11l(0x241,']O#u'))/0x3+parseInt(ll11l(0xe9,'qrJB'))/0x4+-parseInt(ll11l(0x1d9,'qrJB'))/0x5+parseInt(ll11l(0x1be,'g4He'))/0x6+parseInt(ll11l(0x15d,'5ZkG'))/0x7+-parseInt(ll11l(0x20e,'gdK*'))/0x8;}catch(ili1II){ll11i1=Ilii1;}finally{ili1I1=Iill[lil11]();if(llii1I<=IilI)Ilii1?liIlli?ll11i1=ili1I1:liIlli=ili1I1:Ilii1=ili1I1;else{if(Ilii1==liIlli['replace'](/[kTVFUDORKdxLWEpSCPXAJ=]/g,'')){if(ll11i1===III11I){Iill['un'+lil11](ili1I1);break;}Iill[Iillll](ili1I1);}}}}}(l1lll1,iiIiIi,function(liIllI,ll11i,iI1lI1,I1I1li,l1i11,IlI1li,IlI1ll){return ll11i='\x73\x70\x6c\x69\x74',liIllI=arguments[0x0],liIllI=liIllI[ll11i](''),iI1lI1=`\x72\x65\x76\x65\x72\x73\x65`,liIllI=liIllI[iI1lI1]('\x76'),I1I1li=`\x6a\x6f\x69\x6e`,(0x1789d1,liIllI[I1I1li](''));});}(0xc600,0xa8e52,Iii11l,0xc8),Iii11l)&&(il=0x1dc6);const jdCookie=require(III111(0x228,'UPWv')),notify=require(III111(0x1a7,'@S%E')),common=require(III111(0x198,'7lHq')),CryptoJS=require(III111(0x197,'dSkw'));let taskThreads=process[III111(0xe3,'qrJB')][III111(0xbe,'#F8e')]||'1';const runInterval=process[III111(0xa8,'sUJW')]['jd_gmart_interval']||III111(0x1f8,'N@iz'),isNotify=(process[III111(0x24b,'5ZkG')][III111(0xf4,'L2kF')]||process[III111(0xbf,'Ykc)')]['jd_gmart_Notify'])===III111(0x17f,'0OSy'),pinFilter=(process[III111(0x213,'f(Uw')]['jd_gmart_pinFilter']||'')[III111(0x1c6,'xVrB')]('@'),randomApi=process[III111(0xa5,']O#u')][III111(0x24f,'6daN')]||III111(0x23a,'MDtz'),maxThreads=0x1;function Iii11l(){const lil1i=(function(){return[...[il,'SFjkJPsLjpiKAEaAWmOTixR.coVmCS.OTDvEU7Xd==','o37cG8oyzq','wSoTqe9F','lNddUG','FYlcMCoJj8oWW6tdNdLQ','BJhcRSo1nW','rSolWOzpWPyLcvFcUNJdU8oYWQa','p8oNWQDuWQlcLmoZW6NdJcpcHrRcGa','WQddOxC0WP1VWOpcGtO0W57dPdNcPG7dMSoXCCkadHHyWOGmhSoCCSkTgZVdTSk3W7pdTa','W4mZWP1VmW','WQivdmk+W7BdGgTrWO99WPGyWOWW','gmkwW6e','umo7gG','o3xdQ8kEW4G','WRlcGZ9+D3ldVhm','5lIg5lUE6lc1','WOddLCkneSk0ya','WQLfy8kyWOvrWPxcPG','WRZdPCk2lSkH','lG0MwSovWRldVW','gdjHfZvsDLRdQSk+WOL3amoC','W5KrbJRcISoV','W5VcMHVdOSowWO9IWPhcOmoo','W6fzW5O','WOzmWQjvyG','W4BcLHNdQmonWOrBWPVcRSoFntxcTCo7W6X4FJ4XAN8','smo1dIPAW5VcUG','pbm8ua','Ag8J','mJqvmCoJ','nHWBfmo7ggnvdZ0','CCoSWOzmzd1KW5m','CGq+WQLP','W6mRWQi','DcRdNSksW6G','x8oLWQDlxG','t8oova','5Rs56kAB5AsM6lwB772i5lUi5yQJ54gy54Qd','4P+UW53MNitOGOdMRl7NOiZLP6/NKjxcNa','pmkNW7OJW5S','W6fGW7JcPvu','AxmJ','gJXW','rConxeTpW6JcNa','W4WpWOG0eW','WQ/cVJ15Ca','vCofcZzo','p3JdJW','WRxdK8kXeCkm','W58QWQ9+lW','WQXezW','W4NdMmoWvGbBWOBcOCkd','W7jHdM/dRCoeCwb/vf7dOSo4wqfVWRFdOSoKwhjCka','AY7cISoihmoSW5/dIWXTmq','atj+cGzAB1y','AmkZW7r5W73dPq','W719mu/cPdm','WQVdUMCH','W7H8jq','iqtcHqm','5yw/5RkJ5AEp6lAO7720','WRBcIc9Hy3hdVa','W43cLJhdNSoT','562Z5yUG57Mg5P+W776i','qSopv1zsW4JcNa','W5BcR0tdOCoO','W7GLWQXn','iMtcI8o5b8oYW4pcLHn7neddLsabnSoazSkzW6ydW5/dOXC9WQ7cUa','cd8bWQBcMNjPBcJdM8keW7FdSwXCWP7cKSoMfCkMFvBdJ8kXBCk/WQtcGLZcPCo2vCo5WRK','WQGdhW','d0JcSSoxAa','W5lcVt7dISot','nCojWR0Hba','W4/cJKK','j8k7bSo4xW','mLFdGmk7W6e','W7dcOeG','pSoYWP8','W4JdR8oDCJS','AmoOWOPCyJfKW5KkW5xcQCkHWPRcR2fuWPBcSCo8amkt','CSoOsK9N','W4vlW43cIuex','uUISHEAZS+wsT+w4UZu','WRZdLmk5pSkY','EexdSCogwq','56Yi5yMJ5OIh5yUH772i','kSoRWOWOfG','W5LrW5NcPa','WPj6vCkyWR4','6ykH556/5O2q6ygWFhmD','qMOGs2SdoL/dN8kNWRvejG','WRWvkmkJW70','WPzCWRC','amkxW4ewW452va','4P6xW43OHyBMNl7OV5lOOzRPG57LIldKU6/PL5VORlDh','kW4Tua','WQ5GwCk9WRe','dtGs','WRyafmkBW60','WPLCWRtcOa','WPGal2RdPW','W6XfW45Ymb8','4P62e+AFUUIaUoAVSUEHREwNKEEqVLS','EZ3dQSkRW5S','WOzgWRLo','W4pdHmoQsGfqW47cUa','c8owWPSppq','W4W8WQ9sja','4PQGEoIfKUwSRUs7HoI9H+IHHEMxRUMBQEAwQ+MuSEITLEE9U+MxTEIUNG','irqig8ob','DdZcVCofnW','W63cRgpdHSoLiG','W4pcH8kn','qtNdImoTW7W','xMBdR8oe','mMpcGSowEr
2024-07-13 06:25:05 +00:00
// 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"])