KR/jd_dpqd.js

17 lines
55 KiB
JavaScript
Raw Normal View History

2023-07-27 16:14:01 +08:00
/*
常规店铺签到
环境变量: export DPQDTK="token1&token2" export DPQDTK="token1\ntoken2"
定时建议自行修改
cron:1 1 1 1 *
============Quantumultx===============
[task_local]
#常规店铺签到
1 1 1 1 * jd_dpqd.js, tag=常规店铺签到, enabled=true
*/
const $ = new Env('常规店铺签到')
2023-08-11 23:43:04 +08:00
var version_='jsjiami.com.v7';const IIIlii=iii1II;function iii1II(_0x28ab08,_0xcbeae3){const _0x43e161=Iii11l();return iii1II=function(_0x38dc96,_0x6a09d7){_0x38dc96=_0x38dc96-0x1d5;let _0x5462f7=_0x43e161[_0x38dc96];if(iii1II['fVxbrE']===undefined){var _0x71f5b7=function(_0x1cb797){const _0x3234b1='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x305a8d='',_0x23b9eb='';for(let _0x352f65=0x0,_0xe4a74a,_0x514a3a,_0xa944fd=0x0;_0x514a3a=_0x1cb797['charAt'](_0xa944fd++);~_0x514a3a&&(_0xe4a74a=_0x352f65%0x4?_0xe4a74a*0x40+_0x514a3a:_0x514a3a,_0x352f65++%0x4)?_0x305a8d+=String['fromCharCode'](0xff&_0xe4a74a>>(-0x2*_0x352f65&0x6)):0x0){_0x514a3a=_0x3234b1['indexOf'](_0x514a3a);}for(let _0x8259f9=0x0,_0x38a507=_0x305a8d['length'];_0x8259f9<_0x38a507;_0x8259f9++){_0x23b9eb+='%'+('00'+_0x305a8d['charCodeAt'](_0x8259f9)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x23b9eb);};const _0x3d1b9e=function(_0xd67d41,_0x50ef3d){let _0x517be4=[],_0x2072e7=0x0,_0x210a6e,_0x4684b9='';_0xd67d41=_0x71f5b7(_0xd67d41);let _0x450e83;for(_0x450e83=0x0;_0x450e83<0x100;_0x450e83++){_0x517be4[_0x450e83]=_0x450e83;}for(_0x450e83=0x0;_0x450e83<0x100;_0x450e83++){_0x2072e7=(_0x2072e7+_0x517be4[_0x450e83]+_0x50ef3d['charCodeAt'](_0x450e83%_0x50ef3d['length']))%0x100,_0x210a6e=_0x517be4[_0x450e83],_0x517be4[_0x450e83]=_0x517be4[_0x2072e7],_0x517be4[_0x2072e7]=_0x210a6e;}_0x450e83=0x0,_0x2072e7=0x0;for(let _0x41e406=0x0;_0x41e406<_0xd67d41['length'];_0x41e406++){_0x450e83=(_0x450e83+0x1)%0x100,_0x2072e7=(_0x2072e7+_0x517be4[_0x450e83])%0x100,_0x210a6e=_0x517be4[_0x450e83],_0x517be4[_0x450e83]=_0x517be4[_0x2072e7],_0x517be4[_0x2072e7]=_0x210a6e,_0x4684b9+=String['fromCharCode'](_0xd67d41['charCodeAt'](_0x41e406)^_0x517be4[(_0x517be4[_0x450e83]+_0x517be4[_0x2072e7])%0x100]);}return _0x4684b9;};iii1II['DiKzOp']=_0x3d1b9e,_0x28ab08=arguments,iii1II['fVxbrE']=!![];}const _0x1565f6=_0x43e161[0x0],_0x65aff5=_0x38dc96+_0x1565f6,_0x59d5e2=_0x28ab08[_0x65aff5];return!_0x59d5e2?(iii1II['vLCuOu']===undefined&&(iii1II['vLCuOu']=!![]),_0x5462f7=iii1II['DiKzOp'](_0x5462f7,_0x6a09d7),_0x28ab08[_0x65aff5]=_0x5462f7):_0x5462f7=_0x59d5e2,_0x5462f7;},iii1II(_0x28ab08,_0xcbeae3);}function Iii11l(){const ii1i1i=(function(){return[version_,'GljDHsxYjMiPaMmUCPiXwk.cdIomSI.SlTvd7BYW==','mc3cICo9uW','ymo2s8k6wCoPpSoYW6NcTeTjmq','kqFdSr/dSa','WRLHW6nN','56YW5yQD5OQV5yMz','W6KXWRldS8oe','WQjLW6r0sCk4','5B295yQR5BwF562I5yMWlq','cwaIW649','hfxdRCo1mmkVg8kPF8oYWPDSWOlcPgD4W7uxW5JdTvCaWO/cOSoNWQFcRSkGWPHNwSkLWQFdLwSrWRTUi8k2a0b4W6bAjmoaW7VdPSkOWQ9ZW4VdHCo9arNdVYddULqwvSk9W5lcKc0MBSoJW5lcVg7dO8kODej0W6RcR3ddSCorW6NdRCo9WR/dUsqLmmovwCoYb8k9W6NcS8owWQ0sgXBcTSoCWQhdQ8ojmmoptXrZWOqve8k+zhVdHdldI8o4W4FcQvzNyaVdPCo3W61xfx8','CcRcK2Cyd8kK','hw/cQIPL','kSksACo0W6u','tCkjW4L5','W5PIW4Ku','WOLsm8kyxq','W50zW5nfcMS','jrhdSbK','WPFdOmoLWOxdV8kBu8kIWQJcImkjW5ZdOX0','WQ/cUev1W4O','W47cUCkUBmoO','WR3cRCkuWPJcUmoPEN3cRW','W5VcGmkfs8ogoq','nSomh1ba','W59YzCkvWRG','dZxcKSofwq','W4RcUmk8W57cPa','ntVdHaJdSa','W5lcNXfdkW','baRcK8oYrW','W4hcKwzqWR9tWPS','WPtNUztMNlxML7ZPL4lVVia','WR0tcSoCW4a','ycRdMK8','iqZcGNiMEmo9WRNcQKy9gfxdK8keWRjrgSoMWOddJxxdK8ktW5BcSmoFW4CeW4SLoCkeW6CnoSonWRhcQchcP8onW5HLp8ktW4jqWRbBhIeUdMhdQhddNSkDWPDtW6bEW5ZdGCoVlMXkomkzyfpdVSoYWRVdLCoyacS','oCkEl8oooa','xSkhW59Vjq','aSkpWQikW4C','Fs7dJgmj','nCkmWRxdUv7cUWqCadv8qXZdKINdJmkEW4m','B+w5RUMqJ+MsUUAmTo++MSkUp1zodCo4nrODzmksWOVdT8oVFdpcJ8oQWPXfW7GIW6/cHc8ccCk7t3BdJdW','dX3cQSoBFSki','lmogW4VcNSoM','WONcHSk8WPhcUa','k1lcVsvw','EshcLCofW6K','WRijWOFcRxO','W7qYWOddRmoYmCokjg5aW4pOR5NMS5tLP5ZOTRFIGOFVUBO','W53cMbLsnGe','l8kbWPSJW6m','aNm1W7quW7OJW4RcImk+W7ldPICZW6PTWORcVmkilSoFWQTetfTcAezFeJhdTrTlF8kFF1lcS2qLurPGW6JdOW/cTSkHjcFdISkAW7xdPaJcTsldLSkzuhSyWRiEW6D7WRxcMYRcRCoXW5ddM8kUW4nojqisx8oEWOq/WPSHWQHzWP0kW43dIcRcTCoMywNcJ8kgDLakEdGOWQ/cSSoCz8kNWObKgSk2iSolW6bvWOvbWOSSW5zJvaqecmoIa8okWOtdRvhcT3VdGGSdkvFcJ3nbW5NcVhXiW5NcSZq0W7RdTuaAi8oLcmkdvmkOqaJdG2tcJfxdISo4qSkatCkyyCo4cf7cUJKDW7flgSkzW7KeW4KHW6VdV1ldLCofW4iaW6HUvmkYfKyDlrDkr8omhSkaC8olwSoLjIOEuZxdKmkDWQSCWO9ieCkpi8oJnSoKW4ldLKf5WODRWP7dLCoBW5ewW7StW
2023-07-27 16:14:01 +08:00
// prettier-ignore
function Env(t,e){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("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}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("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(a,(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"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.