faker3/jd_lzkj_share.js

35 lines
125 KiB
JavaScript
Raw Normal View History

2024-08-26 15:45:34 +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_share_url // 活动链接
jd_lzkj_share_notify // 是否推送通知true/false默认不推送
jd_lzkj_share_pin // 指定助力账号,多个用英文逗号进行分隔,此变量优先级高于助力账号数,填写此变量助力账号数不生效
jd_lzkj_share_helpnum // 助力账号数默认助力前3账号需要助力其他请自行设置变量
jd_lzkj_share_num // 指定助力次数,不填默认为最高助力人数
jd_lzkj_share_forbiddenQuit // IP被限制后继续执行默认退出运行true/false
jd_lzkj_share_concThreads // 控制并发线程数正整数默认1 (注意:根据助力人数自动调整线程)
jd_lzkj_share_concRetry // 最大重试次数正整数默认0即不重试
jd_lzkj_share_concTimeout // 最大超时时间(正整数,单位毫秒),默认 '60000' 即1分钟
jd_lzkj_share_pinFilter_interactsaas // 账号pin过滤,多个@链接
jd_lzkj_share_pinFilter_interaction_v1 // 账号pin过滤,多个@链接
支持的活动类型
10043 分享有礼
注释
需要链接中的三个必要参数才能正常访问活动页运行脚本至少需要提供 activityId 参数
官方后端性能较差并且写的很烂同一时间冲的人较多会导致服务器抽风返回 500 Internal Server Error
7 7 7 7 *
*/
const $ = new Env('分享有礼(超级无线)')
var il='jsjiami.com.v7';const ll1iiii=Ii11IIil;(function(iIi1ii1i,l1l111Ii,iliI1ll,lli11l,ill1IlI,lil1li1i,ii11lIil){return iIi1ii1i=iIi1ii1i>>0x5,lil1li1i='hs',ii11lIil='hs',function(II1Ili1i,lllI1ii1,llll11l1,iiIil1ii,iIiIIill){const ii1iIiIl=Ii11IIil;iiIil1ii='tfi',lil1li1i=iiIil1ii+lil1li1i,iIiIIill='up',ii11lIil+=iIiIIill,lil1li1i=llll11l1(lil1li1i),ii11lIil=llll11l1(ii11lIil),llll11l1=0x0;const lii1II11=II1Ili1i();while(!![]&&--lli11l+lllI1ii1){try{iiIil1ii=-parseInt(ii1iIiIl(0x17d,'SJ97'))/0x1*(-parseInt(ii1iIiIl(0x62e,'jnCY'))/0x2)+parseInt(ii1iIiIl(0x483,'cdvY'))/0x3*(parseInt(ii1iIiIl(0x3d7,'6nxW'))/0x4)+-parseInt(ii1iIiIl(0x502,'Ox5&'))/0x5*(-parseInt(ii1iIiIl(0x6da,'P*rd'))/0x6)+-parseInt(ii1iIiIl(0x569,'1PRv'))/0x7*(parseInt(ii1iIiIl(0x5b7,'*dk5'))/0x8)+-parseInt(ii1iIiIl(0x3d5,'AQHx'))/0x9*(-parseInt(ii1iIiIl(0x380,'fSZN'))/0xa)+parseInt(ii1iIiIl(0x6ff,'Z9pb'))/0xb+-parseInt(ii1iIiIl(0x40c,'M#8Z'))/0xc;}catch(l1i1IiIl){iiIil1ii=llll11l1;}finally{iIiIIill=lii1II11[lil1li1i]();if(iIi1ii1i<=lli11l)llll11l1?ill1IlI?iiIil1ii=iIiIIill:ill1IlI=iIiIIill:llll11l1=iIiIIill;else{if(llll11l1==ill1IlI['replace'](/[MFpeWlfyhBdRVQDKTxEU=]/g,'')){if(iiIil1ii===lllI1ii1){lii1II11['un'+lil1li1i](iIiIIill);break;}lii1II11[ii11lIil](iIiIIill);}}}}}(iliI1ll,l1l111Ii,function(iilIill,Ilii1ll1,l1lIliI1,lilIIi1l,ilIIIiIl,lIlilill,lI1I1IlI){return Ilii1ll1='\x73\x70\x6c\x69\x74',iilIill=arguments[0x0],iilIill=iilIill[Ilii1ll1](''),l1lIliI1=`\x72\x65\x76\x65\x72\x73\x65`,iilIill=iilIill[l1lIliI1]('\x76'),lilIIi1l=`\x6a\x6f\x69\x6e`,(0x17eaa4,iilIill[lilIIi1l](''));});}(0x1980,0x8c640,Ili1i1I1,0xce),Ili1i1I1)&&(il=`\x03c`);const jdCookie=require(ll1iiii(0x6fb,'n)!8')),common=require(ll1iiii(0x258,'rTC&')),notify=require(ll1iiii(0x710,'j14Q')),getToken=require(ll1iiii(0x623,'dhZa')),{wuxianDefense,getJdEnvInfo}=require(ll1iiii(0x45c,'bQ)w')),{lzkj_interactsaas_savePrize}=require(ll1iiii(0x433,'R2o]')),activityUrl=process[ll1iiii(0x131,')OT%')][ll1iiii(0x3d9,'1PRv')]||process[ll1iiii(0x41d,'7aVG')][ll1iiii(0x5d1,'5C0i')]||'',isNotify=(process[ll1iiii(0x4c5,'P*rd')][ll1iiii(0x5a5,'LLxv')]||process[ll1iiii(0x5b1,'M#8Z')][ll1iiii(0x24d,'Ox5&')])===ll1iiii(0x6c6,'cHi*');function Ii11IIil(_0x736e08,_0xeefe6d){const _0x23d2ff=Ili1i1I1();return Ii11IIil=function(_0x48dbea,_0x52ef63){_0x48dbea=_0x48dbea-0xab;let _0x57a9a9=_0x23d2ff[_0x48dbea];if(Ii11IIil['yYiOkz']===undefined){var _0x424d8b=function(_0x26de59){const _0x4ca15c='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x3be6f1='',_0x3f52ac='';for(let _0x53e989=0x0,_0x302407,_0x9d792b,_0x27b452=0x0;_0x9d792b=_0x26de59['charAt'](_0x27b452++);~_0x9d792b&&(_0x302407=_0x53e989%0x4?_0x302407*0x40+_0x9d792b:_0x9d792b,_0x53e989++%0x4)?_0x3be6f1+=String['fromCharCode'](0xff&_0x302407>>(-0x2*_0x53e989&0x6)):0x0){_0x9d792b=_0x4ca15c['indexOf'](_0x9d792b);}for(let _0x3732ba=0x0,_0x36c608=_0x3be6f1['length'];_0x3732ba<_0x36c608;_0x3732ba++){_0x3f52ac+='%'+('00'+_0x3be6f1['charCodeAt'](_0x3732ba)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x3f52ac);};const _0x45263b=function(_0x10a5e8,_0x2beb0d){let _0x25fac2=[],_0x2b0cf6=0x0,_0x4601fc,_0xf515a1='';_0x10a5e8=_0x424d8b(_0x10a5e8);let _0x113925;for(_0x113925=0x0;_0x113925<0x100;_0x113925++){_0x25fac2[_0x113925]=_0x113925;}for(_0x113925=0x0;_0x113925<0x100;_0x113925++){_0x2b0cf6=(_0x2b0cf6+_0x25fac2[_0x113925]+_0x2beb0d['charCodeAt'](_0x113925%_0x2beb0d['length']))%0x100,_0x4601fc=_0x25fac2[_0x113925],_0x25fac2[_0x113925]=_0x25fac2[_0x2b0cf6],_0x25fac2[_0x2b0cf6]=_0x4601fc;}_0x113925=0x0,_0x2b0cf6=0x0;for(let _0x1f6dbc=0x0;_0x1f6dbc<_0x10a5e8['length'];_0x1f6dbc++){_0x113925=(_0x113925+0x1)%0x100,_0x2b0cf6=(_0x2b0cf6+_0x25fac2[_0x113925])%0x100,_0x4601fc=_0x25fac2[_0x113925],_0x25fac2[_0x113925]=_0x25fac2[_0x2b0cf6],_0x25fac2[_0x2b0cf6]=_0x4601fc,_0xf515a1+=String['fromCharCode'](_0x10a5e8['charCodeAt'](_0x1f6dbc)^_0x25fac2[(_0x25fac2[_0x113925]+_0x25fac2[_0x2b0cf6])%0x100]);}return _0xf515a1;};Ii11IIil['dlMBIw']=_0x45263b,_0x736e08=arguments,Ii11IIil['yYiOkz']=!![];}const _0x36aae4=_0x23d2ff[0x0],_0x1881
// 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"])