mirror of
https://github.com/shufflewzc/faker3.git
synced 2024-11-10 09:39:18 +08:00
19 lines
42 KiB
JavaScript
19 lines
42 KiB
JavaScript
|
/*
|
|||
|
活动名称:关注商品有礼 · 收藏大师
|
|||
|
活动链接:https://txzj-isv.isvjcloud.com/collect_item/home?a=<活动id>
|
|||
|
环境变量:jd_collect_item_activityUrl // 活动链接
|
|||
|
|
|||
|
7 7 7 7 *
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('关注商品有礼(收藏大师)')
|
|||
|
const notify = $.isNode() ? require('./sendNotify') : ''
|
|||
|
const jdCookieNode = $.isNode() ? require('./jdCookie') : ''
|
|||
|
const getToken = require('./function/getToken')
|
|||
|
|
|||
|
var version_='jsjiami.com.v7';const liIlIIi=I1i11i1l;(function(ii1ll1i1,l1I1llli,l11111i,lIiIlI11,I11lIlil,i1iiIIll,i11ll11I){return ii1ll1i1=ii1ll1i1>>0x5,i1iiIIll='hs',i11ll11I='hs',function(l1iiilI,IIlilill,l1lii1li,ii1l11i1,IIII1lI){const I1II1iIl=I1i11i1l;ii1l11i1='tfi',i1iiIIll=ii1l11i1+i1iiIIll,IIII1lI='up',i11ll11I+=IIII1lI,i1iiIIll=l1lii1li(i1iiIIll),i11ll11I=l1lii1li(i11ll11I),l1lii1li=0x0;const Ill111II=l1iiilI();while(!![]&&--lIiIlI11+IIlilill){try{ii1l11i1=-parseInt(I1II1iIl(0x225))/0x1+parseInt(I1II1iIl(0x283))/0x2*(-parseInt(I1II1iIl(0x2b1))/0x3)+parseInt(I1II1iIl(0x231))/0x4*(-parseInt(I1II1iIl(0x1da))/0x5)+parseInt(I1II1iIl(0x2a1))/0x6+-parseInt(I1II1iIl(0x268))/0x7+parseInt(I1II1iIl(0x1c7))/0x8+parseInt(I1II1iIl(0x28f))/0x9;}catch(ii1lIi1I){ii1l11i1=l1lii1li;}finally{IIII1lI=Ill111II[i1iiIIll]();if(ii1ll1i1<=lIiIlI11)l1lii1li?I11lIlil?ii1l11i1=IIII1lI:I11lIlil=IIII1lI:l1lii1li=IIII1lI;else{if(l1lii1li==I11lIlil['replace'](/[PUXBkGnlfgpwduVH=]/g,'')){if(ii1l11i1===IIlilill){Ill111II['un'+i1iiIIll](IIII1lI);break;}Ill111II[i11ll11I](IIII1lI);}}}}}(l11111i,l1I1llli,function(I11l1lI,llililil,IlllllI1,iliiIll,Illli1I,Iii1iIl,iI1li11l){return llililil='\x73\x70\x6c\x69\x74',I11l1lI=arguments[0x0],I11l1lI=I11l1lI[llililil](''),IlllllI1=`\x72\x65\x76\x65\x72\x73\x65`,I11l1lI=I11l1lI[IlllllI1]('\x76'),iliiIll=`\x6a\x6f\x69\x6e`,(0x135e41,I11l1lI[iliiIll](''));});}(0x19a0,0xaa608,iIiIIIiI,0xcf),iIiIIIiI)&&(version_=iIiIIIiI);let lz_cookie={},activityCookie='',inviterNick='';$[liIlIIi(0x274)]=![];let canHelp=![],cookiesArr=[],cookie='',message='',messageTitle='';if($[liIlIIi(0x21e)]()){if(process[liIlIIi(0x248)][liIlIIi(0x13d)])activityUrl=process[liIlIIi(0x248)][liIlIIi(0x13d)];if(JSON[liIlIIi(0x14f)](process[liIlIIi(0x248)])[liIlIIi(0x15d)](liIlIIi(0x16a))>-0x1)process[liIlIIi(0x187)](0x0);Object[liIlIIi(0x206)](jdCookieNode)[liIlIIi(0x1b6)](lll1II1I=>{const lIl11il=liIlIIi;cookiesArr[lIl11il(0x1fa)](jdCookieNode[lll1II1I]);});if(process[liIlIIi(0x248)][liIlIIi(0x199)]&&process[liIlIIi(0x248)][liIlIIi(0x199)]===liIlIIi(0x287))console[liIlIIi(0x27a)]=()=>{};}else cookiesArr=[$[liIlIIi(0x27d)](liIlIIi(0x17b)),$[liIlIIi(0x27d)](liIlIIi(0x1c6)),...$[liIlIIi(0x222)]($[liIlIIi(0x27d)](liIlIIi(0x1de))||'[]')[liIlIIi(0x242)](iiiII1I1=>iiiII1I1[liIlIIi(0x27c)])][liIlIIi(0x2a9)](lill1I=>!!lill1I);let isGetCookie=typeof $request!==liIlIIi(0x160);isGetCookie&&(GetCookie(),$[liIlIIi(0x171)]());activityUrl?(activityId=getQueryString(''+activityUrl,'a'),$[liIlIIi(0x264)]=activityUrl[liIlIIi(0x244)](/https?:\/\/([^/]+)/)[0x1]):console[liIlIIi(0x27a)](liIlIIi(0x1cc));let domains=liIlIIi(0x204)+$[liIlIIi(0x264)];!(async()=>{const l1iiII1i=liIlIIi,llii1lII={'dVMez':function(Ili11Ii,ll1i1Iil){return Ili11Ii+ll1i1Iil;},'ewHrC':function(ilII11li,llilIli){return ilII11li*llilIli;},'zmuRN':function(IllIIil1,IlI1l1Il){return IllIIil1-IlI1l1Il;},'oMvmR':function(l1lIIl,i1IiIII){return l1lIIl>i1IiIII;},'MnFiP':l1iiII1i(0x16a),'WXNRM':function(iI1IIIll,li1Iliil){return iI1IIIll===li1Iliil;},'MCVWo':l1iiII1i(0x287),'CpUzg':function(ilII111i,iIi1lii1){return ilII111i(iIi1lii1);},'SoUFX':l1iiII1i(0x16f),'BvsBj':l1iiII1i(0x216),'KkOZz':function(iIiIliii,l1Iiill1){return iIiIliii===l1Iiill1;},'hjFhS':l1iiII1i(0x234),'gscmT':l1iiII1i(0x1e0),'Rnawq':l1iiII1i(0x16c),'rDeQy':function(i11iIi1I,lIIIIiIi){return i11iIi1I<lIIIIiIi;},'xmUKI':function(i11Iii11,lI1IIill){return i11Iii11===lI1IIill;},'MmWok':l1iiII1i(0x183),'FJYYf':l1iiII1i(0x1ab),'TrsPK':function(IllIllI,l1ii111I){return IllIllI(l1ii111I);},'wCiKZ':function(IIIl11II,lll1lilI){return IIIl11II+lll1lilI;},'kPmua':function(l1IliiiI,iIIII111){return l1IliiiI===iIIII111;},'OFqcP':l1iiII1i(0x267),'TickW':l1iiII1i(0x1fb),'mcdEG':l1iiII1i(0x1a5),'JRlgj':function(l11l1l11,iIi1il1){return l11l1l11+iIi1il1;},'ZSoWS':function(ili1iII,liII11l){return ili1iII+liII11l;},'IyCgi':function(IlIlll1I,IiIIiiI){return IlIlll1I+IiIIiiI;},'SBDaz':l1iiII1i(0x278),'oNwJB':l1iiII1i(0x176),'yRtYa':function(I1iI1i1i,il1iIIlI){return I1iI1i1i===il1iIIlI;},'xRdXi':l1iiII1i(0x223),'PMuYp':l1iiII1i(0x1c1),'PPQOM':functio
|
|||
|
|
|||
|
// 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"])
|