faker2/jd_dpqd_record.js

19 lines
24 KiB
JavaScript
Raw Permalink Normal View History

2024-06-28 07:27:40 +00: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
2024-07-14 14:58:48 +00:00
jd_dpqd_account_interval // 自定义运行间隔时长整数单位毫秒默认1000
2024-06-28 07:27:40 +00:00
此脚本为高并发历史查询本需要读取主脚本生成的活动信息缓存
脚本主要用于查询连签天数不会进行签到操作为了提高签到本的效率故将此功能分离
2024-07-14 13:16:18 +00:00
cron:1 1 1 1 *
2024-06-28 07:27:40 +00:00
*/
const $ = new Env('批量店铺签到(历史查询)')
2024-07-14 14:58:48 +00:00
const _0x20e94e=_0x1356;(function(_0x2df580,_0x2c49df){const _0x2b899d=_0x1356,_0xd9aa7=_0x2df580();while(!![]){try{const _0x6a0d8a=parseInt(_0x2b899d(0xf5,']KOJ'))/0x1+-parseInt(_0x2b899d(0x16c,'%m4P'))/0x2*(-parseInt(_0x2b899d(0x117,'ALvg'))/0x3)+-parseInt(_0x2b899d(0x121,'Kd)L'))/0x4*(parseInt(_0x2b899d(0x160,'iVgd'))/0x5)+parseInt(_0x2b899d(0x137,'5Y98'))/0x6+parseInt(_0x2b899d(0x135,'ALvg'))/0x7*(-parseInt(_0x2b899d(0x132,'(1HB'))/0x8)+parseInt(_0x2b899d(0x146,'**8x'))/0x9*(parseInt(_0x2b899d(0xf2,'Kd)L'))/0xa)+parseInt(_0x2b899d(0x12e,'!WZE'))/0xb*(-parseInt(_0x2b899d(0x12d,'!WZE'))/0xc);if(_0x6a0d8a===_0x2c49df)break;else _0xd9aa7['push'](_0xd9aa7['shift']());}catch(_0x1b66a1){_0xd9aa7['push'](_0xd9aa7['shift']());}}}(_0x323f,0x67e92));const jdCookie=require('./jdCookie'),notify=require(_0x20e94e(0x111,'1Q7N')),common=require(_0x20e94e(0xf9,'lOgR')),{jsTk}=require(_0x20e94e(0x140,'Kd)L'));console['log'](''),console[_0x20e94e(0x104,'IuQK')](_0x20e94e(0x169,'PIGh')+$[_0x20e94e(0x15c,'R$GJ')]+'变量说明=========='),console[_0x20e94e(0x145,'5odT')](_0x20e94e(0xed,'iVgd')),console[_0x20e94e(0xfe,'zzi*')](_0x20e94e(0x143,'K*]N')),console[_0x20e94e(0xee,'gl3B')]('jd_dpqd_account_threads\x20//\x20控制账号并发默认1'),console[_0x20e94e(0x122,'3W^A')]('jd_dpqd_account_interval\x20//\x20自定义运行间隔时长'),console['log'](_0x20e94e(0x123,'!WZE')+$[_0x20e94e(0x10e,'gl3B')]+_0x20e94e(0x178,'CUQB')),console[_0x20e94e(0x145,'5odT')]('');let tokensList=(process[_0x20e94e(0x16d,'%m4P')][_0x20e94e(0x16f,'R$GJ')]||'')['split'](/[,@&|\n]+/g)[_0x20e94e(0x161,'1J$a')](Boolean),taskThreads=process['env']['jd_dpqd_task_threads']||'1',accountThreads=process[_0x20e94e(0xfb,'zZ)[')][_0x20e94e(0x127,'IuQK')]||'1';const runInterval=process[_0x20e94e(0x16e,'iVgd')][_0x20e94e(0x118,'ALvg')]||_0x20e94e(0x16a,'wHXr'),isNotify=![];function _0x1356(_0x908390,_0x84bc2c){const _0x323f2a=_0x323f();return _0x1356=function(_0x135670,_0xcb2f5d){_0x135670=_0x135670-0xeb;let _0x25e713=_0x323f2a[_0x135670];if(_0x1356['ijAIyS']===undefined){var _0x4beaf1=function(_0x216be6){const _0x38d8c2='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x3ddc0f='',_0x4be639='';for(let _0x363c43=0x0,_0x4f87e1,_0x1a3dcd,_0x5474bb=0x0;_0x1a3dcd=_0x216be6['charAt'](_0x5474bb++);~_0x1a3dcd&&(_0x4f87e1=_0x363c43%0x4?_0x4f87e1*0x40+_0x1a3dcd:_0x1a3dcd,_0x363c43++%0x4)?_0x3ddc0f+=String['fromCharCode'](0xff&_0x4f87e1>>(-0x2*_0x363c43&0x6)):0x0){_0x1a3dcd=_0x38d8c2['indexOf'](_0x1a3dcd);}for(let _0x9865a2=0x0,_0x2eff59=_0x3ddc0f['length'];_0x9865a2<_0x2eff59;_0x9865a2++){_0x4be639+='%'+('00'+_0x3ddc0f['charCodeAt'](_0x9865a2)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x4be639);};const _0x3067c1=function(_0x43937a,_0x275a5d){let _0x4dfc81=[],_0x3a3d24=0x0,_0x56d3cd,_0x4ab6ff='';_0x43937a=_0x4beaf1(_0x43937a);let _0x1a702c;for(_0x1a702c=0x0;_0x1a702c<0x100;_0x1a702c++){_0x4dfc81[_0x1a702c]=_0x1a702c;}for(_0x1a702c=0x0;_0x1a702c<0x100;_0x1a702c++){_0x3a3d24=(_0x3a3d24+_0x4dfc81[_0x1a702c]+_0x275a5d['charCodeAt'](_0x1a702c%_0x275a5d['length']))%0x100,_0x56d3cd=_0x4dfc81[_0x1a702c],_0x4dfc81[_0x1a702c]=_0x4dfc81[_0x3a3d24],_0x4dfc81[_0x3a3d24]=_0x56d3cd;}_0x1a702c=0x0,_0x3a3d24=0x0;for(let _0x380ccf=0x0;_0x380ccf<_0x43937a['length'];_0x380ccf++){_0x1a702c=(_0x1a702c+0x1)%0x100,_0x3a3d24=(_0x3a3d24+_0x4dfc81[_0x1a702c])%0x100,_0x56d3cd=_0x4dfc81[_0x1a702c],_0x4dfc81[_0x1a702c]=_0x4dfc81[_0x3a3d24],_0x4dfc81[_0x3a3d24]=_0x56d3cd,_0x4ab6ff+=String['fromCharCode'](_0x43937a['charCodeAt'](_0x380ccf)^_0x4dfc81[(_0x4dfc81[_0x1a702c]+_0x4dfc81[_0x3a3d24])%0x100]);}return _0x4ab6ff;};_0x1356['IrgcxL']=_0x3067c1,_0x908390=arguments,_0x1356['ijAIyS']=!![];}const _0x584760=_0x323f2a[0x0],_0x33264=_0x135670+_0x584760,_0x4a54f6=_0x908390[_0x33264];return!_0x4a54f6?(_0x1356['sJCyfp']===undefined&&(_0x1356['sJCyfp']=!![]),_0x25e713=_0x1356['IrgcxL'](_0x25e713,_0xcb2f5d),_0x908390[_0x33264]=_0x25e713):_0x25e713=_0x4a54f6,_0x25e713;},_0x1356(_0x908390,_0x84bc2c);}let TokensMap=new Map();function _0x323f(){const _0x2d7b39=['WPfRv1zkW7myWQm
2024-06-28 07:27:40 +00:00
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"])