mirror of
https://github.com/shufflewzc/faker3.git
synced 2024-11-14 07:29:18 +08:00
28 lines
49 KiB
JavaScript
28 lines
49 KiB
JavaScript
|
/*
|
|||
|
活动名称:入会礼包
|
|||
|
活动链接:https://shopmember.m.jd.com/shopcard/?venderId=<商家ID>
|
|||
|
环境变量:jd_opencard_venderId // 商家ID,多个用英文逗号分割
|
|||
|
jd_opencard_min_beans // 最低豆子入会阈值(整数),默认10,奖品数量大于或等于此值时才会入会,填0表示不限制
|
|||
|
jd_opencard_task_threads // 控制店铺并发线程数(正整数),默认1,最大3
|
|||
|
jd_opencard_account_threads // 控制账号并发线程数(正整数),默认1,最大3
|
|||
|
jd_opencard_account_interval // 自定义运行间隔时长(整数,单位毫秒),默认0
|
|||
|
jd_opencard_notify // 是否推送中奖信息(true/false),默认不推送
|
|||
|
|
|||
|
目前官方设置的入会礼包奖品只有优惠券、京豆、店铺积分、红包
|
|||
|
黑号或新注册的账号可能会一直403
|
|||
|
|
|||
|
7 7 7 7 *
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('入会礼包')
|
|||
|
const jdCookie = require('./jdCookie')
|
|||
|
const notify = require('./function/sendJDNotify')
|
|||
|
const common = require('./function/jdCommon')
|
|||
|
const { H5st } = require('./function/jdCrypto')
|
|||
|
|
|||
|
var iil='jsjiami.com.v7';const I111Il1I=liI11iii;(function(lIlIIilI,l1iiIliI,i11l1Ili,I111il1,IiilllIi,IliillIl,i1lI1I){return lIlIIilI=lIlIIilI>>0x7,IliillIl='hs',i1lI1I='hs',function(IIi1Il1,liIIIIl1,iIiiliI,lIil1I1I,IIi1IIIl){const Iii1ilii=liI11iii;lIil1I1I='tfi',IliillIl=lIil1I1I+IliillIl,IIi1IIIl='up',i1lI1I+=IIi1IIIl,IliillIl=iIiiliI(IliillIl),i1lI1I=iIiiliI(i1lI1I),iIiiliI=0x0;const iliiiiiI=IIi1Il1();while(!![]&&--I111il1+liIIIIl1){try{lIil1I1I=-parseInt(Iii1ilii(0x2ba,'BuW8'))/0x1*(-parseInt(Iii1ilii(0x2d1,'@FTf'))/0x2)+parseInt(Iii1ilii(0x295,'slLV'))/0x3+parseInt(Iii1ilii(0x2e6,'BuW8'))/0x4*(-parseInt(Iii1ilii(0x301,'U8v%'))/0x5)+-parseInt(Iii1ilii(0x214,'xstx'))/0x6+-parseInt(Iii1ilii(0x26e,'U8v%'))/0x7+parseInt(Iii1ilii(0x1a5,'kdI8'))/0x8+parseInt(Iii1ilii(0x394,'D!MJ'))/0x9*(parseInt(Iii1ilii(0x2df,'@FTf'))/0xa);}catch(l1i1iiii){lIil1I1I=iIiiliI;}finally{IIi1IIIl=iliiiiiI[IliillIl]();if(lIlIIilI<=I111il1)iIiiliI?IiilllIi?lIil1I1I=IIi1IIIl:IiilllIi=IIi1IIIl:iIiiliI=IIi1IIIl;else{if(iIiiliI==IiilllIi['replace'](/[PCbdwqxkWurSTQtYKNFJ=]/g,'')){if(lIil1I1I===liIIIIl1){iliiiiiI['un'+IliillIl](IIi1IIIl);break;}iliiiiiI[i1lI1I](IIi1IIIl);}}}}}(i11l1Ili,l1iiIliI,function(ill1i1II,ii1iill1,lllIIlli,iii1iIli,i11l1IlI,lIili11I,ii1ii1II){return ii1iill1='\x73\x70\x6c\x69\x74',ill1i1II=arguments[0x0],ill1i1II=ill1i1II[ii1iill1](''),lllIIlli=`\x72\x65\x76\x65\x72\x73\x65`,ill1i1II=ill1i1II[lllIIlli]('\x76'),iii1iIli=`\x6a\x6f\x69\x6e`,(0x16f5ab,ill1i1II[iii1iIli](''));});}(0x5e00,0x23ee0,li1llIiI,0xbe),li1llIiI)&&(iil=`\x2c1`);let idList=(process[I111Il1I(0x2b6,'slLV')][I111Il1I(0x212,'Pw[T')]||'')[I111Il1I(0x1af,'(%%G')](','),minBeans=process[I111Il1I(0x24f,'uDhr')][I111Il1I(0x1c0,'Ff90')]||'10',taskThreads=process[I111Il1I(0x293,'4@L2')][I111Il1I(0x38f,'80AB')]||'1',accountThreads=process[I111Il1I(0x250,'80AB')][I111Il1I(0x1b3,'ytCB')]||'1';const runInterval=process[I111Il1I(0x2be,'kdI8')][I111Il1I(0x198,'huge')]||'',isNotify=process[I111Il1I(0x1bb,'BuW8')][I111Il1I(0x38b,'uDhr')]===I111Il1I(0x221,'huge'),invalidIdsMap=new Map(),maxThreads=0x3,cookiesArr=Object[I111Il1I(0x2c4,'KqiU')](jdCookie)[I111Il1I(0x1e6,'Z6*(')](ll1IIil1=>jdCookie[ll1IIil1])[I111Il1I(0x185,'lZT*')](I11IillI=>I11IillI);function liI11iii(_0x6dc437,_0x596ffa){const _0x5959af=li1llIiI();return liI11iii=function(_0xa639cc,_0x1c3ea7){_0xa639cc=_0xa639cc-0x17d;let _0x4ee27c=_0x5959af[_0xa639cc];if(liI11iii['uTZYQk']===undefined){var _0x22aa5d=function(_0x961ce3){const _0x3c7643='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x9193ab='',_0x54386e='';for(let _0x2402e9=0x0,_0x59a06f,_0x25d6c1,_0x440d5b=0x0;_0x25d6c1=_0x961ce3['charAt'](_0x440d5b++);~_0x25d6c1&&(_0x59a06f=_0x2402e9%0x4?_0x59a06f*0x40+_0x25d6c1:_0x25d6c1,_0x2402e9++%0x4)?_0x9193ab+=String['fromCharCode'](0xff&_0x59a06f>>(-0x2*_0x2402e9&0x6)):0x0){_0x25d6c1=_0x3c7643['indexOf'](_0x25d6c1);}for(let _0x2e9a7f=0x0,_0x2262a9=_0x9193ab['length'];_0x2e9a7f<_0x2262a9;_0x2e9a7f++){_0x54386e+='%'+('00'+_0x9193ab['charCodeAt'](_0x2e9a7f)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x54386e);};const _0x58579f=function(_0x42ad53,_0x36ad89){let _0x1256eb=[],_0x335374=0x0,_0x55d215,_0x3f8afd='';_0x42ad53=_0x22aa5d(_0x42ad53);let _0x23881e;for(_0x23881e=0x0;_0x23881e<0x100;_0x23881e++){_0x1256eb[_0x23881e]=_0x23881e;}for(_0x23881e=0x0;_0x23881e<0x100;_0x23881e++){_0x335374=(_0x335374+_0x1256eb[_0x23881e]+_0x36ad89['charCodeAt'](_0x23881e%_0x36ad89['length']))%0x100,_0x55d215=_0x1256eb[_0x23881e],_0x1256eb[_0x23881e]=_0x1256eb[_0x335374],_0x1256eb[_0x335374]=_0x55d215;}_0x23881e=0x0,_0x335374=0x0;for(let _0x45c687=0x0;_0x45c687<_0x42ad53['length'];_0x45c687++){_0x23881e=(_0x23881e+0x1)%0x100,_0x335374=(_0x335374+_0x1256eb[_0x23881e])%0x100,_0x55d215=_0x1256eb[_0x23881e],_0x1256eb[_0x23881e]=_0x1256eb[_0x335374],_0x1256eb[_0x335374]=_0x55d215,_0x3f8afd+=String['fromCharCode'](_0x42ad53['charCodeAt'](_0x45c687)^_0x1256eb[(_0x1256eb[_0x23881e]+_0x1256eb[_0x335374])%0x100]);}return _0x3f8afd;};liI11iii['sfQJtI']=_0x58579f,_0x6dc437=arguments,liI11iii['uTZYQk']=!!
|
|||
|
|
|||
|
// 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"])
|