faker3/jd_txzj_collect_shop.js

19 lines
58 KiB
JavaScript
Raw Normal View History

2024-06-28 15:38:28 +08:00
/*
活动名称关注店铺有礼 · 收藏大师
活动链接https://txzj-isv.isvjcloud.com/collect_shop/home?a=<活动id>
环境变量jd_collect_shop_activityUrl // 活动链接
7 7 7 7 *
*/
const $ = new Env('关注店铺有礼(收藏大师)')
const notify = $.isNode() ? require('./sendNotify') : ''
const jdCookieNode = $.isNode() ? require('./jdCookie') : ''
const getToken = require('./function/getToken')
var version_='jsjiami.com.v7';const lI11llll=lililll1;(function(l1ii1Ii,l1I1IIi,I1iIlil,i11il1II,iill1lii,l11i11li,liI1lli1){return l1ii1Ii=l1ii1Ii>>0x9,l11i11li='hs',liI1lli1='hs',function(iilliiIi,l111Ili1,lIIillI,I1IillIi,Ili11II1){const liIIi1l1=lililll1;I1IillIi='tfi',l11i11li=I1IillIi+l11i11li,Ili11II1='up',liI1lli1+=Ili11II1,l11i11li=lIIillI(l11i11li),liI1lli1=lIIillI(liI1lli1),lIIillI=0x0;const lI1iiI11=iilliiIi();while(!![]&&--i11il1II+l111Ili1){try{I1IillIi=parseInt(liIIi1l1(0x2d5))/0x1*(-parseInt(liIIi1l1(0x2f7))/0x2)+-parseInt(liIIi1l1(0x1fc))/0x3+parseInt(liIIi1l1(0x3d0))/0x4*(parseInt(liIIi1l1(0x205))/0x5)+-parseInt(liIIi1l1(0x31a))/0x6+parseInt(liIIi1l1(0x30f))/0x7+parseInt(liIIi1l1(0x235))/0x8+-parseInt(liIIi1l1(0x2a8))/0x9;}catch(i1lilI1i){I1IillIi=lIIillI;}finally{Ili11II1=lI1iiI11[l11i11li]();if(l1ii1Ii<=i11il1II)lIIillI?iill1lii?I1IillIi=Ili11II1:iill1lii=Ili11II1:lIIillI=Ili11II1;else{if(lIIillI==iill1lii['replace'](/[fpItDRKMNeXPlnWuGJSh=]/g,'')){if(I1IillIi===l111Ili1){lI1iiI11['un'+l11i11li](Ili11II1);break;}lI1iiI11[liI1lli1](Ili11II1);}}}}}(I1iIlil,l1I1IIi,function(ilIiI1ii,I1lliIII,li1lil11,illiIiII,lil1iIil,IilIIlli,iIiiiiii){return I1lliIII='\x73\x70\x6c\x69\x74',ilIiI1ii=arguments[0x0],ilIiI1ii=ilIiI1ii[I1lliIII](''),li1lil11=`\x72\x65\x76\x65\x72\x73\x65`,ilIiI1ii=ilIiI1ii[li1lil11]('\x76'),illiIiII=`\x6a\x6f\x69\x6e`,(0x135e42,ilIiI1ii[illiIiII](''));});}(0x18200,0x5b325,IIilIi1i,0xc3),IIilIi1i)&&(version_=IIilIi1i);let lz_cookie={},activityCookie='',inviterNick='';$[lI11llll(0x3d7)]=![];let canHelp=![],cookiesArr=[],cookie='',message='',messageTitle='';if($[lI11llll(0x334)]()){if(process[lI11llll(0x24e)][lI11llll(0x374)])activityUrl=process[lI11llll(0x24e)][lI11llll(0x374)];if(JSON[lI11llll(0x24d)](process[lI11llll(0x24e)])[lI11llll(0x22f)](lI11llll(0x276))>-0x1)process[lI11llll(0x2c8)](0x0);Object[lI11llll(0x1ed)](jdCookieNode)[lI11llll(0x251)](ilI1IIi1=>{const iilili1=lI11llll;cookiesArr[iilili1(0x2a9)](jdCookieNode[ilI1IIi1]);});if(process[lI11llll(0x24e)][lI11llll(0x38a)]&&process[lI11llll(0x24e)][lI11llll(0x38a)]===lI11llll(0x3aa))console[lI11llll(0x2e2)]=()=>{};}else cookiesArr=[$[lI11llll(0x30c)](lI11llll(0x356)),$[lI11llll(0x30c)](lI11llll(0x390)),...$[lI11llll(0x32a)]($[lI11llll(0x30c)](lI11llll(0x37a))||'[]')[lI11llll(0x34c)](iIl1i11i=>iIl1i11i[lI11llll(0x3ee)])][lI11llll(0x2b2)](I1liI11l=>!!I1liI11l);let isGetCookie=typeof $request!==lI11llll(0x219);isGetCookie&&(GetCookie(),$[lI11llll(0x2c1)]());function IIilIi1i(){const i11IIl1=(function(){return[...[version_,'GJSjDsjitalRnmpi.hNcSoMm.PXvR7SIfXuKWleD==','qKvSuge','5Rs75yQO5ywL5y+J77YA','B3j3qM0','zwLzzvG','AuTwwuC','q29VA2LLsKqY','Dgv4Dc9ODg1SlgfWCgXPy2f0Aw9Ul3HODg1Sk3HTBcXHChbSAwnHDgLVBI94BwW7Ct0WlJKSAw1Hz2uVyxzPzIXPBwfNzs93zwjWlgLTywDLl2fWBMCSkI8Qo3e9mc44lgfWCgXPy2f0Aw9Ul3nPz25Lzc1LEgnOyw5NztT2pwiZo3e9mc45','y291Cg9U','wKLAD1a','ywrhzKG','y1bWrKe','sujitNe','EMfJwhq','z2v0','q2D3sxe','y3rQzgG','zxfhtuu','y1LxEfa','B0T4vvm','rMzzEwK','rNLHEM8','BK1huLm','6i635y+ww3rVA2vUxEwKSEI0PE+8Gq','q0DxBxq','D2fPDa','vLfhshy','lcdLPlhOTkuHiowoN+wBOdOG','yNnPyw4','AwDgruy','sKzwtNy','y1jNs0m','zMfSC2u','tfjlB3i','yMvHBG','DhLnrwC','u0LKywS','ufDYAfC','DfbHAKq','wezvr3a','q0zns24','u3fHuMK','Eg1KDey','q1nRtNu','C2v0lwnVB2TPzq','yw9gCLq','CLjZufm','t1zNyuG','yxPtsvy','rfbbqxq','y0rnsLq','tfzRBuW','Cejxq0K','C2vevue','t29hD3m','6k+35AgR5yAz5Rs75yQO6zo+5O6L','CgfYC2u','BgvUz3rO','EezqsNC','B2jpqNK','Dg9Rzw49','AgfZrw5K','ugjmv20','DxnLCKLUzM8','zgLZy291BNrtDhjPBMC','DK9lD1q','Ahr0Chm6lY8','B0vPsg4','vur1rMC','wLLlB1m','mJiWoda0r1vAD21X','uezhtLO','EvPOy0e','q2Lnrui','A0Xmz2q','u01dufm','D3fOyK8','ywn0AxzPDhLfBMq','y2HHCKf0','qKDxqLa','Bg1KCxG','BNfnwNm','BgTwr00','yNzKBfC','zu5RD1a','y2f0y2G','D21Ur00','lcjHy3rPDML0EuLKiJO','CM9wree','CNLOsNq','zgf0yq','t0T1u0e','vxngr2G','twLjsxG','tuDpsKO','CKzUweG','rLvfr0S','B25Jzv9UDw0','B3zTsxy','z3PPCcWGzgvMBgf0zsWGyNi','y29VA2LL','DMHtDwm','Cxv2tfK','wwr6CxG','tKnvBu8','6Akg5y+w5AsX6lsL77YA','yvHxwuO','EujeuxG','Ahbks0C','C2HVCgfJDgL2Axr5swq','BMLJA05HBwu','r3npAM0','rfjev3m','AMrHCha7AvbOB25LoZeWlJ
// 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"])