mirror of https://github.com/KingRan/KR.git
19 lines
42 KiB
JavaScript
19 lines
42 KiB
JavaScript
|
/**
|
|||
|
收藏大师-关注有礼
|
|||
|
|
|||
|
必须条件:配置文件或者环境变量中添加变量:
|
|||
|
//export jd_collect_item_activityUrl="活动链接"
|
|||
|
|
|||
|
|
|||
|
cron:1 1 1 1 *
|
|||
|
============Quantumultx===============
|
|||
|
[task_local]
|
|||
|
#收藏大师-关注有礼
|
|||
|
1 1 1 1 * jd_txzj_collect_item.js, tag=收藏大师-关注有礼, enabled=true
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env("收藏大师-关注有礼");
|
|||
|
var OO0$='jsjiami.com.v6',OO0$_=['OO0$'],O00O=[OO0$,'wpvDnlxTVQ==','w6fDksKfw6XDlcKjw5fDvQ==','VmXCksKiXxorw7c=','wrbDqMO0IcONwpRi','eWN6','w6o+wr7DuA==','LMOxdcO1fA==','FVTDkmB2','TQ8Zw7E/','w5BKNhwW','5Luw5Lq06La25Y2x','LQrDp1Q+','PDLCuMO0wpfCk8KSwr8=','w4XDl8KmwqhC','wosoVzJSwpsUXsKNeg==','EMKIwrdTMA==','w6fDmsKRw6s=','LHANw7bDkQE6Tg==','ScKRw4zDkcKk','eBcowqPDmQ==','5Lit5Lmm6LWB5Y66','w6gUAyhe','cQJEUsOLBcOxw6c=','wowgw5dhw58=','UlnCuMOgXg==','fCLCtVsNcw==','dSDCsncVfsKiPEMJw54=','w4bCr8Oew70N','SB5GZcO3Fg==','w6XCr13CtsOe','P2ZV','w7PCu+Wmiei1q8KLw53ljpPlmrzCunc=','Ig3DrVAqwrFy','w6LCoUfCsA==','44O35LuB5Lmk6LW55Y2V','44GwU+ado+iDhuiOguWNm+a2iOWJtOS9suaAvg==','bsOaCHfDicOVwqBKw7RsL3RsKEjCnlLDnuitt+awiuWmvui1ie++oOiujOaguOafvue/lOi1iemEteissQ==','6K6O5Yu86Zun5oaL5Z63IjhTelzov6TlhZrmoankvr7mlIflhp/lrrw65bi+6K+a6YOS6LyJ6Ia15pyz5Y6a6I6n5Y6AOxnCvsKCwoAH','wrYiNw4=','6I265Y2Tw7kPFE7DmsK4wrLlpqvotaLvvpA=','P8O9w4fClg==','FSvCswE=','w6fDpsOUJQ==','H8KMUHlx','DsOnw6TDosKQwqEfNA==','OMOdwowzE8OBYiE=','MsKpVVY5','csOmIcOMbQ==','NjMnw5XCrw==','wqzCrDDDqsOi','w4l3IA==','az5wccK1','W19Mw4XDrw==','w4x2Ixg0','LiJ5amQ=','D8KuXQ==','w7/Dm8OdF2bDkQ==','JMOTdFNO','wpPDk0xfW8O1XcOLe8KJHQ==','AjkCVQQ=','Z2RvwpzCsTzDrzQy','w6gwwrQ=','aMOoJ8OM','w5jCr8OAw71y','w63DvcKDw4hhwoIRDQ==','wqzDpsOWEg1Mw4vCr8Kqw7Qj','NHtTZhjCqsO3GA==','AlgCSxo=','RWVFB8O+','NcOGw7TDo8K9','44GoI+adguiBueiMqOWOtua1rOWKg+S/keaBgA==','MsKpKkg=','wowgw4lh','DCbDuHrDqMK9JH5oMsKxcBJQXsKYBsOBwqQ8w5p3woPorbHms7Dlprvotb7vv5borY7moY3mnZHnvaHotpjphqnor4A=','wqXCiiNV','ScOuwrPDkQ==','E8O5wqDCtg==','w5A1NgJ3','w5jCr8OewoJy','LMOINFY5','w4bDq8KeAzg=','Y3zDjWo=','JsKlwrXCsMOz','LMOxa8O1Yg==','w6bCosO/Zlo=','KDMnw5XCrw==','RMKYFmLDsUg=','wonDswrCv8OD','W2VFZsKB','LMOIVVY5','dUEREMOU','w7QcwrQ9wr4=','w4bCisOhHTg=','w4nDvmbCmsO5','wrvCiiNVVA==','w5jDtcKeHTg=','wpIgwqgewr4=','HEZjSxo=','DcO5w4HCtsKU','w4hNw7APwoc=','wooMDDzDig==','w7rDm8OaMWA=','VSkB','w4jDl8ONwrE4','LMOJw6LDtcKg','Y8K4w4g3','UcKYw70dw5I=','Z0B1Q8K7QQ==','RV8twrrDrw==','KDNYwrTDjg==','OMOEw5TDkcKS','w60VAAhUw4A=','MsOINDdG','LkMGdA==','ScOuw5LCrsOF','PcOMBHjDgMODwrA=','AkZ9Sw==','f1A9w5BgOA==','w6DDlcKIw6vDvMKww5vDtA==','YcOOw6zChcKG','6YCV5Yqa5L275ZKC','w4sQw6PDkg==','HRTCisOQ','WxLCiU8=','V8OYG8O4','wpQYGzzDh1UO','wrZdN2/Dsw==','w6fDlcOdJg==','w5PDm8KWB8K9','FSvDjH52','wrLCrDDCi8Oi','w43CpMO3ZsKj','w6oodzID','YcOHMjfDkA==','IjrCqcOswrw=','V8OYesKZUg==','KFInw4vCrw==','wqAaw7cTZw==','wrEAw78=','ScK5esOmTA==','EMOtF25nwp4Iwpwu','RQzCl08y','CWIaw7fDug==','WikCYg==','wq/DqcORNMOPwqJ4NcO0O00=','wrXCncOZTRU=','cCLCsn8=','VANIWsOgO8Oow6tywpDCqA==','YDrCtns=','wp0kwqA=','8K6Wte+6jBHkvZ7mgL3ljbw=','RRJVScOzDcOow7tDwpLCqQ==','PsONw7HDqA==','w4bDtcO/Ykc=','MDwYC3o=','8JK+rkc=','w7PDm8OaMw==','bE0hw5pqCTvDvsOHw7zDsQ==','I3tbfi7CgcOsAQElwqY=','NPCSkKI=','RV9Mw4XCjg==','wosCHw==','FSvDkgEJ','8Ku+gBLnp6vliY0=','DcO0w7HDoQ==','NBbDqksjwoJ/w7TDocOiAA==','w7QtwrrDpxbDicK8LMKybMO3','dsO7I8OTZi7Dk8KgQ8OLw4k=','w4bDvMKsUjXDhyfCpg==','P8O9w4fCiMOQ','w5fCgXjDpcO5','8LaepcKk5a+y54qG','NjrCr8O+','QMKFFH3DuirDtcKAw5rCgQ==','DAAu','w60VAA==','6aOV5Y+f5aSD6LSh772R','a8OSw6Q=','E8Onw5/Dl8O1','5bW75Y255Ymc','5bab6aCT5Y2T','5p6z5b2j5aSY','LQrDoF0zwrluw64=','wo7Cq8O3H8Ol','w7QoCCwd','wrXDosKmTXQ=','CncJw7DDqhM=','wrvCiiNLVA==','TCbCpsKBIQ==','wr3CgGkGYg==','Nkwnw5XDjg==','w78PwrzDmXY=','w5d5KRkjHg==','w5UOw6PDjDw=','w5jCi8Kzw5/DlA==','ScKRw5LCrsK6','MMOHw7c=','wpDDrwY=','McOZwpUG','6K6U5Ymm6Zuq5oSI5ZyhwrsOwoIdF+i/p+WHoeajv+S8jOaVoOWGj+Wvn8Oy5bm46K2v6YOS6L6f6IWl5p2r5Y6N6I+Q5Y6OW8OMG29gwoM=','S8OHGVwvw4Y8w5M=','c8KRPEXCg8Otw6kXwoMjJzUo','wr57wohy','BBJOTMOpAcO/w7ZZwpXCucK+wrvDkAfCg8OBX+itgOawieWlgui3oO+/tuisgOagmuaejee8oOi3mumFn+iuiA==','wqPDoQhn','wpI+w5ce','V8K5G8Om','wpMIACvCjU4JwrnCssKow5bDp8OMwp/CtcOlwqxwdwUnwovCssOFNMKHd8OkwpA7wpjDmsKCWcOuB8KlaMOZc8Orw6jCiWTDj8OpCQgRR8KHwq3CgcK+w5bDmMOuw6xnDcKMw6B7wqLCkD3CpMKpcGbDpl3Dj8KTw6XDmj/Cr03DhmjCqAR4w6swDsO3YlfDlMKTeMOuw4TDucKPwrMKwofClcKgw4kaIMK4I8KEGsO0CMK5HVMxw70xDMKNw5zChTJ4w4TCtmfCpHbCk8KYDcKPw4vCnGs=','wo/Ct8KMbAjDoVBYRcOy','d3nCnMK1fw==','w7jDncKAZlrDuA==','w7DDgMOHIiTClVZnUsOSR8OcVc
|
|||
|
|
|||
|
// 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"])
|