mirror of https://github.com/6dylan6/jdpro.git
26 lines
58 KiB
JavaScript
26 lines
58 KiB
JavaScript
|
/*
|
|||
|
活动名称:店铺签到
|
|||
|
活动链接:https://h5.m.jd.com/babelDiy/Zeus/2PAAf74aG3D61qvfKUM5dxUssJQ9/index.html?token=<token>
|
|||
|
环境变量:jd_dpqd_token // 活动令牌,不支持多个
|
|||
|
jd_dpqd_account_threads // 控制账号并发线程数(正整数),默认1
|
|||
|
jd_dpqd_account_interval // 自定义运行间隔时长(整数,单位毫秒),默认0
|
|||
|
jd_dpqd_max_retry // 签到火爆时的最大重试次数(整数),默认0
|
|||
|
jd_dpqd_notify // 是否推送通知信息(true/false),默认不推送
|
|||
|
|
|||
|
此脚本为高并发单一签到本,自动过滤垃圾活动,与另外3个本无任何关联可单独运行
|
|||
|
|
|||
|
7 7 29 2 * jd_dpqd_single.js
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('单个店铺签到')
|
|||
|
const jdCookie = require('./jdCookie')
|
|||
|
const notify = require('./function/sendJDNotify')
|
|||
|
const common = require('./function/jdCommon')
|
|||
|
const { H5st, jsTk } = require('./function/jdCrypto')
|
|||
|
|
|||
|
var iil='jsjiami.com.v7';const I1Ii111l=l1IIIiIl;(function(l1i1lIi,iI11IlI1,Il1Ii1li,li111111,IlI1Ii1I,I1illl1I,iiii11lI){return l1i1lIi=l1i1lIi>>0x5,I1illl1I='hs',iiii11lI='hs',function(I1Iiii1,Ilill1li,i1li1I1l,I11IiII1,I1lIIII){const iiI1i1il=l1IIIiIl;I11IiII1='tfi',I1illl1I=I11IiII1+I1illl1I,I1lIIII='up',iiii11lI+=I1lIIII,I1illl1I=i1li1I1l(I1illl1I),iiii11lI=i1li1I1l(iiii11lI),i1li1I1l=0x0;const lilIll1l=I1Iiii1();while(!![]&&--li111111+Ilill1li){try{I11IiII1=-parseInt(iiI1i1il(0x195,'Uyh7'))/0x1*(-parseInt(iiI1i1il(0x39f,'&7wW'))/0x2)+parseInt(iiI1i1il(0x180,'Czze'))/0x3+parseInt(iiI1i1il(0x3cb,'&7wW'))/0x4+parseInt(iiI1i1il(0x33e,'^Uyj'))/0x5*(-parseInt(iiI1i1il(0x35c,'(lwu'))/0x6)+-parseInt(iiI1i1il(0x23f,'VVBt'))/0x7+-parseInt(iiI1i1il(0x2b8,'Czze'))/0x8+parseInt(iiI1i1il(0x216,'kR(!'))/0x9*(parseInt(iiI1i1il(0x1b8,'IkW%'))/0xa);}catch(Iiilil1l){I11IiII1=i1li1I1l;}finally{I1lIIII=lilIll1l[I1illl1I]();if(l1i1lIi<=li111111)i1li1I1l?IlI1Ii1I?I11IiII1=I1lIIII:IlI1Ii1I=I1lIIII:i1li1I1l=I1lIIII;else{if(i1li1I1l==IlI1Ii1I['replace'](/[ufQSOBDGndFAXYHeLMRNV=]/g,'')){if(I11IiII1===Ilill1li){lilIll1l['un'+I1illl1I](I1lIIII);break;}lilIll1l[iiii11lI](I1lIIII);}}}}}(Il1Ii1li,iI11IlI1,function(l11i1iI,IIllli1i,li1iIili,IllIi1Il,llIllI11,ilI1111I,III1iIll){return IIllli1i='\x73\x70\x6c\x69\x74',l11i1iI=arguments[0x0],l11i1iI=l11i1iI[IIllli1i](''),li1iIili=`\x72\x65\x76\x65\x72\x73\x65`,l11i1iI=l11i1iI[li1iIili]('\x76'),IllIi1Il=`\x6a\x6f\x69\x6e`,(0x1625ae,l11i1iI[IllIi1Il](''));});}(0x1920,0x53ad8,iiiliill,0xcb),iiiliill)&&(iil=`\xe22`);let token=process[I1Ii111l(0x283,'T9@E')][I1Ii111l(0x35a,'3T[h')]||'',accountThreads=process[I1Ii111l(0x278,'TXqj')][I1Ii111l(0x38c,'elgH')]||'1';const runInterval=process[I1Ii111l(0x1eb,'kR(!')][I1Ii111l(0x35b,')2&@')]||'';let signHotMaxRetryTimes=process[I1Ii111l(0x278,'TXqj')][I1Ii111l(0x249,'L7xV')]||'0';function l1IIIiIl(_0x4658db,_0x3d6b14){const _0x3d1727=iiiliill();return l1IIIiIl=function(_0x150475,_0x309ca3){_0x150475=_0x150475-0x147;let _0x4de084=_0x3d1727[_0x150475];if(l1IIIiIl['BFNpqG']===undefined){var _0x22063e=function(_0x56b6f1){const _0x3810e6='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x9a0803='',_0x3124e4='';for(let _0x2b8966=0x0,_0x256d81,_0x4f56e0,_0x3aae96=0x0;_0x4f56e0=_0x56b6f1['charAt'](_0x3aae96++);~_0x4f56e0&&(_0x256d81=_0x2b8966%0x4?_0x256d81*0x40+_0x4f56e0:_0x4f56e0,_0x2b8966++%0x4)?_0x9a0803+=String['fromCharCode'](0xff&_0x256d81>>(-0x2*_0x2b8966&0x6)):0x0){_0x4f56e0=_0x3810e6['indexOf'](_0x4f56e0);}for(let _0x1ad166=0x0,_0x47df32=_0x9a0803['length'];_0x1ad166<_0x47df32;_0x1ad166++){_0x3124e4+='%'+('00'+_0x9a0803['charCodeAt'](_0x1ad166)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x3124e4);};const _0x4ef75b=function(_0x110ccf,_0x4813b1){let _0x44d1b4=[],_0x228258=0x0,_0x393e7c,_0x4c2d6e='';_0x110ccf=_0x22063e(_0x110ccf);let _0x9eab6c;for(_0x9eab6c=0x0;_0x9eab6c<0x100;_0x9eab6c++){_0x44d1b4[_0x9eab6c]=_0x9eab6c;}for(_0x9eab6c=0x0;_0x9eab6c<0x100;_0x9eab6c++){_0x228258=(_0x228258+_0x44d1b4[_0x9eab6c]+_0x4813b1['charCodeAt'](_0x9eab6c%_0x4813b1['length']))%0x100,_0x393e7c=_0x44d1b4[_0x9eab6c],_0x44d1b4[_0x9eab6c]=_0x44d1b4[_0x228258],_0x44d1b4[_0x228258]=_0x393e7c;}_0x9eab6c=0x0,_0x228258=0x0;for(let _0x46005b=0x0;_0x46005b<_0x110ccf['length'];_0x46005b++){_0x9eab6c=(_0x9eab6c+0x1)%0x100,_0x228258=(_0x228258+_0x44d1b4[_0x9eab6c])%0x100,_0x393e7c=_0x44d1b4[_0x9eab6c],_0x44d1b4[_0x9eab6c]=_0x44d1b4[_0x228258],_0x44d1b4[_0x228258]=_0x393e7c,_0x4c2d6e+=String['fromCharCode'](_0x110ccf['charCodeAt'](_0x46005b)^_0x44d1b4[(_0x44d1b4[_0x9eab6c]+_0x44d1b4[_0x228258])%0x100]);}return _0x4c2d6e;};l1IIIiIl['jhmiqo']=_0x4ef75b,_0x4658db=arguments,l1IIIiIl['BFNpqG']=!![];}const _0x19d5c6=_0x3d1727[0x0],_0x50f825=_0x150475+_0x19d5c6,_0x5245b1=_0x4658db[_0x50f825];return!_0x5245b1?(l1IIIiIl['jdnzli']===undefined&&(l1IIIiIl['jdnzli']=!![]),_0x4de084=l1IIIiIl['jhmiqo'](_0x4de084,_0x309ca3),_0x4658db[_0x50f825]=_0x4de084):_0x4de084=_0x5245b1,_0x4de084;},l1IIIiIl(_0x4658db,_0x3d6b14);}function iiiliill(){const l1iIIlIl=(function(){r
|
|||
|
|
|||
|
// 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"])
|