jdpro/jd_dpqd_main.js

16 lines
120 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-09-23 07:51:45 +00:00
function _0x63FF160(){}var _0xB687727=Object['defineProperty'],_0x470F1E,_0x2438B7E,_0x90D39CB,_0x96E816,_0x3FAE09,_0x5BC4247,_0x70028A,_0x7639C3,_0x3F1396,_0x1C47E5,_0x1EBAD30,_0xA95CF7,_0xA7984A,_0x9EE068,_0x5E28AF,_0xCF6E7F1,_0x29A4654,_0x06074FF;function _0x12C9AEC(_0x63FF160){return _0x470F1E[_0x63FF160>0xec?_0x63FF160-0x49:_0x63FF160+0x15]}_0x470F1E=_0xC72D8C9();function _0x1D22633(_0x63FF160,_0xB687727){return _0x2438B7E.call(_0x12C9AEC(0x23),_0x63FF160,'length',{value:_0xB687727,configurable:!0x0})}_0x63FF160(_0x2438B7E=Object.defineProperty,_0x90D39CB=_0xF72D3F1((_0x63FF160,_0xB687727)=>{return _0xB687727(_0x63FF160())},0x2)(_0x43405B,_0xC70C1B));var _0xBA8E3C=[],_0xADD9273=['an*|^OBw',_0xBAA32F2(0x0),_0xBAA32F2(_0x12C9AEC(0x14)),'|9ErL1DS',_0xBAA32F2(0x2),_0xBAA32F2(0x3),_0xBAA32F2(0x4),_0xBAA32F2(_0x12C9AEC(0x1c)),_0xBAA32F2(_0x12C9AEC(0xe)),_0xBAA32F2(0x7),_0xBAA32F2(_0x12C9AEC(0x16)),_0xBAA32F2(_0x12C9AEC(0x4a)),_0xBAA32F2(0xa),_0xBAA32F2(0xb),_0xBAA32F2(_0x12C9AEC(0x24)),_0xBAA32F2(0xd),_0xBAA32F2(_0x12C9AEC(0x15)),_0xBAA32F2(_0x12C9AEC(-0x15)),_0xBAA32F2(0x10),_0xBAA32F2(_0x12C9AEC(-0x14)),_0xBAA32F2(0x12),_0xBAA32F2(0xd),_0xBAA32F2(_0x12C9AEC(-0x15)),_0xBAA32F2(_0x12C9AEC(-0x14)),_0xBAA32F2(_0x12C9AEC(0xd)),_0xBAA32F2(_0x12C9AEC(-0x14)),_0xBAA32F2(0x12),_0xBAA32F2(0xd),_0xBAA32F2(0x13),_0xBAA32F2(0x14),_0xBAA32F2(0x15),'rWL$X[|;C',_0xBAA32F2(_0x12C9AEC(-0x13)),_0xBAA32F2(_0x12C9AEC(0xae)),_0xBAA32F2(0x18),_0xBAA32F2(_0x12C9AEC(0x20)),_0xBAA32F2(0x1a),_0xBAA32F2(_0x12C9AEC(0xc0)),_0xBAA32F2(0x1c),_0xBAA32F2(_0x12C9AEC(0x28)),_0xBAA32F2(0x1e),_0xBAA32F2(_0x12C9AEC(0x2a)),_0xBAA32F2(0x20),_0xBAA32F2(_0x12C9AEC(-0x13)),_0xBAA32F2(0x21),_0xBAA32F2(0x22),_0xBAA32F2(_0x12C9AEC(0x27)),_0xBAA32F2(0x24),'E/B~K[h;"s5|+bWE;P',_0xBAA32F2(0x25),_0xBAA32F2(0x26),_0xBAA32F2(_0x12C9AEC(-0x13)),_0xBAA32F2(_0x12C9AEC(0x2d)),_0xBAA32F2(0x28),_0xBAA32F2(0x29),_0xBAA32F2(_0x12C9AEC(0x2c)),_0xBAA32F2(_0x12C9AEC(0x2e)),_0xBAA32F2(0x2c),_0xBAA32F2(_0x12C9AEC(0x1a)),'2e&r|6PP',_0xBAA32F2(_0x12C9AEC(-0x3)),_0xBAA32F2(_0x12C9AEC(0x4)),'7SFjs,9gh#m})s.1j|UghCp)vLJfj9FF88msya|%B<84K{;7$*#L/W!0j<haGLO0~M@MUH*?9OFpmH@1Z/uFcro}969n0n/de;Apd.)Yu',_0xBAA32F2(_0x12C9AEC(0x3b)),_0xBAA32F2(0x31),_0xBAA32F2(0x32),_0xBAA32F2(0x33),_0xBAA32F2(_0x12C9AEC(0x33)),_0xBAA32F2(0x1a),_0xBAA32F2(0x35),_0xBAA32F2(_0x12C9AEC(0x12)),_0xBAA32F2(_0x12C9AEC(0x40)),_0xBAA32F2(_0x12C9AEC(0x41)),_0xBAA32F2(0x39),_0xBAA32F2(_0x12C9AEC(0x1f)),_0xBAA32F2(0x39),_0xBAA32F2(_0x12C9AEC(0x4b)),_0xBAA32F2(0x3c),_0xBAA32F2(_0x12C9AEC(0x6d)),_0xBAA32F2(_0x12C9AEC(0x46)),_0xBAA32F2(_0x12C9AEC(0xb)),_0xBAA32F2(0x40),'c`QN82(NBd<Kk>({NZ7p>sMJ,8to05t9oOGE%&Y|',_0xBAA32F2(0x41),_0xBAA32F2(0x1a),_0xBAA32F2(0x2f),_0xBAA32F2(_0x12C9AEC(0x82)),_0xBAA32F2(0x43),_0xBAA32F2(_0x12C9AEC(0x48)),_0xBAA32F2(0x45),_0xBAA32F2(_0x12C9AEC(0x2b)),_0xBAA32F2(0x47),_0x12C9AEC(-0x9),_0xBAA32F2(0x48),_0xBAA32F2(_0x12C9AEC(0xea)),_0xBAA32F2(0x4a),_0xBAA32F2(0x4b),_0xBAA32F2(0x4c),_0xBAA32F2(_0x12C9AEC(0x49)),_0xBAA32F2(0x4e),_0xBAA32F2(_0x12C9AEC(0x5)),_0xBAA32F2(_0x12C9AEC(0x4c)),_0xBAA32F2(0x51),_0xBAA32F2(0x52),_0xBAA32F2(0x53),_0xBAA32F2(0x54),_0xBAA32F2(_0x12C9AEC(0x4d)),_0xBAA32F2(0x56),_0xBAA32F2(0x57),_0xBAA32F2(0x58),_0xBAA32F2(0x59),_0xBAA32F2(0x5a),_0xBAA32F2(0x5b),_0xBAA32F2(0x5c),_0xBAA32F2(_0x12C9AEC(-0x8)),_0xBAA32F2(0x5d),_0xBAA32F2(_0x12C9AEC(0x53)),_0xBAA32F2(0x5f),_0xBAA32F2(0x60),_0xBAA32F2(_0x12C9AEC(0x54)),_0xBAA32F2(0x62),_0xBAA32F2(_0x12C9AEC(0x55)),_0xBAA32F2(0x64),_0xBAA32F2(0x26),_0xBAA32F2(0x65),_0xBAA32F2(_0x12C9AEC(-0x7)),_0xBAA32F2(0x67),_0xBAA32F2(_0x12C9AEC(0x96)),_0xBAA32F2(_0x12C9AEC(-0x6)),_0xBAA32F2(0x6a),_0xBAA32F2(_0x12C9AEC(0x2)),_0xBAA32F2(_0x12C9AEC(-0xc)),_0xBAA32F2(0x6d),_0xBAA32F2(0x6e),_0xBAA32F2(0x6f),_0xBAA32F2(_0x12C9AEC(-0xb)),'aO}8xLRuZBAUB&AF`Z2y@pdz7LE@uUd~o/Naunp|=yM',_0xBAA32F2(0x71),'vuR!m1f|',_0xBAA32F2(0x72),_0xBAA32F2(0x73),_0xBAA32F2(0x74),_0xBAA32F2(0x75),_0xBAA32F2(0x76),_0xBAA32F2(0x77),'M5?+5?H|',_0xBAA32F2(0x78),_0xBAA32F2(_0x12C9AEC(0x5f)),_0xBAA32F2(_0x12C9AEC(0x50)),_0xBAA32F2(_0x12C9AEC(0x60)),_0xBAA32F2(0x7c),_0xBAA32F2(0x7d),_0x
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"])