faker3/jd_dpqd_single.js

20 lines
35 KiB
JavaScript
Raw Normal View History

2024-06-28 15:38:28 +08:00
/*
2024-07-14 22:58:54 +08:00
活动名称常规店铺签到监控
2024-06-28 15:38:28 +08:00
活动链接https://h5.m.jd.com/babelDiy/Zeus/2PAAf74aG3D61qvfKUM5dxUssJQ9/index.html?token=<token>
2024-07-14 22:58:54 +08:00
环境变量jd_dpqd_single_token // 活动令牌,不支持多个
2024-06-28 15:38:28 +08:00
jd_dpqd_account_threads // 控制账号并发线程数正整数默认1
2024-07-14 22:58:54 +08:00
jd_dpqd_account_interval // 自定义运行间隔时长整数单位毫秒默认1000
2024-06-28 15:38:28 +08:00
jd_dpqd_max_retry // 签到火爆时的最大重试次数整数默认0
jd_dpqd_notify // 是否推送通知信息true/false默认不推送
此脚本为高并发单一签到本自动过滤垃圾活动与另外3个本无任何关联可单独运行
2024-07-14 22:58:54 +08:00
1 1 1 1 *
2024-06-28 15:38:28 +08:00
*/
2024-07-14 22:58:54 +08:00
const $ = new Env('常规店铺签到监控')
const _0x1668f4=_0x35fb;(function(_0x48d460,_0x1cf17c){const _0x525381=_0x35fb,_0x5eac9a=_0x48d460();while(!![]){try{const _0x4ac842=-parseInt(_0x525381(0x218,'JUi3'))/0x1*(-parseInt(_0x525381(0x30d,'lP4F'))/0x2)+parseInt(_0x525381(0x2f5,'BPbO'))/0x3+-parseInt(_0x525381(0x1fe,'XnuV'))/0x4*(-parseInt(_0x525381(0x1f7,'e6I('))/0x5)+parseInt(_0x525381(0x2c2,'i1P]'))/0x6+-parseInt(_0x525381(0x242,'[bp6'))/0x7*(parseInt(_0x525381(0x29e,'hE%a'))/0x8)+parseInt(_0x525381(0x225,'r3tO'))/0x9+-parseInt(_0x525381(0x2ba,'CI!z'))/0xa;if(_0x4ac842===_0x1cf17c)break;else _0x5eac9a['push'](_0x5eac9a['shift']());}catch(_0x1ce109){_0x5eac9a['push'](_0x5eac9a['shift']());}}}(_0x3d0b,0xb003e));const jdCookie=require('./jdCookie'),notify=require(_0x1668f4(0x2bc,'x0vQ')),common=require(_0x1668f4(0x2e4,'k7T@')),{H5st,jsTk}=require(_0x1668f4(0x2eb,'3TWU'));function _0x35fb(_0x2a00cf,_0x4f56ec){const _0x3d0b4e=_0x3d0b();return _0x35fb=function(_0x35fb0c,_0x392e59){_0x35fb0c=_0x35fb0c-0x1e0;let _0x595035=_0x3d0b4e[_0x35fb0c];if(_0x35fb['DJVwJt']===undefined){var _0x253ecc=function(_0x25d1ad){const _0x7233='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x5166db='',_0x1c21a8='';for(let _0x52ccd8=0x0,_0x1b194d,_0xb871c7,_0x307fc0=0x0;_0xb871c7=_0x25d1ad['charAt'](_0x307fc0++);~_0xb871c7&&(_0x1b194d=_0x52ccd8%0x4?_0x1b194d*0x40+_0xb871c7:_0xb871c7,_0x52ccd8++%0x4)?_0x5166db+=String['fromCharCode'](0xff&_0x1b194d>>(-0x2*_0x52ccd8&0x6)):0x0){_0xb871c7=_0x7233['indexOf'](_0xb871c7);}for(let _0x57c08a=0x0,_0x4b6edb=_0x5166db['length'];_0x57c08a<_0x4b6edb;_0x57c08a++){_0x1c21a8+='%'+('00'+_0x5166db['charCodeAt'](_0x57c08a)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x1c21a8);};const _0x2dfd6c=function(_0x235c27,_0x32c534){let _0x61599d=[],_0x548e0c=0x0,_0x105663,_0x187d1c='';_0x235c27=_0x253ecc(_0x235c27);let _0x32a588;for(_0x32a588=0x0;_0x32a588<0x100;_0x32a588++){_0x61599d[_0x32a588]=_0x32a588;}for(_0x32a588=0x0;_0x32a588<0x100;_0x32a588++){_0x548e0c=(_0x548e0c+_0x61599d[_0x32a588]+_0x32c534['charCodeAt'](_0x32a588%_0x32c534['length']))%0x100,_0x105663=_0x61599d[_0x32a588],_0x61599d[_0x32a588]=_0x61599d[_0x548e0c],_0x61599d[_0x548e0c]=_0x105663;}_0x32a588=0x0,_0x548e0c=0x0;for(let _0x1c326f=0x0;_0x1c326f<_0x235c27['length'];_0x1c326f++){_0x32a588=(_0x32a588+0x1)%0x100,_0x548e0c=(_0x548e0c+_0x61599d[_0x32a588])%0x100,_0x105663=_0x61599d[_0x32a588],_0x61599d[_0x32a588]=_0x61599d[_0x548e0c],_0x61599d[_0x548e0c]=_0x105663,_0x187d1c+=String['fromCharCode'](_0x235c27['charCodeAt'](_0x1c326f)^_0x61599d[(_0x61599d[_0x32a588]+_0x61599d[_0x548e0c])%0x100]);}return _0x187d1c;};_0x35fb['jFaBGR']=_0x2dfd6c,_0x2a00cf=arguments,_0x35fb['DJVwJt']=!![];}const _0x172c9a=_0x3d0b4e[0x0],_0x450873=_0x35fb0c+_0x172c9a,_0x89bb64=_0x2a00cf[_0x450873];return!_0x89bb64?(_0x35fb['YwayLV']===undefined&&(_0x35fb['YwayLV']=!![]),_0x595035=_0x35fb['jFaBGR'](_0x595035,_0x392e59),_0x2a00cf[_0x450873]=_0x595035):_0x595035=_0x89bb64,_0x595035;},_0x35fb(_0x2a00cf,_0x4f56ec);}let token=process[_0x1668f4(0x202,'lP4F')][_0x1668f4(0x2be,'e6I(')]||'',accountThreads=process[_0x1668f4(0x228,'l73O')][_0x1668f4(0x2c1,'wOt%')]||'1';const runInterval=process[_0x1668f4(0x2aa,'rdsG')][_0x1668f4(0x311,'BPbO')]||_0x1668f4(0x22f,']02G');let signHotMaxRetryTimes=process[_0x1668f4(0x1fb,'VnPM')][_0x1668f4(0x23d,'EyPU')]||'0';const isNotify=process[_0x1668f4(0x2bd,'5[Jb')][_0x1668f4(0x23e,'8LKY')]===_0x1668f4(0x303,'i1P]'),activityUrl='https://h5.m.jd.com/babelDiy/Zeus/2PAAf74aG3D61qvfKUM5dxUssJQ9/index.html?token='+token,signStatusMessages={0x1805c007:_0x1668f4(0x272,'8LKY'),0x181688ea:_0x1668f4(0x2d5,'$Nh['),0x1843da61:_0x1668f4(0x21e,'l73O'),0x1843da62:_0x1668f4(0x214,'5[Jb'),0x184253c7:'账号无效',0x192:_0x1668f4(0x2b1,'UpQm'),'-1':_0x1668f4(0x2d1,'JUi3')},cookiesArr=Object[_0x1668f4(0x2cd,'BPbO')](jdCookie)[_0x1668f4(0x265,'RU3E')](_0x2dfd6c=>jdCookie[_0x2dfd6c])[_0x1668f4(0x25b,'^iW%')](_0x25d1ad=>_0x25d1ad);!cookiesArr[0x0]&&($[_0x1668f4(0x263,'PXtM')]($[_0x1668f4(0x23f,'EaYq')],_0x1668f4(0x2d7,'EyPU')),process[_0x1668f4(0x258,'@pGm')](0x1));!(async()=>{
2024-06-28 15:38:28 +08:00
// 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"])