jdpro/jd_dpqd_main.js

16 lines
116 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 17:07:31 +00:00
var _0xodC='jsjiami.com.v7';function _0x48ef(){const _0x3a30c5=(function(){return[...[_0xodC,'EfjUHsuYjMiSOYaTBmBiGY.conymw.euvK7wuUMn==','WRddRaSI','W5KQW7HAAa','WRRcSxO','W49hf1VcMSoma8oUWOTBWRJcNCkzz8kJibZcVCkuWOdcOa','WRWwW51SW6a','W7zQWPSkWPy','W5S6kJP7','cIJcMx/cSa','zZ8wWRxcJW','nvH1jSodCq','yefpW5u','W6bClvFcOa','5BYQ5Ask5Pw36zsw776O','WQGGWO8sW48','WRdcK2GLWQnC','WQegW4P/W4S','dWtcVG','W5xdG8k5','W5a1W694xXxcRM99ccdcRgShW6iiWOZdUghcQ8oVW4G/pmkCuYNdPc98WPGqxbVcTmoUWOqdjLlcNmkHW7tcMSkgW784DSoyWQu0lXNcLmo+bSk7sM8RWO59lNuEqrtcR8odl8odWRJcM8ksW7BcKK/dJt3cTCojcmk4vmo4WQtdNvNcH8kWbshdTG','W5iLW4rSxf7dPr9OfYldP2HA','s25QrXZdHG','WRRdVGm0W5ZdRW','hN1NW5xcNa','W5ikpa','gwRdSCo8WRSxWOy','WQe+WP4oW4i','mSkUdmk0pa','DmoMoqLf','D8oxdIfVW7pdKa','W7aBW5jYEW','W5yopcnF','W4WllJbh','dqtcRG','gmkGfICc','ASo4WQdcP0a','W6tdHSkInCoS','mCo0WQddSLq','DH1JemkK','cstcNwpcIq','l0jWn8oo','sdeoWQdcSG','WP3cIcbbjIGTfHi','W5iQWROKWQ4','WPtdGCk9WQZcVa','CuBdM2mX','sCk/A8kucwdcLq','WQ3dNCk7','W5y0W7zQsv0','qZem','WQycWPC1W68','W4hdM8kOg8o/xG','WPVdHsC+W5W','WRXGW5pcVLa','EmkdW6ZcKSoD','l8kfbJez','WRZcKSkQW7ZcNq','566q5yUmagmB6k6l5Rcg5Awk6lws4Oct77Q+','WOqcWRtdHK8','c8oWWRK','WOWEBCkjWQK','W4ldIWhcKNe','WPq8WO8','aSk9dYWL','jSkhiCkkaq','CX4mWP/cQW','fmk2oZ8f','iCotWO/dT0G','hvbUW7K','dYHDwJRdP8oMW6S','WOi6WPyUW7v0WRnE','uc5LjCkJaJCwrH0Fr8kUWRbTW6e','W6JdMCkNv8kF','WP3dSCkoh8ku','WRZdUbqMW6W','W53dI8k7Ba','setdJea8','W43cVUESRUwlKUwKKEI2LNtPHz3OQ6hINRtVU6ZINPhVUltINBhVUR8','WP8NWPq8W75N','WQrEW5VcM1K','5BU26zkA5zo256E377+e5P2l6iYm5yYU5yMW772dhow5SEMrO+MsLoApO++/OoADHUInREwoHowiMo+8Ia','W71RfetcLG','WPjfnb7cJW','orZcHepcMq','WPiNwIn5','WPhdUaWmW5W','hKL7hSod','iwjCemo4','WRFcM2i6','dCoRWQ9Vsa','WRNcTxazWO0','WRWGs8k9WRa','wmoOggtcNCkMamkB','W6RdGmkqvCkc','W7NdRtZcJuFdMJy','gvrRW63cNa','obxcNvBcRa','vSkPsCkFc3VcSMG','Ax/dKeCJ','WPVcOCoyW78TaxtdJa','W44IW5dcOce','WO0qWRpdH0qj','i8oWWRXewXvxW77cKCoVW4i','WOSPAmooWQa','W6pcP3/cPg/cM8k+','aSkrW7TPWRldHSk3pCogWQKXWPzeWO8SnCkFW7z2W6lcGq','W4bnf0JcH8ok','mCk1fY8X','u07dGeGcfSkjWR5wdalcRHtdMG','WPCbWPhdHNu','E8owWQW','qdWVWRpcPW','W6xdJCkIjCo8','WOddP8kwWQ7cNmoR','kCkuW7P2WR0','W7ddJCkgECk4','WRpdR8kdWPZcLa','emk6W6n3WQG','cCoWWQK','WQ0gCSkxWQS','CCkUumkdaa','WOuExYX0','iCkqx24VWRlcKuFcLSkZWRRdM1qQWQpcRCkTt8kJrmkeWPFcLSoQW7jat30mW7aBzv7cMmkRWRybW4yaWRP8p8kdECoVWPBcJHrkAJSSgmkZW6zMnSofW7PPW53cUCoyW4XKW7yaWQZcPKZcOqP2W7WCWQlcHYlcH8oO','r3vyW7Pg','W4PtWRSaWQK','z8oVbYbU','FCoWnCog','hwtdRmohWRW','l0DvoCoG','WR0/s8kiWRC','v8kUWQPWxGvmW4G','zmkUC8k3ca','fLDKW7JcNJ8D','vJuwWQhcSwq','vKbLxqe','WRjmcMjU','WRRcJ2SHWQ1qkG','W5WGW69P','WRvZpNTQ','W7yajYTEDSkTvq','W5VdKCkXpmok','fW7cP3dcNW10da','WP/cOSooW48N','qJz6oCkiacuhzHWxbW','C8o2gGWWWOG9wG','rCo/c20','gSkDhSkKibhcN1y','WRlcJhCIWRm','ACoKmSop','W6LCpfVcTG','5PAF6lg/5PEG57I/5y+J77285y6u6io256Ab5yUGWQdLJlBKVORMGBdLIzxVVQ0','d2bQW4VcTG','ACoSnConWRukh8kb','WPjXkvT1WPK','WQ4+yr9R','E2ldUwCJ','WQtdPb0I','WOxdPmkohmki','iSkncryn','W6BcNmkRaSktbvBdM8kwpSknymo2W6jPC8odhsO','gmk9qCkbcNpcVW','WRFcSZn5ha','mMynW7v3suX2WOORWO1MdSoHESo5iJxcPvhdQr9aW4xdRu/cHdz8cJuC','WPfhdMn6','WO8BuHbKF8oi','aGBcGuRcPG','iSoSWPHWyG','W5pdUCkOWPpdOW','WP3cLc5dpb0PhG','WQtdUqCSW5W','o09lW5BcRa','WQzfccZcSW','AevvW5naga','v8kfWQpcLGe','WQS0W6b+W7O','WOKJW75aW5i','dwRdPmoSWRCB','fSo3WQfzEab7W5/cUCo1W4hdIa','xtT7lSk+cq','ux7dQCkXWRasWOTkWQBcGSkcbmkvu8kJW6NdO0NcOMPFzgiTWPC','ECkKW6NcJCoO','vdbJ','WQe3qHbk','m8kJlSkSoG','WQldV8kJomkt','WPdMLQhcSG','bd7cG1lcGa','Aw1XW5T+','WOO8rCkJWQ0','5B+H5Awp5Psd6zs/77+2','WQRdKCkRd8kh','eSkBW7rVWRJdGa','W67dR8k/WOddLb3dRa','WOhcJui+WO4','WPyHWQtdGfu','bCkFcrCh','vCoNd2K','W5ddGSk6FCkx','WOPxiLP8','W7ldH8kof8od','j8krW6DWWRRdNmkDhmo3WQ89','tmkPsCkCgMe','W6T4hwNcHG','W4PtWRSaWQKPW64TvW','W4y5mc5w','xCozWQVcRLe','f2hdSCo7WQysWPXFW5BcGSkibmkhx8k2WPNdS07cO3XLAISWWQaWy2lcOCoPmSoPWQ/cTCopyhTtWQap','WOdcNsXw','nbxcRetcKW','gchdT8kqWR0','xSoblgdcUa','W53dPbJcPvy','WPBdTSkCWR/cICozsuD/WQ4tW5xcKa','WQFdSJKEW6G','WP7dGIu7W7O','cvX1omoU','e8okWRi','xCoLphZcSG','sSocWPy3tW','W4zMewNcQG','FaiqWO7cJG','h8olWRC','aGZcJfdcRq','ghzLW7tcTW','WO5fWRnjW78','wmo1n2FcJ8kRcW','W45Qp0JcQ
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"])