jdpro/jd_market_exchange.js

17 lines
83 KiB
JavaScript
Raw Permalink Normal View History

2024-09-01 08:07:54 +00:00
/*
活动名称超市汪贝兑好礼
活动入口APP-京东超市-每日签到赚汪贝-兑换
活动建议定时自行修改兑换都是卷并且需要PULS会员才能免运费
活动变量jd_market_exchange // 填写兑换值,指定兑换奖品,不填不兑换(查看打印兑换值)
jd_market_notify // 是否推送通知,默认不推送
jd_market_pinFilter // 账号pin过滤多个pin用@分隔,默认不过滤
cron:1 1 1 1 *
*/
const $ = new Env('超市汪贝兑好礼')
function ATe0ZFo(){}var y7ZOCyv=Object['defineProperty'],bgWE2G,YfJAv9o,dZ5PcO,EQOYv4r,Zrm24I,CKbiIf,Kf1HM7,MuECXNy,CiV7oIY,__YrjV,RdiHzsq,CcykMx,eDWSvHD,RGWXex,WikonWe,_MBlncT,SR11r_u;function BnFpg9(ATe0ZFo){return bgWE2G[ATe0ZFo>0xc6?ATe0ZFo-0x5:ATe0ZFo-0x1d]}bgWE2G=bwDxD0a();function mjqFsCM(ATe0ZFo,y7ZOCyv){var dZ5PcO=PtY0Io(ATe0ZFo=>{return bgWE2G[ATe0ZFo<-0x1d?ATe0ZFo+0x4f:ATe0ZFo>0x8d?ATe0ZFo+0x24:ATe0ZFo+0x1c]},0x1);YfJAv9o(ATe0ZFo,dZ5PcO(-0x14),{value:y7ZOCyv,configurable:BnFpg9(0x6d)});return ATe0ZFo}ATe0ZFo(YfJAv9o=Object.defineProperty,dZ5PcO=PtY0Io((ATe0ZFo,y7ZOCyv)=>{return y7ZOCyv(ATe0ZFo())},0x2)(RUfGms,OFyEFa));var LbFhzUU=[],UqItsr=[Ck2tXdl(0x0),Ck2tXdl(BnFpg9(0x2b)),Ck2tXdl(0x2),Ck2tXdl(0x3),'\u0032\u0061\u0048\u0033\u0074\u006a\u0023\u007c',Ck2tXdl(BnFpg9(0x28)),Ck2tXdl(0x5),Ck2tXdl(BnFpg9(0x31)),'NTB:l2@]Oftc<F$o26b|m9u',Ck2tX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Xdl(0x1e),'{o?|a(";','eQ!|i(A+vS,F{`',Ck2tXdl(0x1e),Ck2tXdl(BnFpg9(0x23)),Ck2tXdl(0x3d),Ck2tXdl(0x53),Ck2tXdl(0x54),Ck2tXdl(0x1e),Ck2tXdl(BnFpg9(0x7b)),Ck2tXdl(0x56),'z50|Z*u',Ck2tXdl(BnFpg9(0x75)),Ck2tXdl(0x58),'z50|G*u','1]|TG^;%',':BPXY:|%',Ck2tXdl(0x59),Ck2tXdl(0x5a),Ck2tXdl(BnFpg9(0x41)),Ck2tXdl(BnFpg9(0xb7)),Ck2tXdl(BnFpg9(0x35)),Ck2tXdl(0x5e),Ck2tXdl(BnFpg9(0x58)),Ck2tXdl(0x60),Ck2tXdl(BnFpg9(0x40)),'DrUKQ>~|gH58;ow',Ck2tXdl(0x62),Ck2tXdl(0x63),Ck2tXdl(0x64),Ck2tXdl(BnFpg9(0x3c)),Ck2tXdl(0x66),Ck2tXdl(0x67),Ck2tXdl(0x68),Ck2tXdl(BnFpg9(0x23)),Ck2tXdl(BnFpg9(0x78)),Ck2tXdl(0x6a),Ck2tXdl(0x6b),Ck2tXdl(BnFpg9(0x7d)),Ck2tXdl(0x6d),Ck2tXdl(0x6e),Ck2tXdl(BnFpg9(0x3e)),'\u0031\u005d\u007c\u0054\u0047\u005e\u0047\u0066\u0067\u0038\u006f\u0064\u0054\u0058\u0054\u0070\u002c\u002a\u0072',Ck2tXdl(0x70),Ck2tXdl(0x71),Ck2tXdl(0x72),Ck2tXdl(0x73),Ck2tXdl(BnFpg9(0x83)),Ck2tXdl(BnFpg9(0x86)),Ck2tXdl(0x76),Ck2tXdl(0x77),Ck2tXdl(BnFpg9(0x24)),'sb2WY:|%',Ck2tXdl(BnFpg9(0x55)),Ck2tXdl(0x79),Ck2tXdl(0x7a),Ck2tXdl(0x7b),Ck2tXd
// prettier-ignore
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"])