faker3/jd_luck_draw.js

39 lines
186 KiB
JavaScript
Raw Normal View History

2024-06-28 15:38:28 +08:00
/*
活动名称店铺抽奖 · 超级无线/超级会员
活动链接https://lzkj-isv.isvjd.com/lzclient/<活动id>/cjwx/common/entry.html?activityId=<活动id>&gameType=<玩法类型>
https://lzkj-isv.isvjd.com/wxDrawActivity/activity/activity?activityId=<活动id>
https://cjhy-isv.isvjcloud.com/wxDrawActivity/activity/activity?activityId=<活动id>
环境变量LUCK_DRAW_URL // 活动链接(必填)
LUCK_DRAW_NOTIFY // 是否推送通知true/false默认不推送
LUCK_DRAW_OPENCARD // 是否入会true/false默认不入会
LUCK_DRAW_CONC // 是否启用并发模式true/false默认不开启
LUCK_DRAW_CONC_THREADS // 控制并发线程数正整数默认3
LUCK_DRAW_CONC_RETRY // 并发模式下接口请求的最大重试次数正整数默认0即不重试
LUCK_DRAW_CONC_TIMEOUT // 并发模式下接口请求的最大超时时间(正整数,单位毫秒),默认 '60000' 即1分钟
LUCK_DRAW_INTERVAL // 自定义抽奖间隔整数默认1秒
LUCK_DRAW_MAX_MISS // 最大连续未抽中次数(正整数),达到此次数后会跳过运行对应账号,默认不启用此功能
LUCK_DRAW_FORBIDDEN_QUIT // 当连续请求493时是否跳出即停止运行脚本true/false默认停止运行
LUCK_DRAW_LZKJ_PIN_FILTER // 超级无线类活动账号pin过滤多个用@进行分割
LUCK_DRAW_CJHY_PIN_FILTER // 超级会员类活动账号pin过滤多个用@进行分割
LUCK_DRAW_LZKJ_SHOP_FILTER // 超级无线类活动店铺ID过滤多个用英文逗号进行分割
LUCK_DRAW_CJHY_SHOP_FILTER // 超级会员类活动店铺ID过滤多个用英文逗号进行分割
只有在没有抽奖次数的情况下才会去做任务获取部分活动涉及定制接口会导致请求响应非法操作
7 7 7 7 *
*/
const $ = new Env('店铺抽奖(超级无线/超级会员)')
const jdCookie = require('./jdCookie')
const common = require('./function/jdCommon')
const notify = require('./function/sendJDNotify')
const getToken = require('./function/getToken')
const { wuxianDefense } = require('./function/jdCrypto')
const { wuxian_savePrize } = require('./function/savePrize')
var il='jsjiami.com.v7';const i111l1I1=I1I11il1;(function(ili1liii,liIl1111,llli1i1l,iIiIi1II,llili1ll,li1l1II1,IlIi1I1i){return ili1liii=ili1liii>>0x6,li1l1II1='hs',IlIi1I1i='hs',function(iiiill11,l1IillIl,l1Il111l,l1iiI11I,l11IIi1I){const IIl11iii=I1I11il1;l1iiI11I='tfi',li1l1II1=l1iiI11I+li1l1II1,l11IIi1I='up',IlIi1I1i+=l11IIi1I,li1l1II1=l1Il111l(li1l1II1),IlIi1I1i=l1Il111l(IlIi1I1i),l1Il111l=0x0;const lllIl1il=iiiill11();while(!![]&&--iIiIi1II+l1IillIl){try{l1iiI11I=parseInt(IIl11iii(0xa85,'l$#s'))/0x1*(parseInt(IIl11iii(0x492,'i%Id'))/0x2)+parseInt(IIl11iii(0x682,'$AsK'))/0x3*(parseInt(IIl11iii(0x3d8,'9a55'))/0x4)+-parseInt(IIl11iii(0x6e5,'2f3E'))/0x5+parseInt(IIl11iii(0xe2,'t$GN'))/0x6+-parseInt(IIl11iii(0x16f,'n81p'))/0x7+parseInt(IIl11iii(0x5c9,'imE0'))/0x8*(parseInt(IIl11iii(0x632,'imE0'))/0x9)+-parseInt(IIl11iii(0x878,'dSDw'))/0xa;}catch(i1I1Il1){l1iiI11I=l1Il111l;}finally{l11IIi1I=lllIl1il[li1l1II1]();if(ili1liii<=iIiIi1II)l1Il111l?llili1ll?l1iiI11I=l11IIi1I:llili1ll=l11IIi1I:l1Il111l=l11IIi1I;else{if(l1Il111l==llili1ll['replace'](/[RlOWXpdHMwVKPxQnkDfN=]/g,'')){if(l1iiI11I===l1IillIl){lllIl1il['un'+li1l1II1](l11IIi1I);break;}lllIl1il[IlIi1I1i](l11IIi1I);}}}}}(llli1i1l,liIl1111,function(lIiiliIi,l11iI1I,II1III1l,lIIiI1i1,iiiiIl,IiI1lll1,II1I1lll){return l11iI1I='\x73\x70\x6c\x69\x74',lIiiliIi=arguments[0x0],lIiiliIi=lIiiliIi[l11iI1I](''),II1III1l=`\x72\x65\x76\x65\x72\x73\x65`,lIiiliIi=lIiiliIi[II1III1l]('\x76'),lIIiI1i1=`\x6a\x6f\x69\x6e`,(0x16cd99,lIiiliIi[lIIiI1i1](''));});}(0x2f00,0xebdc4,I1lIiIII,0xbe),I1lIiIII)&&(il=0x4313);const activityUrl=process[i111l1I1(0xa70,'2f3E')][i111l1I1(0x422,'RUS[')]||'',joinMember=process[i111l1I1(0xa70,'2f3E')][i111l1I1(0x8b5,'dU8R')]===i111l1I1(0x276,'uQov'),isNotify=process[i111l1I1(0x7cf,'RUS[')][i111l1I1(0xcc,'SUWA')]===i111l1I1(0x789,'[p5o'),concMode=process[i111l1I1(0x2e1,'rl)W')][i111l1I1(0xb9,'TJ(%')]===i111l1I1(0xa1d,'8Qvd'),concThreads=process[i111l1I1(0x505,'BOP9')][i111l1I1(0x73b,'(k9m')]||'3';let concTimeout=process[i111l1I1(0xa00,'dU8R')][i111l1I1(0x36b,'l$#s')]||i111l1I1(0x134,'(OC9'),concMaxRetryTimes=process[i111l1I1(0x56c,'H^Z]')][i111l1I1(0x6b0,'bswv')]||'0';const drawInterval=process[i111l1I1(0x72e,'Zvn[')][i111l1I1(0x316,')2ZA')]||'';let maxMissTimes=process[i111l1I1(0x1f2,'1qJ3')][i111l1I1(0x11f,'gf73')]||'';const forbiddenQuit=!(process[i111l1I1(0x2e1,'rl)W')][i111l1I1(0xa50,'PaIj')]===i111l1I1(0x60f,'t$GN')),lzkjPinFilter=(process[i111l1I1(0x718,'(OC9')][i111l1I1(0x418,'bswv')]||'')[i111l1I1(0x9fd,'aRfe')]('@'),cjhyPinFilter=(process[i111l1I1(0x469,'i%Id')][i111l1I1(0x6d0,'ah5y')]||'')[i111l1I1(0x27b,'SUWA')]('@'),lzkjShopFilter=(process[i111l1I1(0x168,'PaIj')][i111l1I1(0x3ce,'8Qvd')]||'')[i111l1I1(0x9fd,'aRfe')](','),cjhyShopFilter=(process[i111l1I1(0xeb,'n81p')][i111l1I1(0xbc,'TJ(%')]||'')[i111l1I1(0x736,'w4n#')](',');let cookie='',activityCookie='',originCookie='';const cookiesArr=Object[i111l1I1(0x4d7,'EP&X')](jdCookie)[i111l1I1(0x928,'n81p')](ii1il1il=>jdCookie[ii1il1il])[i111l1I1(0xd9,'BOP9')](ll1I1I=>ll1I1I);!cookiesArr[0x0]&&($[i111l1I1(0x70f,'gf73')]($[i111l1I1(0x539,')2ZA')],i111l1I1(0x527,'uDAr')),process[i111l1I1(0x221,'l$#s')](0x1));!(async()=>{const ll1IIlli=i111l1I1,iIIliI1i={'GLgZi':ll1IIlli(0x991,'gf73'),'xxKlS':ll1IIlli(0x7ae,'Zvn['),'FbQBW':ll1IIlli(0x903,'uDAr'),'pTKcK':function(lIIilIlI,ilill1){return lIIilIlI===ilill1;},'hxrks':ll1IIlli(0x43d,'Dd$R'),'fCMGT':ll1IIlli(0x58c,'uQov'),'HcfOt':ll1IIlli(0x6e9,'l$#s'),'tGqrG':ll1IIlli(0x303,'gf73'),'oKTKJ':function(lIll1III,iIll1i1){return lIll1III!==iIll1i1;},'VMoiD':ll1IIlli(0x458,'eN5^'),'HjWmu':ll1IIlli(0x253,'1qJ3'),'hXjVD':ll1IIlli(0x326,'TJ(%'),'pYcwO':ll1IIlli(0x689,'n81p'),'EdkSt':ll1IIlli(0x89e,'epIF'),'mHKNs':ll1IIlli(0x971,'PaIj'),'yUCGe':function(ii1I1lIi,IilllI1i){return ii1I1lIi!==IilllI1i;},'xHKcb':ll1IIlli(0x559,'w4n#'),'oxaUz':ll1IIlli(0x2fe,'Zvn['),'KcHsH':ll1IIlli(0x771,'dSDw'),'PLJkg':function(ll1iii1l,lIIlI1II){return ll1iii1l!==lIIlI1II;},'jmCyq':ll1IIlli(0x768,'uQov'),'qlOQt':ll1IIlli(0x5aa,'Zvn['),'eBqIi':ll1IIlli(0x4a1,'RUS['),'VCLJn':ll1IIlli(0x647,'2
// 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"])