faker3/jd_lzkj_draw.js

45 lines
181 KiB
JavaScript
Raw Normal View History

2024-06-28 15:38:28 +08:00
/*
活动名称幸运抽奖超级无线
活动链接https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=<类型id>&templateId=<模板id>&activityId=<活动id>&prd=cjwx
https://lzkj-isv.isvjcloud.com/prod/cc/interaction/v1/index?activityType=<类型id>&templateId=<模板id>&activityId=<活动id>&prd=cjwx
https://lorealjdcampaign-rc.isvjcloud.com/interact/index?activityType=<类型id>&activityId=<活动id>&templateId=<模板id>&prd=crm
环境变量jd_lzkj_draw_url // 活动链接
jd_lzkj_draw_opencard // 是否入会true/false默认不入会
jd_lzkj_draw_Notify // 是否推送通知true/false默认不推送
jd_lzkj_draw_Interval // 自定义抽奖间隔整数默认1秒
jd_lzkj_draw_MaxMiss // 最大连续未抽中次数(正整数),达到此次数后会跳过运行对应账号,默认不启用此功能
jd_lzkj_draw_conc // 是否启用并发模式true/false默认不开启
jd_lzkj_draw_concThreads // 控制并发线程数正整数默认3
jd_lzkj_draw_concRetry // 并发模式下接口请求的最大重试次数正整数默认0即不重试
jd_lzkj_draw_concTimeout // 并发模式下接口请求的最大超时时间(正整数,单位毫秒),默认 '60000' 即1分钟
jd_lzkj_draw_pinFilter // 账号pin过滤多个用@进行分割
支持的活动类型
10001 签到抽奖 10004 签到抽奖 10020 九宫格
10021 转盘 10026 转盘积分 10031 扭蛋机
10041 转盘 10042 刮刮乐 10046 老虎机
10054 上上签 10062 砸金蛋 10063 翻翻乐
10073 转盘积分 10080 刮刮乐积分
注释
需要链接中的三个必要参数才能正常访问活动页运行脚本至少需要提供 activityId 参数
只有在没有抽奖次数的前提下才会做任务做任务静默运行没有打印日志
官方后端性能较差并且写的很烂同一时间冲的人较多会导致服务器抽风返回 500 Internal Server Error
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, getJdEnvInfo } = require('./function/jdCrypto')
const { loreal_savePrize } = require('./function/savePrize')
var il='jsjiami.com.v7';const IilIiI=l1lI111;(function(iillilI,ilI1i1i1,iIi1Il1I,IliI1II,i1IilIII,iIiIiIl1,iIlIlill){return iillilI=iillilI>>0x1,iIiIiIl1='hs',iIlIlill='hs',function(IlillIIi,l1ll11,lIIlilll,l1liI1i,I1llIl1i){const lIlII1ll=l1lI111;l1liI1i='tfi',iIiIiIl1=l1liI1i+iIiIiIl1,I1llIl1i='up',iIlIlill+=I1llIl1i,iIiIiIl1=lIIlilll(iIiIiIl1),iIlIlill=lIIlilll(iIlIlill),lIIlilll=0x0;const ii1IIi=IlillIIi();while(!![]&&--IliI1II+l1ll11){try{l1liI1i=parseInt(lIlII1ll(0xa38,'G]6@'))/0x1+-parseInt(lIlII1ll(0x3d8,'Ge6u'))/0x2*(parseInt(lIlII1ll(0x3a4,'Fl3n'))/0x3)+-parseInt(lIlII1ll(0x9d6,'r0J&'))/0x4+-parseInt(lIlII1ll(0x7c4,'#Zqa'))/0x5*(-parseInt(lIlII1ll(0xa6e,'rolS'))/0x6)+parseInt(lIlII1ll(0xac2,'X3kt'))/0x7*(-parseInt(lIlII1ll(0x4e4,'H!^E'))/0x8)+parseInt(lIlII1ll(0x7fd,'Y7kJ'))/0x9+-parseInt(lIlII1ll(0x66f,'WDOD'))/0xa;}catch(liIi1II){l1liI1i=lIIlilll;}finally{I1llIl1i=ii1IIi[iIiIiIl1]();if(iillilI<=IliI1II)lIIlilll?i1IilIII?l1liI1i=I1llIl1i:i1IilIII=I1llIl1i:lIIlilll=I1llIl1i;else{if(lIIlilll==i1IilIII['replace'](/[JrdbgNQYDtGIXTV=]/g,'')){if(l1liI1i===l1ll11){ii1IIi['un'+iIiIiIl1](I1llIl1i);break;}ii1IIi[iIlIlill](I1llIl1i);}}}}}(iIi1Il1I,ilI1i1i1,function(iiIiIill,I1IllI1I,l1ilillI,lI1i1ili,lIIlI11I,IIi11I1,l111I11I){return I1IllI1I='\x73\x70\x6c\x69\x74',iiIiIill=arguments[0x0],iiIiIill=iiIiIill[I1IllI1I](''),l1ilillI=`\x72\x65\x76\x65\x72\x73\x65`,iiIiIill=iiIiIill[l1ilillI]('\x76'),lI1i1ili=`\x6a\x6f\x69\x6e`,(0x16f59e,iiIiIill[lI1i1ili](''));});}(0x198,0x90040,l1iii1I1,0xce),l1iii1I1)&&(il=0x1bd9);const activityUrl=process[IilIiI(0x7da,'r0J&')][IilIiI(0x407,'7&*)')]||'',joinMember=process[IilIiI(0x18c,'WDOD')][IilIiI(0x18b,'#Zqa')]===IilIiI(0xa92,'pd#7'),isNotify=process[IilIiI(0x632,'$WJZ')][IilIiI(0x493,'fhw@')]===IilIiI(0x683,')ULM'),concMode=process[IilIiI(0x7bd,'Be7j')][IilIiI(0x35f,'r0J&')]===IilIiI(0x42e,'Ge6u'),concThreads=process[IilIiI(0x2aa,'Gfrh')][IilIiI(0x6f6,'Zi&c')]||'3';let concTimeout=process[IilIiI(0x484,'(JUZ')][IilIiI(0x56b,'&@5R')]||IilIiI(0x89e,'z2oN'),concMaxRetryTimes=process[IilIiI(0xa8e,'Ls4l')][IilIiI(0x5e7,'Y7kJ')]||'0';function l1iii1I1(){const i1i11111=(function(){return[...[il,'bdjNGsGjrigQamXbriI.cToXJmVTD.VJvY7tgrDb==','W5VcGSkGDSoDWQpdJCkbW5hcOJewWR8','oCkaW6iuW5ZdTK0','W6ddGCoEk3e','WQWKWO7dGSoX','mSouW4pdNCkD','5AAC5zoH5zoz56wq77Yh','5AAC5zkH5zkN56wp772a','tCoXWR7cLSo2gYKRWO0dlr/dNSkOW5yz','k8kIeu9wgCkhtG','WPXjeSka','W443bSkntmoHa0lcOXFcUMC','WOj1WRNdK3y','W5CDaWORW6DNWORdHdHUqSoAW7zY','ySkjaCkdy0RdOrv7deXRWOJdPmoUW63dQr/dPq','WPRdKmoGkCkdW7RcLmkx','uxnJWQ8zW7ldNmoXWPe','o8opW5tdJmkshmowvfSQz3BdN8k1wmkFDG','grdcQCoqW44','W6/dQWnBWO58WRldKqq','WONdMSoImmk5','la5nWQix','fctdLSksnCkTzSkyW7vxWOBcUa','DSkhhmk/ueVdQG','nGXGW7VdJY7cNGe','zXZdKCoyWRq','kgnvWQHK','WQJcVmkBWP3cJG','WOS3WRNcLZy','5RwK5yIv5BkV5P6r5B+B5AA5776U5BYX5AEI5PAQ6zEY77Ya','bvddHgy','datcJmo1W4NcQ8khgW','W5C3aSkg','WPCoWRC','W7C1gqG8','4PIUWQJOROdLOApLHApMOkhLV4NMR4FNOjNNMjhLJORPHyC','cmozW5iHrW','WQBcUCo0W5q','gJldPSk+pCkKyCkfW7vvWPNcVW/dQaRcNq','Amkzu8oTnq','W5ddQ8oOW71UW4vW','WO9PCCoyWOrszmonzq','W4BcIrtcSaTjW4aP','5yMF5ysE5BUu6zcf5l6v5zgG5Aso6lAx77+Z5RE15yQn5lUU6zM+5BIf6zk35l6D5zgk5y+H5lUV5zcMhG','WQhcRmorW50O','jGtcGaGwWPLNl8oJfCoTfeddQCo/sG','D0xdKH/cSq','rCoJWR7cJSoY','WPOlWQpdHSoxWQu','D8k8nHO2','WRyhWONcQXC','ugjIWRyOW7JdHSoW','5l2Z5Oc+5yQ18ywLRE+4VG','bHlcVmonW54','W4O5aSkg','lJxcLSorW78','W4JdNHTkWP4','lmovW5tdICk+jSolxeWV','5yIe5ys95BU46zcz5lYv5zow5OM35yQ4','W7RdPXXTWPq','W4O3ocWr','5AsK5zkb5BAz5yse6yk95y2V5A2/5lIH772G5lQC5Q+s5PEX54k85P605zg6bW','mtxcQSkCWQa','ySkjaCkgBfldRqHQbMXwWQRdPmoYW6O','o8kbW5CFW5ldOva','WQxcLCk6WONcJa','bL7dOfZcKW','Cdz5oMq','W5NcIrtcSZvdW5y','k8kIeu9wf8kBtCkv','lqz9W6VdRYdcHW3dS8kL','c8otW5/dVCkU','bhtdML4','WROsW4pdHt8UEhir','WP8FWQtdTW','WP3cN8kQDSo8','nWbRWPeG','n8o1W5qjrCoHWRxcUmkklG','pSoEW4hdKSkTg8owsga4','WRZdK8oBi8kp','b8kXW7NcN8ozq8k+WP9hWPRdM3OlgZ7cKSkIWQbvySkqWOC','d3RdSKW+','oSkOdeX8gCkrECkFWQyyBCkh','CvFcQ1meW4VdLfNcOSoNWO1vcW','AtTlWO1OWOLSdSosDstdPmklysFcVSozwSoJmCoe','mCopueeiW6xcIqDciq','cGj0WQKP','vSkIg8kmzW','gq/cImolW64','W43dVmoYW7rQW6X0WO0
// 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"])