mirror of
https://github.com/shufflewzc/faker3.git
synced 2024-11-14 07:29:18 +08:00
26 lines
37 KiB
JavaScript
26 lines
37 KiB
JavaScript
|
/*
|
|||
|
活动名称:店铺刮刮乐(刮一刮)
|
|||
|
活动链接:https://shop.m.jd.com/shop/lottery?shopId=<店铺id>&venderId=<商家id>
|
|||
|
环境变量:jd_shopLottery_venderIds // 商家id,多个用英文逗号分割
|
|||
|
jd_shopLottery_threads // 控制并发线程数(正整数),默认1
|
|||
|
jd_shopLottery_interval // 自定义运行间隔时长(整数,单位毫秒),默认500
|
|||
|
jd_shopLottery_notify // 是否推送通知(true/false),默认不推送
|
|||
|
|
|||
|
注:高并发脚本,每个店铺活动每天只能参与一次,访问活动需要同时包含店铺id和商家id
|
|||
|
|
|||
|
每个店铺活动每天只能参与一次
|
|||
|
|
|||
|
7 7 7 7 *
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('店铺刮刮乐(刮一刮)')
|
|||
|
const jdCookie = require('./jdCookie')
|
|||
|
const common = require('./function/jdCommon')
|
|||
|
const notify = require('./function/sendJDNotify')
|
|||
|
|
|||
|
var iil='jsjiami.com.v7';const l1il1ii1=I1llli1i;(function(ii1iiIII,IlIli1lI,iliI1il,lllii1l,lii1lI1,i1li1Iii,IliI1111){return ii1iiIII=ii1iiIII>>0x3,i1li1Iii='hs',IliI1111='hs',function(i1IIiI1I,IiI1Ill,i11lii11,lli1IIIi,liiIi1ll){const IIIi1lII=I1llli1i;lli1IIIi='tfi',i1li1Iii=lli1IIIi+i1li1Iii,liiIi1ll='up',IliI1111+=liiIi1ll,i1li1Iii=i11lii11(i1li1Iii),IliI1111=i11lii11(IliI1111),i11lii11=0x0;const iilli1I1=i1IIiI1I();while(!![]&&--lllii1l+IiI1Ill){try{lli1IIIi=parseInt(IIIi1lII(0x296,'xnkD'))/0x1+parseInt(IIIi1lII(0x2c0,'I2k!'))/0x2*(parseInt(IIIi1lII(0x241,'3hIp'))/0x3)+parseInt(IIIi1lII(0x1fc,'3CST'))/0x4+-parseInt(IIIi1lII(0x21d,'WchR'))/0x5*(-parseInt(IIIi1lII(0x2e4,'moXt'))/0x6)+parseInt(IIIi1lII(0x2a4,'xnkD'))/0x7*(parseInt(IIIi1lII(0x1aa,'D@!o'))/0x8)+-parseInt(IIIi1lII(0x1d4,'3hIp'))/0x9+-parseInt(IIIi1lII(0x25b,'82dZ'))/0xa;}catch(iIiiIllI){lli1IIIi=i11lii11;}finally{liiIi1ll=iilli1I1[i1li1Iii]();if(ii1iiIII<=lllii1l)i11lii11?lii1lI1?lli1IIIi=liiIi1ll:lii1lI1=liiIi1ll:i11lii11=liiIi1ll;else{if(i11lii11==lii1lI1['replace'](/[YebgIJMVfuGHAyWdSTKC=]/g,'')){if(lli1IIIi===IiI1Ill){iilli1I1['un'+i1li1Iii](liiIi1ll);break;}iilli1I1[IliI1111](liiIi1ll);}}}}}(iliI1il,IlIli1lI,function(iillIli1,i1iiiIll,l1l111Ii,iI1iliIl,illlllI1,IlI1iiI,iIIii1I){return i1iiiIll='\x73\x70\x6c\x69\x74',iillIli1=arguments[0x0],iillIli1=iillIli1[i1iiiIll](''),l1l111Ii=`\x72\x65\x76\x65\x72\x73\x65`,iillIli1=iillIli1[l1l111Ii]('\x76'),iI1iliIl=`\x6a\x6f\x69\x6e`,(0x16264c,iillIli1[iI1iliIl](''));});}(0x5e8,0xe69c3,lIiII,0xbf),lIiII)&&(iil=0x1aad);function lIiII(){const i1il1Ii=(function(){return[...[iil,'gSYjyGIsjKigeaCmMuiy.cJodgTmfVW.ev7HbAuM==','W49nCW','WOldH8omW6jR','m8ogW5SbWOe','cIddHHJcPcm','vfRcPSoiW7hdIG','lmohAsPi','W5VdTNZcJ3SXuM0','tCkCWQ7cQ8kK','CtGjW5q','W7m3WOvVwCk9W6igsSojB8kYW4qe','8jAkINy','mdWvfLfEwSoIrSkAvuC','WRtdS8ozWRldTa','5z2p5zYo5RA45yQW5lQc6lwg5lICW7S','WQXxWOtdHq4','kYvxW43dV8opW7hdVSopWOj0','W5lcQmo8W4RdRa','BcGcW4FcGa','vKGXCW','s2jHW6FcKG','n8ohWOeaW6tdHmktW5vzW6q','WQvdW5rXW6e','fdJdK8kBbJRdS8k/meHx','y2hdNtXWW49kDa','hYJdQSoaWR1R','h2JcPmoyoCosWQlcGq','jvTjW4mC','W6xdMNJcHwO','W7/cKCobWRZcKq','WPxcOmoJWRm5EbvK','5y2C5lQJ5AsG6lw9','bmoQhxFdLW','tYZdKmkSWQ4gWP0','zHuZW4BcIa','vgBdK0pcLa','ELVcSq','DdWDW4i','g8oQBK/dRMS','WOrBWORdKW','W7NdVgVcJ1S','cWq1eMz6A8otvCkRBLZcK8kTWRC','44cj5O+856EX44ky6k6l5yA36i6D5y62b3VcNmkkWQdcVW','emoKWPq8W54','WRpdTmklW4rwmSkSWQiLcmoYW5zVgmkI','yqtdLCk1WPC','cmoixSkDWPC','tN5HW4pcOCkI','WOmGdmkSeN/dVhBdMmohW5vsWOTFW6/cGNhcKdxcN0u','dMy+fCkTe8oTcSkwWRjWWQZcP8kRnfBcOSot','W6WfW5zzW7S','W6FcHCo4W4tdLCoZW5ddPa','sEs4P+A3SEwiLfy','fSoMw8kDWOlcTSkGmLxcHCoQdMZdMmkFW7u3W7eBW4qiW57cSCo9W6tcUSoQfCo9ASk6WQ9uW7a','WRFcTxz3WQa','6i+u5y6Z5Rw95yUQ5l+15Og85As06lAc','4P+NW7VMNPNNNiVORi7MS4m5','aCoPhwO','WQLTW5i6hCoRWRDf','bqNdTs5g','rhHQ','WQZdHCoJW59mW4VdPG','WRCug8k5EG','56QX5Rkb8yYYKa','wJZdISk6WQKf','g07cQmoXfq','WQ3dJSoXW55BW40','emoZavZdQCoE','FCowdxT0','xCoHmg0','mrldMrxcRa','c2S/aCkxamouhG','WPhcQmoTWQK','W7JORyFMS5xLP6xOTPWY4P6TD+AwRowsR+w7GoAuPUAnQG','WRikomkAtq','WOVdM8o5WRddOa','fCoYigBdMq','WOmRoSkX','WQddM8oJWQxdGq','WQddHSoOW6H9','5y+85lUI5AEZ6lEN','xcGQW7tcPW','DupcRa','4PYWhUIeVEAENUI+V+IGU+MdUUwkTUs4H+MxRUIUPSks','W7VcJmo7W6tdIq','suq4ESkQra','44gt6iYw5y6V5Rs+5yIP5l6X5Ocu5AwE6lE5','WOqUamkOhG','W6BcGCo/W5tdPmoOW7tdPq','WQJdPmkeWPpdJq','mSosWPfxW60','6i6F5y+b5Rs25yIF5lYL5Ok/5AwO6lAK','fgeIoSogxmkTvmo5','tmoRj31wW4u','CSk4mmkVWPpcPSkfya','WO4jW4nSaW','DSkOmmkoWPJcSa','W7vWW6bChYCjW4K','vfqZB8kNFXXkmCoRW5xdIfldHCoAWRO4sCkJ','56UQ5RoW8lUaMa','CZWkW5BcUCoB','p8oDW606WR8','WRhdKmkyyLa','tthdJCkl','5l2H5OkH5yQ+8lkuIE+4LG','gmknW7OMsG','W4SLa8kgDbi','eCoQWOPpW4O','dmojW7ebW4S','ocxcOcldRuRdRSkbWR8eW44','uLn3DceNmmkFqmkMsxtcTSkS','W7VORAlMSRRLKzNLURb7','eCoMEa','qNLNW6xcPW','WRCjdCkxzW','vSk1WPhcP8k+','W48VbCkNyXiM','k8opgMNdTdqEha','g1TtW7GQpW','Cc/dP8kZWOu','iCoQW7ObW7P3WPNdIG','W7ldGNy','WOzKWPFdGba','vvnYDYiLpCoQEmk8sg3cNW','z1jMW6/cRG','WPhcQmoTWQKKFX5U','WQqfeSkpoa','W5FdVSk2W65ii0f/qmkbhSk7aG','c19oW4y7hSoqW6m','rvRcPmoDW4K','W4NdHxGXW4i','WPRdMmkTWR/dPW','uvddU2NcPW'],..
|
|||
|
|
|||
|
// 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"])
|