faker3/jd_sendbeans.js

21 lines
31 KiB
JavaScript
Raw Normal View History

2024-06-28 15:38:28 +08:00
/*
活动名称翻牌签到
活动链接https://sendbeans.jd.com/jump/index/#/taro/pages/turncard/index?turnTableId=<活动ID>&shopId=<店铺ID>
环境变量jd_sendbeans_url // 由于链接的特殊性多个活动仅支持 @ 链接
jd_sendbeans_task_threads // 控制签到并发线程数正整数默认1最大3
jd_sendbeans_account_threads // 控制账号并发线程数正整数默认1最大3
jd_sendbeans_account_interval // 自定义运行间隔时长整数单位毫秒默认1500
jd_sendbeans_notify // 是否推送中奖信息true/false默认不推送
高并发脚本谨慎使用并发
活动限制IP严重建议使用代理
cron:1 1 1 1 *
*/
const $ = new Env('翻牌签到')
var il='jsjiami.com.v7';const lilIIi=iii1II;(function(lI1lil,i1l1iI,liil1l,lI1lii,Iiili1,Iil1l1,i1i11I){return lI1lil=lI1lil>>0x6,Iil1l1='hs',i1i11I='hs',function(il1iIl,iii1ii,il1iIi,iii1il,II11li){const I1l11l=iii1II;iii1il='tfi',Iil1l1=iii1il+Iil1l1,II11li='up',i1i11I+=II11li,Iil1l1=il1iIi(Iil1l1),i1i11I=il1iIi(i1i11I),il1iIi=0x0;const I1l11i=il1iIl();while(!![]&&--lI1lii+iii1ii){try{iii1il=-parseInt(I1l11l(0x159,'A^^u'))/0x1*(parseInt(I1l11l(0xe9,'q0Rq'))/0x2)+-parseInt(I1l11l(0xe4,'iRDa'))/0x3+parseInt(I1l11l(0x191,'2d%V'))/0x4+-parseInt(I1l11l(0xee,'lDCr'))/0x5*(parseInt(I1l11l(0xd8,'2d%V'))/0x6)+-parseInt(I1l11l(0x15b,'xD*$'))/0x7*(-parseInt(I1l11l(0x16e,'Iet5'))/0x8)+-parseInt(I1l11l(0x15d,'LwUn'))/0x9*(parseInt(I1l11l(0xbc,'5^da'))/0xa)+parseInt(I1l11l(0xdc,'8I^U'))/0xb*(parseInt(I1l11l(0x13d,'uINZ'))/0xc);}catch(iIIiiI){iii1il=il1iIi;}finally{II11li=I1l11i[Iil1l1]();if(lI1lil<=lI1lii)il1iIi?Iiili1?iii1il=II11li:Iiili1=II11li:il1iIi=II11li;else{if(il1iIi==Iiili1['replace'](/[pQyYLqJWFDxPKgId=]/g,'')){if(iii1il===iii1ii){I1l11i['un'+Iil1l1](II11li);break;}I1l11i[i1i11I](II11li);}}}}}(liil1l,i1l1iI,function(liiI1i,ililIi,lilIIl,ililIl,liiI1l,i1l1II,i1ill){return ililIi='\x73\x70\x6c\x69\x74',liiI1i=arguments[0x0],liiI1i=liiI1i[ililIi](''),lilIIl=`\x72\x65\x76\x65\x72\x73\x65`,liiI1i=liiI1i[lilIIl]('\x76'),ililIl=`\x6a\x6f\x69\x6e`,(0x170407,liiI1i[ililIl](''));});}(0x3040,0xd2bee,Iii11l,0xc3),Iii11l)&&(il=0x3935);const jdCookie=require(lilIIi(0xda,'jg0f')),notify=require(lilIIi(0x121,'8I^U')),common=require(lilIIi(0x10d,'pzXN')),{H5st}=require('./utils/Rebels_H');function iii1II(_0x53036c,_0x58179e){const _0x26f107=Iii11l();return iii1II=function(_0x43884b,_0x56e559){_0x43884b=_0x43884b-0x99;let _0x25d88d=_0x26f107[_0x43884b];if(iii1II['ZnLFQT']===undefined){var _0x168340=function(_0x29e28e){const _0x42abcf='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x4f25cc='',_0x5af9c3='';for(let _0x523521=0x0,_0x199dbb,_0x17a51e,_0x537598=0x0;_0x17a51e=_0x29e28e['charAt'](_0x537598++);~_0x17a51e&&(_0x199dbb=_0x523521%0x4?_0x199dbb*0x40+_0x17a51e:_0x17a51e,_0x523521++%0x4)?_0x4f25cc+=String['fromCharCode'](0xff&_0x199dbb>>(-0x2*_0x523521&0x6)):0x0){_0x17a51e=_0x42abcf['indexOf'](_0x17a51e);}for(let _0x19c0c0=0x0,_0x32426b=_0x4f25cc['length'];_0x19c0c0<_0x32426b;_0x19c0c0++){_0x5af9c3+='%'+('00'+_0x4f25cc['charCodeAt'](_0x19c0c0)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x5af9c3);};const _0x523aa=function(_0x2dde5e,_0x5d4c6d){let _0x1e08ee=[],_0x19672a=0x0,_0x576c4d,_0x256ef6='';_0x2dde5e=_0x168340(_0x2dde5e);let _0x24b45a;for(_0x24b45a=0x0;_0x24b45a<0x100;_0x24b45a++){_0x1e08ee[_0x24b45a]=_0x24b45a;}for(_0x24b45a=0x0;_0x24b45a<0x100;_0x24b45a++){_0x19672a=(_0x19672a+_0x1e08ee[_0x24b45a]+_0x5d4c6d['charCodeAt'](_0x24b45a%_0x5d4c6d['length']))%0x100,_0x576c4d=_0x1e08ee[_0x24b45a],_0x1e08ee[_0x24b45a]=_0x1e08ee[_0x19672a],_0x1e08ee[_0x19672a]=_0x576c4d;}_0x24b45a=0x0,_0x19672a=0x0;for(let _0xd2403=0x0;_0xd2403<_0x2dde5e['length'];_0xd2403++){_0x24b45a=(_0x24b45a+0x1)%0x100,_0x19672a=(_0x19672a+_0x1e08ee[_0x24b45a])%0x100,_0x576c4d=_0x1e08ee[_0x24b45a],_0x1e08ee[_0x24b45a]=_0x1e08ee[_0x19672a],_0x1e08ee[_0x19672a]=_0x576c4d,_0x256ef6+=String['fromCharCode'](_0x2dde5e['charCodeAt'](_0xd2403)^_0x1e08ee[(_0x1e08ee[_0x24b45a]+_0x1e08ee[_0x19672a])%0x100]);}return _0x256ef6;};iii1II['BcxiYT']=_0x523aa,_0x53036c=arguments,iii1II['ZnLFQT']=!![];}const _0x178967=_0x26f107[0x0],_0x244b8f=_0x43884b+_0x178967,_0x46cefc=_0x53036c[_0x244b8f];return!_0x46cefc?(iii1II['EvtDDz']===undefined&&(iii1II['EvtDDz']=!![]),_0x25d88d=iii1II['BcxiYT'](_0x25d88d,_0x56e559),_0x53036c[_0x244b8f]=_0x25d88d):_0x25d88d=_0x46cefc,_0x25d88d;},iii1II(_0x53036c,_0x58179e);}function Iii11l(){const il1iII=(function(){return[...[il,'pQjFKQsgjgDJiWgPaYJmWdiyW.cxWom.IyvY7qDL==','eSkYfqP+eLKv','WQhcVY/cJmoWpa','jmk3W5/cUmkR','W5NdUXRdK1HgW70','w1xdQCo3','e8kUBGOA','kL7cMXrAzSkLW6xdP8ku','muxcP1qeWPS','WOhcHColuG8+hSkFDxxcIhNdL8o4gMrIlCo2oSopbZ4jxG','r8oPpY9SnK8nW6BcJW','W6tcQsfOW5JdSZdcN8kGBX0','cCklWRtcG8oH','v8o
// 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.d