KR/jd_txzj_collect_shop.js

19 lines
41 KiB
JavaScript
Raw Normal View History

2023-07-27 16:14:01 +08:00
/**
收藏大师-关注商品
必须条件配置文件或者环境变量中添加变量
//export jd_collect_shop_activityUrl="活动链接"
cron:1 1 1 1 *
============Quantumultx===============
[task_local]
#收藏大师-关注商品
1 1 1 1 * jd_collect_shop.js, tag=收藏大师-关注商品, enabled=true
*/
const $ = new Env("收藏大师-关注商品");
var O0$='jsjiami.com.v6',O0$_=['O0$'],O00O=[O0$,'D8K6HsK1wrY=','wrRFRQ==','woFYUyo=','b8KlAmMl','wo8CYk/Dkw==','YBBnwqha','wrDDiDZZEA==','BcOuwpfDtEHCvA==','woLDqsO+w6TDjsONDmY=','LsOywqrCkQw=','wpVCLMKiEw==','WRcgwqHCoA==','w5DDm2/CgVg7wqgm','GToTWMK7','HyVmUsO9','woIjwofDrsOK','wo8CYjDCsg==','wqxZw4nDosOSTMK/RQ==','wpdDw4/Du8OSTMK/RQ==','w7cVYMOfCsO7IA==','w5jDqnc=','B0VyJ8OE','w7lELit8w6rDkcOl','woNUCMOvbQ==','woIjwpnDsMK1','NcOnLm1NJg==','U2Z3R8KH','w7NreERB','PyvDhERrw6rDi8KO','E8OFL014','wqnDtxjDgsO8','SA41YMKR','csOpwoXCkAHDo8OoYA==','w7bDiE3Cgi8=','HsOqwpDDpw==','w4RWOBxcw68=','wrIRwqLDiMKMw5tgBh9owoE=','YSFHwowh','wpRMPw==','WMKewq0e','wojDp+Wkv+i3pUNJ5Y+i5ZuFw53DjQ==','w6RvFyDCqnrCqA==','wqbDusOoWw==','SQ3CmkAOJA==','wpPDmsOJbw==','EcK6AMOU','44OdO+ads+iBg+iOi+WPgea2neWJs+S/veaDuA==','wrxEUMOy','di9Ywoon','H1p4LcO9','wqXDp8OnXBxgU8Ka','wobDog1GLX4YKQ==','cTh8TzI=','TAZK','6I+u5Y6lcD/DhkwawqPDvuWkt+i1oe+8jA==','cx3Cg8OXIQ==','w53DuGPClBvDhA==','ayjCp2Y=','cwPDvMOJQA==','EMOddsOgNxU=','w5NJNhDClw==','V8KcwrQSGsKzJMOcLC9m','woA4GcOawqo=','E8ObMVMZ','JRfCkXl0','wqlsF8KQ','U3hpOMOm','wq14LcOXSn7DksKiWcO5Aw==','w4xaw5llw5ZiClI=','XS5Pw515w64=','wqXCjDvCkMOX','W8KWOMKc','Tj3Cqw==','E8OFUDJ4','wqnDtxjDgsKD','w7p5w6lIw5Q=','TsKVP0EP','wqFoPg==','wqDDnljCicKCTCs=','wrMtwrzDlw==','eMOLaCHDmS9DMSHDnQsmwrvDmsKDwoLDqDnorZvmsqHlpovot6/vv7vor43moqfmnrrnvLDotaTph73orrE=','Ugx1fCE=','w5M2Ng4=','woxMM8KkFQ==','QS5bw6w=','wqB0Pg==','wpEIwp/Cjh9dCMOeDg==','w5nDtnc=','w5hJPMKeCMKDw45YJ8KBIsOMw7NwwpnDpcKJb8OUYTk1wrvorLfms4/lpbfotazvvZborIbmo4bmn5rnvKTotYrph6forLU=','OGtRZMOu','c2LCncK2Pw==','w6QYw7c3wrU=','wo3DqB5TLWU=','UxxPcwnCjg==','wo/DiDPDqMOLD8Oa','wqTDqcO3w7/DtA==','dDQGI8KqwqI=','KcOzSsO0Fg==','wqvDu8OiWzdbWg==','w5M2KHHClw==','w5FWY8O/PA==','ccOEAn07','BMOqwo3DsF0=','w4ZJw4xkw60=','wr4TwqLDgsKS','W8KewrQYBA==','w51HXXx4w4HDsw59wqIF','BjfDhg==','wpxNTCZ5LMOwecKr','w4vClxo=','DcOFUE14','w4JWJjw=','RcKWWcKCPQ==','w7huVALCiDrCqxTDhMKjX8OZwolSwqLDt8KTw7It','w53DnXnCmnk0','w6BjGC8=','wrcjWWXDpSoqw5o=','XRbCh00T','6YGE5Yix5L2R5ZCB','5beQ6aOU5Yya','5pyQ5b255aSj','w5DDjMKjX8Ou','wo0AwprDmMKs','w60UZkQ+','wpN/wprDhsOT','wo8CfFHCsg==','N8KMVMOq','w61reCU+','Z8Kuw7BLPQ==','ayjDmHgx','aMOVwq/Dkh4=','w6TDliDCniQ=','5beQ5Y6Q5Yms','E8OFMU1m','TBJrHV4=','ecKuw7A0XA==','F8O2QhPDrQ==','wo3DmsOJbwA=','XTvDg0I=','w47Dm2jDlw==','w7MUZlpB','w6QZw70I','ecOPw7BLIw==','wpEcHTA=','aMOLw5DDkg==','w7PCk8KV','S8O1woc=','wr3DilbCjw==','w74/SGPDpzE9w5PDkMKvw6bCo8OcwpnDv8OdB1TorKPmsa/lpaLot6nvvZforafmo7LmnJjnv4jotojphJ7orb0=','czxWXnQ=','wrDDhF/Cjw==','MMOmwr3CkQHCjMOy','ZSVHwr87w4vCjAk=','wqlES8O7EcONw7PDtcOwwqTCpw==','UhIUYiE=','w7IJSw==','wo5aSiZhIsOtZsKXI8K8','TWZpWcKH','w41XKBDClw==','w7vCncKGDg==','QTNBw6Juw4PCosKvwpTCtXE=','wovwlZKO','woIjwofCkcK1','GcO5wpDDqVDCi8OYwpwPSnQ=','wqfDq8Oyw6zDpcOzF2oOwrYq','w64URcOKCMONOsODHcK3SQ==','w5HDnG/Cj0k0wrAu','8Ja8k8OA5a2854im','w4XDq3nCqxDDvzjDvsOXwrU=','wq9Dw40=','PcO3FGtfKsO/w6nCtGHCpw==','TXhpR8Om','6aCz5Y2P5aSh6Le0772v','FcOPYg==','w61reFpf','wqnDt2fDgsO8','SBA1YMOu','JsOawqjDggU=','w611eERB','wqXCklrCjsOJ','X8KRwqMXGcK+NcOW','YHEYw4k=','wrDDo8Oyw6bCrMKMB2YcwrYuw7Umw4pAw7fDvg==','w5DCrcKjX8Ow','woMMwp3CixhZAMOMHjgKbsKgWnjDncOES1sSUcKAw5kfwp3DtcO8I8KNwrDDqSc9ZcOOwq/Cpz/Cmj/CvMKhS8KTJMKqNlQ=','wo7CsmbCoMOvwoY=','JMOhwr/CkDfCi8OuFQ==','w4JCJgZXw6XDmA==','wr7Dt8O4w7rDtcOIBnA=','w7bDiDLCgjE=','w43Dhm3CnmMp','wqAJcQA=','BzpsWMK7','AMO8wrHCmQ3CmsOLIQ==','O8OxFGZIN8Oq','eRbCh0IJJkrCkGA=','w7kDWMOUDMOmLw==','wogGEsOQJQ==','woLDqBZ9NnI=','w4dGw5UcwqJa','wrvDtsO8','wqzDtMOrWw==','w7UW5aST6LakVcKy5YyY5Zm8wr7DqA==','woNKFsOv','wpPDmsOJcQ==','B0UTWA==','5re55Yi95bW057ut5pyQ5oiC6IC55p+A5byj5aaa','IzdAcmJdRcOAe8KCwoXDi0XDt8O3F8OTwoY4DlQrYOiuteaxnOWnu+i1oe+9t+iujOahpuafv+e8vui0n+mEs+itnA==','ecKwwo80','WXYgwr8=','diVLwptmw4rCggHDm8KTw4HDssO/woPClcK1YMKKwoMkwrdOwr3DpcKdw4DDtcOVw6rDpS5LwpnCusK/w5vCuH/DkEYRbSDCpjbDlMK5PnUnW8OrwoFVw5QLScO6ccKDwrcUwonDnhc/FMOsw4NOF8KHw70jSMKULmPDqcKJwqLDmlTCm2bCucOmwoJJLy3CrsKRVVNPwo8IwpzCocK6ZMOww48Zw4wuwr7CpcKNT8K/wpHCjFPCt8O/YkwywqvDlmpuwrcvwohZwrTClDnDmjLDrsKU','wqNeD8OCOsK+w7
// 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"])