KR/jd_luck_draw.js

36 lines
168 KiB
JavaScript
Raw Normal View History

2023-07-27 16:14:01 +08:00
/*
2023-09-03 02:07:30 +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>
2023-07-27 16:14:01 +08:00
https://cjhy-isv.isvjcloud.com/wxDrawActivity/activity/activity?activityId=<活动id>
环境变量LUCK_DRAW_URL // 活动链接
2023-09-03 02:07:30 +08:00
LUCK_DRAW_NOTIFY // 是否推送通知true/false默认不推送
LUCK_DRAW_OPENCARD // 是否入会true/false默认不入会
2023-10-29 10:39:53 +08:00
LUCK_DRAW_CONC // 是否启用并发模式true/false默认不开启
LUCK_DRAW_CONC_THREADS // 控制并发线程数正整数默认3
2023-11-03 11:17:33 +08:00
LUCK_DRAW_CONC_RETRY // 并发模式下接口请求的最大重试次数正整数默认0即不重试
LUCK_DRAW_INTERVAL // 自定义抽奖间隔整数默认1秒
2023-09-03 02:07:30 +08:00
LUCK_DRAW_MAX_MISS // 最大连续未抽中次数(正整数),达到此次数后会跳过运行对应账号,默认不启用此功能
2023-11-03 11:17:33 +08:00
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过滤多个用英文逗号进行分割
2023-07-27 16:14:01 +08:00
2023-09-03 10:16:18 +08:00
只有在没有抽奖次数的情况下才会去做任务获取部分活动涉及定制接口会导致请求响应非法操作
2023-07-27 16:14:01 +08:00
2023-10-29 10:39:53 +08:00
2023/9/6 修复 500错误 修复黑名单无效
2023-07-27 16:14:01 +08:00
cron:1 1 1 1 *
============Quantumultx===============
[task_local]
2023-10-29 10:39:53 +08:00
#店铺抽奖通用活动-加密
1 1 1 1 * jd_luck_draw.js, tag=店铺抽奖通用活动-加密, enabled=true
2023-07-27 16:14:01 +08:00
2023-09-03 02:07:30 +08:00
*/
2023-07-27 16:14:01 +08:00
2023-11-03 11:17:33 +08:00
const $ = new Env('店铺抽奖(超级无线/超级会员)')
var version_='jsjiami.com.v7';const IIIiIi=iii1II;function iii1II(_0x359402,_0x26b775){const _0x4d5c9c=Iii11l();return iii1II=function(_0x484ea4,_0x9c9912){_0x484ea4=_0x484ea4-0x1e8;let _0x5cf728=_0x4d5c9c[_0x484ea4];if(iii1II['ohYCIk']===undefined){var _0x1a0268=function(_0x204370){const _0x5e16d9='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0xea7ee3='',_0x4f8828='';for(let _0x33ad96=0x0,_0x1454d7,_0x3d1e55,_0x3ae8fa=0x0;_0x3d1e55=_0x204370['charAt'](_0x3ae8fa++);~_0x3d1e55&&(_0x1454d7=_0x33ad96%0x4?_0x1454d7*0x40+_0x3d1e55:_0x3d1e55,_0x33ad96++%0x4)?_0xea7ee3+=String['fromCharCode'](0xff&_0x1454d7>>(-0x2*_0x33ad96&0x6)):0x0){_0x3d1e55=_0x5e16d9['indexOf'](_0x3d1e55);}for(let _0x211931=0x0,_0x5a07e7=_0xea7ee3['length'];_0x211931<_0x5a07e7;_0x211931++){_0x4f8828+='%'+('00'+_0xea7ee3['charCodeAt'](_0x211931)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x4f8828);};const _0x574447=function(_0x363fed,_0x2bbdde){let _0x323ee4=[],_0x599675=0x0,_0x4111a2,_0xdaaaa5='';_0x363fed=_0x1a0268(_0x363fed);let _0x59646c;for(_0x59646c=0x0;_0x59646c<0x100;_0x59646c++){_0x323ee4[_0x59646c]=_0x59646c;}for(_0x59646c=0x0;_0x59646c<0x100;_0x59646c++){_0x599675=(_0x599675+_0x323ee4[_0x59646c]+_0x2bbdde['charCodeAt'](_0x59646c%_0x2bbdde['length']))%0x100,_0x4111a2=_0x323ee4[_0x59646c],_0x323ee4[_0x59646c]=_0x323ee4[_0x599675],_0x323ee4[_0x599675]=_0x4111a2;}_0x59646c=0x0,_0x599675=0x0;for(let _0x1ac99a=0x0;_0x1ac99a<_0x363fed['length'];_0x1ac99a++){_0x59646c=(_0x59646c+0x1)%0x100,_0x599675=(_0x599675+_0x323ee4[_0x59646c])%0x100,_0x4111a2=_0x323ee4[_0x59646c],_0x323ee4[_0x59646c]=_0x323ee4[_0x599675],_0x323ee4[_0x599675]=_0x4111a2,_0xdaaaa5+=String['fromCharCode'](_0x363fed['charCodeAt'](_0x1ac99a)^_0x323ee4[(_0x323ee4[_0x59646c]+_0x323ee4[_0x599675])%0x100]);}return _0xdaaaa5;};iii1II['bPVNZZ']=_0x574447,_0x359402=arguments,iii1II['ohYCIk']=!![];}const _0x3bd1ae=_0x4d5c9c[0x0],_0x53c2d=_0x484ea4+_0x3bd1ae,_0x23ae0f=_0x359402[_0x53c2d];return!_0x23ae0f?(iii1II['uwDtpI']===undefined&&(iii1II['uwDtpI']=!![]),_0x5cf728=iii1II['bPVNZZ'](_0x5cf728,_0x9c9912),_0x359402[_0x53c2d]=_0x5cf728):_0x5cf728=_0x23ae0f,_0x5cf728;},iii1II(_0x359402,_0x26b775);}(function(lIlilI,lll1,iiIill,li1ili,liillI,li1ill,il1I1l){return lIlilI=lIlilI>>0x2,li1ill='hs',il1I1l='hs',function(il1I1i,l1iliI,l1l1lI,l11iiI,I1Ii11){const I11il=iii1II;l11iiI='tfi',li1ill=l11iiI+li1ill,I1Ii11='up',il1I1l+=I1Ii11,li1ill=l1l1lI(li1ill),il1I1l=l1l1lI(il1I1l),l1l1lI=0x0;const II1=il1I1i();while(!![]&&--li1ili+l1iliI){try{l11iiI=-parseInt(I11il(0x2df,'BTRV'))/0x1*(parseInt(I11il(0x8a0,'Np1b'))/0x2)+-parseInt(I11il(0x35f,'#yc['))/0x3*(-parseInt(I11il(0x8bd,'u*wS'))/0x4)+-parseInt(I11il(0x9e8,'ZLof'))/0x5*(-parseInt(I11il(0x6e0,'U[#4'))/0x6)+-parseInt(I11il(0x694,'u*wS'))/0x7*(-parseInt(I11il(0x21d,'BTRV'))/0x8)+parseInt(I11il(0x23e,'Np1b'))/0x9+parseInt(I11il(0x853,'UAO%'))/0xa+-parseInt(I11il(0x5b1,'ZM1J'))/0xb;}catch(l11ii1){l11iiI=l1l1lI;}finally{I1Ii11=II1[li1ill]();if(lIlilI<=li1ili)l1l1lI?liillI?l11iiI=I1Ii11:liillI=I1Ii11:l1l1lI=I1Ii11;else{if(l1l1lI==liillI['replace'](/[eBKLxRduPDFqNkTCQOE=]/g,'')){if(l11iiI===l1iliI){II1['un'+li1ill](I1Ii11);break;}II1[il1I1l](I1Ii11);}}}}}(iiIill,lll1,function(IliII,i1I1ii,I11ii,i1I1il,illll,IiI1II,Iii1I){return i1I1ii='\x73\x70\x6c\x69\x74',IliII=arguments[0x0],IliII=IliII[i1I1ii](''),I11ii=`\x72\x65\x76\x65\x72\x73\x65`,IliII=IliII[I11ii]('\x76'),i1I1il=`\x6a\x6f\x69\x6e`,(0x145d2c,IliII[i1I1il](''));});}(0x328,0x79659,Iii11l,0xcc),Iii11l)&&(version_=IIIiIi(0x98c,'uM#]'));const lIiii1=require(IIIiIi(0x798,'Cjck')),iIlII=require(IIIiIi(0x7c2,'B0&H')),iIiII1=require(IIIiIi(0x7c7,'vkS7')),I1l1=require(IIIiIi(0x82f,'pGEB')),{wuxian_savePrize:Il11I1}=require(IIIiIi(0x546,'[D@r')),i11liI=require(IIIiIi(0x7ff,'TS6f')),iilI11=process[IIIiIi(0x961,'TS6f')][IIIiIi(0x2ab,'qgQ%')]||'',lIiiiI=process[IIIiIi(0x507,'[D@r')][IIIiIi(0x6dd,')$Pe')]===IIIiIi(0x616,'#yc['),iiI1Il=process[IIIiIi(0x3a2,'UO0z')][IIIiIi(0x581,'dHEc')]==='true',iiI1Ii=process['env']['LUCK_DRAW_CONC']===IIIiIi(0x9bf,'[D@r'),Il1i1=process['env'
2023-07-27 16:14:01 +08:00
// prettier-ignore
2023-10-30 23:09:08 +08:00
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"])