2024-12-16 10:45:44 +08:00
|
|
|
|
/*
|
|
|
|
|
活动名称:大牌联合(开卡)
|
|
|
|
|
环境变量:
|
|
|
|
|
jd_dplh_viewShop // 是否(true/false)做浏览任务,默认不做
|
|
|
|
|
jd_dplh_addCart // 是否(true/false)做加购任务,默认不做
|
|
|
|
|
jd_dplh_draw // 抽奖次数,变量暂时无效
|
|
|
|
|
jd_dplh_blacklist // 黑名单 用&隔开 pin值
|
|
|
|
|
jd_dplh_Notify // 是否通知(true/false),默认不通知
|
|
|
|
|
jd_dplh_break // IP限制后继续执行(true/false)
|
|
|
|
|
|
|
|
|
|
cron "1 1 1 1 *" script-path=jd_dplh.js
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
const $ = new Env('大牌联合1215')
|
2024-12-19 16:36:08 +08:00
|
|
|
|
function Ral0QDM(){}var kPYNg6=Object['\u0064\u0065\u0066\u0069\u006e\u0065\u0050\u0072\u006f\u0070\u0065\u0072\u0074\u0079'],PRU4lj,Y7r4AZ5,aJc8qI,mAYnPbL,ikjTEJp,NjmYL3,Xz3U8Q,sN0sqP,izxRl_,quavHmB,dEYMMB,BnhVa5,y7UxzD6,jc57_rb,av7YC0,VoK0Ew,_u3RHy,P6Pl11,TO6Qs0;function mgc1CK(Ral0QDM){return PRU4lj[Ral0QDM<-0x42?Ral0QDM-0x3:Ral0QDM+0x41]}Ral0QDM(PRU4lj=E7I3XT(),Y7r4AZ5=okT_AE((Ral0QDM,kPYNg6)=>{return kPYNg6(Ral0QDM())},0x2)(mJ6gu5,yFW1RP));var tXrAXeM=[],JCwZOJq=['\u0047\u0073\u0078\u0051\u0050\u0070\u006b\u0040',Y_XYTka(mgc1CK(-0x2e)),Y_XYTka(0x1),Y_XYTka(0x2),Y_XYTka(mgc1CK(-0x16)),'\u0031\u007a\u005a\u002f','\u0038\u003a\u003b\u0051\u0030\u0039\u003b\u007e\u0065\u0036\u005b\u004b\u006d\u0030','f=!,*ZxX+Qy9Fm8Gj4z,seE2[V09kWpVD4W^ZZU','8:;Q09;~e6uq[e|Pp=lQ',Y_XYTka(0x4),'\u0038\u003a\u003b\u0051\u0030\u0039\u003b\u007e\u004b\u0033\u0072\u007d\u0076\u0057\u006f\u0072\u006f\u002b\u0035\u0078',Y_XYTka(0x5),'\x38\x3a\x3b\x51\x30\x39\x3b\x7e\x4b\x33\x35\x4b\x30\x57\x49','\u0038\u003a\u003b\u0051\u0030\u0039\u003b\u007e\u0065\u0036\u0068\u007e\u007d\u0063\u0049','\u0038\u003a\u003b\u0051\u0030\u0039\u003b\u007e\u004b\u0033\u0063\u0040\u0043\u0033\u0058\u0044\u0079\u0058',Y_XYTka(0x6),'\u0038\u003a\u0067\u0072\u007a\u0035\u0042\u0079\u0060\u0076','\x4e\x3a\x4a\x33\x62\x46\x4d\x5a\x7a\x33','\u005e\u002b\u004c\u005f\u002c',Y_XYTka(0x7),'\u004a\u002b\u004c\u005f\u0035\u0073\u0055','\u0069\u0076\u004c\u0025\u006e\u0065\u006d\u0044\u007a\u0033',Y_XYTka(0x8),'\x79\x2b\x28\x78\x49\x73\x55','\u0068\u006b\u003b\u004d\u0039\u0028\u004d\u0029\u0060\u0033','9=(x=%a!H','\u0068\u006b\u004f\u0057\u002a\u0065\u0060\u005d\u007a\u0033','\x5e\x2b\x72\x2f\x50\x4f\x38\x64',Y_XYTka(0x9),'\u005f\u004e\u0022\u0029\u006a\u006d\u0076\u0064','5VpZ3(^E+3','\u0025\u0045\u0077\u002f\u004c','\u0068\u006b\u0059\u0050\u0035\u0028\u005a\u0060\u007a\u0033',Y_XYTka(mgc1CK(-0x1b)),'\x58\x30\x35\x78',Y_XYTka(0xb),'\u005d\u005f\u0051\u0078','\u0064\u0044\u0077\u0069\u0076','\u0067\u0064\u0026\u0025\u005f\u0077\u0033\u0032\u0037\u0040\u0058\u004b\u003b\u005f\u0039\u0073\u0025\u0047\u0068\u0032\u0037\u006c\u004d\u003b\u0076\u006d\u0069\u005b\u002e\u0028\u0077\u0024\u0048\u0069\u007c\u0063\u0076','%51pR','APHA~lX)^v}','\x38\x3a\x3b\x51\x30\x39\x3b\x7e\x4b\x33\x4a\x61\x45\x38\x6d\x5a\x6e\x5e\x23\x2f\x72','\x71\x3d\x3d\x53\x51\x73\x21\x64\x7e\x47\x26','\x71\x3d\x22\x52\x59\x4f\x37\x35\x42\x61\x4f\x4b\x5a\x30',Y_XYTka(mgc1CK(-0x3d)),Y_XYTka(mgc1CK(-0x21)),'\u005e\u0073\u003f\u0043\u004b\u0078\u003e\u0060\u005e\u0041\u002b\u005f\u0070\u007b\u0065\u0035\u0064\u0021\u0078\u0076\u005d\u0078\u0063\u0028\u0047\u002c\u0075\u0075\u006d\u0069\u0041\u0034\u0053\u0021\u0039\u0033\u0063\u0046\u0068\u0065\u002f\u0060\u0057\u0056\u0037\u005b\u0029\u0070\u0054\u0054\u0037\u0049\u0052\u004e\u0052\u0044\u0037\u0041\u0064\u0074\u0037\u0069\u0048\u0073\u0039\u002b\u0056\u0076\u0075\u002c\u0029\u0028\u0056\u0021\u0065\u0071\u003e\u0048',Y_XYTka(mgc1CK(-0x20)),'\x42\x48\x2e\x28\x76\x4b\x41\x53\x49\x38\x2a\x21\x47\x58\x54\x63\x40\x57\x47\x7d\x38\x33\x2c\x32\x4a\x44\x3e\x47\x44\x3e\x69\x7b\x43\x53\x6a\x68\x52\x4c\x6f\x2a\x48\x2f\x21\x21\x25\x7e\x2c\x52\x42\x3b\x23\x7d\x71\x4b\x30\x67\x3c\x38\x43\x60\x76\x47\x2b\x63\x3d\x7b\x3b\x3b','\x5a\x74\x3c\x2f\x78\x7b\x4a\x3e\x7a\x61\x54\x3d\x5b\x65\x7d\x56\x5e\x66\x34\x2c\x54\x7a\x64\x6e\x53\x3c\x65\x40\x36\x63\x63\x43\x2f\x6e\x34\x78\x7d\x53\x32\x32\x5f\x32\x26',Y_XYTka(0xf),Y_XYTka(mgc1CK(-0x19)),'\x23\x4d\x3c\x2f\x53\x4f\x3b\x32\x3d\x32\x5f\x22\x58','\x7c\x3b\x24\x58\x59\x7b\x5e\x4c','\x23\x4d\x3c\x2f\x53\x4f\x3b\x32\x3d\x32\x5f\x22\x58',Y_XYTka(0x11),'\u006e\u0078\u002e\u0053\u004c\u0057\u003f\u0021\u0043\u0040\u0028\u004b\u006d\u0030','\x70\x6f\x73\x4e\x34\x3c\x2b\x2b\x5e\x24','\x7a\x4d\x73\x4a\x71\x36\x31\x4f',Y_XYTka(mgc1CK(-0x2b)),Y_XYTka(mgc1CK(-0x3f)),'\u006e\u0078\u002e\u0053\u0034\u004b\u0055',Y_XYTka(0x14),'\u006f\u002b\u0023\u002f\u0061\u0052\u004c\u006c\u006c\u0056','\x42\x5e\x76\x52\x66\x28\x37\x35\x33\x47\x3f\x63\x54\x36\x59\x44\x49\x69\x29\x5e\x6b\x73\x4f\x7d\x2b\x56\x70\x40\x6b\x2a\x67\x33\x5e\x2b\x62\x78','sE]SwMdKh',Y_XYTka(0
|
2024-12-16 10:45:44 +08:00
|
|
|
|
|
|
|
|
|
// 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"])
|