faker3/jd_dpqd_sign.js

27 lines
45 KiB
JavaScript
Raw Normal View History

2024-06-28 15:38:28 +08:00
/*
活动名称批量店铺签到
活动链接https://h5.m.jd.com/babelDiy/Zeus/2PAAf74aG3D61qvfKUM5dxUssJQ9/index.html?token=<token>
环境变量jd_dpqd_tokens // 活动令牌,多个用英文逗号分割
jd_dpqd_task_threads // 控制签到并发线程数正整数默认1
jd_dpqd_account_threads // 控制账号并发线程数正整数默认1
jd_dpqd_account_interval // 自定义运行间隔时长整数单位毫秒默认0
jd_dpqd_max_retry // 签到火爆时的最大重试次数整数默认0
jd_dpqd_prize_notify // 是否推送中奖信息true/false默认不推送
此脚本为高并发签到本需要读取主脚本生成的活动信息缓存自动过滤无效活动
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 il='jsjiami.com.v7';const il1I1l1=ii1IIl1i;function ii1IIl1i(_0x36aaa4,_0x1b5c0f){const _0x32a26b=i1llIili();return ii1IIl1i=function(_0x1e8303,_0x2b02c9){_0x1e8303=_0x1e8303-0x79;let _0x3bc825=_0x32a26b[_0x1e8303];if(ii1IIl1i['soWhnM']===undefined){var _0x37dd73=function(_0x40a4b0){const _0x298f3b='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x18fdd8='',_0x2d78a2='';for(let _0x1e35db=0x0,_0x484d77,_0x5c41e5,_0x3fe0ab=0x0;_0x5c41e5=_0x40a4b0['charAt'](_0x3fe0ab++);~_0x5c41e5&&(_0x484d77=_0x1e35db%0x4?_0x484d77*0x40+_0x5c41e5:_0x5c41e5,_0x1e35db++%0x4)?_0x18fdd8+=String['fromCharCode'](0xff&_0x484d77>>(-0x2*_0x1e35db&0x6)):0x0){_0x5c41e5=_0x298f3b['indexOf'](_0x5c41e5);}for(let _0x7d5a6=0x0,_0x27978d=_0x18fdd8['length'];_0x7d5a6<_0x27978d;_0x7d5a6++){_0x2d78a2+='%'+('00'+_0x18fdd8['charCodeAt'](_0x7d5a6)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x2d78a2);};const _0x4203e9=function(_0x5af387,_0x47dc34){let _0x8f0a95=[],_0x557ae5=0x0,_0x3465a7,_0x29901b='';_0x5af387=_0x37dd73(_0x5af387);let _0x51468b;for(_0x51468b=0x0;_0x51468b<0x100;_0x51468b++){_0x8f0a95[_0x51468b]=_0x51468b;}for(_0x51468b=0x0;_0x51468b<0x100;_0x51468b++){_0x557ae5=(_0x557ae5+_0x8f0a95[_0x51468b]+_0x47dc34['charCodeAt'](_0x51468b%_0x47dc34['length']))%0x100,_0x3465a7=_0x8f0a95[_0x51468b],_0x8f0a95[_0x51468b]=_0x8f0a95[_0x557ae5],_0x8f0a95[_0x557ae5]=_0x3465a7;}_0x51468b=0x0,_0x557ae5=0x0;for(let _0x17e1b9=0x0;_0x17e1b9<_0x5af387['length'];_0x17e1b9++){_0x51468b=(_0x51468b+0x1)%0x100,_0x557ae5=(_0x557ae5+_0x8f0a95[_0x51468b])%0x100,_0x3465a7=_0x8f0a95[_0x51468b],_0x8f0a95[_0x51468b]=_0x8f0a95[_0x557ae5],_0x8f0a95[_0x557ae5]=_0x3465a7,_0x29901b+=String['fromCharCode'](_0x5af387['charCodeAt'](_0x17e1b9)^_0x8f0a95[(_0x8f0a95[_0x51468b]+_0x8f0a95[_0x557ae5])%0x100]);}return _0x29901b;};ii1IIl1i['IIGnFK']=_0x4203e9,_0x36aaa4=arguments,ii1IIl1i['soWhnM']=!![];}const _0x110c4f=_0x32a26b[0x0],_0xae3de2=_0x1e8303+_0x110c4f,_0x55ebb0=_0x36aaa4[_0xae3de2];return!_0x55ebb0?(ii1IIl1i['OFWaUu']===undefined&&(ii1IIl1i['OFWaUu']=!![]),_0x3bc825=ii1IIl1i['IIGnFK'](_0x3bc825,_0x2b02c9),_0x36aaa4[_0xae3de2]=_0x3bc825):_0x3bc825=_0x55ebb0,_0x3bc825;},ii1IIl1i(_0x36aaa4,_0x1b5c0f);}(function(lil1lil1,l1II1ll,I1liIl1i,li1I1lil,lII1ll,liIi1ili,Ii1iIii){return lil1lil1=lil1lil1>>0x2,liIi1ili='hs',Ii1iIii='hs',function(ili1i11,Illli11l,IlIIlII,lI11lliI,I11II11i){const Ii1lIi11=ii1IIl1i;lI11lliI='tfi',liIi1ili=lI11lliI+liIi1ili,I11II11i='up',Ii1iIii+=I11II11i,liIi1ili=IlIIlII(liIi1ili),Ii1iIii=IlIIlII(Ii1iIii),IlIIlII=0x0;const liIIi1i=ili1i11();while(!![]&&--li1I1lil+Illli11l){try{lI11lliI=-parseInt(Ii1lIi11(0x182,'Qej2'))/0x1*(-parseInt(Ii1lIi11(0x24d,'ZpbH'))/0x2)+-parseInt(Ii1lIi11(0x9f,'ZSlF'))/0x3+parseInt(Ii1lIi11(0xba,'8ltK'))/0x4+parseInt(Ii1lIi11(0x164,'S10E'))/0x5+parseInt(Ii1lIi11(0x81,'^eui'))/0x6+parseInt(Ii1lIi11(0x107,'pKPm'))/0x7+-parseInt(Ii1lIi11(0x226,'yX6&'))/0x8;}catch(il1l1liI){lI11lliI=IlIIlII;}finally{I11II11i=liIIi1i[liIi1ili]();if(lil1lil1<=li1I1lil)IlIIlII?lII1ll?lI11lliI=I11II11i:lII1ll=I11II11i:IlIIlII=I11II11i;else{if(IlIIlII==lII1ll['replace'](/[qVOrnEFltRbWuMgD=]/g,'')){if(lI11lliI===Illli11l){liIIi1i['un'+liIi1ili](I11II11i);break;}liIIi1i[Ii1iIii](I11II11i);}}}}}(I1liIl1i,l1II1ll,function(IIIIlI1l,i1l1Ilii,IIIillIi,I11iIiii,IIlii1li,iII1Ii1,i111l1I){return i1l1Ilii='\x73\x70\x6c\x69\x74',IIIIlI1l=arguments[0x0],IIIIlI1l=IIIIlI1l[i1l1Ilii](''),IIIillIi=`\x72\x65\x76\x65\x72\x73\x65`,IIIIlI1l=IIIIlI1l[IIIillIi]('\x76'),I11iIiii=`\x6a\x6f\x69\x6e`,(0x17202c,IIIIlI1l[I11iIiii](''));});}(0x31c,0x9fab0,i1llIili,0xc9),i1llIili)&&(il=i1llIili);let tokensList=(process[il1I1l1(0x1a2,'dNpS')][il1I1l1(0x17b,'R[Ks')]||'')[il1I1l1(0x221,'iy!#')](',')||[],taskThreads=process[il1I1l1(0x9a,'c4(!')][il1I1l1(0x93,'gSMa')]||'1',accountThreads=process[il1I1l1(0x24b,'*g^7')][il1I1l1(0x130,'ZSlF')]||'1';const runInterval=process[il1I1l1(0x16b,'114a')][il1I1l1(0x1a5,'runq')]||'';let signHotMaxRetryTimes=process[il1I1l1(0x231,'yI)F')][il1I1l1(0x179,'R[Ks')]||'0';const isNotify=process[il1I1l1(0x1be,'mNJt')][il1I1
// 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"])