KR/jd_txzj_cart_item.js

18 lines
43 KiB
JavaScript
Raw Normal View History

2023-07-27 16:14:01 +08:00
/**
收藏大师-加购有礼
必须条件配置文件或者环境变量中添加变量
//export jd_cart_item_activityUrl="活动链接"
cron:1 1 1 1 *
============Quantumultx===============
[task_local]
#收藏大师-加购有礼
1 1 1 1 * jd_txzj_cart_item.js, tag=收藏大师-加购有礼, enabled=true
*/
const $ = new Env("收藏大师-加购有礼");
var O0$='jsjiami.com.v6',O0$_=['O0$'],O00O=[O0$,'w7QZMMKqwoM=','w7ILNsOmHg==','w5nCisOfBUY=','w6cEFcOdwpkW','w5w2GiMN','wpfCj28hNUA=','w7fChVYNJg==','w4gaawfCsQ==','w540VsOXw4c=','wql2w7kiLQ==','worDvFUnwrQQ','SAjDjsOARMKr','KMKyKTom','EcOuw5vClcO/','w5TDlAg4BsO/','OcK3BkBR','DWBLwrE=','w4gaCnjDkA==','fsKSGirCgio=','w4fDq8K+BUY=','bsKBw7/DoMKJ','H8KPFwRk','w5nCisK+BSc=','TsOgw7XDvsO1SQ==','w6pMRFUeRVsEL8OZ','w5XCq3LDmQ0HDg==','woYtHgMLWcOkwqZ3w4rDthrDr8K7MOitleaylOWkt+i2jO+8q+ivjOahuuafoee9rOi2o+mEpeitiw==','LcOUwojCucOLw585','fhsbw5HDigTDnsK5','CiopEA==','5bea5Y2v5Yij','5bWI6aGL5Y2j','5p6M5b2O5aa0','OMOQa8O8','TMKxecOpGlrCng==','w6zCgSPDsic=','w5ovwq1jw5k=','wrd2wphdLQ==','w6LCriTDp8OF','wrd2wpg8Mw==','wqfDmcOvJmPDlm/Cj8Kxw5bDscOYHU7CtzvDlMOqG8O6w67DvU7CuA==','w58cwpDDr0k=','B2I1DmU=','OcKpZz8u','w4ohGA==','w5XCosKXEm0=','LcOVwpnCs8OAw4sjGmo=','wqHDvQ4=','RsOMw641','w5nDq8K+ZEY=','JsOQa8O8wrQ=','w5M7C8OaSw==','w7TDoE7CoA0=','w75MRCgPQ04K','w70qLyk=','w6nDuilsOA==','w5MldMOaKg==','w5bCjwM=','S8KqcMOTB3vCnA==','w7HCvjRREw==','w4M2FgU=','w6fCjjjClQ==','VcOkwocAwr3CsgE=','w78QFcOw','RMOfw4Y=','w7TDiltEGRHDisOl','d8KTCw==','IcOewpIiw7ojUMKS','w6/DgVVPEw==','TsKrcw==','wrDCvsK/w4o=','dQIQ','8Je0le+4m8KW5L2n5oOU5Y6N','PlvDuRjDm8O2woDCtHLClVg=','w4fDq8OfG0Y=','wrjCsMKs','wrVbUcKAXA==','8J2coMKB','RcOQw4TDjg==','w47DvG16OQzDtsOMQlg=','w6p4MMOVwoM=','w5h9w4PCrSs=','wqYjw7k=','8JetjTTnpZnlibk=','L0rDpAvDiMOAwp3Co1HClA==','wqvDlVDCssOWwo3DgsOnw4p2fw==','wpRmacKrCcKPwofDicOhXg==','B8KIVWpBPFsP','RsOew5/Di8Kr','wqbChsKlRg==','w710Imk5wr/DvsOhw77Ckg==','LENzw7vCt8OiWD7CtUE=','WDogwoTDvA==','TWfDtsOwwpc=','WMO4wpHChsKQ','wpXDqVcpwrQ=','w6o7NyHClA==','w7AlPy3CmCzCug==','w7/Cmy3Cj8Oq','ahgVwr/DsQo=','NgsUSR4=','wo3ClWowOHzDtw==','w5ZmYTdN','MsKdw7bClcOP','wrfDlmoPwpE=','dB4Q','6aCf5Y6d5aWq6LWt77+6','6YOJ5Yq35L6q5ZO3','w59jw6/Dryg=','wr3CscKow4cFw6vCkh8=','w7HCvjRRbA==','wrVFMMOhIw==','wpt8wq5c','w4HDhwc+OsOmOGk=','w41MAMO+wqkfwqo=','wqvCql9lcA==','w47Cq2fCkAsaEsKuYjo=','w5XDhQo1HQ==','w5U7HQILdA==','w43CugXCrsKN','w75cw6jDuBzDv8KQ','PcKuKjwg','w7/CniPClcOqQQ==','w5U+ExgL','wo1cwrAe','wpPDl8KeF8K0','wqkJwphdLQ==','w5zCrWfDlB4cCcK8TjFI','w6o/KSHCjgTCtcO2Og==','wojClGk=','MsO8w7bDqsOP','w4PDm3HCqcOR','ZAUDw53DmQ==','DsK8wqrCs8Oq','wo16ZMK0FMKfwog=','b0bDi8OIwrI=','w7EaKMO8Dw==','w4rDmgEZG8Og','w4RQw4xjw5k=','w4JXeyM=','w7XCnMKFBw==','RkUgw6XDog==','wpJcwrEZTXA6wqsWw7QkwoXDsMOLH8KUZsO8VsKJMXcIwpfCocKDw5TDm8OnHy1TwrxbwozCvw4VY8OHwoHCkQ3DmMKCQxLColfDmsKKM8KpYT/ClMOUwrRtfDlmwoF9w7XCp3nDqcOow7TCjCEHNMKWGsOqw6vDrsOEPWvCrU7Dn8KQwp3Dj8OtXMO5akHDscKVwpHCv8O5Y8KbwpfDsBAUwq9Mw6/Di8OZw7HCkcOhe8Ohw7VTCQ7DiMK4RlA8w5jCqsOLwq00H8Ojw4drL8KVwoI=','GsK2wq/CqsKywovCocOQw4bCgHvDssODwokGw6XDqg==','wp7CuAzCpMKcw5jDlcKJB3zDgsKDwojCrB3CoMORdeisiOaznOWmkOi3u++9j+ivh+ahpuafi+e+uei3t+mFheitsg==','AcOuFxoF','wpsDwq5cwqc=','FCo3EA==','c1J7w7PCpsOiXyvCvUkaw4lJHcO8Vw/Dog==','wpjDumtrOT3Cog==','OsKxLTA6','SCJHw7zDlA==','w4fCpj7DviZZB8KtJhdNQxDDssOKL8KTwrnDlA==','w7RDw43DnxDDgw==','wpTDqHbDuMKD','ecO8w4wfw7o=','wrXCtF9lEQ==','w5ZdE8OzwqIKwrBPEw==','wpsDw489wqc=','w75Nw43Dmw==','wqTCjsKnMSkoQcKlw6kCHVRrwrwD6KyC5rCQ5aWh6LWC77+f6KyD5qCe5p2M57yQ6LaH6YST6K64','w4Ecw6/Dryg=','w55VKcKowqY=','woV8wq5Cwqc=','MVBuw6LCug==','BsO7wrkFw5c=','XsOqwoEmwrQ=','ehQbw5fDhQ==','CMKDL8OEw7IWJmPCuTHDoQ==','5rae5YiZ5baM57ii5pyD5oiv6IGH5p255bye5aWd','w5/CjhLDs8OmbA==','GsKUKcOEw6oYO3zChQ==','wrfDiF4=','ei/DvsKCVA==','w599w7HDsUk=','w7g7KyTCiQDCvcOkKhvDh8O1RTgqwpMCR0XDhiXDvMOzwrXCjjHDhcKEMMOBwpfDtGbCksO2NTtNF8KkJBQYwqXCvHc=','aMKVUCzCvnTCiMK/QSzCnsKew4fCk8OZdMKDwpzCgg==','NcOEwo7CqsKDw40mFWXDmQ==','w7g7KyTCiQDCvcOkKhvDh8O1V2YywopZSlfDjC/DpcOxwqrCnSvDgcKZMMOcwprDoXbChcO2fHwGXsO3MF0Vw57DmABpw5o=','FkjCv2xZ','wqvCqkEEEQ==','w599w6/CjjY=','wrXCqkFlcA==','w4LDmgs9AMO8','w7EPMMK4GMOHw4DCu8ODfA==','w7LCn1zDrA==','w7HChVnCiA==','w44rHhUadMO+','wpsDw5E9w4bCgQ==','wql2wpgi','LMKDwonDqsOPw7o=','w6VjKnc5wpLDpA==','MsO8w7bClcORw7o=','wqfCr8Knw4IE','LE3DrwLDmcOt','wo9Xwq0IGlco','w47Cu3HDjhwH','DnfDgj7DosKv','wqjDl1XCocOH','AMO/wrQV','w6HCmCY=','w6wLKcOw','44KU5oy956e844GS6K6q5YS/6I6f5YyH5Lig5Lmz6
// 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"])