mirror of
https://github.com/shufflewzc/faker3.git
synced 2024-11-10 09:39:18 +08:00
26 lines
39 KiB
JavaScript
26 lines
39 KiB
JavaScript
|
/*
|
|||
|
活动名称:批量店铺签到(历史查询)
|
|||
|
活动链接:https://h5.m.jd.com/babelDiy/Zeus/2PAAf74aG3D61qvfKUM5dxUssJQ9/index.html?token=<token>
|
|||
|
环境变量:jd_dpqd_tokens // 活动令牌,多个用英文逗号分割
|
|||
|
jd_dpqd_task_threads // 控制签到并发线程数(正整数),默认1
|
|||
|
jd_dpqd_account_threads // 控制账号并发线程数(正整数),默认1
|
|||
|
jd_dpqd_account_interval // 自定义运行间隔时长(整数,单位毫秒),默认0
|
|||
|
|
|||
|
此脚本为高并发历史查询本,需要读取主脚本生成的活动信息缓存
|
|||
|
脚本主要用于查询连签天数,不会进行签到操作,为了提高签到本的效率故将此功能分离
|
|||
|
|
|||
|
7 7 7 7 *
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('批量店铺签到(历史查询)')
|
|||
|
const jdCookie = require('./jdCookie')
|
|||
|
const notify = require('./function/sendJDNotify')
|
|||
|
const common = require('./function/jdCommon')
|
|||
|
const { jsTk } = require('./function/jdCrypto')
|
|||
|
|
|||
|
var iil='jsjiami.com.v7';const i1iiIIii=IIlilIii;(function(I1Iil1i,llIIIli1,l1IIiiI,i1iIli1l,ill1l1II,Ili1l1ii,IlIillli){return I1Iil1i=I1Iil1i>>0x2,Ili1l1ii='hs',IlIillli='hs',function(liI1IIl1,l1iiI1il,lIIIiI1,iii1I1II,li111lIi){const iIi1i11I=IIlilIii;iii1I1II='tfi',Ili1l1ii=iii1I1II+Ili1l1ii,li111lIi='up',IlIillli+=li111lIi,Ili1l1ii=lIIIiI1(Ili1l1ii),IlIillli=lIIIiI1(IlIillli),lIIIiI1=0x0;const ilIllil=liI1IIl1();while(!![]&&--i1iIli1l+l1iiI1il){try{iii1I1II=parseInt(iIi1i11I(0x286,'#Jkl'))/0x1+-parseInt(iIi1i11I(0x2a3,'#Jkl'))/0x2+parseInt(iIi1i11I(0x1e3,'G#kj'))/0x3*(-parseInt(iIi1i11I(0x245,'CrKD'))/0x4)+-parseInt(iIi1i11I(0x1ed,'7JKZ'))/0x5+parseInt(iIi1i11I(0x2ba,'xsGI'))/0x6+parseInt(iIi1i11I(0x28f,'E@Sd'))/0x7+parseInt(iIi1i11I(0x248,'xsGI'))/0x8;}catch(i1lIii1){iii1I1II=lIIIiI1;}finally{li111lIi=ilIllil[Ili1l1ii]();if(I1Iil1i<=i1iIli1l)lIIIiI1?ill1l1II?iii1I1II=li111lIi:ill1l1II=li111lIi:lIIIiI1=li111lIi;else{if(lIIIiI1==ill1l1II['replace'](/[IbnSAEDhpJdkQPeFuLGYRyw=]/g,'')){if(iii1I1II===l1iiI1il){ilIllil['un'+Ili1l1ii](li111lIi);break;}ilIllil[IlIillli](li111lIi);}}}}}(l1IIiiI,llIIIli1,function(lIiIiIil,II1IiI11,i1l11iIl,iIl1iiII,I1lI1,i1IiIIl1,IiiI11Il){return II1IiI11='\x73\x70\x6c\x69\x74',lIiIiIil=arguments[0x0],lIiIiIil=lIiIiIil[II1IiI11](''),i1l11iIl=`\x72\x65\x76\x65\x72\x73\x65`,lIiIiIil=lIiIiIil[i1l11iIl]('\x76'),iIl1iiII=`\x6a\x6f\x69\x6e`,(0x1625ac,lIiIiIil[iIl1iiII](''));});}(0x31c,0xf0182,l1IiII1I,0xc9),l1IiII1I)&&(iil=i1iiIIii(0x346,'(p@F'));let tokensList=(process[i1iiIIii(0x33b,'d&&Z')][i1iiIIii(0x252,'8qO)')]||'')[i1iiIIii(0x274,'G#kj')](',')||[],taskThreads=process[i1iiIIii(0x34b,'xsGI')][i1iiIIii(0x280,'&afM')]||'1',accountThreads=process[i1iiIIii(0x33b,'d&&Z')][i1iiIIii(0x1de,'i&Gn')]||'1';const runInterval=process[i1iiIIii(0x1ff,'L1!7')][i1iiIIii(0x1fb,'[nsm')]||'',isNotify=![];let TokensMap=new Map();const invalidTokensMap=new Map(),CacheFile=__dirname+i1iiIIii(0x2b7,'aLv^'),cookiesArr=Object[i1iiIIii(0x32e,'sFn(')](jdCookie)[i1iiIIii(0x28b,'0Y6g')](llII11l=>jdCookie[llII11l])[i1iiIIii(0x2cd,'sw%V')](I1iII1il=>I1iII1il);!cookiesArr[0x0]&&($[i1iiIIii(0x2aa,'#Jkl')]($[i1iiIIii(0x348,'[Dq[')],i1iiIIii(0x279,'Zqui')),process[i1iiIIii(0x26d,'7X7d')](0x1));function l1IiII1I(){const Iii1liI1=(function(){return[...[iil,'nAdjusjLRiwaDPmEGik.eQcSLoIm.ypvFbA7YwJh==','k3xcO8k6WQ7dK3ZdNdGehMS','dv8qahi','i8kqW65HW77dHKhcTa','W5Hei8kzbuC','DmkNFvuk','bxmkW6BdTmkwDCkmvq8oWQHlFq','wSoDwuhdOW','WR4/kmkMpq','W5FdH8ki','bSkIW7nDW5K','WOn1W4jhCG','77YO8ygjKW','bSkfWOzUWQC','lbGDnmo4A8oIWOy','o0ZcUmkpWR4','rfpdQmkEWPe','FJftmZbrt8oAW7tdHwjXW6us','eCkJiHdcTKDZBmk4W6NcQSok','wLZcHq7dKq','vmocdflcSa','hvNcG8kHeq','W7hcIColkv0','yKj6nCojvmkmWRezt8kFz8kdW77cQ3OcW7HAhq','WOOuW4q','qSkbW6RcSmoX','emknWQ9KWPy','vSkwteeOyYbTqJlcNmkOW58N','d8ocAa','W7pcJCoYbxm','WPnOcSobgmkp','W4FcKteowq','WPbqFSkcoG','6lsD5y2d5PEE5PEmrVcOQi4','d0yzW5ZdIq','hh/cVSk6','W41KxCoBDSosyCkpiYpcOmoU','WRmdW7fgWR0','W4JdGSorW4ZcSa','WPmMwdJcHW','duq4W63dKq','Eu0lnSojESoLWPldRhxdL0RdTG','WRpcSZJcGr8','lN0DW4xdRq','vmo1EupdOqr8rG','ngdcGq','umkdWQpcSceMWQxcQSoxW6e','W7BdJmozWOpdTSoYo8ohW4y','WOVcHdZcLXG','WO5lzCkagSoHtba','WOy/kCkHnW','77+95Bs76l+j5lMZ6zII772W','W73cSrC3sW','WO7cNsVcHZHL','mhtcHmkL','ewiFW5JdR8kcs8klCHm','WPPtimoYnW','hempuvm','kSkdW49ZW45xW6xcNq','CLJcGXZdOW','4P65CoADJ+IaKUASPUEIIUwKLEEtNhC','W59BjmkvhW','WP1lEmkv','ySoWw8occa','cSksW7XiW4W','E8krWP9Uga','44k65O+h56sK44ku6k+F5ysW6i6V5y+mW7qjzelcQg8','lXbgumkxk8k7WRJdIf/dMwZdNq','smoCv8oIeG','WRRcHrayga','igeiBMG','WORdQHyRWRa','budcI8kaWPi','smo0sepdTaDrFCkJW5JcNmoGCZ3cKXFcTdtcGGu','pKpcOCkLWP8','aUkCJdFINAVcPoAEK+IVL+wKK+I3SU++Sq','a3qjW7pdNq','mfvDi8o5','W63cPSoyjM0','W47dJwZdMxOGW4nIW4arEui','aSkDW5DzW7O','WOyGcCkgmq','DSkkFvJcHmkP','oCk0W5nCW4W','uL1t','DmkoWQXVlG','AmkTW7lcRa','WPpcItJcNcC','WORcMCoztmkQw8kkevBcJvdcRmkVWPi','WReWubFcSq','CEIVP+AXT+wsOow4Hui','oq3cUM7dNCkZW4X3W5m','DNfWC8kF','WOjGd8obkCkuWOrB','Cw3cMtBdIa','WPhcKt7cQZPJ','r27cGW','umkDDa','F8oHl2RcGW','WOXEASozDG','WOSAW5m','WP5Ka8ofumkCWOvxW5tdVa','k0iVW4/dTG','zSkEWQO4','vqCDkxZdMSohW4u','BCkLW
|
|||
|
|
|||
|
// 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"])
|