yydspure/jd_half_redrain.js

20 lines
54 KiB
JavaScript
Raw Normal View History

2022-07-28 21:53:26 +08:00
/*
半点京豆雨
30 16-23/1 * * * jd_half_redrain.js
*/
const $ = new Env('半点京豆雨');
const notify = $.isNode() ? require('./sendNotify') : '';
//Node.js用户请在jdCookie.js处填写京东ck;
const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
//IOS等用户直接用NobyDa的jd cookie
let cookiesArr = [], cookie = '', message;
var _0xodW='jsjiami.com.v6',_0x5a5d=[_0xodW,'w7cjbUJN','wrozw7xywqQ=','WsK1TzDCtw==','RFfCnjjDpg==','w5Aow6RCVg==','U8K7wqHDuzA=','CsKkw681Ag==','AMKkIcOWwpo=','YQjCi8Okw4E=','w6R9F8OiwpA=','w4UZFx3Cjw==','QEDDt8KOEw==','wqZZw4rDisOZ','RMKdZj/Cvg==','w58xUm9W','wr8lNUhi','wrklw7ZgwqQ=','NsK3OFgSKsKRw6DDpsOEOAjCug4mLi7DmF3CpV7Cu8K7wpHDoMKpOcKQwrchdAzCoMKow4V5VQdYfmpQRsOAwrjDrArChcKuGg9tH2k=','w4QXRHNt','woBVDMOWBg==','w6cXw7AMVg==','wpEqAHRs','w5gcw7NEYw==','fjvCusOfw5U=','S8OjwpxawrTDpg==','ScKDew==','wr3CmMKQe8KwdsKqZsKnJ8K9w5/Dlw==','w69wDA==','wpNPAMOxwq/DlzPCvg7CgcO+FB4=','QRfCk2ti','OxzCrT9NwrPCsA==','F8OqwrdPIA==','ZQbCuVQ2YBQ=','w7dOcsKsDQ==','w75QM8OvwoU=','dsKYwrHDhA==','OcKdJ8OVwrg=','wrwWw6x8wqA=','DgNjCiU=','YzPCjsO/w6E=','w5LChcKzR1E=','wrYtBQ==','woAZw5AvbcO7wrPCksOE','w55VYQ==','wrQjD0s=','JsK2wpLDueiuleaznuWllui2me+/veivmuahhOadque/iOi2vemEvOisug==','5buq6YWW5o+G5LuV6L+Q5Y60aMKc6K+K56qv5ZOI6Yak6K+6w7c=','w4g1bHBt','w7/CisKDW1w=','OTxVCwk=','axDCgV8wfRs=','cgLCv0My','WcKWw5zCscKi','w5vCvsKJMjk=','w47CjMKYRlIdLQ==','w4d/w7PDqHw=','w54EIBnCtg==','MzPCuChp','dRbClHwB','w6/CkcKwCiw=','UjzCrkBQwqgp','LVrDisK8WQ==','w5xTZcKpG1LCkcOG','bAbDtG7Dvw==','SyrCq13Cvw==','w4Zcw7HDsFdqMsOc','w59tH8OSwpgRw6g1','GBjCixVo','wohDacKCCw==','BsK8BMOuwpY=','w6M9cnNU','wrwuDUFI','NsKKNU05','IMO/wq1FF1U=','fMKLfgDCpw==','w63CtMKlCQg=','wpxCAMO8Dw==','w43CosKbPTw=','bREY','5Lik5Lua5p+Q5YuZ5Ziy6L2E5ZmE56mY5pa95o+x','G8OtwoA=','WCrCvQ==','OiPDksK7','wpBLOcOxMQ==','McOgccKUwrQ=','TRvCnlnCog==','wpDCjMKYdMKv','RMKJw77CjMK2','w54zdXVKdyEWOFk=','DSZl','5bqY6Yay5o2b5LmD6L6m5Y60wqbCkeisrOeoluWTiemGhuittcOO','UcOkwqBcwr7DpHLCnMK/','w6ZxHcOlwqQC','w7IPw4RbQw==','w7RqZcKkIw==','A8OSwoBiNA==','aAHCl0rCrMKg','aQbCkX7Cqg==','wqMhKGJC','YsK1VhAn','wpshLUNW','KTbCriJF','RTjCqFdU','TsKdwrjDuCk=','wrhUacKSPw==','PwzDrXvCnA==','GcOEwpFlGQ==','wpotw4M=','5Luo5pW15q+z5pWF5bSi5rmi','6aKB5Y615aeM6LSK77+D5p+45Z+S5bSV6aKU6L2I','5b2T5buJ772/','w5TCi8KmQFsTKsODwpI=','asKfWA==','MBbCvg==','5Luf5LqG5p+v5Ym55Zmj6K6w6Zaq5peM5o2T5LqY56q8772l6K+Y5qGJ5p676Ie06LiD6K+X5aWL57+p57q/5oGy5YSM','IcOqwrFIFl8=','R8KawovDnAc=','5LiM6Ke/5Z2XDBJ3w4DDouaKkOWKs+WniuWJveewuOi2hOS/peaUojjDiHAKZ38=','wpRQGsO3HA==','G8KKOEUT','w6jCisKjRlk=','w5fCisORw5IZ','V8KWwrvDlDM=','wqojEF1f','XsKPWzrCuA==','wp8SC11O','wrMsBktCf8OI','woIww41X','N3jCu2jCicOfQQ==','ZTnChcO4w7E=','w5XCmsKiTEcHJg==','bMKfVjM=','QMKIYxHCpWk=','w7FGw4rDvnU=','w4g7w486cA==','cxPCpnkx','OsKVw4s+JjI=','w4JPdcKq','w6xsFcONwpUYw6QiZFrDhmM=','RsKCZBg=','I8KUFcOWwpIrfw==','CDpMFgQQ','Oi/Domw=','w7oFw45Ub0nCjQ==','IsOrwrBJ','w6PChcOe','TMKzwp3DtCfDnjLDuw==','ZBAJ','FMKHE2wkUsOrwog=','wrNSwox2SQ==','w6TCqcK6','wqByJsO0KsKSwrvDpcKD','wrpgfg==','KMOXRcKFw5rCm2I=','w4o1IBvCgF0=','OQHCsC8=','wrJWwpRhTcKAw5s=','wrACw40tasO5wpDCsA==','DsKZw5ctHcKLRg==','wpktDUVTVcOkwrMG','JsOcVcKEw4PCoGU=','wpxhZ8K9B2fDvsOUw4o=','JMKBw5k=','w6lxFcOLwr8V','ZxcTOhh9','w4UzYHFMPk1WPUxvHsOZw7vCpcO6w7saf8OlWUlIwqE=','I3zCp3fCjQ==','wrDClcKbZsK2cQ==','44CW5oyg56SF44GM6K6X5YWm6I+C5Y+u5Lmr5LiR6LWH5Y6Y5LiPMMKIcQ51KWDnmobmjoLkvoLnl5zCr3QMEsOtwrbnmZfkuZ7kuZvnr4rliIfoj47ljIo=','wrF/K8OUwo/CqE7Dji3Co8OaNGTDnsOgOSU2w5HDncKmUA==','w6/CvsKYb2omAsOswqUgF25R','BsOGwqlxMQ==','L8OlwoVPNQ==','w7IIw7c8Tw==','w44vPh/CuA==','w48IRXhc','w5nCo8KpLRs=','NsOswpNlOw==','DsKuw4zDtsOc','wq4Ow6J/wps=','A8OuZMK0wqE=','w6vCssKLHhI=','G8KKL0Up','dMK0wojDlBY=','RTHCm2vCow==','w6XCtsKyb3g=','BcKTw4Q=','wpsxw4M=','wozChsOZw4E=','Z8KnVQ7Cng==','F8OnQsKPwoE=','ZQXCnHrCvg==','XCrClEtVwrk=','DUvDkcKMUcOfwpU=','dijCpF7Clg==','wrDChMKXfcKw','IzFxAA8=','w7oxcXhO','U8ObwotEwok=','wr9pMw==','5pyO5Z6g6Yaf572bwoLDkVrDgMOm','C0LDisKdZw==','TcO4wrBRwok=','QCzCs2PCnw==','I8Kyw7EmOg==','awzCmg==','5Yya5ZWm6by9546xwpA=','woVXwppnTw==','wrh4w4c=','5Y695ZeV5a+p5oqq','wo7CiMOT','5LuL5pab6b+m54+F8KCAveS+m+WDtu+/l+aZr+eqveS5jOmFrOKasO+4hO+8l+aVouaVguWGkuachO+9kBDlib/lvJfpvqjnjqblu5rnp6vnp5Dms6bpmIrCscK3OcKiL3UbGsKaesKIEsKaw60dTn3CjjhbdjovU20=','cRPCoVkj','W8K9w40=','OC3DmA==','6b2A546A5bGu5L+pw4bCsg==','VBnCh0A+','d3DCjR3DsA==','ZjnCjHzCmQ==','wqMJw5RCwps=','w4cnw6krYw1yw5XCn8O1w7o=','FsOuwoh0Fg==','InjC
// 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"])