jdpro/jd_dpqd_main.js

16 lines
106 KiB
JavaScript
Raw Normal View History

2024-06-28 07:47:44 +00:00
/*
活动名称批量店铺签到活动查询
活动链接https://h5.m.jd.com/babelDiy/Zeus/2PAAf74aG3D61qvfKUM5dxUssJQ9/index.html?token=<token>
环境变量jd_dpqd_tokens // 活动令牌,多个用英文逗号,@&,换行分割
查询活动信息主脚本自动去重并过滤无效活动默认过滤垃圾奖品活动
运行后会在本地目录生成缓存文件以用于签到脚本使用IP限制严重请勿频繁运行
cron:1 1 1 1 *
*/
const $ = new Env('批量店铺签到(活动查询)')
var _0xodg='jsjiami.com.v7';const _0xf7f7c8=_0x4571;if(function(_0x21b1d9,_0x244ac1,_0x4bbf4a,_0x5b0b69,_0x4736d9,_0x30508c,_0x44a663){return _0x21b1d9=_0x21b1d9>>0x1,_0x30508c='hs',_0x44a663='hs',function(_0x4868c4,_0xa429a5,_0x49d22e,_0x330b7d,_0x5c788f){const _0x2b93ab=_0x4571;_0x330b7d='tfi',_0x30508c=_0x330b7d+_0x30508c,_0x5c788f='up',_0x44a663+=_0x5c788f,_0x30508c=_0x49d22e(_0x30508c),_0x44a663=_0x49d22e(_0x44a663),_0x49d22e=0x0;const _0x32e4ea=_0x4868c4();while(!![]&&--_0x5b0b69+_0xa429a5){try{_0x330b7d=-parseInt(_0x2b93ab(0x39d,'Rn3e'))/0x1+-parseInt(_0x2b93ab(0x23d,'cL@r'))/0x2*(parseInt(_0x2b93ab(0x170,'we57'))/0x3)+parseInt(_0x2b93ab(0x3c2,'Xsf('))/0x4+-parseInt(_0x2b93ab(0x1c5,'X4^P'))/0x5+parseInt(_0x2b93ab(0x34f,'cL@r'))/0x6+-parseInt(_0x2b93ab(0x123,'vBjz'))/0x7+-parseInt(_0x2b93ab(0x559,'3vaJ'))/0x8*(-parseInt(_0x2b93ab(0x2b6,'de7('))/0x9);}catch(_0x4047f9){_0x330b7d=_0x49d22e;}finally{_0x5c788f=_0x32e4ea[_0x30508c]();if(_0x21b1d9<=_0x5b0b69)_0x49d22e?_0x4736d9?_0x330b7d=_0x5c788f:_0x4736d9=_0x5c788f:_0x49d22e=_0x5c788f;else{if(_0x49d22e==_0x4736d9['replace'](/[wfLukYlOWMrBKnAqSIgGRT=]/g,'')){if(_0x330b7d===_0xa429a5){_0x32e4ea['un'+_0x30508c](_0x5c788f);break;}_0x32e4ea[_0x44a663](_0x5c788f);}}}}}(_0x4bbf4a,_0x244ac1,function(_0x51dd9f,_0x3432ee,_0x55b21b,_0x4c9e34,_0x159a44,_0x1417fe,_0x1082a8){return _0x3432ee='\x73\x70\x6c\x69\x74',_0x51dd9f=arguments[0x0],_0x51dd9f=_0x51dd9f[_0x3432ee](''),_0x55b21b=`\x72\x65\x76\x65\x72\x73\x65`,_0x51dd9f=_0x51dd9f[_0x55b21b]('\x76'),_0x4c9e34=`\x6a\x6f\x69\x6e`,(0x160cd5,_0x51dd9f[_0x4c9e34](''));});}(0x19a,0x562f5,_0x36b1,0xcf),_0x36b1){}const _0x9501cf=$[_0xf7f7c8(0x44a,'ZtY]')]()?require(_0xf7f7c8(0x551,'^weQ')):'',_0x26fc48=$[_0xf7f7c8(0x3a1,'^c8[')]()?require(_0xf7f7c8(0x560,'SnKI')):'',_0x4b2c3e=require(_0xf7f7c8(0x261,'LR4b')),_0x5673c7=require(_0xf7f7c8(0x33f,'h(y)')),_0x3759b1=require(_0xf7f7c8(0x35e,'YvEW')),_0x53a208=require(_0xf7f7c8(0xfe,'YvEW'))[_0xf7f7c8(0x13e,'we57')],_0x4f2767=require('fs'),_0x1fa251=__dirname+_0xf7f7c8(0x250,'[ui8');let _0x3f069a=[],_0x5975cd='',_0x59b714,_0x427825=0x0,_0x40cdb6=null,_0x5588ac=[_0xf7f7c8(0x142,'8wnw')];const _0x41ef1c=_0xf7f7c8(0x2b5,'LR4b'),_0x1c7ca6=new Date();_0x1c7ca6[_0xf7f7c8(0x145,'v5RY')](_0x1c7ca6[_0xf7f7c8(0x2bc,'*#vl')]()+0x1),_0x1c7ca6[_0xf7f7c8(0x420,'Puab')](0x0,0x0,0x0,0x0);function _0x36b1(){const _0x4705f2=(function(){return[...[_0xodg,'ujwqfsMjnKigGamWRkiBg.TcSAoYmKL.rvOI7glM==','W5xcIIBcKCoGF1/cJG','W4NcLSkdW5VdNG','amoDWPxcLdKxW6STtf1F','AJhdKWldLW','W7bEi8k3W7WOW4C0','WQRdVx8eW6q','5BYS5AAW5Pwj6zA67764','WPFcVmkCW77dKa','W4xdICk0BCk+zZxcHtZdNCozW4Dv','W6hcObtcGCox','WR3cJI5hW6G','D8kwx3tcN8oe','fCoUWQzaEW','tCoVoW','qSovpCoxca','cSobAwP6','W74TWROPxG','W43dKmoZDG','tr0syIe','bCkzFCoTWPW','wmoZjmodcW','W58QbuPc','tmoOpSoAavRcJ8oP','Bc49Ca','W6VdSb3cTGC','WQVdI2O','yspdUg1F','rSkEjCojpq','WR0Rmrri','Emklsu3cIa','WPubvmkyWObRWRPDtLJdVZ/cMSoOqCkOd8kSqmkpo0edW6P1WPWkAxZcQXdcUmoin1m','WORdKMSZmW','WPRcICklW4BdOq','umknDf3cVG','WRZcNvFdKGra','W5RdKXRcHJX1W4C','W6SPWP/ORBFMS77LPApOTQtIGBpVUjG','jSoVc1my','W4JdKSoZFJi7hqxdP8o/FG','lmoCBMPA','CSo7gCkvW4ZdT8oeWRSiW5lcJ8onWQiuWPHTbCkDWPZdQrSLECkrkwK1v8oeWPWqyCkpW47dUmkOvSoJwSoLF8kcW7ZcRmkXW6hcG0pdR8ktsvJdHNFdGJiNW7NdImk0WOZdNrKierRcVragaSk/WO3cVaBdMmkhWRWxW498','qHGhBmog','WQeIc8kSWO8','WRKTW7eIWRu','rcChyCoK','6kYQ5yUm6zQ95Ow85z+2iCoqWQHgW5hOVktLH6xMOipKVAFMLPBLHQpLR6CH5BU16k+u6yck6l2q6iwc5P6N5y+Z6iYQ5y+/fxmNW4ewkq','WQRcICkXW5NdN8kHW5K','cColuMTYWQ7cMq89W5hcT8orWQvn','w8oXiCoqgG','WRtcLvbcwG','WQxcOSkZW5hdVG','W4ZdMSk+DSoCjJZcHq','fMDadSkP','W7vCE+ITKUAYU+wLOEI3REkdN++4Pq','WRJcOXxdGSkU','W53cNSk5W4tdPG','AZHrrSotgaRcKuapWPWrWQRdRY7cKCkiWPOLqCo0WQTHW7LlW5qFW7WJx2HxWPb6rSkN','WQRcUXf3W7S','WPddL0yKjJasWR7dTsSulSkSWOm','W5fOu8oRWRm','WR7cOdrxW7lcTZzJ','gmo1WQi','FCk9CSoGjq','W4pdIa3cIW','WQRcLmk3W4ZdSW','d8oaAG','sSolWPJcLImA','W6u+WOmCxG','W68wcvT2','WRhdNCkeF8kqBq','WRFcQe5dzq','WQTwxbFcUXhdTSk0','WPBdNh4','W55QWO15WQ8','W5ldUs/cJru','jx5WaSkr','WPf1uZNcTq','DH/dNwLV','vCoeWOqEW5i','WP8EWQ7dMCk8','CConaG','d8oatcZdSG','WQeLWRtdH8ka','WPSRWOyAEa','WP/cI
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"])