jdpro/jd_dpqd_main.js

16 lines
104 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('批量店铺签到(活动查询)')
2024-08-02 16:46:49 +00:00
var _0xodq='jsjiami.com.v7';const _0x6352b0=_0x12da;(function(_0x3f8c62,_0x2559fe,_0x435e37,_0x35b057,_0x5a5b4b,_0x45cc2f,_0x222ad2){return _0x3f8c62=_0x3f8c62>>0x5,_0x45cc2f='hs',_0x222ad2='hs',function(_0x346b12,_0x371b1e,_0x4f5d9b,_0x2ad9a4,_0x537db9){const _0x5e1d8f=_0x12da;_0x2ad9a4='tfi',_0x45cc2f=_0x2ad9a4+_0x45cc2f,_0x537db9='up',_0x222ad2+=_0x537db9,_0x45cc2f=_0x4f5d9b(_0x45cc2f),_0x222ad2=_0x4f5d9b(_0x222ad2),_0x4f5d9b=0x0;const _0x473908=_0x346b12();while(!![]&&--_0x35b057+_0x371b1e){try{_0x2ad9a4=-parseInt(_0x5e1d8f(0x391,'&M!C'))/0x1*(parseInt(_0x5e1d8f(0x240,'U&Vx'))/0x2)+-parseInt(_0x5e1d8f(0x4dd,'S#7N'))/0x3+parseInt(_0x5e1d8f(0x2fd,'uwWs'))/0x4*(parseInt(_0x5e1d8f(0x3d1,'si1!'))/0x5)+parseInt(_0x5e1d8f(0x3f5,'@qv]'))/0x6+parseInt(_0x5e1d8f(0x29b,'o40D'))/0x7+-parseInt(_0x5e1d8f(0x505,'YQ)h'))/0x8*(parseInt(_0x5e1d8f(0x434,'DTXL'))/0x9)+-parseInt(_0x5e1d8f(0x48b,'tFdJ'))/0xa*(-parseInt(_0x5e1d8f(0x13e,'EBI0'))/0xb);}catch(_0x1f123a){_0x2ad9a4=_0x4f5d9b;}finally{_0x537db9=_0x473908[_0x45cc2f]();if(_0x3f8c62<=_0x35b057)_0x4f5d9b?_0x5a5b4b?_0x2ad9a4=_0x537db9:_0x5a5b4b=_0x537db9:_0x4f5d9b=_0x537db9;else{if(_0x4f5d9b==_0x5a5b4b['replace'](/[uDHKwVdhRCIFgQAnpLJy=]/g,'')){if(_0x2ad9a4===_0x371b1e){_0x473908['un'+_0x45cc2f](_0x537db9);break;}_0x473908[_0x222ad2](_0x537db9);}}}}}(_0x435e37,_0x2559fe,function(_0x4c4d4c,_0x25148d,_0x3dc7cd,_0x10521a,_0x4b3c6a,_0x24356f,_0x2cdac8){return _0x25148d='\x73\x70\x6c\x69\x74',_0x4c4d4c=arguments[0x0],_0x4c4d4c=_0x4c4d4c[_0x25148d](''),_0x3dc7cd=`\x72\x65\x76\x65\x72\x73\x65`,_0x4c4d4c=_0x4c4d4c[_0x3dc7cd]('\x76'),_0x10521a=`\x6a\x6f\x69\x6e`,(0x17c3c7,_0x4c4d4c[_0x10521a](''));});}(0x17e0,0x6d956,_0xb92f,0xc1),_0xb92f)&&(_0xodq=`\x496`);const _0x2e0a47=$[_0x6352b0(0x432,'o40D')]()?require(_0x6352b0(0x3ac,'oBVd')):'',_0x1b3bab=$[_0x6352b0(0x11a,'L)mP')]()?require(_0x6352b0(0x3de,'c1jl')):'',_0x44ac11=require(_0x6352b0(0x397,'U&Vx')),_0x5d83ab=require(_0x6352b0(0x128,'W)Mq')),_0x4e391e=require(_0x6352b0(0x360,'o40D')),_0x244237=require(_0x6352b0(0x5a3,'js)A'))[_0x6352b0(0x414,'*T]&')],_0x1cce7c=require('fs'),_0xc442f9=process[_0x6352b0(0x4f6,'U&Vx')][_0x6352b0(0x1a8,'3vXa')]==_0x6352b0(0x419,'a1@M')?!![]:![],_0x3100dc=__dirname+_0x6352b0(0x538,'UIvm');let _0x5d9dc1=[],_0x199bcb='',_0x330afd,_0x3ef572=0x0,_0x4eee36=null,_0x33106b=[_0x6352b0(0x12f,'Aj31')];const _0x3b0987=_0x6352b0(0x578,'RV(L'),_0x373ac0=new Date();_0x373ac0[_0x6352b0(0x450,'HjTw')](_0x373ac0[_0x6352b0(0x4c9,'o40D')]()+0x1),_0x373ac0[_0x6352b0(0x549,'J5D&')](0x0,0x0,0x0,0x0);if(process[_0x6352b0(0x3a3,'HC!S')][_0x6352b0(0x51f,'h[$f')])try{ccc=require(_0x6352b0(0x40f,'X&[e')),$[_0x6352b0(0x583,'JGqj')]=ccc[_0x6352b0(0x1f0,'TMr9')]($[_0x6352b0(0x546,'X&[e')][_0x6352b0(0x25a,'KF2q')]($)),$[_0x6352b0(0x197,'c1jl')]=ccc[_0x6352b0(0x207,'oBVd')]($[_0x6352b0(0x39d,'X&[e')][_0x6352b0(0x2fc,'@qv]')]($));}catch{$[_0x6352b0(0x39b,'&M!C')]=$[_0x6352b0(0x3d8,'OORk')],$[_0x6352b0(0x121,'o40D')]=$[_0x6352b0(0x23d,'*T]&')];}else $[_0x6352b0(0x35d,'BeTN')]=$[_0x6352b0(0x1b5,'js)A')],$[_0x6352b0(0x39b,'&M!C')]=$[_0x6352b0(0x1ad,'h[$f')];if($[_0x6352b0(0x1d1,'c1jl')]()){Object[_0x6352b0(0x204,'3vXa')](_0x1b3bab)[_0x6352b0(0x21a,'*]@s')](_0x5f54d7=>{const _0x4e76db=_0x6352b0;_0x5d9dc1[_0x4e76db(0x458,'Eyok')](_0x1b3bab[_0x5f54d7]);});if(process[_0x6352b0(0x357,'TG9v')][_0x6352b0(0x428,'byKO')]&&process[_0x6352b0(0x405,'X&[e')][_0x6352b0(0x2ee,'TG9v')]===_0x6352b0(0x1a6,'DO7F'))console[_0x6352b0(0x134,'HjTw')]=()=>{};}else{let _0x20f744=$[_0x6352b0(0x1b7,'@19l')](_0x6352b0(0x2b8,'S#7N'))||'[]';_0x20f744=_0x44f152(_0x20f744),_0x5d9dc1=_0x20f744[_0x6352b0(0x5cf,'!nlR')](_0x2cbc61=>_0x2cbc61[_0x6352b0(0x16f,'RV(L')]),_0x5d9dc1[_0x6352b0(0x1c5,'TUxy')](),_0x5d9dc1[_0x6352b0(0x59c,'DTXL')](...[$[_0x6352b0(0x1d3,'KF2q')](_0x6352b0(0x1bf,'!nlR')),$[_0x6352b0(0x5ad,'W)Mq')](_0x6352b0(0x3fe,'TUxy'))]),_0x5d9dc1[_0x6352b0(0x37a,'Eyok')](),_0x5d9dc1=_0x5d9dc1[_0x6352b0(0x2f5,'uwWs')](_0x47bf9b=>_0x47bf9b!==''&&_0x47bf9b!==null&&_0x47bf9b!==undefined);}function _0x12da(_0x195d86,_0x26ade0){const _0x2be979=_0xb92f();return _0x12da=function(
2024-06-28 07:47:44 +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"])